From d53758015b414a100af2c87b837ef21113fc593c Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Mon, 2 Mar 2026 22:23:57 +0000 Subject: [PATCH 1/2] feat: Added a field for enabling image and table annotation for layout parser processor PiperOrigin-RevId: 877500954 Source-Link: https://github.com/googleapis/googleapis/commit/aa40d20bf5f2386cd39045bcefea48334017258d Source-Link: https://github.com/googleapis/googleapis-gen/commit/9a5ddacb78bb927694274c8f642c405b0b18202a Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWNvbnRlbnR3YXJlaG91c2UvLk93bEJvdC55YW1sIiwiaCI6IjlhNWRkYWNiNzhiYjkyNzY5NDI3NGM4ZjY0MmM0MDViMGIxODIwMmEifQ== --- .../.OwlBot.yaml | 19 + .../.eslintignore | 7 + .../.eslintrc.json | 3 + .../.gitattributes | 4 + .../google-cloud-contentwarehouse/.gitignore | 14 + .../google-cloud-contentwarehouse/.jsdoc.js | 55 + .../google-cloud-contentwarehouse/.mocharc.js | 33 + .../google-cloud-contentwarehouse/.nycrc | 24 + .../.prettierignore | 6 + .../.prettierrc.js | 22 + .../CODE_OF_CONDUCT.md | 94 + .../CONTRIBUTING.md | 76 + .../google-cloud-contentwarehouse/LICENSE | 202 + .../google-cloud-contentwarehouse/README.md | 142 + .../v1/async_document_service_request.proto | 34 + .../cloud/contentwarehouse/v1/common.proto | 165 + .../cloud/contentwarehouse/v1/document.proto | 356 + .../v1/document_link_service.proto | 237 + .../contentwarehouse/v1/document_schema.proto | 202 + .../v1/document_schema_service.proto | 181 + .../v1/document_service.proto | 279 + .../v1/document_service_request.proto | 355 + .../cloud/contentwarehouse/v1/filters.proto | 290 + .../cloud/contentwarehouse/v1/histogram.proto | 109 + .../v1/pipeline_service.proto | 87 + .../cloud/contentwarehouse/v1/pipelines.proto | 291 + .../contentwarehouse/v1/rule_engine.proto | 289 + .../contentwarehouse/v1/ruleset_service.proto | 81 + .../v1/ruleset_service_request.proto | 121 + .../contentwarehouse/v1/synonymset.proto | 61 + .../v1/synonymset_service.proto | 89 + .../v1/synonymset_service_request.proto | 125 + .../google/cloud/documentai/v1/barcode.proto | 69 + .../google/cloud/documentai/v1/document.proto | 1204 + .../cloud/documentai/v1/document_io.proto | 175 + .../v1/document_processor_service.proto | 1267 + .../cloud/documentai/v1/document_schema.proto | 168 + .../cloud/documentai/v1/evaluation.proto | 182 + .../google/cloud/documentai/v1/geometry.proto | 55 + .../documentai/v1/operation_metadata.proto | 66 + .../cloud/documentai/v1/processor.proto | 297 + .../cloud/documentai/v1/processor_type.proto | 67 + .../protos/protos.d.ts | 30589 ++++++ .../protos/protos.js | 78298 ++++++++++++++++ .../protos/protos.json | 7060 ++ ...ument_link_service.create_document_link.js | 75 + ...ument_link_service.delete_document_link.js | 68 + ...cument_link_service.list_linked_sources.js | 84 + ...cument_link_service.list_linked_targets.js | 68 + ...t_schema_service.create_document_schema.js | 66 + ...t_schema_service.delete_document_schema.js | 61 + ...ment_schema_service.get_document_schema.js | 61 + ...nt_schema_service.list_document_schemas.js | 78 + ...t_schema_service.update_document_schema.js | 68 + .../v1/document_service.create_document.js | 94 + .../v1/document_service.delete_document.js | 70 + .../v1/document_service.fetch_acl.js | 76 + .../v1/document_service.get_document.js | 69 + .../v1/document_service.lock_document.js | 71 + .../v1/document_service.search_documents.js | 164 + .../generated/v1/document_service.set_acl.js | 95 + .../v1/document_service.update_document.js | 86 + .../v1/pipeline_service.run_pipeline.js | 86 + .../v1/rule_set_service.create_rule_set.js | 67 + .../v1/rule_set_service.delete_rule_set.js | 63 + .../v1/rule_set_service.get_rule_set.js | 63 + .../v1/rule_set_service.list_rule_sets.js | 78 + .../v1/rule_set_service.update_rule_set.js | 68 + ...data_google.cloud.contentwarehouse.v1.json | 1343 + .../synonym_set_service.create_synonym_set.js | 67 + .../synonym_set_service.delete_synonym_set.js | 63 + .../v1/synonym_set_service.get_synonym_set.js | 63 + .../synonym_set_service.list_synonym_sets.js | 78 + .../synonym_set_service.update_synonym_set.js | 68 + .../src/index.ts | 37 + .../src/v1/document_link_service_client.ts | 1214 + .../document_link_service_client_config.json | 46 + .../v1/document_link_service_proto_list.json | 23 + .../src/v1/document_schema_service_client.ts | 1327 + ...document_schema_service_client_config.json | 63 + .../document_schema_service_proto_list.json | 23 + .../src/v1/document_service_client.ts | 1907 + .../v1/document_service_client_config.json | 77 + .../src/v1/document_service_proto_list.json | 23 + .../src/v1/gapic_metadata.json | 393 + .../src/v1/index.ts | 24 + .../src/v1/pipeline_service_client.ts | 1085 + .../v1/pipeline_service_client_config.json | 31 + .../src/v1/pipeline_service_proto_list.json | 23 + .../src/v1/rule_set_service_client.ts | 1285 + .../v1/rule_set_service_client_config.json | 63 + .../src/v1/rule_set_service_proto_list.json | 23 + .../src/v1/synonym_set_service_client.ts | 1291 + .../v1/synonym_set_service_client_config.json | 63 + .../v1/synonym_set_service_proto_list.json | 23 + .../system-test/fixtures/sample/src/index.js | 32 + .../system-test/fixtures/sample/src/index.ts | 62 + .../system-test/install.ts | 49 + .../test/gapic_document_link_service_v1.ts | 1117 + .../test/gapic_document_schema_service_v1.ts | 1263 + .../test/gapic_document_service_v1.ts | 1549 + .../test/gapic_pipeline_service_v1.ts | 980 + .../test/gapic_rule_set_service_v1.ts | 1225 + .../test/gapic_synonym_set_service_v1.ts | 1225 + .../tsconfig.json | 22 + .../webpack.config.js | 64 + 106 files changed, 143643 insertions(+) create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/.OwlBot.yaml create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/.eslintignore create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/.eslintrc.json create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/.gitattributes create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/.gitignore create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/.jsdoc.js create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/.mocharc.js create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/.nycrc create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/.prettierignore create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/.prettierrc.js create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/CODE_OF_CONDUCT.md create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/CONTRIBUTING.md create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/LICENSE create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/README.md create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/async_document_service_request.proto create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/common.proto create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/document.proto create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/document_link_service.proto create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/document_schema.proto create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/document_schema_service.proto create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/document_service.proto create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/document_service_request.proto create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/filters.proto create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/histogram.proto create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/pipeline_service.proto create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/pipelines.proto create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/rule_engine.proto create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/ruleset_service.proto create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/ruleset_service_request.proto create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/synonymset.proto create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/synonymset_service.proto create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/synonymset_service_request.proto create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/barcode.proto create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/document.proto create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/document_io.proto create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/document_processor_service.proto create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/document_schema.proto create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/evaluation.proto create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/geometry.proto create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/operation_metadata.proto create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/processor.proto create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/processor_type.proto create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/protos.d.ts create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/protos.js create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/protos.json create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_link_service.create_document_link.js create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_link_service.delete_document_link.js create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_link_service.list_linked_sources.js create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_link_service.list_linked_targets.js create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_schema_service.create_document_schema.js create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_schema_service.delete_document_schema.js create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_schema_service.get_document_schema.js create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_schema_service.list_document_schemas.js create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_schema_service.update_document_schema.js create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.create_document.js create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.delete_document.js create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.fetch_acl.js create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.get_document.js create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.lock_document.js create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.search_documents.js create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.set_acl.js create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.update_document.js create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/pipeline_service.run_pipeline.js create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/rule_set_service.create_rule_set.js create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/rule_set_service.delete_rule_set.js create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/rule_set_service.get_rule_set.js create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/rule_set_service.list_rule_sets.js create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/rule_set_service.update_rule_set.js create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/snippet_metadata_google.cloud.contentwarehouse.v1.json create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/synonym_set_service.create_synonym_set.js create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/synonym_set_service.delete_synonym_set.js create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/synonym_set_service.get_synonym_set.js create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/synonym_set_service.list_synonym_sets.js create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/synonym_set_service.update_synonym_set.js create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/src/index.ts create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_link_service_client.ts create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_link_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_link_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_schema_service_client.ts create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_schema_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_schema_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_service_client.ts create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/src/v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/src/v1/index.ts create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/src/v1/pipeline_service_client.ts create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/src/v1/pipeline_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/src/v1/pipeline_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/src/v1/rule_set_service_client.ts create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/src/v1/rule_set_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/src/v1/rule_set_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/src/v1/synonym_set_service_client.ts create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/src/v1/synonym_set_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/src/v1/synonym_set_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/system-test/fixtures/sample/src/index.js create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/system-test/fixtures/sample/src/index.ts create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/system-test/install.ts create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/test/gapic_document_link_service_v1.ts create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/test/gapic_document_schema_service_v1.ts create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/test/gapic_document_service_v1.ts create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/test/gapic_pipeline_service_v1.ts create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/test/gapic_rule_set_service_v1.ts create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/test/gapic_synonym_set_service_v1.ts create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/tsconfig.json create mode 100644 owl-bot-staging/google-cloud-contentwarehouse/webpack.config.js diff --git a/owl-bot-staging/google-cloud-contentwarehouse/.OwlBot.yaml b/owl-bot-staging/google-cloud-contentwarehouse/.OwlBot.yaml new file mode 100644 index 00000000000..1db6d4e09d3 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/.OwlBot.yaml @@ -0,0 +1,19 @@ +# Copyright 2025 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. + +deep-copy-regex: + - source: /google/cloud/contentwarehouse/google-cloud-contentwarehouse-nodejs + dest: /owl-bot-staging/google-cloud-contentwarehouse + +api-name: contentwarehouse \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-contentwarehouse/.eslintignore b/owl-bot-staging/google-cloud-contentwarehouse/.eslintignore new file mode 100644 index 00000000000..cfc348ec4d1 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/google-cloud-contentwarehouse/.eslintrc.json b/owl-bot-staging/google-cloud-contentwarehouse/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/.gitattributes b/owl-bot-staging/google-cloud-contentwarehouse/.gitattributes new file mode 100644 index 00000000000..33739cb74e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/.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/owl-bot-staging/google-cloud-contentwarehouse/.gitignore b/owl-bot-staging/google-cloud-contentwarehouse/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +/.coverage +/coverage +/.nyc_output +/docs/ +/out/ +/build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/owl-bot-staging/google-cloud-contentwarehouse/.jsdoc.js b/owl-bot-staging/google-cloud-contentwarehouse/.jsdoc.js new file mode 100644 index 00000000000..2a4b52efad3 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2026 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 2026 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/contentwarehouse', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/google-cloud-contentwarehouse/.mocharc.js b/owl-bot-staging/google-cloud-contentwarehouse/.mocharc.js new file mode 100644 index 00000000000..5eb34e86c87 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/.mocharc.js @@ -0,0 +1,33 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/owl-bot-staging/google-cloud-contentwarehouse/.nycrc b/owl-bot-staging/google-cloud-contentwarehouse/.nycrc new file mode 100644 index 00000000000..81a95fc94b0 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/.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 +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-contentwarehouse/.prettierignore b/owl-bot-staging/google-cloud-contentwarehouse/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/owl-bot-staging/google-cloud-contentwarehouse/.prettierrc.js b/owl-bot-staging/google-cloud-contentwarehouse/.prettierrc.js new file mode 100644 index 00000000000..7649ee3c254 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/.prettierrc.js @@ -0,0 +1,22 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/CODE_OF_CONDUCT.md b/owl-bot-staging/google-cloud-contentwarehouse/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..2add2547a81 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/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/owl-bot-staging/google-cloud-contentwarehouse/CONTRIBUTING.md b/owl-bot-staging/google-cloud-contentwarehouse/CONTRIBUTING.md new file mode 100644 index 00000000000..f721a03aa09 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/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 Contentwarehouse 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=contentwarehouse.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-contentwarehouse/LICENSE b/owl-bot-staging/google-cloud-contentwarehouse/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/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/owl-bot-staging/google-cloud-contentwarehouse/README.md b/owl-bot-staging/google-cloud-contentwarehouse/README.md new file mode 100644 index 00000000000..a3e8c00728c --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/README.md @@ -0,0 +1,142 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "The comments you see below are used to generate those parts of the template in later states." +Google Cloud Platform logo + +# [Document AI Warehouse API: Nodejs Client][homepage] + +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 + +[![npm version](https://img.shields.io/npm/v/@google-cloud/contentwarehouse.svg)](https://www.npmjs.org/package/@google-cloud/contentwarehouse) + +Document AI Warehouse API client for Node.js + +[//]: # "partials.introduction" + +A comprehensive list of changes in each version may be found in +[the CHANGELOG][homepage_changelog]. + +* [Document AI Warehouse API Nodejs Client API Reference](https://cloud.google.com/nodejs/docs/reference/contentwarehouse/latest) + + +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) + +* [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 Document AI Warehouse API API][enable_api]. +1. [Set up authentication][auth] so you can access the + API from your local workstation. +### Installing the client library + +```bash +npm install @google-cloud/contentwarehouse +``` + +[//]: # "partials.body" + +## Samples + +Samples are in the [`samples/`][homepage_samples] directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | +| --------------------------- | --------------------------------- | +| create document link | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/document_link_service.create_document_link.js) | +| delete document link | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/document_link_service.delete_document_link.js) | +| list linked sources | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/document_link_service.list_linked_sources.js) | +| list linked targets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/document_link_service.list_linked_targets.js) | +| create document schema | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/document_schema_service.create_document_schema.js) | +| delete document schema | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/document_schema_service.delete_document_schema.js) | +| get document schema | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/document_schema_service.get_document_schema.js) | +| list document schemas | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/document_schema_service.list_document_schemas.js) | +| update document schema | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/document_schema_service.update_document_schema.js) | +| create document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/document_service.create_document.js) | +| delete document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/document_service.delete_document.js) | +| fetch acl | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/document_service.fetch_acl.js) | +| get document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/document_service.get_document.js) | +| lock document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/document_service.lock_document.js) | +| search documents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/document_service.search_documents.js) | +| set acl | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/document_service.set_acl.js) | +| update document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/document_service.update_document.js) | +| run pipeline | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/pipeline_service.run_pipeline.js) | +| create rule set | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/rule_set_service.create_rule_set.js) | +| delete rule set | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/rule_set_service.delete_rule_set.js) | +| get rule set | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/rule_set_service.get_rule_set.js) | +| list rule sets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/rule_set_service.list_rule_sets.js) | +| update rule set | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/rule_set_service.update_rule_set.js) | +| cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/snippet_metadata_google.cloud.contentwarehouse.v1.json) | +| create synonym set | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/synonym_set_service.create_synonym_set.js) | +| delete synonym set | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/synonym_set_service.delete_synonym_set.js) | +| get synonym set | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/synonym_set_service.get_synonym_set.js) | +| list synonym sets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/synonym_set_service.list_synonym_sets.js) | +| update synonym set | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/synonym_set_service.update_synonym_set.js) | + + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://github.com/nodejs/release#release-schedule). +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, `npm install @google-cloud/contentwarehouse@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + +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/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/CONTRIBUTING.md). + +Please note that this `README.md` +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/LICENSE) + +[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=contentwarehouse.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local +[homepage_samples]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples +[homepage_changelog]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/CHANGELOG.md +[homepage]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/async_document_service_request.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/async_document_service_request.proto new file mode 100644 index 00000000000..ef97e474a66 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/async_document_service_request.proto @@ -0,0 +1,34 @@ +// Copyright 2025 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.cloud.contentwarehouse.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.ContentWarehouse.V1"; +option go_package = "cloud.google.com/go/contentwarehouse/apiv1/contentwarehousepb;contentwarehousepb"; +option java_multiple_files = true; +option java_outer_classname = "AsyncDocumentServiceRequestProto"; +option java_package = "com.google.cloud.contentwarehouse.v1"; +option php_namespace = "Google\\Cloud\\ContentWarehouse\\V1"; +option ruby_package = "Google::Cloud::ContentWarehouse::V1"; + +// Metadata object for CreateDocument request (currently empty). +message CreateDocumentMetadata {} + +// Metadata object for UpdateDocument request (currently empty). +message UpdateDocumentMetadata {} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/common.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/common.proto new file mode 100644 index 00000000000..e6942c28914 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/common.proto @@ -0,0 +1,165 @@ +// Copyright 2025 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.cloud.contentwarehouse.v1; + +import "google/api/resource.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.ContentWarehouse.V1"; +option go_package = "cloud.google.com/go/contentwarehouse/apiv1/contentwarehousepb;contentwarehousepb"; +option java_multiple_files = true; +option java_outer_classname = "CommonProto"; +option java_package = "com.google.cloud.contentwarehouse.v1"; +option php_namespace = "Google\\Cloud\\ContentWarehouse\\V1"; +option ruby_package = "Google::Cloud::ContentWarehouse::V1"; +option (google.api.resource_definition) = { + type: "contentwarehouse.googleapis.com/Location" + pattern: "projects/{project}/locations/{location}" +}; + +// Meta information is used to improve the performance of the service. +message RequestMetadata { + // Provides user unique identification and groups information. + UserInfo user_info = 1; +} + +// Additional information returned to client, such as debugging information. +message ResponseMetadata { + // A unique id associated with this call. This id is logged for tracking + // purpose. + string request_id = 1; +} + +// The user information. +message UserInfo { + // A unique user identification string, as determined by the client. + // The maximum number of allowed characters is 255. + // Allowed characters include numbers 0 to 9, uppercase and lowercase letters, + // and restricted special symbols (:, @, +, -, _, ~) + // The format is "user:xxxx@example.com"; + string id = 1; + + // The unique group identifications which the user is belong to. + // The format is "group:yyyy@example.com"; + repeated string group_ids = 2; +} + +// Options for Update operations. +message UpdateOptions { + // Type for update. + UpdateType update_type = 1; + + // Field mask for merging Document fields. + // For the `FieldMask` definition, + // see + // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + google.protobuf.FieldMask update_mask = 2; + + // Options for merging. + MergeFieldsOptions merge_fields_options = 3; +} + +// Options for merging updated fields. +message MergeFieldsOptions { + // When merging message fields, the default behavior is to merge + // the content of two message fields together. If you instead want to use + // the field from the source message to replace the corresponding field in + // the destination message, set this flag to true. When this flag is set, + // specified submessage fields that are missing in source will be cleared in + // destination. + optional bool replace_message_fields = 1; + + // When merging repeated fields, the default behavior is to append + // entries from the source repeated field to the destination repeated field. + // If you instead want to keep only the entries from the source repeated + // field, set this flag to true. + // + // If you want to replace a repeated field within a message field on the + // destination message, you must set both replace_repeated_fields and + // replace_message_fields to true, otherwise the repeated fields will be + // appended. + optional bool replace_repeated_fields = 2; +} + +// Update type of the requests. +enum UpdateType { + // Defaults to full replace behavior, ie. FULL_REPLACE. + UPDATE_TYPE_UNSPECIFIED = 0; + + // Fully replace all the fields (including previously linked raw document). + // Any field masks will be ignored. + UPDATE_TYPE_REPLACE = 1; + + // Merge the fields into the existing entities. + UPDATE_TYPE_MERGE = 2; + + // Inserts the properties by names. + UPDATE_TYPE_INSERT_PROPERTIES_BY_NAMES = 3; + + // Replace the properties by names. + UPDATE_TYPE_REPLACE_PROPERTIES_BY_NAMES = 4; + + // Delete the properties by names. + UPDATE_TYPE_DELETE_PROPERTIES_BY_NAMES = 5; + + // For each of the property, replaces the property if the it exists, otherwise + // inserts a new property. And for the rest of the fields, merge them based on + // update mask and merge fields options. + UPDATE_TYPE_MERGE_AND_REPLACE_OR_INSERT_PROPERTIES_BY_NAMES = 6; +} + +// Type of database used by the customer +enum DatabaseType { + // This value is required by protobuf best practices + DB_UNKNOWN = 0; + + // Internal Spanner + DB_INFRA_SPANNER = 1; + + // Cloud Sql with a Postgres Sql instance + DB_CLOUD_SQL_POSTGRES = 2 [deprecated = true]; +} + +// Access Control Mode. +enum AccessControlMode { + // This value is required by protobuf best practices + ACL_MODE_UNKNOWN = 0; + + // Universal Access: No document level access control. + ACL_MODE_UNIVERSAL_ACCESS = 1; + + // Document level access control with customer own Identity Service. + ACL_MODE_DOCUMENT_LEVEL_ACCESS_CONTROL_BYOID = 2; + + // Document level access control using Google Cloud Identity. + ACL_MODE_DOCUMENT_LEVEL_ACCESS_CONTROL_GCI = 3; +} + +// The default role of the document creator. +enum DocumentCreatorDefaultRole { + // Unspecified, will be default to document admin role. + DOCUMENT_CREATOR_DEFAULT_ROLE_UNSPECIFIED = 0; + + // Document Admin, same as contentwarehouse.googleapis.com/documentAdmin. + DOCUMENT_ADMIN = 1; + + // Document Editor, same as contentwarehouse.googleapis.com/documentEditor. + DOCUMENT_EDITOR = 2; + + // Document Viewer, same as contentwarehouse.googleapis.com/documentViewer. + DOCUMENT_VIEWER = 3; +} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/document.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/document.proto new file mode 100644 index 00000000000..baaad074dfc --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/document.proto @@ -0,0 +1,356 @@ +// Copyright 2025 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.cloud.contentwarehouse.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/documentai/v1/document.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/datetime.proto"; + +option csharp_namespace = "Google.Cloud.ContentWarehouse.V1"; +option go_package = "cloud.google.com/go/contentwarehouse/apiv1/contentwarehousepb;contentwarehousepb"; +option java_multiple_files = true; +option java_outer_classname = "DocumentProto"; +option java_package = "com.google.cloud.contentwarehouse.v1"; +option php_namespace = "Google\\Cloud\\ContentWarehouse\\V1"; +option ruby_package = "Google::Cloud::ContentWarehouse::V1"; + +// Defines the structure for content warehouse document proto. +message Document { + option (google.api.resource) = { + type: "contentwarehouse.googleapis.com/Document" + pattern: "projects/{project}/locations/{location}/documents/{document}" + pattern: "projects/{project}/locations/{location}/documents/referenceId/{reference_id}" + }; + + // The resource name of the document. + // Format: + // projects/{project_number}/locations/{location}/documents/{document_id}. + // + // The name is ignored when creating a document. + string name = 1; + + // The reference ID set by customers. Must be unique per project and location. + string reference_id = 11; + + // Required. Display name of the document given by the user. This name will be + // displayed in the UI. Customer can populate this field with the name of the + // document. This differs from the 'title' field as 'title' is optional and + // stores the top heading in the document. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Title that describes the document. + // This can be the top heading or text that describes the document. + string title = 18; + + // Uri to display the document, for example, in the UI. + string display_uri = 17; + + // The Document schema name. + // Format: + // projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}. + string document_schema_name = 3 [(google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/DocumentSchema" + }]; + + oneof structured_content { + // Other document format, such as PPTX, XLXS + string plain_text = 15; + + // Document AI format to save the structured content, including OCR. + google.cloud.documentai.v1.Document cloud_ai_document = 4; + } + + // A path linked to structured content file. + string structured_content_uri = 16 [deprecated = true]; + + // Raw document file. + oneof raw_document { + // Raw document file in Cloud Storage path. + string raw_document_path = 5; + + // Raw document content. + bytes inline_raw_document = 6; + } + + // List of values that are user supplied metadata. + repeated Property properties = 7; + + // Output only. The time when the document is last updated. + google.protobuf.Timestamp update_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the document is created. + google.protobuf.Timestamp create_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // This is used when DocAI was not used to load the document and parsing/ + // extracting is needed for the inline_raw_document. For example, if + // inline_raw_document is the byte representation of a PDF file, then + // this should be set to: RAW_DOCUMENT_FILE_TYPE_PDF. + RawDocumentFileType raw_document_file_type = 10; + + // If true, makes the document visible to asynchronous policies and rules. + bool async_enabled = 12 [deprecated = true]; + + // Indicates the category (image, audio, video etc.) of the original content. + ContentCategory content_category = 20; + + // If true, text extraction will not be performed. + bool text_extraction_disabled = 19 [deprecated = true]; + + // If true, text extraction will be performed. + bool text_extraction_enabled = 21; + + // The user who creates the document. + string creator = 13; + + // The user who lastly updates the document. + string updater = 14; + + // Output only. If linked to a Collection with RetentionPolicy, the date when + // the document becomes mutable. + google.protobuf.Timestamp disposition_time = 22 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Indicates if the document has a legal hold on it. + bool legal_hold = 23 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// References to the documents. +message DocumentReference { + // Required. Name of the referenced document. + string document_name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/Document" + } + ]; + + // display_name of the referenced document; this name does not need to be + // consistent to the display_name in the Document proto, depending on the ACL + // constraint. + string display_name = 2; + + // Stores the subset of the referenced document's content. + // This is useful to allow user peek the information of the referenced + // document. + string snippet = 3; + + // The document type of the document being referenced. + bool document_is_folder = 4; + + // Output only. The time when the document is last updated. + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the document is created. + google.protobuf.Timestamp create_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the document is deleted. + google.protobuf.Timestamp delete_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Document is a folder with retention policy. + bool document_is_retention_folder = 8; + + // Document is a folder with legal hold. + bool document_is_legal_hold_folder = 9; +} + +// Property of a document. +message Property { + // Required. Must match the name of a PropertyDefinition in the + // DocumentSchema. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Type of the property. + // Must match the property_options type of the matching PropertyDefinition. + // Value of the Property parsed into a specific data type. + // Specific type value(s) obtained from Document AIs Property.mention_text + // field. + oneof values { + // Integer property values. + IntegerArray integer_values = 2; + + // Float property values. + FloatArray float_values = 3; + + // String/text property values. + TextArray text_values = 4; + + // Enum property values. + EnumArray enum_values = 5; + + // Nested structured data property values. + PropertyArray property_values = 6; + + // Date time property values. + // It is not supported by CMEK compliant deployment. + DateTimeArray date_time_values = 7; + + // Map property values. + MapProperty map_property = 8; + + // Timestamp property values. + // It is not supported by CMEK compliant deployment. + TimestampArray timestamp_values = 9; + } +} + +// Integer values. +message IntegerArray { + // List of integer values. + repeated int32 values = 1; +} + +// Float values. +message FloatArray { + // List of float values. + repeated float values = 1; +} + +// String/text values. +message TextArray { + // List of text values. + repeated string values = 1; +} + +// Enum values. +message EnumArray { + // List of enum values. + repeated string values = 1; +} + +// DateTime values. +message DateTimeArray { + // List of datetime values. + // Both OffsetDateTime and ZonedDateTime are supported. + repeated google.type.DateTime values = 1; +} + +// Timestamp values. +message TimestampArray { + // List of timestamp values. + repeated TimestampValue values = 1; +} + +// Timestamp value type. +message TimestampValue { + oneof value { + // Timestamp value + google.protobuf.Timestamp timestamp_value = 1; + + // The string must represent a valid instant in UTC and is parsed using + // java.time.format.DateTimeFormatter.ISO_INSTANT. + // e.g. "2013-09-29T18:46:19Z" + string text_value = 2; + } +} + +// Property values. +message PropertyArray { + // List of property values. + repeated Property properties = 1; +} + +// Map property value. +// Represents a structured entries of key value pairs, consisting of field names +// which map to dynamically typed values. +message MapProperty { + // Unordered map of dynamically typed values. + map fields = 1; +} + +// `Value` represents a dynamically typed value which can be either be +// a float, a integer, a string, or a datetime value. A producer of value is +// expected to set one of these variants. Absence of any variant indicates an +// error. +message Value { + // The kind of value. + oneof kind { + // Represents a float value. + float float_value = 1; + + // Represents a integer value. + int32 int_value = 2; + + // Represents a string value. + string string_value = 3; + + // Represents an enum value. + EnumValue enum_value = 4; + + // Represents a datetime value. + google.type.DateTime datetime_value = 5; + + // Represents a timestamp value. + TimestampValue timestamp_value = 6; + + // Represents a boolean value. + bool boolean_value = 7; + } +} + +// Represents the string value of the enum field. +message EnumValue { + // String value of the enum field. This must match defined set of enums + // in document schema using EnumTypeOptions. + string value = 1; +} + +// When a raw document is supplied, this indicates the file format +enum RawDocumentFileType { + // No raw document specified or it is non-parsable + RAW_DOCUMENT_FILE_TYPE_UNSPECIFIED = 0; + + // Adobe PDF format + RAW_DOCUMENT_FILE_TYPE_PDF = 1; + + // Microsoft Word format + RAW_DOCUMENT_FILE_TYPE_DOCX = 2; + + // Microsoft Excel format + RAW_DOCUMENT_FILE_TYPE_XLSX = 3; + + // Microsoft Powerpoint format + RAW_DOCUMENT_FILE_TYPE_PPTX = 4; + + // UTF-8 encoded text format + RAW_DOCUMENT_FILE_TYPE_TEXT = 5; + + // TIFF or TIF image file format + RAW_DOCUMENT_FILE_TYPE_TIFF = 6; +} + +// When a raw document or structured content is supplied, this stores the +// content category. +enum ContentCategory { + // No category is specified. + CONTENT_CATEGORY_UNSPECIFIED = 0; + + // Content is of image type. + CONTENT_CATEGORY_IMAGE = 1; + + // Content is of audio type. + CONTENT_CATEGORY_AUDIO = 2; + + // Content is of video type. + CONTENT_CATEGORY_VIDEO = 3; +} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/document_link_service.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/document_link_service.proto new file mode 100644 index 00000000000..16af6fc1f4c --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/document_link_service.proto @@ -0,0 +1,237 @@ +// Copyright 2025 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.cloud.contentwarehouse.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/contentwarehouse/v1/common.proto"; +import "google/cloud/contentwarehouse/v1/document.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.ContentWarehouse.V1"; +option go_package = "cloud.google.com/go/contentwarehouse/apiv1/contentwarehousepb;contentwarehousepb"; +option java_multiple_files = true; +option java_outer_classname = "DocumentLinkServiceProto"; +option java_package = "com.google.cloud.contentwarehouse.v1"; +option php_namespace = "Google\\Cloud\\ContentWarehouse\\V1"; +option ruby_package = "Google::Cloud::ContentWarehouse::V1"; + +// This service lets you manage document-links. +// Document-Links are treated as sub-resources under source documents. +service DocumentLinkService { + option (google.api.default_host) = "contentwarehouse.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Return all target document-links from the document. + rpc ListLinkedTargets(ListLinkedTargetsRequest) + returns (ListLinkedTargetsResponse) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/documents/*}/linkedTargets" + body: "*" + }; + option (google.api.method_signature) = "parent"; + } + + // Return all source document-links from the document. + rpc ListLinkedSources(ListLinkedSourcesRequest) + returns (ListLinkedSourcesResponse) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/documents/*}/linkedSources" + body: "*" + }; + option (google.api.method_signature) = "parent"; + } + + // Create a link between a source document and a target document. + rpc CreateDocumentLink(CreateDocumentLinkRequest) returns (DocumentLink) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/documents/*}/documentLinks" + body: "*" + }; + option (google.api.method_signature) = "parent,document_link"; + } + + // Remove the link between the source and target documents. + rpc DeleteDocumentLink(DeleteDocumentLinkRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/documents/*/documentLinks/*}:delete" + body: "*" + }; + option (google.api.method_signature) = "name"; + } +} + +// Response message for DocumentLinkService.ListLinkedTargets. +message ListLinkedTargetsResponse { + // Target document-links. + repeated DocumentLink document_links = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for DocumentLinkService.ListLinkedTargets. +message ListLinkedTargetsRequest { + // Required. The name of the document, for which all target links are + // returned. Format: + // projects/{project_number}/locations/{location}/documents/{target_document_id}. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/Document" + } + ]; + + // The meta information collected about the document creator, used to enforce + // access control for the service. + RequestMetadata request_metadata = 2; +} + +// Response message for DocumentLinkService.ListLinkedSources. +message ListLinkedSourcesResponse { + // Source document-links. + repeated DocumentLink document_links = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Response message for DocumentLinkService.ListLinkedSources. +message ListLinkedSourcesRequest { + // Required. The name of the document, for which all source links are + // returned. Format: + // projects/{project_number}/locations/{location}/documents/{source_document_id}. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/Document" + } + ]; + + // The maximum number of document-links to return. The service may return + // fewer than this value. + // + // If unspecified, at most 50 document-links will be returned. + // The maximum value is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 3; + + // A page token, received from a previous `ListLinkedSources` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListLinkedSources` + // must match the call that provided the page token. + string page_token = 4; + + // The meta information collected about the document creator, used to enforce + // access control for the service. + RequestMetadata request_metadata = 2; +} + +// A document-link between source and target document. +message DocumentLink { + option (google.api.resource) = { + type: "contentwarehouse.googleapis.com/DocumentLink" + pattern: "projects/{project}/locations/{location}/documents/{document}/documentLinks/{document_link}" + }; + + // The state of a document-link. + enum State { + // Unknown state of documentlink. + STATE_UNSPECIFIED = 0; + + // The documentlink has both source and target documents detected. + ACTIVE = 1; + + // Target document is deleted, and mark the documentlink as soft-deleted. + SOFT_DELETED = 2; + } + + // Name of this document-link. + // It is required that the parent derived form the name to be consistent with + // the source document reference. Otherwise an exception will be thrown. + // Format: + // projects/{project_number}/locations/{location}/documents/{source_document_id}/documentLinks/{document_link_id}. + string name = 1; + + // Document references of the source document. + DocumentReference source_document_reference = 2; + + // Document references of the target document. + DocumentReference target_document_reference = 3; + + // Description of this document-link. + string description = 4; + + // Output only. The time when the documentLink is last updated. + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the documentLink is created. + google.protobuf.Timestamp create_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The state of the documentlink. If target node has been deleted, the + // link is marked as invalid. Removing a source node will result in removal + // of all associated links. + State state = 7; +} + +// Request message for DocumentLinkService.CreateDocumentLink. +message CreateDocumentLinkRequest { + // Required. Parent of the document-link to be created. + // parent of document-link should be a document. + // Format: + // projects/{project_number}/locations/{location}/documents/{source_document_id}. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/Document" + } + ]; + + // Required. Document links associated with the source documents + // (source_document_id). + DocumentLink document_link = 2 [(google.api.field_behavior) = REQUIRED]; + + // The meta information collected about the document creator, used to enforce + // access control for the service. + RequestMetadata request_metadata = 3; +} + +// Request message for DocumentLinkService.DeleteDocumentLink. +message DeleteDocumentLinkRequest { + // Required. The name of the document-link to be deleted. + // Format: + // projects/{project_number}/locations/{location}/documents/{source_document_id}/documentLinks/{document_link_id}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/DocumentLink" + } + ]; + + // The meta information collected about the document creator, used to enforce + // access control for the service. + RequestMetadata request_metadata = 2; +} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/document_schema.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/document_schema.proto new file mode 100644 index 00000000000..c9ee6699fb4 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/document_schema.proto @@ -0,0 +1,202 @@ +// Copyright 2025 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.cloud.contentwarehouse.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.ContentWarehouse.V1"; +option go_package = "cloud.google.com/go/contentwarehouse/apiv1/contentwarehousepb;contentwarehousepb"; +option java_multiple_files = true; +option java_outer_classname = "DocumentSchemaProto"; +option java_package = "com.google.cloud.contentwarehouse.v1"; +option php_namespace = "Google\\Cloud\\ContentWarehouse\\V1"; +option ruby_package = "Google::Cloud::ContentWarehouse::V1"; + +// A document schema used to define document structure. +message DocumentSchema { + option (google.api.resource) = { + type: "contentwarehouse.googleapis.com/DocumentSchema" + pattern: "projects/{project}/locations/{location}/documentSchemas/{document_schema}" + }; + + // The resource name of the document schema. + // Format: + // projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}. + // + // The name is ignored when creating a document schema. + string name = 1; + + // Required. Name of the schema given by the user. Must be unique per project. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Document details. + repeated PropertyDefinition property_definitions = 3; + + // Document Type, true refers the document is a folder, otherwise it is + // a typical document. + bool document_is_folder = 4; + + // Output only. The time when the document schema is last updated. + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the document schema is created. + google.protobuf.Timestamp create_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Schema description. + string description = 7; +} + +// Defines the metadata for a schema property. +message PropertyDefinition { + // Stores the retrieval importance. + enum RetrievalImportance { + // No importance specified. Default medium importance. + RETRIEVAL_IMPORTANCE_UNSPECIFIED = 0; + + // Highest importance. + HIGHEST = 1; + + // Higher importance. + HIGHER = 2; + + // High importance. + HIGH = 3; + + // Medium importance. + MEDIUM = 4; + + // Low importance (negative). + LOW = 5; + + // Lowest importance (negative). + LOWEST = 6; + } + + // The schema source information. + message SchemaSource { + // The schema name in the source. + string name = 1; + + // The Doc AI processor type name. + string processor_type = 2; + } + + // Required. The name of the metadata property. + // Must be unique within a document schema and is case insensitive. + // Names must be non-blank, start with a letter, and can contain alphanumeric + // characters and: /, :, -, _, and . + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // The display-name for the property, used for front-end. + string display_name = 12; + + // Whether the property can have multiple values. + bool is_repeatable = 2; + + // Whether the property can be filtered. If this is a sub-property, all the + // parent properties must be marked filterable. + bool is_filterable = 3; + + // Indicates that the property should be included in a global search. + bool is_searchable = 4; + + // Whether the property is user supplied metadata. + // This out-of-the box placeholder setting can be used to tag derived + // properties. Its value and interpretation logic should be implemented by API + // user. + bool is_metadata = 5; + + // Whether the property is mandatory. + // Default is 'false', i.e. populating property value can be skipped. + // If 'true' then user must populate the value for this property. + bool is_required = 14; + + // The retrieval importance of the property during search. + RetrievalImportance retrieval_importance = 18; + + // Type of the property. + oneof value_type_options { + // Integer property. + IntegerTypeOptions integer_type_options = 7; + + // Float property. + FloatTypeOptions float_type_options = 8; + + // Text/string property. + TextTypeOptions text_type_options = 9; + + // Nested structured data property. + PropertyTypeOptions property_type_options = 10; + + // Enum/categorical property. + EnumTypeOptions enum_type_options = 11; + + // Date time property. + // It is not supported by CMEK compliant deployment. + DateTimeTypeOptions date_time_type_options = 13; + + // Map property. + MapTypeOptions map_type_options = 15; + + // Timestamp property. + // It is not supported by CMEK compliant deployment. + TimestampTypeOptions timestamp_type_options = 16; + } + + // The mapping information between this property to another schema source. + repeated SchemaSource schema_sources = 19; +} + +// Configurations for an integer property. +message IntegerTypeOptions {} + +// Configurations for a float property. +message FloatTypeOptions {} + +// Configurations for a text property. +message TextTypeOptions {} + +// Configurations for a date time property. +message DateTimeTypeOptions {} + +// Configurations for a Map property. +message MapTypeOptions {} + +// Configurations for a timestamp property. +message TimestampTypeOptions {} + +// Configurations for a nested structured data property. +message PropertyTypeOptions { + // Required. List of property definitions. + repeated PropertyDefinition property_definitions = 1 + [(google.api.field_behavior) = REQUIRED]; +} + +// Configurations for an enum/categorical property. +message EnumTypeOptions { + // Required. List of possible enum values. + repeated string possible_values = 1 [(google.api.field_behavior) = REQUIRED]; + + // Make sure the Enum property value provided in the document is in the + // possile value list during document creation. The validation check runs by + // default. + bool validation_check_disabled = 2; +} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/document_schema_service.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/document_schema_service.proto new file mode 100644 index 00000000000..ba570f044d9 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/document_schema_service.proto @@ -0,0 +1,181 @@ +// Copyright 2025 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.cloud.contentwarehouse.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/contentwarehouse/v1/document_schema.proto"; +import "google/protobuf/empty.proto"; + +option csharp_namespace = "Google.Cloud.ContentWarehouse.V1"; +option go_package = "cloud.google.com/go/contentwarehouse/apiv1/contentwarehousepb;contentwarehousepb"; +option java_multiple_files = true; +option java_outer_classname = "DocumentSchemaServiceProto"; +option java_package = "com.google.cloud.contentwarehouse.v1"; +option php_namespace = "Google\\Cloud\\ContentWarehouse\\V1"; +option ruby_package = "Google::Cloud::ContentWarehouse::V1"; + +// This service lets you manage document schema. +service DocumentSchemaService { + option (google.api.default_host) = "contentwarehouse.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a document schema. + rpc CreateDocumentSchema(CreateDocumentSchemaRequest) + returns (DocumentSchema) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/documentSchemas" + body: "document_schema" + }; + option (google.api.method_signature) = "parent,document_schema"; + } + + // Updates a Document Schema. Returns INVALID_ARGUMENT if the name of the + // Document Schema is non-empty and does not equal the existing name. + // Supports only appending new properties, adding new ENUM possible values, + // and updating the + // [EnumTypeOptions.validation_check_disabled][google.cloud.contentwarehouse.v1.EnumTypeOptions.validation_check_disabled] + // flag for ENUM possible values. Updating existing properties will result + // into INVALID_ARGUMENT. + rpc UpdateDocumentSchema(UpdateDocumentSchemaRequest) + returns (DocumentSchema) { + option (google.api.http) = { + patch: "/v1/{name=projects/*/locations/*/documentSchemas/*}" + body: "*" + }; + option (google.api.method_signature) = "name,document_schema"; + } + + // Gets a document schema. Returns NOT_FOUND if the document schema does not + // exist. + rpc GetDocumentSchema(GetDocumentSchemaRequest) returns (DocumentSchema) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/documentSchemas/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Deletes a document schema. Returns NOT_FOUND if the document schema does + // not exist. Returns BAD_REQUEST if the document schema has documents + // depending on it. + rpc DeleteDocumentSchema(DeleteDocumentSchemaRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/documentSchemas/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists document schemas. + rpc ListDocumentSchemas(ListDocumentSchemasRequest) + returns (ListDocumentSchemasResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/documentSchemas" + }; + option (google.api.method_signature) = "parent"; + } +} + +// Request message for DocumentSchemaService.CreateDocumentSchema. +message CreateDocumentSchemaRequest { + // Required. The parent name. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/Location" + } + ]; + + // Required. The document schema to create. + DocumentSchema document_schema = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for DocumentSchemaService.GetDocumentSchema. +message GetDocumentSchemaRequest { + // Required. The name of the document schema to retrieve. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/DocumentSchema" + } + ]; +} + +// Request message for DocumentSchemaService.UpdateDocumentSchema. +message UpdateDocumentSchemaRequest { + // Required. The name of the document schema to update. + // Format: + // projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/DocumentSchema" + } + ]; + + // Required. The document schema to update with. + DocumentSchema document_schema = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for DocumentSchemaService.DeleteDocumentSchema. +message DeleteDocumentSchemaRequest { + // Required. The name of the document schema to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/DocumentSchema" + } + ]; +} + +// Request message for DocumentSchemaService.ListDocumentSchemas. +message ListDocumentSchemasRequest { + // Required. The parent, which owns this collection of document schemas. + // Format: projects/{project_number}/locations/{location}. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/Location" + } + ]; + + // The maximum number of document schemas to return. The service may return + // fewer than this value. + // If unspecified, at most 50 document schemas will be returned. + // The maximum value is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2; + + // A page token, received from a previous `ListDocumentSchemas` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListDocumentSchemas` + // must match the call that provided the page token. + string page_token = 3; +} + +// Response message for DocumentSchemaService.ListDocumentSchemas. +message ListDocumentSchemasResponse { + // The document schemas from the specified parent. + repeated DocumentSchema document_schemas = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/document_service.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/document_service.proto new file mode 100644 index 00000000000..78e4a2b3817 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/document_service.proto @@ -0,0 +1,279 @@ +// Copyright 2025 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.cloud.contentwarehouse.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/resource.proto"; +import "google/cloud/contentwarehouse/v1/common.proto"; +import "google/cloud/contentwarehouse/v1/document.proto"; +import "google/cloud/contentwarehouse/v1/document_service_request.proto"; +import "google/cloud/contentwarehouse/v1/histogram.proto"; +import "google/cloud/contentwarehouse/v1/rule_engine.proto"; +import "google/iam/v1/policy.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; + +option csharp_namespace = "Google.Cloud.ContentWarehouse.V1"; +option go_package = "cloud.google.com/go/contentwarehouse/apiv1/contentwarehousepb;contentwarehousepb"; +option java_multiple_files = true; +option java_outer_classname = "DocumentServiceProto"; +option java_package = "com.google.cloud.contentwarehouse.v1"; +option php_namespace = "Google\\Cloud\\ContentWarehouse\\V1"; +option ruby_package = "Google::Cloud::ContentWarehouse::V1"; + +// This service lets you manage document. +service DocumentService { + option (google.api.default_host) = "contentwarehouse.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a document. + rpc CreateDocument(CreateDocumentRequest) returns (CreateDocumentResponse) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/documents" + body: "*" + }; + option (google.api.method_signature) = "parent,document"; + } + + // Gets a document. Returns NOT_FOUND if the document does not exist. + rpc GetDocument(GetDocumentRequest) returns (Document) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/documents/*}:get" + body: "*" + additional_bindings { + post: "/v1/{name=projects/*/locations/*/documents/referenceId/*}:get" + body: "*" + } + }; + option (google.api.method_signature) = "name"; + } + + // Updates a document. Returns INVALID_ARGUMENT if the name of the document + // is non-empty and does not equal the existing name. + rpc UpdateDocument(UpdateDocumentRequest) returns (UpdateDocumentResponse) { + option (google.api.http) = { + patch: "/v1/{name=projects/*/locations/*/documents/*}" + body: "*" + additional_bindings { + patch: "/v1/{name=projects/*/locations/*/documents/referenceId/*}" + body: "*" + } + }; + option (google.api.method_signature) = "name,document"; + } + + // Deletes a document. Returns NOT_FOUND if the document does not exist. + rpc DeleteDocument(DeleteDocumentRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/documents/*}:delete" + body: "*" + additional_bindings { + post: "/v1/{name=projects/*/locations/*/documents/referenceId/*}:delete" + body: "*" + } + }; + option (google.api.method_signature) = "name"; + } + + // Searches for documents using provided + // [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest]. + // This call only returns documents that the caller has permission to search + // against. + rpc SearchDocuments(SearchDocumentsRequest) + returns (SearchDocumentsResponse) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/documents:search" + body: "*" + }; + option (google.api.method_signature) = "parent"; + } + + // Lock the document so the document cannot be updated by other users. + rpc LockDocument(LockDocumentRequest) returns (Document) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/documents/*}:lock" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Gets the access control policy for a resource. Returns NOT_FOUND error if + // the resource does not exist. Returns an empty policy if the resource exists + // but does not have a policy set. + rpc FetchAcl(FetchAclRequest) returns (FetchAclResponse) { + option (google.api.http) = { + post: "/v1/{resource=projects/*/locations/*/documents/*}:fetchAcl" + body: "*" + additional_bindings { + post: "/v1/{resource=projects/*}:fetchAcl" + body: "*" + } + }; + option (google.api.method_signature) = "resource"; + } + + // Sets the access control policy for a resource. Replaces any existing + // policy. + rpc SetAcl(SetAclRequest) returns (SetAclResponse) { + option (google.api.http) = { + post: "/v1/{resource=projects/*/locations/*/documents/*}:setAcl" + body: "*" + additional_bindings { post: "/v1/{resource=projects/*}:setAcl" body: "*" } + }; + option (google.api.method_signature) = "resource,policy"; + } +} + +// Response message for DocumentService.CreateDocument. +message CreateDocumentResponse { + // Document created after executing create request. + Document document = 1; + + // Output from Rule Engine recording the rule evaluator and action executor's + // output. + // + // Refer format in: google/cloud/contentwarehouse/v1/rule_engine.proto + RuleEngineOutput rule_engine_output = 2; + + // Additional information for the API invocation, such as the request tracking + // id. + ResponseMetadata metadata = 3; + + // post-processing LROs + repeated google.longrunning.Operation long_running_operations = 4; +} + +// Response message for DocumentService.UpdateDocument. +message UpdateDocumentResponse { + // Updated document after executing update request. + Document document = 1; + + // Output from Rule Engine recording the rule evaluator and action executor's + // output. + // + // Refer format in: google/cloud/contentwarehouse/v1/rule_engine.proto + RuleEngineOutput rule_engine_output = 2; + + // Additional information for the API invocation, such as the request tracking + // id. + ResponseMetadata metadata = 3; +} + +// Additional result info for the question-answering feature. +message QAResult { + // A text span in the search text snippet that represents a highlighted + // section (answer context, highly relevant sentence, etc.). + message Highlight { + // Start index of the highlight. + int32 start_index = 1; + + // End index of the highlight, exclusive. + int32 end_index = 2; + } + + // Highlighted sections in the snippet. + repeated Highlight highlights = 1; + + // The calibrated confidence score for this document, in the range + // [0., 1.]. This represents the confidence level for whether the returned + // document and snippet answers the user's query. + float confidence_score = 2; +} + +// Response message for DocumentService.SearchDocuments. +message SearchDocumentsResponse { + // Document entry with metadata inside + // [SearchDocumentsResponse][google.cloud.contentwarehouse.v1.SearchDocumentsResponse] + message MatchingDocument { + // Document that matches the specified + // [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest]. + // This document only contains indexed metadata information. + Document document = 1; + + // Contains snippets of text from the document full raw text that most + // closely match a search query's keywords, if available. All HTML tags in + // the original fields are stripped when returned in this field, and + // matching query keywords are enclosed in HTML bold tags. + // + // If the question-answering feature is enabled, this field will instead + // contain a snippet that answers the user's natural-language query. No HTML + // bold tags will be present, and highlights in the answer snippet can be + // found in + // [QAResult.highlights][google.cloud.contentwarehouse.v1.QAResult.highlights]. + string search_text_snippet = 2; + + // Experimental. + // Additional result info if the question-answering feature is enabled. + QAResult qa_result = 3; + + // Return the 1-based page indices where those pages have one or more + // matched tokens. + repeated int64 matched_token_page_indices = 4; + } + + // The document entities that match the specified + // [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest]. + repeated MatchingDocument matching_documents = 1; + + // The token that specifies the starting position of the next page of results. + // This field is empty if there are no more results. + string next_page_token = 2; + + // The total number of matched documents which is available only if the client + // set + // [SearchDocumentsRequest.require_total_size][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.require_total_size] + // to `true` or set + // [SearchDocumentsRequest.total_result_size][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.total_result_size] + // to `ESTIMATED_SIZE` or `ACTUAL_SIZE`. Otherwise, the value will be `-1`. + // Typically a UI would handle this condition by displaying "of + // many", for example: "Displaying 10 of many". + int32 total_size = 3; + + // Additional information for the API invocation, such as the request tracking + // id. + ResponseMetadata metadata = 4; + + // The histogram results that match with the specified + // [SearchDocumentsRequest.histogram_queries][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.histogram_queries]. + repeated HistogramQueryResult histogram_query_results = 6; + + // Experimental. + // Question answer from the query against the document. + string question_answer = 7; +} + +// Response message for DocumentService.FetchAcl. +message FetchAclResponse { + // The IAM policy. + google.iam.v1.Policy policy = 1; + + // Additional information for the API invocation, such as the request tracking + // id. + ResponseMetadata metadata = 2; +} + +// Response message for DocumentService.SetAcl. +message SetAclResponse { + // The policy will be attached to a resource (e.g. projecct, document). + google.iam.v1.Policy policy = 1; + + // Additional information for the API invocation, such as the request tracking + // id. + ResponseMetadata metadata = 2; +} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/document_service_request.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/document_service_request.proto new file mode 100644 index 00000000000..2611e1a39a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/document_service_request.proto @@ -0,0 +1,355 @@ +// Copyright 2025 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.cloud.contentwarehouse.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/contentwarehouse/v1/common.proto"; +import "google/cloud/contentwarehouse/v1/document.proto"; +import "google/cloud/contentwarehouse/v1/filters.proto"; +import "google/cloud/contentwarehouse/v1/histogram.proto"; +import "google/iam/v1/policy.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.ContentWarehouse.V1"; +option go_package = "cloud.google.com/go/contentwarehouse/apiv1/contentwarehousepb;contentwarehousepb"; +option java_multiple_files = true; +option java_outer_classname = "DocumentServiceRequestProto"; +option java_package = "com.google.cloud.contentwarehouse.v1"; +option php_namespace = "Google\\Cloud\\ContentWarehouse\\V1"; +option ruby_package = "Google::Cloud::ContentWarehouse::V1"; + +// Request Option for processing Cloud AI Document in CW Document. +message CloudAIDocumentOption { + // Whether to convert all the entities to properties. + bool enable_entities_conversions = 1; + + // If set, only selected entities will be converted to properties. + map customized_entities_properties_conversions = 2; +} + +// Request message for DocumentService.CreateDocument. +message CreateDocumentRequest { + // Required. The parent name. + // Format: projects/{project_number}/locations/{location}. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/Location" + } + ]; + + // Required. The document to create. + Document document = 2 [(google.api.field_behavior) = REQUIRED]; + + // The meta information collected about the end user, used to enforce access + // control for the service. + RequestMetadata request_metadata = 3; + + // Default document policy during creation. + // This refers to an Identity and Access (IAM) policy, which specifies access + // controls for the Document. + // Conditions defined in the policy will be ignored. + google.iam.v1.Policy policy = 4; + + // Request Option for processing Cloud AI Document in Document Warehouse. + // This field offers limited support for mapping entities from Cloud AI + // Document to Warehouse Document. Please consult with product team before + // using this field and other available options. + CloudAIDocumentOption cloud_ai_document_option = 5; + + // Field mask for creating Document fields. If mask path is empty, + // it means all fields are masked. + // For the `FieldMask` definition, + // see + // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask. + google.protobuf.FieldMask create_mask = 6; +} + +// Request message for DocumentService.GetDocument. +message GetDocumentRequest { + // Required. The name of the document to retrieve. + // Format: + // projects/{project_number}/locations/{location}/documents/{document_id} or + // projects/{project_number}/locations/{location}/documents/referenceId/{reference_id}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/Document" + } + ]; + + // The meta information collected about the end user, used to enforce access + // control for the service. + RequestMetadata request_metadata = 2; +} + +// Request message for DocumentService.UpdateDocument. +message UpdateDocumentRequest { + // Required. The name of the document to update. + // Format: + // projects/{project_number}/locations/{location}/documents/{document_id} + // or + // projects/{project_number}/locations/{location}/documents/referenceId/{reference_id}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/Document" + } + ]; + + // Required. The document to update. + Document document = 2 [(google.api.field_behavior) = REQUIRED]; + + // The meta information collected about the end user, used to enforce access + // control for the service. + RequestMetadata request_metadata = 3; + + // Request Option for processing Cloud AI Document in Document Warehouse. + // This field offers limited support for mapping entities from Cloud AI + // Document to Warehouse Document. Please consult with product team before + // using this field and other available options. + CloudAIDocumentOption cloud_ai_document_option = 5; + + // Options for the update operation. + UpdateOptions update_options = 6; +} + +// Request message for DocumentService.DeleteDocument. +message DeleteDocumentRequest { + // Required. The name of the document to delete. + // Format: + // projects/{project_number}/locations/{location}/documents/{document_id} + // or + // projects/{project_number}/locations/{location}/documents/referenceId/{reference_id}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/Document" + } + ]; + + // The meta information collected about the end user, used to enforce access + // control for the service. + RequestMetadata request_metadata = 2; +} + +// Request message for DocumentService.SearchDocuments. +message SearchDocumentsRequest { + // The total number of matching documents. + enum TotalResultSize { + // Total number calculation will be skipped. + TOTAL_RESULT_SIZE_UNSPECIFIED = 0; + + // Estimate total number. The total result size will be accurated up to + // 10,000. This option will add cost and latency to your request. + ESTIMATED_SIZE = 1; + + // It may adversely impact performance. The limit is 1000,000. + ACTUAL_SIZE = 2; + } + + // Required. The parent, which owns this collection of documents. + // Format: projects/{project_number}/locations/{location}. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/Location" + } + ]; + + // The meta information collected about the end user, used to enforce access + // control and improve the search quality of the service. + RequestMetadata request_metadata = 3; + + // Query used to search against documents (keyword, filters, etc.). + DocumentQuery document_query = 4; + + // An integer that specifies the current offset (that is, starting result + // location, amongst the documents deemed by the API as relevant) in search + // results. This field is only considered if + // [page_token][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.page_token] + // is unset. + // + // The maximum allowed value is 5000. Otherwise an error is thrown. + // + // For example, 0 means to return results starting from the first matching + // document, and 10 means to return from the 11th document. This can be used + // for pagination, (for example, pageSize = 10 and offset = 10 means to return + // from the second page). + int32 offset = 5; + + // A limit on the number of documents returned in the search results. + // Increasing this value above the default value of 10 can increase search + // response time. The value can be between 1 and 100. + int32 page_size = 6; + + // The token specifying the current offset within search results. + // See + // [SearchDocumentsResponse.next_page_token][google.cloud.contentwarehouse.v1.SearchDocumentsResponse.next_page_token] + // for an explanation of how to obtain the next set of query results. + string page_token = 7; + + // The criteria determining how search results are sorted. For non-empty + // query, default is `"relevance desc"`. For empty query, default is + // `"upload_date desc"`. + // + // Supported options are: + // + // * `"relevance desc"`: By relevance descending, as determined by the API + // algorithms. + // * `"upload_date desc"`: By upload date descending. + // * `"upload_date"`: By upload date ascending. + // * `"update_date desc"`: By last updated date descending. + // * `"update_date"`: By last updated date ascending. + // * `"retrieval_importance desc"`: By retrieval importance of properties + // descending. This feature is still under development, please do not use + // unless otherwise instructed to do so. + string order_by = 8; + + // An expression specifying a histogram request against matching + // documents. Expression syntax is an aggregation function call with + // histogram facets and other options. + // + // The following aggregation functions are supported: + // + // * `count(string_histogram_facet)`: Count the number of matching entities + // for each distinct attribute value. + // + // Data types: + // + // * Histogram facet (aka filterable properties): Facet names with format + // <schema id>.<facet>. Facets will have the + // format of: `[a-zA-Z][a-zA-Z0-9_:/-.]`. If the facet is a child + // facet, then the parent hierarchy needs to be specified separated by + // dots in the prefix after the schema id. Thus, the format for a multi- + // level facet is: <schema id>.<parent facet name>. + // <child facet name>. Example: + // schema123.root_parent_facet.middle_facet.child_facet + // * DocumentSchemaId: (with no schema id prefix) to get + // histograms for each document type (returns the schema id path, e.g. + // projects/12345/locations/us-west/documentSchemas/abc123). + // + // Example expression: + // + // * Document type counts: + // count('DocumentSchemaId') + // + // * For schema id, abc123, get the counts for MORTGAGE_TYPE: + // count('abc123.MORTGAGE_TYPE') + repeated HistogramQuery histogram_queries = 9; + + // Controls if the search document request requires the return of a total size + // of matched documents. See + // [SearchDocumentsResponse.total_size][google.cloud.contentwarehouse.v1.SearchDocumentsResponse.total_size]. + // + // Enabling this flag may adversely impact performance. Hint: If this is + // used with pagination, set this flag on the initial query but set this + // to false on subsequent page calls (keep the total count locally). + // + // Defaults to false. + bool require_total_size = 10; + + // Controls if the search document request requires the return of a total size + // of matched documents. See + // [SearchDocumentsResponse.total_size][google.cloud.contentwarehouse.v1.SearchDocumentsResponse.total_size]. + TotalResultSize total_result_size = 12; + + // Experimental, do not use. + // The limit on the number of documents returned for the question-answering + // feature. To enable the question-answering feature, set + // [DocumentQuery].[is_nl_query][] to true. + int32 qa_size_limit = 11; +} + +// Request message for DocumentService.LockDocument. +message LockDocumentRequest { + // Required. The name of the document to lock. + // Format: + // projects/{project_number}/locations/{location}/documents/{document}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/Document" + } + ]; + + // The collection the document connects to. + string collection_id = 2; + + // The user information who locks the document. + UserInfo locking_user = 3; +} + +// Request message for DocumentService.FetchAcl +message FetchAclRequest { + // Required. REQUIRED: The resource for which the policy is being requested. + // Format for document: + // projects/{project_number}/locations/{location}/documents/{document_id}. + // Format for collection: + // projects/{project_number}/locations/{location}/collections/{collection_id}. + // Format for project: projects/{project_number}. + string resource = 1 [(google.api.field_behavior) = REQUIRED]; + + // The meta information collected about the end user, used to enforce access + // control for the service. + RequestMetadata request_metadata = 2; + + // For Get Project ACL only. Authorization check for end user will be ignored + // when project_owner=true. + bool project_owner = 3; +} + +// Request message for DocumentService.SetAcl. +message SetAclRequest { + // Required. REQUIRED: The resource for which the policy is being requested. + // Format for document: + // projects/{project_number}/locations/{location}/documents/{document_id}. + // Format for collection: + // projects/{project_number}/locations/{location}/collections/{collection_id}. + // Format for project: projects/{project_number}. + string resource = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. REQUIRED: The complete policy to be applied to the `resource`. + // The size of the policy is limited to a few 10s of KB. This refers to an + // Identity and Access (IAM) policy, which specifies access controls for the + // Document. + // + // You can set ACL with condition for projects only. + // + // Supported operators are: `=`, `!=`, `<`, `<=`, `>`, and `>=` where + // the left of the operator is `DocumentSchemaId` or property name and the + // right of the operator is a number or a quoted string. You must escape + // backslash (\\) and quote (\") characters. + // + // Boolean expressions (AND/OR) are supported up to 3 levels of nesting (for + // example, "((A AND B AND C) OR D) AND E"), a maximum of 10 comparisons are + // allowed in the expression. The expression must be < 6000 bytes in length. + // + // Sample condition: + // `"DocumentSchemaId = \"some schema id\" OR SchemaId.floatPropertyName + // >= 10"` + google.iam.v1.Policy policy = 2 [(google.api.field_behavior) = REQUIRED]; + + // The meta information collected about the end user, used to enforce access + // control for the service. + RequestMetadata request_metadata = 3; + + // For Set Project ACL only. Authorization check for end user will be ignored + // when project_owner=true. + bool project_owner = 4; +} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/filters.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/filters.proto new file mode 100644 index 00000000000..269d2d07bc8 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/filters.proto @@ -0,0 +1,290 @@ +// Copyright 2025 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.cloud.contentwarehouse.v1; + +import "google/api/resource.proto"; +import "google/type/interval.proto"; + +option csharp_namespace = "Google.Cloud.ContentWarehouse.V1"; +option go_package = "cloud.google.com/go/contentwarehouse/apiv1/contentwarehousepb;contentwarehousepb"; +option java_multiple_files = true; +option java_outer_classname = "FiltersProto"; +option java_package = "com.google.cloud.contentwarehouse.v1"; +option php_namespace = "Google\\Cloud\\ContentWarehouse\\V1"; +option ruby_package = "Google::Cloud::ContentWarehouse::V1"; + +message DocumentQuery { + // The query string that matches against the full text of the document and + // the searchable properties. + // + // The query partially supports [Google AIP style + // syntax](https://google.aip.dev/160). Specifically, the query supports + // literals, logical operators, negation operators, comparison operators, and + // functions. + // + // Literals: A bare literal value (examples: "42", "Hugo") is a value to be + // matched against. It searches over the full text of the document and the + // searchable properties. + // + // Logical operators: "AND", "and", "OR", and "or" are binary logical + // operators (example: "engineer OR developer"). + // + // Negation operators: "NOT" and "!" are negation operators (example: "NOT + // software"). + // + // Comparison operators: support the binary comparison operators =, !=, <, >, + // <= and >= for string, numeric, enum, boolean. Also support like operator + // `~~` for string. It provides semantic search functionality by parsing, + // stemming and doing synonyms expansion against the input query. + // + // To specify a property in the query, the left hand side expression in the + // comparison must be the property ID including the parent. The right hand + // side must be literals. For example: + // "\"projects/123/locations/us\".property_a < 1" matches results whose + // "property_a" is less than 1 in project 123 and us location. + // The literals and comparison expression can be connected in a single query + // (example: "software engineer \"projects/123/locations/us\".salary > 100"). + // + // Functions: supported functions are `LOWER([property_name])` to perform a + // case insensitive match and `EMPTY([property_name])` to filter on the + // existence of a key. + // + // Support nested expressions connected using parenthesis and logical + // operators. The default logical operators is `AND` if there is no operators + // between expressions. + // + // The query can be used with other filters e.g. `time_filters` and + // `folder_name_filter`. They are connected with `AND` operator under the + // hood. + // + // The maximum number of allowed characters is 255. + string query = 1; + + // Experimental, do not use. + // If the query is a natural language question. False by default. If true, + // then the question-answering feature will be used instead of search, and + // `result_count` in + // [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest] + // must be set. In addition, all other input fields related to search + // (pagination, histograms, etc.) will be ignored. + bool is_nl_query = 12; + + // This filter specifies a structured syntax to match against the + // [PropertyDefinition].[is_filterable][] marked as `true`. The syntax for + // this expression is a subset of SQL syntax. + // + // Supported operators are: `=`, `!=`, `<`, `<=`, `>`, and `>=` where the left + // of the operator is a property name and the right of the operator is a + // number or a quoted string. You must escape backslash (\\) and quote (\") + // characters. Supported functions are `LOWER([property_name])` to perform a + // case insensitive match and `EMPTY([property_name])` to filter on the + // existence of a key. + // + // Boolean expressions (AND/OR/NOT) are supported up to 3 levels of nesting + // (for example, "((A AND B AND C) OR NOT D) AND E"), a maximum of 100 + // comparisons or functions are allowed in the expression. The expression must + // be < 6000 bytes in length. + // + // Sample Query: + // `(LOWER(driving_license)="class \"a\"" OR EMPTY(driving_license)) AND + // driving_years > 10` + string custom_property_filter = 4 [deprecated = true]; + + // Documents created/updated within a range specified by this filter are + // searched against. + repeated TimeFilter time_filters = 5; + + // This filter specifies the exact document schema + // [Document.document_schema_name][google.cloud.contentwarehouse.v1.Document.document_schema_name] + // of the documents to search against. + // + // If a value isn't specified, documents within the search results are + // associated with any schema. If multiple values are specified, documents + // within the search results may be associated with any of the specified + // schemas. + // + // At most 20 document schema names are allowed. + repeated string document_schema_names = 6; + + // This filter specifies a structured syntax to match against the + // [PropertyDefinition.is_filterable][google.cloud.contentwarehouse.v1.PropertyDefinition.is_filterable] + // marked as `true`. The relationship between the PropertyFilters is OR. + repeated PropertyFilter property_filter = 7; + + // This filter specifies the types of files to return: ALL, FOLDER, or FILE. + // If FOLDER or FILE is specified, then only either folders or files will be + // returned, respectively. If ALL is specified, both folders and files will be + // returned. + // + // If no value is specified, ALL files will be returned. + FileTypeFilter file_type_filter = 8; + + // Search all the documents under this specified folder. + // Format: + // projects/{project_number}/locations/{location}/documents/{document_id}. + string folder_name_filter = 9; + + // Search the documents in the list. + // Format: + // projects/{project_number}/locations/{location}/documents/{document_id}. + repeated string document_name_filter = 14; + + // For custom synonyms. + // Customers provide the synonyms based on context. One customer can provide + // multiple set of synonyms based on different context. The search query will + // be expanded based on the custom synonyms of the query context set. + // By default, no custom synonyms wll be applied if no query context is + // provided. + // It is not supported for CMEK compliant deployment. + repeated string query_context = 10; + + // The exact creator(s) of the documents to search against. + // + // If a value isn't specified, documents within the search results are + // associated with any creator. If multiple values are specified, documents + // within the search results may be associated with any of the specified + // creators. + repeated string document_creator_filter = 11; + + // To support the custom weighting across document schemas, customers need to + // provide the properties to be used to boost the ranking in the search + // request. For a search query with CustomWeightsMetadata specified, only the + // RetrievalImportance for the properties in the CustomWeightsMetadata will + // be honored. + CustomWeightsMetadata custom_weights_metadata = 13; +} + +// Filter on create timestamp or update timestamp of documents. +message TimeFilter { + // Time field used in TimeFilter. + enum TimeField { + // Default value. + TIME_FIELD_UNSPECIFIED = 0; + + // Earliest document create time. + CREATE_TIME = 1; + + // Latest document update time. + UPDATE_TIME = 2; + + // Time when document becomes mutable again. + DISPOSITION_TIME = 3; + } + + google.type.Interval time_range = 1; + + // Specifies which time field to filter documents on. + // + // Defaults to [TimeField.UPLOAD_TIME][]. + TimeField time_field = 2; +} + +message PropertyFilter { + // The Document schema name + // [Document.document_schema_name][google.cloud.contentwarehouse.v1.Document.document_schema_name]. + // Format: + // projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}. + string document_schema_name = 1 [(google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/DocumentSchema" + }]; + + // The filter condition. + // The syntax for this expression is a subset of SQL syntax. + // + // Supported operators are: `=`, `!=`, `<`, `<=`, `>`, `>=`, and `~~` where + // the left of the operator is a property name and the right of the operator + // is a number or a quoted string. You must escape backslash (\\) and quote + // (\") characters. + // + // `~~` is the LIKE operator. The right of the operator must be a string. The + // only supported property data type for LIKE is text_values. It provides + // semantic search functionality by parsing, stemming and doing synonyms + // expansion against the input query. It matches if the property contains + // semantic similar content to the query. It is not regex matching or wildcard + // matching. For example, "property.company ~~ \"google\"" will match records + // whose property `property.compnay` have values like "Google Inc.", "Google + // LLC" or "Google Company". + // + // Supported functions are `LOWER([property_name])` to perform a + // case insensitive match and `EMPTY([property_name])` to filter on the + // existence of a key. + // + // Boolean expressions (AND/OR/NOT) are supported up to 3 levels of nesting + // (for example, "((A AND B AND C) OR NOT D) AND E"), a maximum of 100 + // comparisons or functions are allowed in the expression. The expression must + // be < 6000 bytes in length. + // + // Only properties that are marked filterable are allowed + // ([PropertyDefinition.is_filterable][google.cloud.contentwarehouse.v1.PropertyDefinition.is_filterable]). + // Property names do not need to be prefixed by the document schema id (as is + // the case with histograms), however property names will need to be prefixed + // by its parent hierarchy, if any. For example: + // top_property_name.sub_property_name. + // + // Sample Query: + // `(LOWER(driving_license)="class \"a\"" OR EMPTY(driving_license)) AND + // driving_years > 10` + // + // + // CMEK compliant deployment only supports: + // + // * Operators: `=`, `<`, `<=`, `>`, and `>=`. + // * Boolean expressions: AND and OR. + string condition = 2; +} + +// Filter for the specific types of documents returned. +message FileTypeFilter { + // Representation of the types of files. + enum FileType { + // Default document type. If set, disables the filter. + FILE_TYPE_UNSPECIFIED = 0; + + // Returns all document types, including folders. + ALL = 1; + + // Returns only folders. + FOLDER = 2; + + // Returns only non-folder documents. + DOCUMENT = 3; + + // Returns only root folders + ROOT_FOLDER = 4; + } + + // The type of files to return. + FileType file_type = 1; +} + +// To support the custom weighting across document schemas. +message CustomWeightsMetadata { + // List of schema and property name. Allows a maximum of 10 schemas to be + // specified for relevance boosting. + repeated WeightedSchemaProperty weighted_schema_properties = 1; +} + +// Specifies the schema property name. +message WeightedSchemaProperty { + // The document schema name. + string document_schema_name = 1 [(google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/DocumentSchema" + }]; + + // The property definition names in the schema. + repeated string property_names = 2; +} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/histogram.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/histogram.proto new file mode 100644 index 00000000000..5b64748ce47 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/histogram.proto @@ -0,0 +1,109 @@ +// Copyright 2025 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.cloud.contentwarehouse.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.ContentWarehouse.V1"; +option go_package = "cloud.google.com/go/contentwarehouse/apiv1/contentwarehousepb;contentwarehousepb"; +option java_multiple_files = true; +option java_outer_classname = "HistogramProto"; +option java_package = "com.google.cloud.contentwarehouse.v1"; +option php_namespace = "Google\\Cloud\\ContentWarehouse\\V1"; +option ruby_package = "Google::Cloud::ContentWarehouse::V1"; + +// The histogram request. +message HistogramQuery { + // An expression specifies a histogram request against matching documents for + // searches. + // + // See + // [SearchDocumentsRequest.histogram_queries][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.histogram_queries] + // for details about syntax. + string histogram_query = 1; + + // Controls if the histogram query requires the return of a precise count. + // Enable this flag may adversely impact performance. + // + // Defaults to true. + bool require_precise_result_size = 2; + + // Optional. Filter the result of histogram query by the property names. It + // only works with histogram query count('FilterableProperties'). It is an + // optional. It will perform histogram on all the property names for all the + // document schemas. Setting this field will have a better performance. + HistogramQueryPropertyNameFilter filters = 3 + [(google.api.field_behavior) = OPTIONAL]; +} + +message HistogramQueryPropertyNameFilter { + // The result of the histogram query count('FilterableProperties') using + // HISTOGRAM_YAXIS_DOCUMENT will be: + // invoice_id: 2 + // address: 1 + // payment_method: 2 + // line_item_description: 1 + enum HistogramYAxis { + // Count the documents per property name. + HISTOGRAM_YAXIS_DOCUMENT = 0; + + // Count the properties per property name. + HISTOGRAM_YAXIS_PROPERTY = 1; + } + + // This filter specifies the exact document schema(s) + // [Document.document_schema_name][google.cloud.contentwarehouse.v1.Document.document_schema_name] + // to run histogram query against. It is optional. It will perform histogram + // for property names for all the document schemas if it is not set. + // + // At most 10 document schema names are allowed. + // Format: + // projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}. + repeated string document_schemas = 1 [(google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/DocumentSchema" + }]; + + // It is optional. It will perform histogram for all the property names if it + // is not set. + // The properties need to be defined with the is_filterable flag set to + // true and the name of the property should be in the format: + // "schemaId.propertyName". The property needs to be defined in the schema. + // Example: the schema id is abc. Then the name of property for property + // MORTGAGE_TYPE will be "abc.MORTGAGE_TYPE". + repeated string property_names = 2; + + // By default, the y_axis is HISTOGRAM_YAXIS_DOCUMENT if this field is not + // set. + HistogramYAxis y_axis = 3; +} + +// Histogram result that matches +// [HistogramQuery][google.cloud.contentwarehouse.v1.HistogramQuery] specified +// in searches. +message HistogramQueryResult { + // Requested histogram expression. + string histogram_query = 1; + + // A map from the values of the facet associated with distinct values to the + // number of matching entries with corresponding value. + // + // The key format is: + // + // * (for string histogram) string values stored in the field. + map histogram = 2; +} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/pipeline_service.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/pipeline_service.proto new file mode 100644 index 00000000000..0da21292a83 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/pipeline_service.proto @@ -0,0 +1,87 @@ +// Copyright 2025 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.cloud.contentwarehouse.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/contentwarehouse/v1/common.proto"; +import "google/cloud/contentwarehouse/v1/pipelines.proto"; +import "google/longrunning/operations.proto"; + +option csharp_namespace = "Google.Cloud.ContentWarehouse.V1"; +option go_package = "cloud.google.com/go/contentwarehouse/apiv1/contentwarehousepb;contentwarehousepb"; +option java_multiple_files = true; +option java_outer_classname = "PipelineServiceProto"; +option java_package = "com.google.cloud.contentwarehouse.v1"; +option php_namespace = "Google\\Cloud\\ContentWarehouse\\V1"; +option ruby_package = "Google::Cloud::ContentWarehouse::V1"; + +// This service lets you manage pipelines. +service PipelineService { + option (google.api.default_host) = "contentwarehouse.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Run a predefined pipeline. + rpc RunPipeline(RunPipelineRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*}:runPipeline" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "RunPipelineResponse" + metadata_type: "RunPipelineMetadata" + }; + } +} + +// Request message for DocumentService.RunPipeline. +message RunPipelineRequest { + // Required. The resource name which owns the resources of the pipeline. + // Format: projects/{project_number}/locations/{location}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/Location" + } + ]; + + // The predefined pipelines. + oneof pipeline { + // Cloud Storage ingestion pipeline. + GcsIngestPipeline gcs_ingest_pipeline = 2; + + // Use DocAI processors to process documents in Cloud Storage and ingest + // them to Document Warehouse. + GcsIngestWithDocAiProcessorsPipeline + gcs_ingest_with_doc_ai_processors_pipeline = 3; + + // Export docuemnts from Document Warehouse to CDW for training purpose. + ExportToCdwPipeline export_cdw_pipeline = 4; + + // Use a DocAI processor to process documents in Document Warehouse, and + // re-ingest the updated results into Document Warehouse. + ProcessWithDocAiPipeline process_with_doc_ai_pipeline = 5; + } + + // The meta information collected about the end user, used to enforce access + // control for the service. + RequestMetadata request_metadata = 6; +} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/pipelines.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/pipelines.proto new file mode 100644 index 00000000000..d316b45e15a --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/pipelines.proto @@ -0,0 +1,291 @@ +// Copyright 2025 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.cloud.contentwarehouse.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/contentwarehouse/v1/common.proto"; +import "google/iam/v1/policy.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.ContentWarehouse.V1"; +option go_package = "cloud.google.com/go/contentwarehouse/apiv1/contentwarehousepb;contentwarehousepb"; +option java_multiple_files = true; +option java_outer_classname = "PipelinesProto"; +option java_package = "com.google.cloud.contentwarehouse.v1"; +option php_namespace = "Google\\Cloud\\ContentWarehouse\\V1"; +option ruby_package = "Google::Cloud::ContentWarehouse::V1"; +option (google.api.resource_definition) = { + type: "cloudfunctions.googleapis.com/CloudFunction" + pattern: "projects/{project}/locations/{location}/functions/{function}" +}; + +// Response message of RunPipeline method. +message RunPipelineResponse {} + +// Metadata message of RunPipeline method. +message RunPipelineMetadata { + // The metadata message for GcsIngest pipeline. + message GcsIngestPipelineMetadata { + // The input Cloud Storage folder in this pipeline. + // Format: `gs:///`. + string input_path = 1; + } + + // The metadata message for Export-to-CDW pipeline. + message ExportToCdwPipelineMetadata { + // The input list of all the resource names of the documents to be exported. + repeated string documents = 1; + + // The output CDW dataset resource name. + string doc_ai_dataset = 2; + + // The output Cloud Storage folder in this pipeline. + string output_path = 3; + } + + // The metadata message for Process-with-DocAi pipeline. + message ProcessWithDocAiPipelineMetadata { + // The input list of all the resource names of the documents to be + // processed. + repeated string documents = 1; + + // The DocAI processor to process the documents with. + ProcessorInfo processor_info = 2; + } + + // The status of processing a document. + message IndividualDocumentStatus { + // Document identifier of an existing document. + string document_id = 1; + + // The status processing the document. + google.rpc.Status status = 2; + } + + // Number of files that were processed by the pipeline. + int32 total_file_count = 1; + + // Number of files that have failed at some point in the pipeline. + int32 failed_file_count = 2; + + // User unique identification and groups information. + UserInfo user_info = 3; + + // The pipeline metadata. + oneof pipeline_metadata { + // The pipeline metadata for GcsIngest pipeline. + GcsIngestPipelineMetadata gcs_ingest_pipeline_metadata = 4; + + // The pipeline metadata for Export-to-CDW pipeline. + ExportToCdwPipelineMetadata export_to_cdw_pipeline_metadata = 6; + + // The pipeline metadata for Process-with-DocAi pipeline. + ProcessWithDocAiPipelineMetadata process_with_doc_ai_pipeline_metadata = 7; + } + + // The list of response details of each document. + repeated IndividualDocumentStatus individual_document_statuses = 5; +} + +// The DocAI processor information. +message ProcessorInfo { + // The processor resource name. + // Format is `projects/{project}/locations/{location}/processors/{processor}`, + // or + // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + string processor_name = 1; + + // The processor will process the documents with this document type. + string document_type = 2; + + // The Document schema resource name. All documents processed by this + // processor will use this schema. + // Format: + // projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}. + string schema_name = 3; +} + +// The ingestion pipeline config. +message IngestPipelineConfig { + // The document level acl policy config. + // This refers to an Identity and Access (IAM) policy, which specifies access + // controls for all documents ingested by the pipeline. The + // [role][google.iam.v1.Binding.role] and + // [members][google.iam.v1.Binding.role] under the policy needs to be + // specified. + // + // The following roles are supported for document level acl control: + // * roles/contentwarehouse.documentAdmin + // * roles/contentwarehouse.documentEditor + // * roles/contentwarehouse.documentViewer + // + // The following members are supported for document level acl control: + // * user:user-email@example.com + // * group:group-email@example.com + // Note that for documents searched with LLM, only single level user or group + // acl check is supported. + google.iam.v1.Policy document_acl_policy = 1; + + // The document text extraction enabled flag. + // If the flag is set to true, DWH will perform text extraction on the raw + // document. + bool enable_document_text_extraction = 2; + + // Optional. The name of the folder to which all ingested documents will be + // linked during ingestion process. Format is + // `projects/{project}/locations/{location}/documents/{folder_id}` + string folder = 3 [(google.api.field_behavior) = OPTIONAL]; + + // The Cloud Function resource name. The Cloud Function needs to live inside + // consumer project and is accessible to Document AI Warehouse P4SA. + // Only Cloud Functions V2 is supported. Cloud function execution should + // complete within 5 minutes or this file ingestion may fail due to timeout. + // Format: `https://{region}-{project_id}.cloudfunctions.net/{cloud_function}` + // The following keys are available the request json payload. + // * display_name + // * properties + // * plain_text + // * reference_id + // * document_schema_name + // * raw_document_path + // * raw_document_file_type + // + // The following keys from the cloud function json response payload will be + // ingested to the Document AI Warehouse as part of Document proto content + // and/or related information. The original values will be overridden if any + // key is present in the response. + // * display_name + // * properties + // * plain_text + // * document_acl_policy + // * folder + string cloud_function = 4 [(google.api.resource_reference) = { + type: "cloudfunctions.googleapis.com/CloudFunction" + }]; +} + +// The configuration of the Cloud Storage Ingestion pipeline. +message GcsIngestPipeline { + // The input Cloud Storage folder. All files under this folder will be + // imported to Document Warehouse. + // Format: `gs:///`. + string input_path = 1; + + // The Document Warehouse schema resource name. All documents processed by + // this pipeline will use this schema. + // Format: + // projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}. + string schema_name = 2; + + // The Doc AI processor type name. Only used when the format of ingested + // files is Doc AI Document proto format. + string processor_type = 3; + + // The flag whether to skip ingested documents. + // If it is set to true, documents in Cloud Storage contains key "status" with + // value "status=ingested" in custom metadata will be skipped to ingest. + bool skip_ingested_documents = 4; + + // Optional. The config for the Cloud Storage Ingestion pipeline. + // It provides additional customization options to run the pipeline and can be + // skipped if it is not applicable. + IngestPipelineConfig pipeline_config = 5 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The configuration of the Cloud Storage Ingestion with DocAI Processors +// pipeline. +message GcsIngestWithDocAiProcessorsPipeline { + // The input Cloud Storage folder. All files under this folder will be + // imported to Document Warehouse. + // Format: `gs:///`. + string input_path = 1; + + // The split and classify processor information. + // The split and classify result will be used to find a matched extract + // processor. + ProcessorInfo split_classify_processor_info = 2; + + // The extract processors information. + // One matched extract processor will be used to process documents based on + // the classify processor result. If no classify processor is specified, the + // first extract processor will be used. + repeated ProcessorInfo extract_processor_infos = 3; + + // The Cloud Storage folder path used to store the raw results from + // processors. + // Format: `gs:///`. + string processor_results_folder_path = 4; + + // The flag whether to skip ingested documents. + // If it is set to true, documents in Cloud Storage contains key "status" with + // value "status=ingested" in custom metadata will be skipped to ingest. + bool skip_ingested_documents = 5; + + // Optional. The config for the Cloud Storage Ingestion with DocAI Processors + // pipeline. It provides additional customization options to run the pipeline + // and can be skipped if it is not applicable. + IngestPipelineConfig pipeline_config = 6 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The configuration of exporting documents from the Document Warehouse to CDW +// pipeline. +message ExportToCdwPipeline { + // The list of all the resource names of the documents to be processed. + // Format: + // projects/{project_number}/locations/{location}/documents/{document_id}. + repeated string documents = 1; + + // The Cloud Storage folder path used to store the exported documents before + // being sent to CDW. + // Format: `gs:///`. + string export_folder_path = 2; + + // Optional. The CDW dataset resource name. This field is optional. If not + // set, the documents will be exported to Cloud Storage only. Format: + // projects/{project}/locations/{location}/processors/{processor}/dataset + string doc_ai_dataset = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Ratio of training dataset split. When importing into Document AI Workbench, + // documents will be automatically split into training and test split category + // with the specified ratio. This field is required if doc_ai_dataset is set. + float training_split_ratio = 4; +} + +// The configuration of processing documents in Document Warehouse with DocAi +// processors pipeline. +message ProcessWithDocAiPipeline { + // The list of all the resource names of the documents to be processed. + // Format: + // projects/{project_number}/locations/{location}/documents/{document_id}. + repeated string documents = 1; + + // The Cloud Storage folder path used to store the exported documents before + // being sent to CDW. + // Format: `gs:///`. + string export_folder_path = 2; + + // The CDW processor information. + ProcessorInfo processor_info = 3; + + // The Cloud Storage folder path used to store the raw results from + // processors. + // Format: `gs:///`. + string processor_results_folder_path = 4; +} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/rule_engine.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/rule_engine.proto new file mode 100644 index 00000000000..6beedad8d40 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/rule_engine.proto @@ -0,0 +1,289 @@ +// Copyright 2025 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.cloud.contentwarehouse.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/iam/v1/policy.proto"; + +option csharp_namespace = "Google.Cloud.ContentWarehouse.V1"; +option go_package = "cloud.google.com/go/contentwarehouse/apiv1/contentwarehousepb;contentwarehousepb"; +option java_multiple_files = true; +option java_outer_classname = "RuleEngineProto"; +option java_package = "com.google.cloud.contentwarehouse.v1"; +option php_namespace = "Google\\Cloud\\ContentWarehouse\\V1"; +option ruby_package = "Google::Cloud::ContentWarehouse::V1"; + +// Represents a set of rules from a single customer. +message RuleSet { + option (google.api.resource) = { + type: "contentwarehouse.googleapis.com/RuleSet" + pattern: "projects/{project}/locations/{location}/ruleSets/{rule_set}" + }; + + // The resource name of the rule set. Managed internally. + // Format: + // projects/{project_number}/locations/{location}/ruleSet/{rule_set_id}. + // + // The name is ignored when creating a rule set. + string name = 6; + + // Short description of the rule-set. + string description = 1; + + // Source of the rules i.e., customer name. + string source = 2; + + // List of rules given by the customer. + repeated Rule rules = 3; +} + +// Represents the rule for a content warehouse trigger. +message Rule { + // The trigger types for actions. + enum TriggerType { + // Trigger for unknown action. + UNKNOWN = 0; + + // Trigger for create document action. + ON_CREATE = 1; + + // Trigger for update document action. + ON_UPDATE = 4; + + // Trigger for create link action. + ON_CREATE_LINK = 7; + + // Trigger for delete link action. + ON_DELETE_LINK = 8; + } + + // Short description of the rule and its context. + string description = 1; + + // ID of the rule. It has to be unique across all the examples. + // This is managed internally. + string rule_id = 2; + + // Identifies the trigger type for running the policy. + TriggerType trigger_type = 3; + + // Represents the conditional expression to be evaluated. + // Expression should evaluate to a boolean result. + // When the condition is true actions are executed. + // Example: user_role = "hsbc_role_1" AND doc.salary > 20000 + string condition = 4; + + // List of actions that are executed when the rule is satisfied. + repeated Action actions = 5; +} + +// Represents the action triggered by Rule Engine when the rule is true. +message Action { + // ID of the action. Managed internally. + string action_id = 1; + + oneof action { + // Action triggering access control operations. + AccessControlAction access_control = 2; + + // Action triggering data validation operations. + DataValidationAction data_validation = 3; + + // Action triggering data update operations. + DataUpdateAction data_update = 4; + + // Action triggering create document link operation. + AddToFolderAction add_to_folder = 5; + + // Action publish to Pub/Sub operation. + PublishAction publish_to_pub_sub = 6; + + // Action removing a document from a folder. + RemoveFromFolderAction remove_from_folder_action = 9; + + // Action deleting the document. + DeleteDocumentAction delete_document_action = 10; + } +} + +// Represents the action responsible for access control list management +// operations. +message AccessControlAction { + // Type of ACL modification operation. + enum OperationType { + // The unknown operation type. + UNKNOWN = 0; + + // Adds newly given policy bindings in the existing bindings list. + ADD_POLICY_BINDING = 1; + + // Removes newly given policy bindings from the existing bindings list. + REMOVE_POLICY_BINDING = 2; + + // Replaces existing policy bindings with the given policy binding list + REPLACE_POLICY_BINDING = 3; + } + + // Identifies the type of operation. + OperationType operation_type = 1; + + // Represents the new policy from which bindings are added, removed or + // replaced based on the type of the operation. the policy is limited to a few + // 10s of KB. + google.iam.v1.Policy policy = 2; +} + +// Represents the action responsible for data validation operations. +message DataValidationAction { + // Map of (K, V) -> (field, string condition to be evaluated on the field) + // E.g., ("age", "age > 18 && age < 60") entry triggers validation of field + // age with the given condition. Map entries will be ANDed during validation. + map conditions = 1; +} + +// Represents the action responsible for properties update operations. +message DataUpdateAction { + // Map of (K, V) -> (valid name of the field, new value of the field) + // E.g., ("age", "60") entry triggers update of field age with a value of 60. + // If the field is not present then new entry is added. + // During update action execution, value strings will be casted to + // appropriate types. + map entries = 1; +} + +// Represents the action responsible for adding document under a folder. +message AddToFolderAction { + // Names of the folder under which new document is to be added. + // Format: + // projects/{project_number}/locations/{location}/documents/{document_id}. + repeated string folders = 1 [(google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/Document" + }]; +} + +// Represents the action responsible for remove a document from a specific +// folder. +message RemoveFromFolderAction { + // Condition of the action to be executed. + string condition = 1; + + // Name of the folder under which new document is to be added. + // Format: + // projects/{project_number}/locations/{location}/documents/{document_id}. + string folder = 2 [(google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/Document" + }]; +} + +// Represents the action responsible for publishing messages to a Pub/Sub topic. +message PublishAction { + // The topic id in the Pub/Sub service for which messages will be published + // to. + string topic_id = 1; + + // Messages to be published. + repeated string messages = 2; +} + +// Represents the action responsible for deleting the document. +message DeleteDocumentAction { + // Boolean field to select between hard vs soft delete options. + // Set 'true' for 'hard delete' and 'false' for 'soft delete'. + bool enable_hard_delete = 1; +} + +// Records the output of Rule Engine including rule evaluation and actions +// result. +message RuleEngineOutput { + // Name of the document against which the rules and actions were evaluated. + string document_name = 3; + + // Output from Rule Evaluator containing matched, unmatched and invalid rules. + RuleEvaluatorOutput rule_evaluator_output = 1; + + // Output from Action Executor containing rule and corresponding actions + // execution result. + ActionExecutorOutput action_executor_output = 2; +} + +// Represents the output of the Rule Evaluator. +message RuleEvaluatorOutput { + // List of rules fetched from database for the given request trigger type. + repeated Rule triggered_rules = 1; + + // A subset of triggered rules that are evaluated true for a given request. + repeated Rule matched_rules = 2; + + // A subset of triggered rules that failed the validation check(s) after + // parsing. + repeated InvalidRule invalid_rules = 3; +} + +// A triggered rule that failed the validation check(s) after parsing. +message InvalidRule { + // Triggered rule. + Rule rule = 1; + + // Validation error on a parsed expression. + string error = 2; +} + +// Represents the output of the Action Executor. +message ActionExecutorOutput { + // List of rule and corresponding actions result. + repeated RuleActionsPair rule_actions_pairs = 1; +} + +// Represents a rule and outputs of associated actions. +message RuleActionsPair { + // Represents the rule. + Rule rule = 1; + + // Outputs of executing the actions associated with the above rule. + repeated ActionOutput action_outputs = 2; +} + +// Represents the result of executing an action. +message ActionOutput { + // Represents execution state of the action. + enum State { + // The unknown state. + UNKNOWN = 0; + + // State indicating action executed successfully. + ACTION_SUCCEEDED = 1; + + // State indicating action failed. + ACTION_FAILED = 2; + + // State indicating action timed out. + ACTION_TIMED_OUT = 3; + + // State indicating action is pending. + ACTION_PENDING = 4; + } + + // ID of the action. + string action_id = 1; + + // State of an action. + State action_state = 2; + + // Action execution output message. + string output_message = 3; +} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/ruleset_service.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/ruleset_service.proto new file mode 100644 index 00000000000..b7f102c75c9 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/ruleset_service.proto @@ -0,0 +1,81 @@ +// Copyright 2025 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.cloud.contentwarehouse.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/cloud/contentwarehouse/v1/rule_engine.proto"; +import "google/cloud/contentwarehouse/v1/ruleset_service_request.proto"; +import "google/protobuf/empty.proto"; + +option csharp_namespace = "Google.Cloud.ContentWarehouse.V1"; +option go_package = "cloud.google.com/go/contentwarehouse/apiv1/contentwarehousepb;contentwarehousepb"; +option java_multiple_files = true; +option java_outer_classname = "RuleSetServiceProto"; +option java_package = "com.google.cloud.contentwarehouse.v1"; +option php_namespace = "Google\\Cloud\\ContentWarehouse\\V1"; +option ruby_package = "Google::Cloud::ContentWarehouse::V1"; + +// Service to manage customer specific RuleSets. +service RuleSetService { + option (google.api.default_host) = "contentwarehouse.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a ruleset. + rpc CreateRuleSet(CreateRuleSetRequest) returns (RuleSet) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/ruleSets" + body: "rule_set" + }; + option (google.api.method_signature) = "parent,rule_set"; + } + + // Gets a ruleset. Returns NOT_FOUND if the ruleset does not exist. + rpc GetRuleSet(GetRuleSetRequest) returns (RuleSet) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/ruleSets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a ruleset. Returns INVALID_ARGUMENT if the name of the ruleset + // is non-empty and does not equal the existing name. + rpc UpdateRuleSet(UpdateRuleSetRequest) returns (RuleSet) { + option (google.api.http) = { + patch: "/v1/{name=projects/*/locations/*/ruleSets/*}" + body: "*" + }; + option (google.api.method_signature) = "name,rule_set"; + } + + // Deletes a ruleset. Returns NOT_FOUND if the document does not exist. + rpc DeleteRuleSet(DeleteRuleSetRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/ruleSets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists rulesets. + rpc ListRuleSets(ListRuleSetsRequest) returns (ListRuleSetsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/ruleSets" + }; + option (google.api.method_signature) = "parent"; + } +} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/ruleset_service_request.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/ruleset_service_request.proto new file mode 100644 index 00000000000..bb9e50a59b9 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/ruleset_service_request.proto @@ -0,0 +1,121 @@ +// Copyright 2025 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.cloud.contentwarehouse.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/contentwarehouse/v1/rule_engine.proto"; + +option csharp_namespace = "Google.Cloud.ContentWarehouse.V1"; +option go_package = "cloud.google.com/go/contentwarehouse/apiv1/contentwarehousepb;contentwarehousepb"; +option java_multiple_files = true; +option java_outer_classname = "RuleSetServiceRequestProto"; +option java_package = "com.google.cloud.contentwarehouse.v1"; +option php_namespace = "Google\\Cloud\\ContentWarehouse\\V1"; +option ruby_package = "Google::Cloud::ContentWarehouse::V1"; + +// Request message for RuleSetService.CreateRuleSet. +message CreateRuleSetRequest { + // Required. The parent name. + // Format: projects/{project_number}/locations/{location}. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/Location" + } + ]; + + // Required. The rule set to create. + RuleSet rule_set = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for RuleSetService.GetRuleSet. +message GetRuleSetRequest { + // Required. The name of the rule set to retrieve. + // Format: + // projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/RuleSet" + } + ]; +} + +// Request message for RuleSetService.UpdateRuleSet. +message UpdateRuleSetRequest { + // Required. The name of the rule set to update. + // Format: + // projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/RuleSet" + } + ]; + + // Required. The rule set to update. + RuleSet rule_set = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for RuleSetService.DeleteRuleSet. +message DeleteRuleSetRequest { + // Required. The name of the rule set to delete. + // Format: + // projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/RuleSet" + } + ]; +} + +// Request message for RuleSetService.ListRuleSets. +message ListRuleSetsRequest { + // Required. The parent, which owns this collection of document. + // Format: projects/{project_number}/locations/{location}. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/Location" + } + ]; + + // The maximum number of rule sets to return. The service may return + // fewer than this value. + // If unspecified, at most 50 rule sets will be returned. + // The maximum value is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2; + + // A page token, received from a previous `ListRuleSets` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListRuleSets` + // must match the call that provided the page token. + string page_token = 3; +} + +// Response message for RuleSetService.ListRuleSets. +message ListRuleSetsResponse { + // The rule sets from the specified parent. + repeated RuleSet rule_sets = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/synonymset.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/synonymset.proto new file mode 100644 index 00000000000..a6e968e8aa0 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/synonymset.proto @@ -0,0 +1,61 @@ +// Copyright 2025 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.cloud.contentwarehouse.v1; + +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.ContentWarehouse.V1"; +option go_package = "cloud.google.com/go/contentwarehouse/apiv1/contentwarehousepb;contentwarehousepb"; +option java_multiple_files = true; +option java_outer_classname = "SynonymSetProto"; +option java_package = "com.google.cloud.contentwarehouse.v1"; +option php_namespace = "Google\\Cloud\\ContentWarehouse\\V1"; +option ruby_package = "Google::Cloud::ContentWarehouse::V1"; + +// Represents a list of synonyms for a given context. +// For example a context "sales" could contain: +// Synonym 1: sale, invoice, bill, order +// Synonym 2: money, credit, finance, payment +// Synonym 3: shipping, freight, transport +// Each SynonymSets should be disjoint +message SynonymSet { + option (google.api.resource) = { + type: "contentwarehouse.googleapis.com/SynonymSet" + pattern: "projects/{project}/locations/{location}/synonymSets/{context}" + }; + + // Represents a list of words given by the customer + // All these words are synonyms of each other. + message Synonym { + // For example: sale, invoice, bill, order + repeated string words = 1; + } + + // The resource name of the SynonymSet + // This is mandatory for google.api.resource. + // Format: + // projects/{project_number}/locations/{location}/synonymSets/{context}. + string name = 1; + + // This is a freeform field. Example contexts can be "sales," "engineering," + // "real estate," "accounting," etc. + // The context can be supplied during search requests. + string context = 2; + + // List of Synonyms for the context. + repeated Synonym synonyms = 3; +} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/synonymset_service.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/synonymset_service.proto new file mode 100644 index 00000000000..4bc0f5781b9 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/synonymset_service.proto @@ -0,0 +1,89 @@ +// Copyright 2025 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.cloud.contentwarehouse.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/cloud/contentwarehouse/v1/synonymset.proto"; +import "google/cloud/contentwarehouse/v1/synonymset_service_request.proto"; +import "google/protobuf/empty.proto"; + +option csharp_namespace = "Google.Cloud.ContentWarehouse.V1"; +option go_package = "cloud.google.com/go/contentwarehouse/apiv1/contentwarehousepb;contentwarehousepb"; +option java_multiple_files = true; +option java_outer_classname = "SynonymSetServiceProto"; +option java_package = "com.google.cloud.contentwarehouse.v1"; +option php_namespace = "Google\\Cloud\\ContentWarehouse\\V1"; +option ruby_package = "Google::Cloud::ContentWarehouse::V1"; + +// A Service that manage/custom customer specified SynonymSets. +service SynonymSetService { + option (google.api.default_host) = "contentwarehouse.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a SynonymSet for a single context. + // Throws an ALREADY_EXISTS exception if a synonymset already exists + // for the context. + rpc CreateSynonymSet(CreateSynonymSetRequest) returns (SynonymSet) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/synonymSets" + body: "synonym_set" + }; + option (google.api.method_signature) = "parent,synonym_set"; + } + + // Gets a SynonymSet for a particular context. + // Throws a NOT_FOUND exception if the Synonymset + // does not exist + rpc GetSynonymSet(GetSynonymSetRequest) returns (SynonymSet) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/synonymSets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Remove the existing SynonymSet for the context and replaces it + // with a new one. + // Throws a NOT_FOUND exception if the SynonymSet is not found. + rpc UpdateSynonymSet(UpdateSynonymSetRequest) returns (SynonymSet) { + option (google.api.http) = { + patch: "/v1/{name=projects/*/locations/*/synonymSets/*}" + body: "synonym_set" + }; + option (google.api.method_signature) = "name,synonym_set"; + } + + // Deletes a SynonymSet for a given context. + // Throws a NOT_FOUND exception if the SynonymSet is not found. + rpc DeleteSynonymSet(DeleteSynonymSetRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/synonymSets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Returns all SynonymSets (for all contexts) for the specified location. + rpc ListSynonymSets(ListSynonymSetsRequest) + returns (ListSynonymSetsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/synonymSets" + }; + option (google.api.method_signature) = "parent"; + } +} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/synonymset_service_request.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/synonymset_service_request.proto new file mode 100644 index 00000000000..48d35603cfb --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/synonymset_service_request.proto @@ -0,0 +1,125 @@ +// Copyright 2025 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.cloud.contentwarehouse.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/contentwarehouse/v1/synonymset.proto"; + +option csharp_namespace = "Google.Cloud.ContentWarehouse.V1"; +option go_package = "cloud.google.com/go/contentwarehouse/apiv1/contentwarehousepb;contentwarehousepb"; +option java_multiple_files = true; +option java_outer_classname = "SynonymSetServiceRequestProto"; +option java_package = "com.google.cloud.contentwarehouse.v1"; +option php_namespace = "Google\\Cloud\\ContentWarehouse\\V1"; +option ruby_package = "Google::Cloud::ContentWarehouse::V1"; + +// Request message for SynonymSetService.CreateSynonymSet. +message CreateSynonymSetRequest { + // Required. The parent name. + // Format: projects/{project_number}/locations/{location}. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/Location" + } + ]; + + // Required. The synonymSet to be created for a context + SynonymSet synonym_set = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for SynonymSetService.GetSynonymSet. +// Will return synonymSet for a certain context. +message GetSynonymSetRequest { + // Required. The name of the synonymSet to retrieve + // Format: + // projects/{project_number}/locations/{location}/synonymSets/{context}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/SynonymSet" + } + ]; +} + +// Request message for SynonymSetService.ListSynonymSets. +// Will return all synonymSets belonging to the customer project. +message ListSynonymSetsRequest { + // Required. The parent name. + // Format: projects/{project_number}/locations/{location}. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/Location" + } + ]; + + // The maximum number of synonymSets to return. The service may return + // fewer than this value. + // If unspecified, at most 50 rule sets will be returned. + // The maximum value is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2; + + // A page token, received from a previous `ListSynonymSets` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListSynonymSets` + // must match the call that provided the page token. + string page_token = 3; +} + +// Response message for SynonymSetService.ListSynonymSets. +message ListSynonymSetsResponse { + // The synonymSets from the specified parent. + repeated SynonymSet synonym_sets = 1; + + // A page token, received from a previous `ListSynonymSets` call. + // Provide this to retrieve the subsequent page. + string next_page_token = 2; +} + +// Request message for SynonymSetService.UpdateSynonymSet. +// Removes the SynonymSet for the specified context and replaces +// it with the SynonymSet in this request. +message UpdateSynonymSetRequest { + // Required. The name of the synonymSet to update + // Format: + // projects/{project_number}/locations/{location}/synonymSets/{context}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/SynonymSet" + } + ]; + + // Required. The synonymSet to be updated for the customer + SynonymSet synonym_set = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for SynonymSetService.DeleteSynonymSet. +message DeleteSynonymSetRequest { + // Required. The name of the synonymSet to delete + // Format: + // projects/{project_number}/locations/{location}/synonymSets/{context}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/SynonymSet" + } + ]; +} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/barcode.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/barcode.proto new file mode 100644 index 00000000000..ba6672a0873 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/barcode.proto @@ -0,0 +1,69 @@ +// Copyright 2025 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.cloud.documentai.v1; + +option csharp_namespace = "Google.Cloud.DocumentAI.V1"; +option go_package = "cloud.google.com/go/documentai/apiv1/documentaipb;documentaipb"; +option java_multiple_files = true; +option java_outer_classname = "BarcodeProto"; +option java_package = "com.google.cloud.documentai.v1"; +option php_namespace = "Google\\Cloud\\DocumentAI\\V1"; +option ruby_package = "Google::Cloud::DocumentAI::V1"; + +// Encodes the detailed information of a barcode. +message Barcode { + // Format of a barcode. + // The supported formats are: + // + // - `CODE_128`: Code 128 type. + // - `CODE_39`: Code 39 type. + // - `CODE_93`: Code 93 type. + // - `CODABAR`: Codabar type. + // - `DATA_MATRIX`: 2D Data Matrix type. + // - `ITF`: ITF type. + // - `EAN_13`: EAN-13 type. + // - `EAN_8`: EAN-8 type. + // - `QR_CODE`: 2D QR code type. + // - `UPC_A`: UPC-A type. + // - `UPC_E`: UPC-E type. + // - `PDF417`: PDF417 type. + // - `AZTEC`: 2D Aztec code type. + // - `DATABAR`: GS1 DataBar code type. + string format = 1; + + // Value format describes the format of the value that a barcode + // encodes. + // The supported formats are: + // + // - `CONTACT_INFO`: Contact information. + // - `EMAIL`: Email address. + // - `ISBN`: ISBN identifier. + // - `PHONE`: Phone number. + // - `PRODUCT`: Product. + // - `SMS`: SMS message. + // - `TEXT`: Text string. + // - `URL`: URL address. + // - `WIFI`: Wifi information. + // - `GEO`: Geo-localization. + // - `CALENDAR_EVENT`: Calendar event. + // - `DRIVER_LICENSE`: Driver's license. + string value_format = 2; + + // Raw value encoded in the barcode. + // For example: `'MEBKM:TITLE:Google;URL:https://www.google.com;;'`. + string raw_value = 3; +} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/document.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/document.proto new file mode 100644 index 00000000000..1eaad2a3c54 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/document.proto @@ -0,0 +1,1204 @@ +// Copyright 2025 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.cloud.documentai.v1; + +import "google/api/field_behavior.proto"; +import "google/cloud/documentai/v1/barcode.proto"; +import "google/cloud/documentai/v1/geometry.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; +import "google/type/color.proto"; +import "google/type/date.proto"; +import "google/type/datetime.proto"; +import "google/type/money.proto"; +import "google/type/postal_address.proto"; + +option csharp_namespace = "Google.Cloud.DocumentAI.V1"; +option go_package = "cloud.google.com/go/documentai/apiv1/documentaipb;documentaipb"; +option java_multiple_files = true; +option java_outer_classname = "DocumentProto"; +option java_package = "com.google.cloud.documentai.v1"; +option php_namespace = "Google\\Cloud\\DocumentAI\\V1"; +option ruby_package = "Google::Cloud::DocumentAI::V1"; + +// Document represents the canonical document resource in Document AI. It is an +// interchange format that provides insights into documents and allows for +// collaboration between users and Document AI to iterate and optimize for +// quality. +message Document { + // For a large document, sharding may be performed to produce several + // document shards. Each document shard contains this field to detail which + // shard it is. + message ShardInfo { + // The 0-based index of this shard. + int64 shard_index = 1; + + // Total number of shards. + int64 shard_count = 2; + + // The index of the first character in + // [Document.text][google.cloud.documentai.v1.Document.text] in the overall + // document global text. + int64 text_offset = 3; + } + + // Annotation for common text style attributes. This adheres to CSS + // conventions as much as possible. + message Style { + // Font size with unit. + message FontSize { + // Font size for the text. + float size = 1; + + // Unit for the font size. Follows CSS naming (such as `in`, `px`, and + // `pt`). + string unit = 2; + } + + // Text anchor indexing into the + // [Document.text][google.cloud.documentai.v1.Document.text]. + TextAnchor text_anchor = 1; + + // Text color. + google.type.Color color = 2; + + // Text background color. + google.type.Color background_color = 3; + + // [Font weight](https://www.w3schools.com/cssref/pr_font_weight.asp). + // Possible values are `normal`, `bold`, `bolder`, and `lighter`. + string font_weight = 4; + + // [Text style](https://www.w3schools.com/cssref/pr_font_font-style.asp). + // Possible values are `normal`, `italic`, and `oblique`. + string text_style = 5; + + // [Text + // decoration](https://www.w3schools.com/cssref/pr_text_text-decoration.asp). + // Follows CSS standard. + // + string text_decoration = 6; + + // Font size. + FontSize font_size = 7; + + // Font family such as `Arial`, `Times New Roman`. + // https://www.w3schools.com/cssref/pr_font_font-family.asp + string font_family = 8; + } + + // A page in a [Document][google.cloud.documentai.v1.Document]. + message Page { + // Dimension for the page. + message Dimension { + // Page width. + float width = 1; + + // Page height. + float height = 2; + + // Dimension unit. + string unit = 3; + } + + // Rendered image contents for this page. + message Image { + // Raw byte content of the image. + bytes content = 1; + + // Encoding [media type (MIME + // type)](https://www.iana.org/assignments/media-types/media-types.xhtml) + // for the image. + string mime_type = 2; + + // Width of the image in pixels. + int32 width = 3; + + // Height of the image in pixels. + int32 height = 4; + } + + // Representation for transformation matrix, intended to be compatible and + // used with OpenCV format for image manipulation. + message Matrix { + // Number of rows in the matrix. + int32 rows = 1; + + // Number of columns in the matrix. + int32 cols = 2; + + // This encodes information about what data type the matrix uses. + // For example, 0 (CV_8U) is an unsigned 8-bit image. For the full list + // of OpenCV primitive data types, please refer to + // https://docs.opencv.org/4.3.0/d1/d1b/group__core__hal__interface.html + int32 type = 3; + + // The matrix data. + bytes data = 4; + } + + // Visual element describing a layout unit on a page. + message Layout { + // Detected human reading orientation. + enum Orientation { + // Unspecified orientation. + ORIENTATION_UNSPECIFIED = 0; + + // Orientation is aligned with page up. + PAGE_UP = 1; + + // Orientation is aligned with page right. + // Turn the head 90 degrees clockwise from upright to read. + PAGE_RIGHT = 2; + + // Orientation is aligned with page down. + // Turn the head 180 degrees from upright to read. + PAGE_DOWN = 3; + + // Orientation is aligned with page left. + // Turn the head 90 degrees counterclockwise from upright to read. + PAGE_LEFT = 4; + } + + // Text anchor indexing into the + // [Document.text][google.cloud.documentai.v1.Document.text]. + TextAnchor text_anchor = 1; + + // Confidence of the current + // [Layout][google.cloud.documentai.v1.Document.Page.Layout] within + // context of the object this layout is for. e.g. confidence can be for a + // single token, a table, a visual element, etc. depending on context. + // Range `[0, 1]`. + float confidence = 2; + + // The bounding polygon for the + // [Layout][google.cloud.documentai.v1.Document.Page.Layout]. + BoundingPoly bounding_poly = 3; + + // Detected orientation for the + // [Layout][google.cloud.documentai.v1.Document.Page.Layout]. + Orientation orientation = 4; + } + + // A block has a set of lines (collected into paragraphs) that have a + // common line-spacing and orientation. + message Block { + // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + // [Block][google.cloud.documentai.v1.Document.Page.Block]. + Layout layout = 1; + + // A list of detected languages together with confidence. + repeated DetectedLanguage detected_languages = 2; + + // The history of this annotation. + Provenance provenance = 3 [deprecated = true]; + } + + // A collection of lines that a human would perceive as a paragraph. + message Paragraph { + // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + // [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph]. + Layout layout = 1; + + // A list of detected languages together with confidence. + repeated DetectedLanguage detected_languages = 2; + + // The history of this annotation. + Provenance provenance = 3 [deprecated = true]; + } + + // A collection of tokens that a human would perceive as a line. + // Does not cross column boundaries, can be horizontal, vertical, etc. + message Line { + // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + // [Line][google.cloud.documentai.v1.Document.Page.Line]. + Layout layout = 1; + + // A list of detected languages together with confidence. + repeated DetectedLanguage detected_languages = 2; + + // The history of this annotation. + Provenance provenance = 3 [deprecated = true]; + } + + // A detected token. + message Token { + // Detected break at the end of a + // [Token][google.cloud.documentai.v1.Document.Page.Token]. + message DetectedBreak { + // Enum to denote the type of break found. + enum Type { + // Unspecified break type. + TYPE_UNSPECIFIED = 0; + + // A single whitespace. + SPACE = 1; + + // A wider whitespace. + WIDE_SPACE = 2; + + // A hyphen that indicates that a token has been split across lines. + HYPHEN = 3; + } + + // Detected break type. + Type type = 1; + } + + // Font and other text style attributes. + message StyleInfo { + // Font size in points (`1` point is `¹⁄₇₂` inches). + int32 font_size = 1; + + // Font size in pixels, equal to _unrounded + // [font_size][google.cloud.documentai.v1.Document.Page.Token.StyleInfo.font_size]_ + // * _resolution_ ÷ `72.0`. + double pixel_font_size = 2; + + // Letter spacing in points. + double letter_spacing = 3; + + // Name or style of the font. + string font_type = 4; + + // Whether the text is bold (equivalent to + // [font_weight][google.cloud.documentai.v1.Document.Page.Token.StyleInfo.font_weight] + // is at least `700`). + bool bold = 5; + + // Whether the text is italic. + bool italic = 6; + + // Whether the text is underlined. + bool underlined = 7; + + // Whether the text is strikethrough. This feature is not supported yet. + bool strikeout = 8; + + // Whether the text is a subscript. This feature is not supported yet. + bool subscript = 9; + + // Whether the text is a superscript. This feature is not supported yet. + bool superscript = 10; + + // Whether the text is in small caps. This feature is not supported yet. + bool smallcaps = 11; + + // TrueType weight on a scale `100` (thin) to `1000` (ultra-heavy). + // Normal is `400`, bold is `700`. + int32 font_weight = 12; + + // Whether the text is handwritten. + bool handwritten = 13; + + // Color of the text. + google.type.Color text_color = 14; + + // Color of the background. + google.type.Color background_color = 15; + } + + // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + // [Token][google.cloud.documentai.v1.Document.Page.Token]. + Layout layout = 1; + + // Detected break at the end of a + // [Token][google.cloud.documentai.v1.Document.Page.Token]. + DetectedBreak detected_break = 2; + + // A list of detected languages together with confidence. + repeated DetectedLanguage detected_languages = 3; + + // The history of this annotation. + Provenance provenance = 4 [deprecated = true]; + + // Text style attributes. + StyleInfo style_info = 5; + } + + // A detected symbol. + message Symbol { + // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + // [Symbol][google.cloud.documentai.v1.Document.Page.Symbol]. + Layout layout = 1; + + // A list of detected languages together with confidence. + repeated DetectedLanguage detected_languages = 2; + } + + // Detected non-text visual elements e.g. checkbox, signature etc. on the + // page. + message VisualElement { + // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + // [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement]. + Layout layout = 1; + + // Type of the + // [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement]. + string type = 2; + + // A list of detected languages together with confidence. + repeated DetectedLanguage detected_languages = 3; + } + + // A table representation similar to HTML table structure. + message Table { + // A row of table cells. + message TableRow { + // Cells that make up this row. + repeated TableCell cells = 1; + } + + // A cell representation inside the table. + message TableCell { + // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + // [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell]. + Layout layout = 1; + + // How many rows this cell spans. + int32 row_span = 2; + + // How many columns this cell spans. + int32 col_span = 3; + + // A list of detected languages together with confidence. + repeated DetectedLanguage detected_languages = 4; + } + + // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + // [Table][google.cloud.documentai.v1.Document.Page.Table]. + Layout layout = 1; + + // Header rows of the table. + repeated TableRow header_rows = 2; + + // Body rows of the table. + repeated TableRow body_rows = 3; + + // A list of detected languages together with confidence. + repeated DetectedLanguage detected_languages = 4; + + // The history of this table. + Provenance provenance = 5 [deprecated = true]; + } + + // A form field detected on the page. + message FormField { + // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the + // [FormField][google.cloud.documentai.v1.Document.Page.FormField] name. + // e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc. + Layout field_name = 1; + + // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the + // [FormField][google.cloud.documentai.v1.Document.Page.FormField] value. + Layout field_value = 2; + + // A list of detected languages for name together with confidence. + repeated DetectedLanguage name_detected_languages = 3; + + // A list of detected languages for value together with confidence. + repeated DetectedLanguage value_detected_languages = 4; + + // If the value is non-textual, this field represents the type. Current + // valid values are: + // + // - blank (this indicates the `field_value` is normal text) + // - `unfilled_checkbox` + // - `filled_checkbox` + string value_type = 5; + + // Created for Labeling UI to export key text. + // If corrections were made to the text identified by the + // `field_name.text_anchor`, this field will contain the correction. + string corrected_key_text = 6; + + // Created for Labeling UI to export value text. + // If corrections were made to the text identified by the + // `field_value.text_anchor`, this field will contain the correction. + string corrected_value_text = 7; + + // The history of this annotation. + Provenance provenance = 8; + } + + // A detected barcode. + message DetectedBarcode { + // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + // [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode]. + Layout layout = 1; + + // Detailed barcode information of the + // [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode]. + Barcode barcode = 2; + } + + // Detected language for a structural component. + message DetectedLanguage { + // The [BCP-47 language + // code](https://www.unicode.org/reports/tr35/#Unicode_locale_identifier), + // such as `en-US` or `sr-Latn`. + string language_code = 1; + + // Confidence of detected language. Range `[0, 1]`. + float confidence = 2; + } + + // Image quality scores for the page image. + message ImageQualityScores { + // Image Quality Defects + message DetectedDefect { + // Name of the defect type. Supported values are: + // + // - `quality/defect_blurry` + // - `quality/defect_noisy` + // - `quality/defect_dark` + // - `quality/defect_faint` + // - `quality/defect_text_too_small` + // - `quality/defect_document_cutoff` + // - `quality/defect_text_cutoff` + // - `quality/defect_glare` + string type = 1; + + // Confidence of detected defect. Range `[0, 1]` where `1` indicates + // strong confidence that the defect exists. + float confidence = 2; + } + + // The overall quality score. Range `[0, 1]` where `1` is perfect quality. + float quality_score = 1; + + // A list of detected defects. + repeated DetectedDefect detected_defects = 2; + } + + // 1-based index for current + // [Page][google.cloud.documentai.v1.Document.Page] in a parent + // [Document][google.cloud.documentai.v1.Document]. Useful when a page is + // taken out of a [Document][google.cloud.documentai.v1.Document] for + // individual processing. + int32 page_number = 1; + + // Rendered image for this page. This image is preprocessed to remove any + // skew, rotation, and distortions such that the annotation bounding boxes + // can be upright and axis-aligned. + Image image = 13; + + // Transformation matrices that were applied to the original document image + // to produce [Page.image][google.cloud.documentai.v1.Document.Page.image]. + repeated Matrix transforms = 14; + + // Physical dimension of the page. + Dimension dimension = 2; + + // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the page. + Layout layout = 3; + + // A list of detected languages together with confidence. + repeated DetectedLanguage detected_languages = 4; + + // A list of visually detected text blocks on the page. + // A block has a set of lines (collected into paragraphs) that have a common + // line-spacing and orientation. + repeated Block blocks = 5; + + // A list of visually detected text paragraphs on the page. + // A collection of lines that a human would perceive as a paragraph. + repeated Paragraph paragraphs = 6; + + // A list of visually detected text lines on the page. + // A collection of tokens that a human would perceive as a line. + repeated Line lines = 7; + + // A list of visually detected tokens on the page. + repeated Token tokens = 8; + + // A list of detected non-text visual elements e.g. checkbox, + // signature etc. on the page. + repeated VisualElement visual_elements = 9; + + // A list of visually detected tables on the page. + repeated Table tables = 10; + + // A list of visually detected form fields on the page. + repeated FormField form_fields = 11; + + // A list of visually detected symbols on the page. + repeated Symbol symbols = 12; + + // A list of detected barcodes. + repeated DetectedBarcode detected_barcodes = 15; + + // Image quality scores. + ImageQualityScores image_quality_scores = 17; + + // The history of this page. + Provenance provenance = 16 [deprecated = true]; + } + + // An entity that could be a phrase in the text or a property that belongs to + // the document. It is a known entity type, such as a person, an organization, + // or location. + message Entity { + // Parsed and normalized entity value. + message NormalizedValue { + // An optional structured entity value. + // Must match entity type defined in schema if + // known. If this field is present, the `text` field could also be + // populated. + oneof structured_value { + // Money value. See also: + // https://github.com/googleapis/googleapis/blob/master/google/type/money.proto + google.type.Money money_value = 2; + + // Date value. Includes year, month, day. See also: + // https://github.com/googleapis/googleapis/blob/master/google/type/date.proto + google.type.Date date_value = 3; + + // DateTime value. Includes date, time, and timezone. See also: + // https://github.com/googleapis/googleapis/blob/master/google/type/datetime.proto + google.type.DateTime datetime_value = 4; + + // Postal address. See also: + // https://github.com/googleapis/googleapis/blob/master/google/type/postal_address.proto + google.type.PostalAddress address_value = 5; + + // Boolean value. Can be used for entities with binary values, or for + // checkboxes. + bool boolean_value = 6; + + // Integer value. + int32 integer_value = 7; + + // Float value. + float float_value = 8; + + bool signature_value = 10; + } + + // Optional. An optional field to store a normalized string. + // For some entity types, one of respective `structured_value` fields may + // also be populated. Also not all the types of `structured_value` will be + // normalized. For example, some processors may not generate `float` + // or `integer` normalized text by default. + // + // Below are sample formats mapped to structured values. + // + // - Money/Currency type (`money_value`) is in the ISO 4217 text format. + // - Date type (`date_value`) is in the ISO 8601 text format. + // - Datetime type (`datetime_value`) is in the ISO 8601 text format. + string text = 1 [(google.api.field_behavior) = OPTIONAL]; + } + + // Specifies how the entity's value is obtained. + enum Method { + // When the method is not specified, it should be treated as `EXTRACT`. + METHOD_UNSPECIFIED = 0; + + // The entity's value is directly extracted as-is from the document + // text. + EXTRACT = 1; + + // The entity's value is derived through inference and is not + // necessarily an exact text extraction from the document. + DERIVE = 2; + } + + // Optional. Provenance of the entity. + // Text anchor indexing into the + // [Document.text][google.cloud.documentai.v1.Document.text]. + TextAnchor text_anchor = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Entity type from a schema e.g. `Address`. + string type = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Text value of the entity e.g. `1600 Amphitheatre Pkwy`. + string mention_text = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Deprecated. Use `id` field instead. + string mention_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Confidence of detected Schema entity. Range `[0, 1]`. + float confidence = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Represents the provenance of this entity wrt. the location on + // the page where it was found. + PageAnchor page_anchor = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Canonical id. This will be a unique value in the entity list + // for this document. + string id = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Normalized entity value. Absent if the extracted value could + // not be converted or the type (e.g. address) is not supported for certain + // parsers. This field is also only populated for certain supported document + // types. + NormalizedValue normalized_value = 9 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Entities can be nested to form a hierarchical data structure + // representing the content in the document. + repeated Entity properties = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The history of this annotation. + Provenance provenance = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether the entity will be redacted for de-identification + // purposes. + bool redacted = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies how the entity's value is obtained. + Method method = 15 [(google.api.field_behavior) = OPTIONAL]; + } + + // Relationship between + // [Entities][google.cloud.documentai.v1.Document.Entity]. + message EntityRelation { + // Subject entity id. + string subject_id = 1; + + // Object entity id. + string object_id = 2; + + // Relationship description. + string relation = 3; + } + + // Text reference indexing into the + // [Document.text][google.cloud.documentai.v1.Document.text]. + message TextAnchor { + // A text segment in the + // [Document.text][google.cloud.documentai.v1.Document.text]. The indices + // may be out of bounds which indicate that the text extends into another + // document shard for large sharded documents. See + // [ShardInfo.text_offset][google.cloud.documentai.v1.Document.ShardInfo.text_offset] + message TextSegment { + // [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] + // start UTF-8 char index in the + // [Document.text][google.cloud.documentai.v1.Document.text]. + int64 start_index = 1; + + // [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] + // half open end UTF-8 char index in the + // [Document.text][google.cloud.documentai.v1.Document.text]. + int64 end_index = 2; + } + + // The text segments from the + // [Document.text][google.cloud.documentai.v1.Document.text]. + repeated TextSegment text_segments = 1; + + // Contains the content of the text span so that users do + // not have to look it up in the text_segments. It is always + // populated for formFields. + string content = 2; + } + + // Referencing the visual context of the entity in the + // [Document.pages][google.cloud.documentai.v1.Document.pages]. Page anchors + // can be cross-page, consist of multiple bounding polygons and optionally + // reference specific layout element types. + message PageAnchor { + // Represents a weak reference to a page element within a document. + message PageRef { + // The type of layout that is being referenced. + enum LayoutType { + // Layout Unspecified. + LAYOUT_TYPE_UNSPECIFIED = 0; + + // References a + // [Page.blocks][google.cloud.documentai.v1.Document.Page.blocks] + // element. + BLOCK = 1; + + // References a + // [Page.paragraphs][google.cloud.documentai.v1.Document.Page.paragraphs] + // element. + PARAGRAPH = 2; + + // References a + // [Page.lines][google.cloud.documentai.v1.Document.Page.lines] element. + LINE = 3; + + // References a + // [Page.tokens][google.cloud.documentai.v1.Document.Page.tokens] + // element. + TOKEN = 4; + + // References a + // [Page.visual_elements][google.cloud.documentai.v1.Document.Page.visual_elements] + // element. + VISUAL_ELEMENT = 5; + + // Refrrences a + // [Page.tables][google.cloud.documentai.v1.Document.Page.tables] + // element. + TABLE = 6; + + // References a + // [Page.form_fields][google.cloud.documentai.v1.Document.Page.form_fields] + // element. + FORM_FIELD = 7; + } + + // Required. Index into the + // [Document.pages][google.cloud.documentai.v1.Document.pages] element, + // for example using + // `[Document.pages][page_refs.page]` to locate the related page element. + // This field is skipped when its value is the default `0`. See + // https://developers.google.com/protocol-buffers/docs/proto3#json. + int64 page = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The type of the layout element that is being referenced if + // any. + LayoutType layout_type = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Deprecated. Use + // [PageRef.bounding_poly][google.cloud.documentai.v1.Document.PageAnchor.PageRef.bounding_poly] + // instead. + string layout_id = 3 + [deprecated = true, (google.api.field_behavior) = OPTIONAL]; + + // Optional. Identifies the bounding polygon of a layout element on the + // page. If `layout_type` is set, the bounding polygon must be exactly the + // same to the layout element it's referring to. + BoundingPoly bounding_poly = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Confidence of detected page element, if applicable. Range + // `[0, 1]`. + float confidence = 5 [(google.api.field_behavior) = OPTIONAL]; + } + + // One or more references to visual page elements + repeated PageRef page_refs = 1; + } + + // Structure to identify provenance relationships between annotations in + // different revisions. + message Provenance { + // The parent element the current element is based on. Used for + // referencing/aligning, removal and replacement operations. + message Parent { + // The index of the index into current revision's parent_ids list. + int32 revision = 1; + + // The index of the parent item in the corresponding item list (eg. list + // of entities, properties within entities, etc.) in the parent revision. + int32 index = 3; + + // The id of the parent provenance. + int32 id = 2 [deprecated = true]; + } + + // If a processor or agent does an explicit operation on existing elements. + enum OperationType { + // Operation type unspecified. If no operation is specified a provenance + // entry is simply used to match against a `parent`. + OPERATION_TYPE_UNSPECIFIED = 0; + + // Add an element. + ADD = 1; + + // Remove an element identified by `parent`. + REMOVE = 2; + + // Updates any fields within the given provenance scope of the message. It + // overwrites the fields rather than replacing them. Use this when you + // want to update a field value of an entity without also updating all the + // child properties. + UPDATE = 7; + + // Currently unused. Replace an element identified by `parent`. + REPLACE = 3; + + // Deprecated. Request human review for the element identified by + // `parent`. + EVAL_REQUESTED = 4 [deprecated = true]; + + // Deprecated. Element is reviewed and approved at human review, + // confidence will be set to 1.0. + EVAL_APPROVED = 5 [deprecated = true]; + + // Deprecated. Element is skipped in the validation process. + EVAL_SKIPPED = 6 [deprecated = true]; + } + + // The index of the revision that produced this element. + int32 revision = 1 [deprecated = true]; + + // The Id of this operation. Needs to be unique within the scope of the + // revision. + int32 id = 2 [deprecated = true]; + + // References to the original elements that are replaced. + repeated Parent parents = 3; + + // The type of provenance operation. + OperationType type = 4; + } + + // Contains past or forward revisions of this document. + message Revision { + // Human Review information of the document. + message HumanReview { + // Human review state. e.g. `requested`, `succeeded`, `rejected`. + string state = 1; + + // A message providing more details about the current state of processing. + // For example, the rejection reason when the state is `rejected`. + string state_message = 2; + } + + // Who/what made the change + oneof source { + // If the change was made by a person specify the name or id of that + // person. + string agent = 4; + + // If the annotation was made by processor identify the processor by its + // resource name. + string processor = 5; + } + + // Id of the revision, internally generated by doc proto storage. + // Unique within the context of the document. + string id = 1; + + // The revisions that this revision is based on. This can include one or + // more parent (when documents are merged.) This field represents the + // index into the `revisions` field. + repeated int32 parent = 2 [deprecated = true]; + + // The revisions that this revision is based on. Must include all the ids + // that have anything to do with this revision - eg. there are + // `provenance.parent.revision` fields that index into this field. + repeated string parent_ids = 7; + + // The time that the revision was created, internally generated by + // doc proto storage at the time of create. + google.protobuf.Timestamp create_time = 3; + + // Human Review information of this revision. + HumanReview human_review = 6; + } + + // This message is used for text changes aka. OCR corrections. + message TextChange { + // Provenance of the correction. + // Text anchor indexing into the + // [Document.text][google.cloud.documentai.v1.Document.text]. There can + // only be a single `TextAnchor.text_segments` element. If the start and + // end index of the text segment are the same, the text change is inserted + // before that index. + TextAnchor text_anchor = 1; + + // The text that replaces the text identified in the `text_anchor`. + string changed_text = 2; + + // The history of this annotation. + repeated Provenance provenance = 3 [deprecated = true]; + } + + // Represents the parsed layout of a document as a collection of blocks that + // the document is divided into. + message DocumentLayout { + // Represents a block. A block could be one of the various types (text, + // table, list) supported. + message DocumentLayoutBlock { + // Represents where the block starts and ends in the document. + message LayoutPageSpan { + // Page where block starts in the document. + int32 page_start = 1; + + // Page where block ends in the document. + int32 page_end = 2; + } + + // Represents a text type block. + message LayoutTextBlock { + // Text content stored in the block. + string text = 1; + + // Type of the text in the block. Available options are: `paragraph`, + // `subtitle`, `heading-1`, `heading-2`, `heading-3`, `heading-4`, + // `heading-5`, `header`, `footer`. + string type = 2; + + // A text block could further have child blocks. + // Repeated blocks support further hierarchies and nested blocks. + repeated DocumentLayoutBlock blocks = 3; + } + + // Represents a table type block. + message LayoutTableBlock { + // Header rows at the top of the table. + repeated LayoutTableRow header_rows = 1; + + // Body rows containing main table content. + repeated LayoutTableRow body_rows = 2; + + // Table caption/title. + string caption = 3; + } + + // Represents a row in a table. + message LayoutTableRow { + // A table row is a list of table cells. + repeated LayoutTableCell cells = 1; + } + + // Represents a cell in a table row. + message LayoutTableCell { + // A table cell is a list of blocks. + // Repeated blocks support further hierarchies and nested blocks. + repeated DocumentLayoutBlock blocks = 1; + + // How many rows this cell spans. + int32 row_span = 2; + + // How many columns this cell spans. + int32 col_span = 3; + } + + // Represents a list type block. + message LayoutListBlock { + // List entries that constitute a list block. + repeated LayoutListEntry list_entries = 1; + + // Type of the list_entries (if exist). Available options are `ordered` + // and `unordered`. + string type = 2; + } + + // Represents an entry in the list. + message LayoutListEntry { + // A list entry is a list of blocks. + // Repeated blocks support further hierarchies and nested blocks. + repeated DocumentLayoutBlock blocks = 1; + } + + oneof block { + // Block consisting of text content. + LayoutTextBlock text_block = 2; + + // Block consisting of table content/structure. + LayoutTableBlock table_block = 3; + + // Block consisting of list content/structure. + LayoutListBlock list_block = 4; + } + + // ID of the block. + string block_id = 1; + + // Page span of the block. + LayoutPageSpan page_span = 5; + + // Identifies the bounding box for the block. + BoundingPoly bounding_box = 6; + } + + // List of blocks in the document. + repeated DocumentLayoutBlock blocks = 1; + } + + // Represents the chunks that the document is divided into. + message ChunkedDocument { + // Represents a chunk. + message Chunk { + // Represents where the chunk starts and ends in the document. + message ChunkPageSpan { + // Page where chunk starts in the document. + int32 page_start = 1; + + // Page where chunk ends in the document. + int32 page_end = 2; + } + + // Represents the page header associated with the chunk. + message ChunkPageHeader { + // Header in text format. + string text = 1; + + // Page span of the header. + ChunkPageSpan page_span = 2; + } + + // Represents the page footer associated with the chunk. + message ChunkPageFooter { + // Footer in text format. + string text = 1; + + // Page span of the footer. + ChunkPageSpan page_span = 2; + } + + // ID of the chunk. + string chunk_id = 1; + + // Unused. + repeated string source_block_ids = 2; + + // Text content of the chunk. + string content = 3; + + // Page span of the chunk. + ChunkPageSpan page_span = 4; + + // Page headers associated with the chunk. + repeated ChunkPageHeader page_headers = 5; + + // Page footers associated with the chunk. + repeated ChunkPageFooter page_footers = 6; + } + + // List of chunks. + repeated Chunk chunks = 1; + } + + // The output of the validation given the document and the validation rules. + message EntityValidationOutput { + // Validation result for a single validation rule. + message ValidationResult { + // The result of the validation rule. + enum ValidationResultType { + // The validation result type is unspecified. + VALIDATION_RESULT_TYPE_UNSPECIFIED = 0; + + // The validation is valid. + VALIDATION_RESULT_TYPE_VALID = 1; + + // The validation is invalid. + VALIDATION_RESULT_TYPE_INVALID = 2; + + // The validation is skipped. + VALIDATION_RESULT_TYPE_SKIPPED = 3; + + // The validation is not applicable. + VALIDATION_RESULT_TYPE_NOT_APPLICABLE = 4; + } + + // The name of the validation rule. + string rule_name = 1; + + // The description of the validation rule. + string rule_description = 2; + + // The result of the validation rule. + ValidationResultType validation_result_type = 3; + + // The detailed information of the running the validation process using + // the entity from the document based on the validation rule. + string validation_details = 4; + } + + // The result of each validation rule. + repeated ValidationResult validation_results = 1; + + // The overall result of the validation, true if all applicable rules are + // valid. + bool pass_all_rules = 2; + } + + // Entity revision. + message EntitiesRevision { + // The revision id. + string revision_id = 1; + + // The entities in this revision. + repeated Entity entities = 2; + + // The entity validation output for this revision. + EntityValidationOutput entity_validation_output = 3; + } + + // Original source document from the user. + oneof source { + // Optional. Currently supports Google Cloud Storage URI of the form + // `gs://bucket_name/object_name`. Object versioning is not supported. + // For more information, refer to [Google Cloud Storage Request + // URIs](https://cloud.google.com/storage/docs/reference-uris). + string uri = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Inline document content, represented as a stream of bytes. + // Note: As with all `bytes` fields, protobuffers use a pure binary + // representation, whereas JSON representations use base64. + bytes content = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. An internal identifier for document. Should be loggable (no PII). + string docid = 15 [(google.api.field_behavior) = OPTIONAL]; + + // An IANA published [media type (MIME + // type)](https://www.iana.org/assignments/media-types/media-types.xhtml). + string mime_type = 3; + + // Optional. UTF-8 encoded text in reading order from the document. + string text = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Styles for the [Document.text][google.cloud.documentai.v1.Document.text]. + repeated Style text_styles = 5 [deprecated = true]; + + // Visual page layout for the [Document][google.cloud.documentai.v1.Document]. + repeated Page pages = 6; + + // A list of entities detected on + // [Document.text][google.cloud.documentai.v1.Document.text]. For document + // shards, entities in this list may cross shard boundaries. + repeated Entity entities = 7; + + // Placeholder. Relationship among + // [Document.entities][google.cloud.documentai.v1.Document.entities]. + repeated EntityRelation entity_relations = 8; + + // Placeholder. A list of text corrections made to + // [Document.text][google.cloud.documentai.v1.Document.text]. This is usually + // used for annotating corrections to OCR mistakes. Text changes for a given + // revision may not overlap with each other. + repeated TextChange text_changes = 14; + + // Information about the sharding if this document is sharded part of a larger + // document. If the document is not sharded, this message is not specified. + ShardInfo shard_info = 9; + + // Any error that occurred while processing this document. + google.rpc.Status error = 10; + + // Placeholder. Revision history of this document. + repeated Revision revisions = 13; + + // Parsed layout of the document. + DocumentLayout document_layout = 17; + + // Document chunked based on chunking config. + ChunkedDocument chunked_document = 18; + + // The entity validation output for the document. This is the validation + // output for `document.entities` field. + EntityValidationOutput entity_validation_output = 21; + + // A list of entity revisions. The entity revisions are appended to the + // document in the processing order. This field can be used for comparing the + // entity extraction results at different stages of the processing. + repeated EntitiesRevision entities_revisions = 22; + + // The entity revision ID that `document.entities` field is based on. + // If this field is set and `entities_revisions` is not empty, the entities in + // `document.entities` field are the entities in the entity revision with this + // ID and `document.entity_validation_output` field is the + // `entity_validation_output` field in this entity revision. + string entities_revision_id = 23; +} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/document_io.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/document_io.proto new file mode 100644 index 00000000000..65e7ed447d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/document_io.proto @@ -0,0 +1,175 @@ +// Copyright 2025 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.cloud.documentai.v1; + +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.DocumentAI.V1"; +option go_package = "cloud.google.com/go/documentai/apiv1/documentaipb;documentaipb"; +option java_multiple_files = true; +option java_outer_classname = "DocumentIoProto"; +option java_package = "com.google.cloud.documentai.v1"; +option php_namespace = "Google\\Cloud\\DocumentAI\\V1"; +option ruby_package = "Google::Cloud::DocumentAI::V1"; + +// Payload message of raw document content (bytes). +message RawDocument { + // Inline document content. + bytes content = 1; + + // An IANA MIME type (RFC6838) indicating the nature and format of the + // [content][google.cloud.documentai.v1.RawDocument.content]. + string mime_type = 2; + + // The display name of the document, it supports all Unicode characters except + // the following: + // `*`, `?`, `[`, `]`, `%`, `{`, `}`,`'`, `\"`, `,` + // `~`, `=` and `:` are reserved. + // If not specified, a default ID is generated. + string display_name = 3; +} + +// Specifies a document stored on Cloud Storage. +message GcsDocument { + // The Cloud Storage object uri. + string gcs_uri = 1; + + // An IANA MIME type (RFC6838) of the content. + string mime_type = 2; +} + +// Specifies a set of documents on Cloud Storage. +message GcsDocuments { + // The list of documents. + repeated GcsDocument documents = 1; +} + +// Specifies all documents on Cloud Storage with a common prefix. +message GcsPrefix { + // The URI prefix. + string gcs_uri_prefix = 1; +} + +// The common config to specify a set of documents used as input. +message BatchDocumentsInputConfig { + // The source. Make sure that the caller of the API has storage.objects.get + // access to the buckets. + oneof source { + // The set of documents that match the specified Cloud Storage `gcs_prefix`. + GcsPrefix gcs_prefix = 1; + + // The set of documents individually specified on Cloud Storage. + GcsDocuments gcs_documents = 2; + } +} + +// Config that controls the output of documents. All documents will be written +// as a JSON file. +message DocumentOutputConfig { + // The configuration used when outputting documents. + message GcsOutputConfig { + // The sharding config for the output document. + message ShardingConfig { + // The number of pages per shard. + int32 pages_per_shard = 1; + + // The number of overlapping pages between consecutive shards. + int32 pages_overlap = 2; + } + + // The Cloud Storage uri (a directory) of the output. + string gcs_uri = 1; + + // Specifies which fields to include in the output documents. + // Only supports top level document and pages field so it must be in the + // form of `{document_field_name}` or `pages.{page_field_name}`. + google.protobuf.FieldMask field_mask = 2; + + // Specifies the sharding config for the output document. + ShardingConfig sharding_config = 3; + } + + // The destination of the results. + oneof destination { + // Output config to write the results to Cloud Storage. + GcsOutputConfig gcs_output_config = 1; + } +} + +// Config for Document OCR. +message OcrConfig { + // Hints for OCR Engine + message Hints { + // List of BCP-47 language codes to use for OCR. In most cases, not + // specifying it yields the best results since it enables automatic language + // detection. For languages based on the Latin alphabet, setting hints is + // not needed. In rare cases, when the language of the text in the + // image is known, setting a hint will help get better results (although it + // will be a significant hindrance if the hint is wrong). + repeated string language_hints = 1; + } + + // Configurations for premium OCR features. + message PremiumFeatures { + // Turn on selection mark detector in OCR engine. Only available in OCR 2.0 + // (and later) processors. + bool enable_selection_mark_detection = 3; + + // Turn on font identification model and return font style information. + bool compute_style_info = 4; + + // Turn on the model that can extract LaTeX math formulas. + bool enable_math_ocr = 5; + } + + // Hints for the OCR model. + Hints hints = 2; + + // Enables special handling for PDFs with existing text information. Results + // in better text extraction quality in such PDF inputs. + bool enable_native_pdf_parsing = 3; + + // Enables intelligent document quality scores after OCR. Can help with + // diagnosing why OCR responses are of poor quality for a given input. + // Adds additional latency comparable to regular OCR to the process call. + bool enable_image_quality_scores = 4; + + // A list of advanced OCR options to further fine-tune OCR behavior. Current + // valid values are: + // + // - `legacy_layout`: a heuristics layout detection algorithm, which serves as + // an alternative to the current ML-based layout detection algorithm. + // Customers can choose the best suitable layout algorithm based on their + // situation. + repeated string advanced_ocr_options = 5; + + // Includes symbol level OCR information if set to true. + bool enable_symbol = 6; + + // Turn on font identification model and return font style information. + // Deprecated, use + // [PremiumFeatures.compute_style_info][google.cloud.documentai.v1.OcrConfig.PremiumFeatures.compute_style_info] + // instead. + bool compute_style_info = 8 [deprecated = true]; + + // Turn off character box detector in OCR engine. Character box detection is + // enabled by default in OCR 2.0 (and later) processors. + bool disable_character_boxes_detection = 10; + + // Configurations for premium OCR features. + PremiumFeatures premium_features = 11; +} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/document_processor_service.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/document_processor_service.proto new file mode 100644 index 00000000000..ffd175f036c --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/document_processor_service.proto @@ -0,0 +1,1267 @@ +// Copyright 2026 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.cloud.documentai.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/documentai/v1/document.proto"; +import "google/cloud/documentai/v1/document_io.proto"; +import "google/cloud/documentai/v1/document_schema.proto"; +import "google/cloud/documentai/v1/evaluation.proto"; +import "google/cloud/documentai/v1/operation_metadata.proto"; +import "google/cloud/documentai/v1/processor.proto"; +import "google/cloud/documentai/v1/processor_type.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.DocumentAI.V1"; +option go_package = "cloud.google.com/go/documentai/apiv1/documentaipb;documentaipb"; +option java_multiple_files = true; +option java_outer_classname = "DocumentAiProcessorService"; +option java_package = "com.google.cloud.documentai.v1"; +option php_namespace = "Google\\Cloud\\DocumentAI\\V1"; +option ruby_package = "Google::Cloud::DocumentAI::V1"; +option (google.api.resource_definition) = { + type: "documentai.googleapis.com/HumanReviewConfig" + pattern: "projects/{project}/locations/{location}/processors/{processor}/humanReviewConfig" +}; +option (google.api.resource_definition) = { + type: "documentai.googleapis.com/Location" + pattern: "projects/{project}/locations/{location}" +}; + +// Service to call Document AI to process documents according to the +// processor's definition. Processors are built using state-of-the-art Google +// AI such as natural language, computer vision, and translation to extract +// structured information from unstructured or semi-structured documents. +service DocumentProcessorService { + option (google.api.default_host) = "documentai.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Processes a single document. + rpc ProcessDocument(ProcessRequest) returns (ProcessResponse) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/processors/*}:process" + body: "*" + additional_bindings { + post: "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:process" + body: "*" + } + }; + option (google.api.method_signature) = "name"; + } + + // LRO endpoint to batch process many documents. The output is written + // to Cloud Storage as JSON in the [Document] format. + rpc BatchProcessDocuments(BatchProcessRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/processors/*}:batchProcess" + body: "*" + additional_bindings { + post: "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:batchProcess" + body: "*" + } + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "BatchProcessResponse" + metadata_type: "BatchProcessMetadata" + }; + } + + // Fetches processor types. Note that we don't use + // [ListProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes] + // here, because it isn't paginated. + rpc FetchProcessorTypes(FetchProcessorTypesRequest) + returns (FetchProcessorTypesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}:fetchProcessorTypes" + }; + option (google.api.method_signature) = "parent"; + } + + // Lists the processor types that exist. + rpc ListProcessorTypes(ListProcessorTypesRequest) + returns (ListProcessorTypesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/processorTypes" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets a processor type detail. + rpc GetProcessorType(GetProcessorTypeRequest) returns (ProcessorType) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/processorTypes/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all processors which belong to this project. + rpc ListProcessors(ListProcessorsRequest) returns (ListProcessorsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/processors" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets a processor detail. + rpc GetProcessor(GetProcessorRequest) returns (Processor) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/processors/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Trains a new processor version. + // Operation metadata is returned as + // [TrainProcessorVersionMetadata][google.cloud.documentai.v1.TrainProcessorVersionMetadata]. + rpc TrainProcessorVersion(TrainProcessorVersionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/processors/*}/processorVersions:train" + body: "*" + }; + option (google.api.method_signature) = "parent,processor_version"; + option (google.longrunning.operation_info) = { + response_type: "TrainProcessorVersionResponse" + metadata_type: "TrainProcessorVersionMetadata" + }; + } + + // Gets a processor version detail. + rpc GetProcessorVersion(GetProcessorVersionRequest) + returns (ProcessorVersion) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all versions of a processor. + rpc ListProcessorVersions(ListProcessorVersionsRequest) + returns (ListProcessorVersionsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/processors/*}/processorVersions" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes the processor version, all artifacts under the processor version + // will be deleted. + rpc DeleteProcessorVersion(DeleteProcessorVersionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteProcessorVersionMetadata" + }; + } + + // Deploys the processor version. + rpc DeployProcessorVersion(DeployProcessorVersionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:deploy" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "DeployProcessorVersionResponse" + metadata_type: "DeployProcessorVersionMetadata" + }; + } + + // Undeploys the processor version. + rpc UndeployProcessorVersion(UndeployProcessorVersionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:undeploy" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "UndeployProcessorVersionResponse" + metadata_type: "UndeployProcessorVersionMetadata" + }; + } + + // Creates a processor from the + // [ProcessorType][google.cloud.documentai.v1.ProcessorType] provided. The + // processor will be at `ENABLED` state by default after its creation. Note + // that this method requires the `documentai.processors.create` permission on + // the project, which is highly privileged. A user or service account with + // this permission can create new processors that can interact with any gcs + // bucket in your project. + rpc CreateProcessor(CreateProcessorRequest) returns (Processor) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/processors" + body: "processor" + }; + option (google.api.method_signature) = "parent,processor"; + } + + // Deletes the processor, unloads all deployed model artifacts if it was + // enabled and then deletes all artifacts associated with this processor. + rpc DeleteProcessor(DeleteProcessorRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/processors/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteProcessorMetadata" + }; + } + + // Enables a processor + rpc EnableProcessor(EnableProcessorRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/processors/*}:enable" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "EnableProcessorResponse" + metadata_type: "EnableProcessorMetadata" + }; + } + + // Disables a processor + rpc DisableProcessor(DisableProcessorRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/processors/*}:disable" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "DisableProcessorResponse" + metadata_type: "DisableProcessorMetadata" + }; + } + + // Set the default (active) version of a + // [Processor][google.cloud.documentai.v1.Processor] that will be used in + // [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument] + // and + // [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]. + rpc SetDefaultProcessorVersion(SetDefaultProcessorVersionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{processor=projects/*/locations/*/processors/*}:setDefaultProcessorVersion" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "SetDefaultProcessorVersionResponse" + metadata_type: "SetDefaultProcessorVersionMetadata" + }; + } + + // Send a document for Human Review. The input document should be processed by + // the specified processor. + rpc ReviewDocument(ReviewDocumentRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{human_review_config=projects/*/locations/*/processors/*/humanReviewConfig}:reviewDocument" + body: "*" + }; + option (google.api.method_signature) = "human_review_config"; + option (google.longrunning.operation_info) = { + response_type: "ReviewDocumentResponse" + metadata_type: "ReviewDocumentOperationMetadata" + }; + } + + // Evaluates a ProcessorVersion against annotated documents, producing an + // Evaluation. + rpc EvaluateProcessorVersion(EvaluateProcessorVersionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{processor_version=projects/*/locations/*/processors/*/processorVersions/*}:evaluateProcessorVersion" + body: "*" + }; + option (google.api.method_signature) = "processor_version"; + option (google.longrunning.operation_info) = { + response_type: "EvaluateProcessorVersionResponse" + metadata_type: "EvaluateProcessorVersionMetadata" + }; + } + + // Retrieves a specific evaluation. + rpc GetEvaluation(GetEvaluationRequest) returns (Evaluation) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*/evaluations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Retrieves a set of evaluations for a given processor version. + rpc ListEvaluations(ListEvaluationsRequest) + returns (ListEvaluationsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/processors/*/processorVersions/*}/evaluations" + }; + option (google.api.method_signature) = "parent"; + } +} + +// Options for Process API +message ProcessOptions { + // Serving config for layout parser processor. + message LayoutConfig { + // Serving config for chunking. + message ChunkingConfig { + // Optional. The chunk sizes to use when splitting documents, in order of + // level. + int32 chunk_size = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether or not to include ancestor headings when splitting. + bool include_ancestor_headings = 2 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. Config for chunking in layout parser processor. + ChunkingConfig chunking_config = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether to include images in layout parser processor response. + bool return_images = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether to include bounding boxes in layout parser processor + // response. + bool return_bounding_boxes = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether to include image annotations in layout parser response. + bool enable_image_annotation = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether to include table annotations in layout parser response. + bool enable_table_annotation = 6 [(google.api.field_behavior) = OPTIONAL]; + } + + // A list of individual page numbers. + message IndividualPageSelector { + // Optional. Indices of the pages (starting from 1). + repeated int32 pages = 1 [(google.api.field_behavior) = OPTIONAL]; + } + + // A subset of pages to process. If not specified, all pages are processed. + // If a page range is set, only the given pages are extracted and processed + // from the document. In the output document, + // [Document.Page.page_number][google.cloud.documentai.v1.Document.Page.page_number] + // refers to the page number in the original document. + // This configuration only applies to online processing with + // [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument]. + oneof page_range { + // Which pages to process (1-indexed). + IndividualPageSelector individual_page_selector = 5; + + // Only process certain pages from the start. Process all if the document + // has fewer pages. + int32 from_start = 6; + + // Only process certain pages from the end, same as above. + int32 from_end = 7; + } + + // Only applicable to `OCR_PROCESSOR` and `FORM_PARSER_PROCESSOR`. + // Returns error if set on other processor types. + OcrConfig ocr_config = 1; + + // Optional. Only applicable to `LAYOUT_PARSER_PROCESSOR`. + // Returns error if set on other processor types. + LayoutConfig layout_config = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Override the schema of the + // [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. Will + // return an Invalid Argument error if this field is set when the underlying + // [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] doesn't + // support schema override. + DocumentSchema schema_override = 8 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for the +// [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument] +// method. +message ProcessRequest { + // The document payload. + oneof source { + // An inline document proto. + Document inline_document = 4; + + // A raw document content (bytes). + RawDocument raw_document = 5; + + // A raw document on Google Cloud Storage. + GcsDocument gcs_document = 8; + } + + // Required. The resource name of the + // [Processor][google.cloud.documentai.v1.Processor] or + // [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] + // to use for processing. If a + // [Processor][google.cloud.documentai.v1.Processor] is specified, the server + // will use its [default + // version][google.cloud.documentai.v1.Processor.default_processor_version]. + // Format: `projects/{project}/locations/{location}/processors/{processor}`, + // or + // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "*" } + ]; + + // Whether human review should be skipped for this request. Default to + // `false`. + bool skip_human_review = 3; + + // Specifies which fields to include in the + // [ProcessResponse.document][google.cloud.documentai.v1.ProcessResponse.document] + // output. Only supports top-level document and pages field, so it must be in + // the form of `{document_field_name}` or `pages.{page_field_name}`. + google.protobuf.FieldMask field_mask = 6; + + // Inference-time options for the process API + ProcessOptions process_options = 7; + + // Optional. The labels with user-defined metadata for the request. + // + // Label keys and values can be no longer than 63 characters + // (Unicode codepoints) and can only contain lowercase letters, numeric + // characters, underscores, and dashes. International characters are allowed. + // Label values are optional. Label keys must start with a letter. + map labels = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Option to remove images from the document. + bool imageless_mode = 11 [(google.api.field_behavior) = OPTIONAL]; +} + +// The status of human review on a processed document. +message HumanReviewStatus { + // The final state of human review on a processed document. + enum State { + // Human review state is unspecified. Most likely due to an internal error. + STATE_UNSPECIFIED = 0; + + // Human review is skipped for the document. This can happen because human + // review isn't enabled on the processor or the processing request has + // been set to skip this document. + SKIPPED = 1; + + // Human review validation is triggered and passed, so no review is needed. + VALIDATION_PASSED = 2; + + // Human review validation is triggered and the document is under review. + IN_PROGRESS = 3; + + // Some error happened during triggering human review, see the + // [state_message][google.cloud.documentai.v1.HumanReviewStatus.state_message] + // for details. + ERROR = 4; + } + + // The state of human review on the processing request. + State state = 1; + + // A message providing more details about the human review state. + string state_message = 2; + + // The name of the operation triggered by the processed document. This field + // is populated only when the + // [state][google.cloud.documentai.v1.HumanReviewStatus.state] is + // `HUMAN_REVIEW_IN_PROGRESS`. It has the same response type and metadata as + // the long-running operation returned by + // [ReviewDocument][google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument]. + string human_review_operation = 3; +} + +// Response message for the +// [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument] +// method. +message ProcessResponse { + // The document payload, will populate fields based on the processor's + // behavior. + Document document = 1; + + // The status of human review on the processed document. + HumanReviewStatus human_review_status = 3; +} + +// Request message for +// [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]. +message BatchProcessRequest { + // Required. The resource name of + // [Processor][google.cloud.documentai.v1.Processor] or + // [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. + // Format: `projects/{project}/locations/{location}/processors/{processor}`, + // or + // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "*" } + ]; + + // The input documents for the + // [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments] + // method. + BatchDocumentsInputConfig input_documents = 5; + + // The output configuration for the + // [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments] + // method. + DocumentOutputConfig document_output_config = 6; + + // Whether human review should be skipped for this request. Default to + // `false`. + bool skip_human_review = 4; + + // Inference-time options for the process API + ProcessOptions process_options = 7; + + // Optional. The labels with user-defined metadata for the request. + // + // Label keys and values can be no longer than 63 characters + // (Unicode codepoints) and can only contain lowercase letters, numeric + // characters, underscores, and dashes. International characters are allowed. + // Label values are optional. Label keys must start with a letter. + map labels = 9 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]. +message BatchProcessResponse {} + +// The long-running operation metadata for +// [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]. +message BatchProcessMetadata { + // The status of a each individual document in the batch process. + message IndividualProcessStatus { + // The source of the document, same as the + // [input_gcs_source][google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.input_gcs_source] + // field in the request when the batch process started. + string input_gcs_source = 1; + + // The status processing the document. + google.rpc.Status status = 2; + + // The Cloud Storage output destination (in the request as + // [DocumentOutputConfig.GcsOutputConfig.gcs_uri][google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.gcs_uri]) + // of the processed document if it was successful, otherwise empty. + string output_gcs_destination = 3; + + // The status of human review on the processed document. + HumanReviewStatus human_review_status = 5; + } + + // Possible states of the batch processing operation. + enum State { + // The default value. This value is used if the state is omitted. + STATE_UNSPECIFIED = 0; + + // Request operation is waiting for scheduling. + WAITING = 1; + + // Request is being processed. + RUNNING = 2; + + // The batch processing completed successfully. + SUCCEEDED = 3; + + // The batch processing was being cancelled. + CANCELLING = 4; + + // The batch processing was cancelled. + CANCELLED = 5; + + // The batch processing has failed. + FAILED = 6; + } + + // The state of the current batch processing. + State state = 1; + + // A message providing more details about the current state of processing. + // For example, the error message if the operation is failed. + string state_message = 2; + + // The creation time of the operation. + google.protobuf.Timestamp create_time = 3; + + // The last update time of the operation. + google.protobuf.Timestamp update_time = 4; + + // The list of response details of each document. + repeated IndividualProcessStatus individual_process_statuses = 5; +} + +// Request message for the +// [FetchProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypes] +// method. Some processor types may require the project be added to an +// allowlist. +message FetchProcessorTypesRequest { + // Required. The location of processor types to list. + // Format: `projects/{project}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "documentai.googleapis.com/ProcessorType" + } + ]; +} + +// Response message for the +// [FetchProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypes] +// method. +message FetchProcessorTypesResponse { + // The list of processor types. + repeated ProcessorType processor_types = 1; +} + +// Request message for the +// [ListProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes] +// method. Some processor types may require the project be added to an +// allowlist. +message ListProcessorTypesRequest { + // Required. The location of processor types to list. + // Format: `projects/{project}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "documentai.googleapis.com/ProcessorType" + } + ]; + + // The maximum number of processor types to return. + // If unspecified, at most `100` processor types will be returned. + // The maximum value is `500`. Values above `500` will be coerced to `500`. + int32 page_size = 2; + + // Used to retrieve the next page of results, empty if at the end of the list. + string page_token = 3; +} + +// Response message for the +// [ListProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes] +// method. +message ListProcessorTypesResponse { + // The processor types. + repeated ProcessorType processor_types = 1; + + // Points to the next page, otherwise empty. + string next_page_token = 2; +} + +// Request message for list all processors belongs to a project. +message ListProcessorsRequest { + // Required. The parent (project and location) which owns this collection of + // Processors. Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "documentai.googleapis.com/Processor" + } + ]; + + // The maximum number of processors to return. + // If unspecified, at most `50` processors will be returned. + // The maximum value is `100`. Values above `100` will be coerced to `100`. + int32 page_size = 2; + + // We will return the processors sorted by creation time. The page token + // will point to the next processor. + string page_token = 3; +} + +// Response message for the +// [ListProcessors][google.cloud.documentai.v1.DocumentProcessorService.ListProcessors] +// method. +message ListProcessorsResponse { + // The list of processors. + repeated Processor processors = 1; + + // Points to the next processor, otherwise empty. + string next_page_token = 2; +} + +// Request message for the +// [GetProcessorType][google.cloud.documentai.v1.DocumentProcessorService.GetProcessorType] +// method. +message GetProcessorTypeRequest { + // Required. The processor type resource name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "documentai.googleapis.com/ProcessorType" + } + ]; +} + +// Request message for the +// [GetProcessor][google.cloud.documentai.v1.DocumentProcessorService.GetProcessor] +// method. +message GetProcessorRequest { + // Required. The processor resource name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "documentai.googleapis.com/Processor" + } + ]; +} + +// Request message for the +// [GetProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.GetProcessorVersion] +// method. +message GetProcessorVersionRequest { + // Required. The processor resource name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "documentai.googleapis.com/ProcessorVersion" + } + ]; +} + +// Request message for list all processor versions belongs to a processor. +message ListProcessorVersionsRequest { + // Required. The parent (project, location and processor) to list all + // versions. Format: + // `projects/{project}/locations/{location}/processors/{processor}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "documentai.googleapis.com/ProcessorVersion" + } + ]; + + // The maximum number of processor versions to return. + // If unspecified, at most `10` processor versions will be returned. + // The maximum value is `20`. Values above `20` will be coerced to `20`. + int32 page_size = 2; + + // We will return the processor versions sorted by creation time. The page + // token will point to the next processor version. + string page_token = 3; +} + +// Response message for the +// [ListProcessorVersions][google.cloud.documentai.v1.DocumentProcessorService.ListProcessorVersions] +// method. +message ListProcessorVersionsResponse { + // The list of processors. + repeated ProcessorVersion processor_versions = 1; + + // Points to the next processor, otherwise empty. + string next_page_token = 2; +} + +// Request message for the +// [DeleteProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessorVersion] +// method. +message DeleteProcessorVersionRequest { + // Required. The processor version resource name to be deleted. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "documentai.googleapis.com/ProcessorVersion" + } + ]; +} + +// The long-running operation metadata for the +// [DeleteProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessorVersion] +// method. +message DeleteProcessorVersionMetadata { + // The basic metadata of the long-running operation. + CommonOperationMetadata common_metadata = 1; +} + +// Request message for the +// [DeployProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.DeployProcessorVersion] +// method. +message DeployProcessorVersionRequest { + // Required. The processor version resource name to be deployed. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "documentai.googleapis.com/ProcessorVersion" + } + ]; +} + +// Response message for the +// [DeployProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.DeployProcessorVersion] +// method. +message DeployProcessorVersionResponse {} + +// The long-running operation metadata for the +// [DeployProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.DeployProcessorVersion] +// method. +message DeployProcessorVersionMetadata { + // The basic metadata of the long-running operation. + CommonOperationMetadata common_metadata = 1; +} + +// Request message for the +// [UndeployProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.UndeployProcessorVersion] +// method. +message UndeployProcessorVersionRequest { + // Required. The processor version resource name to be undeployed. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "documentai.googleapis.com/ProcessorVersion" + } + ]; +} + +// Response message for the +// [UndeployProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.UndeployProcessorVersion] +// method. +message UndeployProcessorVersionResponse {} + +// The long-running operation metadata for the +// [UndeployProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.UndeployProcessorVersion] +// method. +message UndeployProcessorVersionMetadata { + // The basic metadata of the long-running operation. + CommonOperationMetadata common_metadata = 1; +} + +// Request message for the +// [CreateProcessor][google.cloud.documentai.v1.DocumentProcessorService.CreateProcessor] +// method. Notice this request is sent to a regionalized backend service. If the +// [ProcessorType][google.cloud.documentai.v1.ProcessorType] isn't available in +// that region, the creation fails. +message CreateProcessorRequest { + // Required. The parent (project and location) under which to create the + // processor. Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "documentai.googleapis.com/Processor" + } + ]; + + // Required. The processor to be created, requires + // [Processor.type][google.cloud.documentai.v1.Processor.type] and + // [Processor.display_name][google.cloud.documentai.v1.Processor.display_name] + // to be set. Also, the + // [Processor.kms_key_name][google.cloud.documentai.v1.Processor.kms_key_name] + // field must be set if the processor is under CMEK. + Processor processor = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for the +// [DeleteProcessor][google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessor] +// method. +message DeleteProcessorRequest { + // Required. The processor resource name to be deleted. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "documentai.googleapis.com/Processor" + } + ]; +} + +// The long-running operation metadata for the +// [DeleteProcessor][google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessor] +// method. +message DeleteProcessorMetadata { + // The basic metadata of the long-running operation. + CommonOperationMetadata common_metadata = 5; +} + +// Request message for the +// [EnableProcessor][google.cloud.documentai.v1.DocumentProcessorService.EnableProcessor] +// method. +message EnableProcessorRequest { + // Required. The processor resource name to be enabled. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "documentai.googleapis.com/Processor" + } + ]; +} + +// Response message for the +// [EnableProcessor][google.cloud.documentai.v1.DocumentProcessorService.EnableProcessor] +// method. Intentionally empty proto for adding fields in future. +message EnableProcessorResponse {} + +// The long-running operation metadata for the +// [EnableProcessor][google.cloud.documentai.v1.DocumentProcessorService.EnableProcessor] +// method. +message EnableProcessorMetadata { + // The basic metadata of the long-running operation. + CommonOperationMetadata common_metadata = 5; +} + +// Request message for the +// [DisableProcessor][google.cloud.documentai.v1.DocumentProcessorService.DisableProcessor] +// method. +message DisableProcessorRequest { + // Required. The processor resource name to be disabled. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "documentai.googleapis.com/Processor" + } + ]; +} + +// Response message for the +// [DisableProcessor][google.cloud.documentai.v1.DocumentProcessorService.DisableProcessor] +// method. Intentionally empty proto for adding fields in future. +message DisableProcessorResponse {} + +// The long-running operation metadata for the +// [DisableProcessor][google.cloud.documentai.v1.DocumentProcessorService.DisableProcessor] +// method. +message DisableProcessorMetadata { + // The basic metadata of the long-running operation. + CommonOperationMetadata common_metadata = 5; +} + +// Request message for the +// [SetDefaultProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.SetDefaultProcessorVersion] +// method. +message SetDefaultProcessorVersionRequest { + // Required. The resource name of the + // [Processor][google.cloud.documentai.v1.Processor] to change default + // version. + string processor = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "documentai.googleapis.com/Processor" + } + ]; + + // Required. The resource name of child + // [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to use as + // default. Format: + // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}` + string default_processor_version = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "documentai.googleapis.com/ProcessorVersion" + } + ]; +} + +// Response message for the +// [SetDefaultProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.SetDefaultProcessorVersion] +// method. +message SetDefaultProcessorVersionResponse {} + +// The long-running operation metadata for the +// [SetDefaultProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.SetDefaultProcessorVersion] +// method. +message SetDefaultProcessorVersionMetadata { + // The basic metadata of the long-running operation. + CommonOperationMetadata common_metadata = 1; +} + +// Request message for the +// [TrainProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.TrainProcessorVersion] +// method. +message TrainProcessorVersionRequest { + // The input data used to train a new + // [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. + message InputData { + // The documents used for training the new version. + BatchDocumentsInputConfig training_documents = 3; + + // The documents used for testing the trained version. + BatchDocumentsInputConfig test_documents = 4; + } + + // Options to control the training of the Custom Document Extraction (CDE) + // Processor. + message CustomDocumentExtractionOptions { + // Training Method for CDE. `TRAINING_METHOD_UNSPECIFIED` will fall back to + // `MODEL_BASED`. + enum TrainingMethod { + TRAINING_METHOD_UNSPECIFIED = 0; + + MODEL_BASED = 1; + + TEMPLATE_BASED = 2; + } + + // Optional. Training method to use for CDE training. + TrainingMethod training_method = 3 [(google.api.field_behavior) = OPTIONAL]; + } + + // Options to control foundation model tuning of the processor. + message FoundationModelTuningOptions { + // Optional. The number of steps to run for model tuning. Valid values are + // between 1 and 400. If not provided, recommended steps will be used. + int32 train_steps = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The multiplier to apply to the recommended learning rate. Valid + // values are between 0.1 and 10. If not provided, recommended learning rate + // will be used. + float learning_rate_multiplier = 3 [(google.api.field_behavior) = OPTIONAL]; + } + + oneof processor_flags { + // Options to control Custom Document Extraction (CDE) Processor. + CustomDocumentExtractionOptions custom_document_extraction_options = 5; + + // Options to control foundation model tuning of a processor. + FoundationModelTuningOptions foundation_model_tuning_options = 12; + } + + // Required. The parent (project, location and processor) to create the new + // version for. Format: + // `projects/{project}/locations/{location}/processors/{processor}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "documentai.googleapis.com/Processor" + } + ]; + + // Required. The processor version to be created. + ProcessorVersion processor_version = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. The schema the processor version will be trained with. + DocumentSchema document_schema = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The input data used to train the + // [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. + InputData input_data = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The processor version to use as a base for training. This + // processor version must be a child of `parent`. Format: + // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`. + string base_processor_version = 8 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response for +// [TrainProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.TrainProcessorVersion]. +message TrainProcessorVersionResponse { + // The resource name of the processor version produced by training. + string processor_version = 1; +} + +// The metadata that represents a processor version being created. +message TrainProcessorVersionMetadata { + // The dataset validation information. + // This includes any and all errors with documents and the dataset. + message DatasetValidation { + // The total number of document errors. + int32 document_error_count = 3; + + // The total number of dataset errors. + int32 dataset_error_count = 4; + + // Error information pertaining to specific documents. A maximum of 10 + // document errors will be returned. + // Any document with errors will not be used throughout training. + repeated google.rpc.Status document_errors = 1; + + // Error information for the dataset as a whole. A maximum of 10 dataset + // errors will be returned. + // A single dataset error is terminal for training. + repeated google.rpc.Status dataset_errors = 2; + } + + // The basic metadata of the long-running operation. + CommonOperationMetadata common_metadata = 1; + + // The training dataset validation information. + DatasetValidation training_dataset_validation = 2; + + // The test dataset validation information. + DatasetValidation test_dataset_validation = 3; +} + +// Request message for the +// [ReviewDocument][google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument] +// method. +message ReviewDocumentRequest { + // The priority level of the human review task. + enum Priority { + // The default priority level. + DEFAULT = 0; + + // The urgent priority level. The labeling manager should allocate labeler + // resource to the urgent task queue to respect this priority level. + URGENT = 1; + } + + // The document payload. + oneof source { + // An inline document proto. + Document inline_document = 4; + } + + // Required. The resource name of the + // [HumanReviewConfig][google.cloud.documentai.v1.HumanReviewConfig] that the + // document will be reviewed with. + string human_review_config = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "documentai.googleapis.com/HumanReviewConfig" + } + ]; + + // Whether the validation should be performed on the ad-hoc review request. + bool enable_schema_validation = 3; + + // The priority of the human review task. + Priority priority = 5; + + // The document schema of the human review task. + DocumentSchema document_schema = 6; +} + +// Response message for the +// [ReviewDocument][google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument] +// method. +message ReviewDocumentResponse { + // Possible states of the review operation. + enum State { + // The default value. This value is used if the state is omitted. + STATE_UNSPECIFIED = 0; + + // The review operation is rejected by the reviewer. + REJECTED = 1; + + // The review operation is succeeded. + SUCCEEDED = 2; + } + + // The Cloud Storage uri for the human reviewed document if the review is + // succeeded. + string gcs_destination = 1; + + // The state of the review operation. + State state = 2; + + // The reason why the review is rejected by reviewer. + string rejection_reason = 3; +} + +// The long-running operation metadata for the +// [ReviewDocument][google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument] +// method. +message ReviewDocumentOperationMetadata { + // The basic metadata of the long-running operation. + CommonOperationMetadata common_metadata = 5; + + // The Crowd Compute question ID. + string question_id = 6; +} + +// Evaluates the given +// [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] against the +// supplied documents. +message EvaluateProcessorVersionRequest { + // Required. The resource name of the + // [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to + // evaluate. + // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + string processor_version = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "documentai.googleapis.com/ProcessorVersion" + } + ]; + + // Optional. The documents used in the evaluation. If unspecified, use the + // processor's dataset as evaluation input. + BatchDocumentsInputConfig evaluation_documents = 3 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Metadata of the +// [EvaluateProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.EvaluateProcessorVersion] +// method. +message EvaluateProcessorVersionMetadata { + // The basic metadata of the long-running operation. + CommonOperationMetadata common_metadata = 1; +} + +// Response of the +// [EvaluateProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.EvaluateProcessorVersion] +// method. +message EvaluateProcessorVersionResponse { + // The resource name of the created evaluation. + string evaluation = 2; +} + +// Retrieves a specific Evaluation. +message GetEvaluationRequest { + // Required. The resource name of the + // [Evaluation][google.cloud.documentai.v1.Evaluation] to get. + // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "documentai.googleapis.com/Evaluation" + } + ]; +} + +// Retrieves a list of evaluations for a given +// [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. +message ListEvaluationsRequest { + // Required. The resource name of the + // [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to list + // evaluations for. + // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "documentai.googleapis.com/ProcessorVersion" + } + ]; + + // The standard list page size. + // If unspecified, at most `5` evaluations are returned. + // The maximum value is `100`. Values above `100` are coerced to `100`. + int32 page_size = 2; + + // A page token, received from a previous `ListEvaluations` call. + // Provide this to retrieve the subsequent page. + string page_token = 3; +} + +// The response from `ListEvaluations`. +message ListEvaluationsResponse { + // The evaluations requested. + repeated Evaluation evaluations = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/document_schema.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/document_schema.proto new file mode 100644 index 00000000000..ad721141a6d --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/document_schema.proto @@ -0,0 +1,168 @@ +// Copyright 2025 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.cloud.documentai.v1; + +option csharp_namespace = "Google.Cloud.DocumentAI.V1"; +option go_package = "cloud.google.com/go/documentai/apiv1/documentaipb;documentaipb"; +option java_multiple_files = true; +option java_outer_classname = "DocumentAiDocumentSchema"; +option java_package = "com.google.cloud.documentai.v1"; +option php_namespace = "Google\\Cloud\\DocumentAI\\V1"; +option ruby_package = "Google::Cloud::DocumentAI::V1"; + +// The schema defines the output of the processed document by a processor. +message DocumentSchema { + // EntityType is the wrapper of a label of the corresponding model with + // detailed attributes and limitations for entity-based processors. Multiple + // types can also compose a dependency tree to represent nested types. + message EntityType { + // Defines the a list of enum values. + message EnumValues { + // The individual values that this enum values type can include. + repeated string values = 1; + } + + // Defines properties that can be part of the entity type. + message Property { + // Types of occurrences of the entity type in the document. This + // represents the number of instances, not mentions, of an entity. + // For example, a bank statement might only have one + // `account_number`, but this account number can be mentioned in several + // places on the document. In this case, the `account_number` is + // considered a `REQUIRED_ONCE` entity type. If, on the other hand, we + // expect a bank statement to contain the status of multiple different + // accounts for the customers, the occurrence type is set to + // `REQUIRED_MULTIPLE`. + enum OccurrenceType { + // Unspecified occurrence type. + OCCURRENCE_TYPE_UNSPECIFIED = 0; + + // There will be zero or one instance of this entity type. The same + // entity instance may be mentioned multiple times. + OPTIONAL_ONCE = 1; + + // The entity type will appear zero or multiple times. + OPTIONAL_MULTIPLE = 2; + + // The entity type will only appear exactly once. The same + // entity instance may be mentioned multiple times. + REQUIRED_ONCE = 3; + + // The entity type will appear once or more times. + REQUIRED_MULTIPLE = 4; + } + + // Specifies how the entity's value is obtained from the document. + enum Method { + // Unspecified method. It defaults to `EXTRACT`. + METHOD_UNSPECIFIED = 0; + + // The entity's value is directly extracted as-is from the document + // text. + EXTRACT = 1; + + // The entity's value is derived through inference and is not + // necessarily an exact text extraction from the document. + DERIVE = 2; + } + + // The name of the property. Follows the same guidelines as the + // EntityType name. + string name = 1; + + // User defined name for the property. + string display_name = 6; + + // A reference to the value type of the property. This type is subject + // to the same conventions as the `Entity.base_types` field. + string value_type = 2; + + // Occurrence type limits the number of instances an entity type appears + // in the document. + OccurrenceType occurrence_type = 3; + + // Specifies how the entity's value is obtained. + Method method = 8; + } + + oneof value_source { + // If specified, lists all the possible values for this entity. This + // should not be more than a handful of values. If the number of values + // is >10 or could change frequently use the `EntityType.value_ontology` + // field and specify a list of all possible values in a value ontology + // file. + EnumValues enum_values = 14; + } + + // User defined name for the type. + string display_name = 13; + + // Name of the type. It must be unique within the schema file and + // cannot be a "Common Type". The following naming conventions are used: + // + // - Use `snake_casing`. + // - Name matching is case-sensitive. + // - Maximum 64 characters. + // - Must start with a letter. + // - Allowed characters: ASCII letters `[a-z0-9_-]`. (For backward + // compatibility internal infrastructure and tooling can handle any ascii + // character.) + // - The `/` is sometimes used to denote a property of a type. For example + // `line_item/amount`. This convention is deprecated, but will still be + // honored for backward compatibility. + string name = 1; + + // The entity type that this type is derived from. For now, one and only + // one should be set. + repeated string base_types = 2; + + // Description the nested structure, or composition of an entity. + repeated Property properties = 6; + } + + // Metadata for global schema behavior. + message Metadata { + // If true, a `document` entity type can be applied to subdocument + // (splitting). Otherwise, it can only be applied to the entire document + // (classification). + bool document_splitter = 1; + + // If true, on a given page, there can be multiple `document` annotations + // covering it. + bool document_allow_multiple_labels = 2; + + // If set, all the nested entities must be prefixed with the parents. + bool prefixed_naming_on_properties = 6; + + // If set, we will skip the naming format validation in the schema. So the + // string values in `DocumentSchema.EntityType.name` and + // `DocumentSchema.EntityType.Property.name` will not be checked. + bool skip_naming_validation = 7; + } + + // Display name to show to users. + string display_name = 1; + + // Description of the schema. + string description = 2; + + // Entity types of the schema. + repeated EntityType entity_types = 3; + + // Metadata of the schema. + Metadata metadata = 4; +} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/evaluation.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/evaluation.proto new file mode 100644 index 00000000000..3ffc570703a --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/evaluation.proto @@ -0,0 +1,182 @@ +// Copyright 2025 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.cloud.documentai.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.DocumentAI.V1"; +option go_package = "cloud.google.com/go/documentai/apiv1/documentaipb;documentaipb"; +option java_multiple_files = true; +option java_outer_classname = "DocumentAiEvaluation"; +option java_package = "com.google.cloud.documentai.v1"; +option php_namespace = "Google\\Cloud\\DocumentAI\\V1"; +option ruby_package = "Google::Cloud::DocumentAI::V1"; + +// Gives a short summary of an evaluation, and links to the evaluation itself. +message EvaluationReference { + // The resource name of the Long Running Operation for the evaluation. + string operation = 1; + + // The resource name of the evaluation. + string evaluation = 2 [(google.api.resource_reference) = { + type: "documentai.googleapis.com/Evaluation" + }]; + + // An aggregate of the statistics for the evaluation with fuzzy matching on. + Evaluation.Metrics aggregate_metrics = 4; + + // An aggregate of the statistics for the evaluation with fuzzy matching off. + Evaluation.Metrics aggregate_metrics_exact = 5; +} + +// An evaluation of a ProcessorVersion's performance. +message Evaluation { + option (google.api.resource) = { + type: "documentai.googleapis.com/Evaluation" + pattern: "projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}" + }; + + // Evaluation counters for the documents that were used. + message Counters { + // How many documents were sent for evaluation. + int32 input_documents_count = 1; + + // How many documents were not included in the evaluation as they didn't + // pass validation. + int32 invalid_documents_count = 2; + + // How many documents were not included in the evaluation as Document AI + // failed to process them. + int32 failed_documents_count = 3; + + // How many documents were used in the evaluation. + int32 evaluated_documents_count = 4; + } + + // Evaluation metrics, either in aggregate or about a specific entity. + message Metrics { + // The calculated precision. + float precision = 1; + + // The calculated recall. + float recall = 2; + + // The calculated f1 score. + float f1_score = 3; + + // The amount of occurrences in predicted documents. + int32 predicted_occurrences_count = 4; + + // The amount of occurrences in ground truth documents. + int32 ground_truth_occurrences_count = 5; + + // The amount of documents with a predicted occurrence. + int32 predicted_document_count = 10; + + // The amount of documents with a ground truth occurrence. + int32 ground_truth_document_count = 11; + + // The amount of true positives. + int32 true_positives_count = 6; + + // The amount of false positives. + int32 false_positives_count = 7; + + // The amount of false negatives. + int32 false_negatives_count = 8; + + // The amount of documents that had an occurrence of this label. + int32 total_documents_count = 9; + } + + // Evaluations metrics, at a specific confidence level. + message ConfidenceLevelMetrics { + // The confidence level. + float confidence_level = 1; + + // The metrics at the specific confidence level. + Metrics metrics = 2; + } + + // Metrics across multiple confidence levels. + message MultiConfidenceMetrics { + // A type that determines how metrics should be interpreted. + enum MetricsType { + // The metrics type is unspecified. By default, metrics without a + // particular specification are for leaf entity types (i.e., top-level + // entity types without child types, or child types which are not + // parent types themselves). + METRICS_TYPE_UNSPECIFIED = 0; + + // Indicates whether metrics for this particular label type represent an + // aggregate of metrics for other types instead of being based on actual + // TP/FP/FN values for the label type. Metrics for parent (i.e., non-leaf) + // entity types are an aggregate of metrics for their children. + AGGREGATE = 1; + } + + // Metrics across confidence levels with fuzzy matching enabled. + repeated ConfidenceLevelMetrics confidence_level_metrics = 1; + + // Metrics across confidence levels with only exact matching. + repeated ConfidenceLevelMetrics confidence_level_metrics_exact = 4; + + // The calculated area under the precision recall curve (AUPRC), computed by + // integrating over all confidence thresholds. + float auprc = 2; + + // The Estimated Calibration Error (ECE) of the confidence of the predicted + // entities. + float estimated_calibration_error = 3; + + // The AUPRC for metrics with fuzzy matching disabled, i.e., exact matching + // only. + float auprc_exact = 5; + + // The ECE for the predicted entities with fuzzy matching disabled, i.e., + // exact matching only. + float estimated_calibration_error_exact = 6; + + // The metrics type for the label. + MetricsType metrics_type = 7; + } + + // The resource name of the evaluation. + // Format: + // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}` + string name = 1; + + // The time that the evaluation was created. + google.protobuf.Timestamp create_time = 2; + + // Counters for the documents used in the evaluation. + Counters document_counters = 5; + + // Metrics for all the entities in aggregate. + MultiConfidenceMetrics all_entities_metrics = 3; + + // Metrics across confidence levels, for different entities. + map entity_metrics = 4; + + // The KMS key name used for encryption. + string kms_key_name = 6; + + // The KMS key version with which data is encrypted. + string kms_key_version_name = 7; +} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/geometry.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/geometry.proto new file mode 100644 index 00000000000..b6715431b18 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/geometry.proto @@ -0,0 +1,55 @@ +// Copyright 2025 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.cloud.documentai.v1; + +option csharp_namespace = "Google.Cloud.DocumentAI.V1"; +option go_package = "cloud.google.com/go/documentai/apiv1/documentaipb;documentaipb"; +option java_multiple_files = true; +option java_outer_classname = "GeometryProto"; +option java_package = "com.google.cloud.documentai.v1"; +option php_namespace = "Google\\Cloud\\DocumentAI\\V1"; +option ruby_package = "Google::Cloud::DocumentAI::V1"; + +// A vertex represents a 2D point in the image. +// NOTE: the vertex coordinates are in the same scale as the original image. +message Vertex { + // X coordinate. + int32 x = 1; + + // Y coordinate (starts from the top of the image). + int32 y = 2; +} + +// A vertex represents a 2D point in the image. +// NOTE: the normalized vertex coordinates are relative to the original image +// and range from 0 to 1. +message NormalizedVertex { + // X coordinate. + float x = 1; + + // Y coordinate (starts from the top of the image). + float y = 2; +} + +// A bounding polygon for the detected image annotation. +message BoundingPoly { + // The bounding polygon vertices. + repeated Vertex vertices = 1; + + // The bounding polygon normalized vertices. + repeated NormalizedVertex normalized_vertices = 2; +} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/operation_metadata.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/operation_metadata.proto new file mode 100644 index 00000000000..0853e38ea8c --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/operation_metadata.proto @@ -0,0 +1,66 @@ +// Copyright 2025 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.cloud.documentai.v1; + +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.DocumentAI.V1"; +option go_package = "cloud.google.com/go/documentai/apiv1/documentaipb;documentaipb"; +option java_multiple_files = true; +option java_outer_classname = "OperationMetadataProto"; +option java_package = "com.google.cloud.documentai.v1"; +option php_namespace = "Google\\Cloud\\DocumentAI\\V1"; +option ruby_package = "Google::Cloud::DocumentAI::V1"; + +// The common metadata for long running operations. +message CommonOperationMetadata { + // State of the longrunning operation. + enum State { + // Unspecified state. + STATE_UNSPECIFIED = 0; + + // Operation is still running. + RUNNING = 1; + + // Operation is being cancelled. + CANCELLING = 2; + + // Operation succeeded. + SUCCEEDED = 3; + + // Operation failed. + FAILED = 4; + + // Operation is cancelled. + CANCELLED = 5; + } + + // The state of the operation. + State state = 1; + + // A message providing more details about the current state of processing. + string state_message = 2; + + // A related resource to this operation. + string resource = 5; + + // The creation time of the operation. + google.protobuf.Timestamp create_time = 3; + + // The last update time of the operation. + google.protobuf.Timestamp update_time = 4; +} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/processor.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/processor.proto new file mode 100644 index 00000000000..2306252d163 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/processor.proto @@ -0,0 +1,297 @@ +// Copyright 2025 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.cloud.documentai.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/documentai/v1/document_schema.proto"; +import "google/cloud/documentai/v1/evaluation.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.DocumentAI.V1"; +option go_package = "cloud.google.com/go/documentai/apiv1/documentaipb;documentaipb"; +option java_multiple_files = true; +option java_outer_classname = "DocumentAiProcessor"; +option java_package = "com.google.cloud.documentai.v1"; +option php_namespace = "Google\\Cloud\\DocumentAI\\V1"; +option ruby_package = "Google::Cloud::DocumentAI::V1"; + +// A processor version is an implementation of a processor. Each processor +// can have multiple versions, pretrained by Google internally or uptrained +// by the customer. A processor can only have one default version at a time. +// Its document-processing behavior is defined by that version. +message ProcessorVersion { + option (google.api.resource) = { + type: "documentai.googleapis.com/ProcessorVersion" + pattern: "projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}" + }; + + // Information about the upcoming deprecation of this processor version. + message DeprecationInfo { + // The time at which this processor version will be deprecated. + google.protobuf.Timestamp deprecation_time = 1; + + // If set, the processor version that will be used as a replacement. + string replacement_processor_version = 2 + [(google.api.resource_reference) = { + type: "documentai.googleapis.com/ProcessorVersion" + }]; + } + + // Information about Generative AI model-based processor versions. + message GenAiModelInfo { + // Information for a pretrained Google-managed foundation model. + message FoundationGenAiModelInfo { + // Whether finetuning is allowed for this base processor version. + bool finetuning_allowed = 1; + + // The minimum number of labeled documents in the training dataset + // required for finetuning. + int32 min_train_labeled_documents = 2; + } + + // Information for a custom Generative AI model created by the user. These + // are created with `Create New Version` in either the `Call foundation + // model` or `Fine tuning` tabs. + message CustomGenAiModelInfo { + // The type of custom model created by the user. + enum CustomModelType { + // The model type is unspecified. + CUSTOM_MODEL_TYPE_UNSPECIFIED = 0; + + // The model is a versioned foundation model. + VERSIONED_FOUNDATION = 1; + + // The model is a finetuned foundation model. + FINE_TUNED = 2; + } + + // The type of custom model created by the user. + CustomModelType custom_model_type = 1; + + // The base processor version ID for the custom model. + string base_processor_version_id = 2; + } + + // The processor version is either a pretrained Google-managed foundation + // model or a custom Generative AI model created by the user. + oneof model_info { + // Information for a pretrained Google-managed foundation model. + FoundationGenAiModelInfo foundation_gen_ai_model_info = 1; + + // Information for a custom Generative AI model created by the user. + CustomGenAiModelInfo custom_gen_ai_model_info = 2; + } + } + + // The possible states of the processor version. + enum State { + // The processor version is in an unspecified state. + STATE_UNSPECIFIED = 0; + + // The processor version is deployed and can be used for processing. + DEPLOYED = 1; + + // The processor version is being deployed. + DEPLOYING = 2; + + // The processor version is not deployed and cannot be used for processing. + UNDEPLOYED = 3; + + // The processor version is being undeployed. + UNDEPLOYING = 4; + + // The processor version is being created. + CREATING = 5; + + // The processor version is being deleted. + DELETING = 6; + + // The processor version failed and is in an indeterminate state. + FAILED = 7; + + // The processor version is being imported. + IMPORTING = 8; + } + + // The possible model types of the processor version. + enum ModelType { + // The processor version has unspecified model type. + MODEL_TYPE_UNSPECIFIED = 0; + + // The processor version has generative model type. + MODEL_TYPE_GENERATIVE = 1; + + // The processor version has custom model type. + MODEL_TYPE_CUSTOM = 2; + } + + // Identifier. The resource name of the processor version. + // Format: + // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // The display name of the processor version. + string display_name = 2; + + // Output only. The schema of the processor version. Describes the output. + DocumentSchema document_schema = 12 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The state of the processor version. + State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the processor version was created. + google.protobuf.Timestamp create_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The most recently invoked evaluation for the processor + // version. + EvaluationReference latest_evaluation = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The KMS key name used for encryption. + string kms_key_name = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The KMS key version with which data is encrypted. + string kms_key_version_name = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Denotes that this `ProcessorVersion` is managed by Google. + bool google_managed = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. If set, information about the eventual deprecation of this + // version. + DeprecationInfo deprecation_info = 13 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The model type of this processor version. + ModelType model_type = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reserved for future use. + bool satisfies_pzs = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reserved for future use. + bool satisfies_pzi = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Information about Generative AI model-based processor + // versions. + GenAiModelInfo gen_ai_model_info = 18 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Contains the alias and the aliased resource name of processor version. +message ProcessorVersionAlias { + // The alias in the form of `processor_version` resource name. + string alias = 1; + + // The resource name of aliased processor version. + string processor_version = 2 [(google.api.resource_reference) = { + type: "documentai.googleapis.com/ProcessorVersion" + }]; +} + +// The first-class citizen for Document AI. Each processor defines how to +// extract structural information from a document. +message Processor { + option (google.api.resource) = { + type: "documentai.googleapis.com/Processor" + pattern: "projects/{project}/locations/{location}/processors/{processor}" + }; + + // The possible states of the processor. + enum State { + // The processor is in an unspecified state. + STATE_UNSPECIFIED = 0; + + // The processor is enabled, i.e., has an enabled version which can + // currently serve processing requests and all the feature dependencies have + // been successfully initialized. + ENABLED = 1; + + // The processor is disabled. + DISABLED = 2; + + // The processor is being enabled, will become `ENABLED` if successful. + ENABLING = 3; + + // The processor is being disabled, will become `DISABLED` if successful. + DISABLING = 4; + + // The processor is being created, will become either `ENABLED` (for + // successful creation) or `FAILED` (for failed ones). + // Once a processor is in this state, it can then be used for document + // processing, but the feature dependencies of the processor might not be + // fully created yet. + CREATING = 5; + + // The processor failed during creation or initialization of feature + // dependencies. The user should delete the processor and recreate one as + // all the functionalities of the processor are disabled. + FAILED = 6; + + // The processor is being deleted, will be removed if successful. + DELETING = 7; + } + + // Output only. Immutable. The resource name of the processor. + // Format: `projects/{project}/locations/{location}/processors/{processor}` + string name = 1 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // The processor type, such as: `OCR_PROCESSOR`, `INVOICE_PROCESSOR`. + // To get a list of processor types, see + // [FetchProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypes]. + string type = 2; + + // The display name of the processor. + string display_name = 3; + + // Output only. The state of the processor. + State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The default processor version. + string default_processor_version = 9 [(google.api.resource_reference) = { + type: "documentai.googleapis.com/ProcessorVersion" + }]; + + // Output only. The processor version aliases. + repeated ProcessorVersionAlias processor_version_aliases = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Immutable. The http endpoint that can be called to invoke + // processing. + string process_endpoint = 6 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Output only. The time the processor was created. + google.protobuf.Timestamp create_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The [KMS key](https://cloud.google.com/security-key-management) used for + // encryption and decryption in CMEK scenarios. + string kms_key_name = 8; + + // Output only. Reserved for future use. + bool satisfies_pzs = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reserved for future use. + bool satisfies_pzi = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/processor_type.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/processor_type.proto new file mode 100644 index 00000000000..19ae44ee1f8 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/processor_type.proto @@ -0,0 +1,67 @@ +// Copyright 2025 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.cloud.documentai.v1; + +import "google/api/launch_stage.proto"; +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.DocumentAI.V1"; +option go_package = "cloud.google.com/go/documentai/apiv1/documentaipb;documentaipb"; +option java_multiple_files = true; +option java_outer_classname = "DocumentAiProcessorType"; +option java_package = "com.google.cloud.documentai.v1"; +option php_namespace = "Google\\Cloud\\DocumentAI\\V1"; +option ruby_package = "Google::Cloud::DocumentAI::V1"; + +// A processor type is responsible for performing a certain document +// understanding task on a certain type of document. +message ProcessorType { + option (google.api.resource) = { + type: "documentai.googleapis.com/ProcessorType" + pattern: "projects/{project}/locations/{location}/processorTypes/{processor_type}" + }; + + // The location information about where the processor is available. + message LocationInfo { + // The location ID. For supported locations, refer to [regional and + // multi-regional support](/document-ai/docs/regions). + string location_id = 1; + } + + // The resource name of the processor type. + // Format: `projects/{project}/processorTypes/{processor_type}` + string name = 1; + + // The processor type, such as: `OCR_PROCESSOR`, `INVOICE_PROCESSOR`. + string type = 2; + + // The processor category, used by UI to group processor types. + string category = 3; + + // The locations in which this processor is available. + repeated LocationInfo available_locations = 4; + + // Whether the processor type allows creation. If true, users can create a + // processor of this processor type. Otherwise, users need to request access. + bool allow_creation = 6; + + // Launch stage of the processor type + google.api.LaunchStage launch_stage = 8; + + // A set of Cloud Storage URIs of sample documents for this processor. + repeated string sample_document_uris = 9; +} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/protos.d.ts b/owl-bot-staging/google-cloud-contentwarehouse/protos/protos.d.ts new file mode 100644 index 00000000000..1c4cee39fe7 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/protos/protos.d.ts @@ -0,0 +1,30589 @@ +// Copyright 2026 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 type {protobuf as $protobuf} from "google-gax"; +import Long = require("long"); +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace contentwarehouse. */ + namespace contentwarehouse { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of a CreateDocumentMetadata. */ + interface ICreateDocumentMetadata { + } + + /** Represents a CreateDocumentMetadata. */ + class CreateDocumentMetadata implements ICreateDocumentMetadata { + + /** + * Constructs a new CreateDocumentMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.ICreateDocumentMetadata); + + /** + * Creates a new CreateDocumentMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateDocumentMetadata instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.ICreateDocumentMetadata): google.cloud.contentwarehouse.v1.CreateDocumentMetadata; + + /** + * Encodes the specified CreateDocumentMetadata message. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateDocumentMetadata.verify|verify} messages. + * @param message CreateDocumentMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.ICreateDocumentMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateDocumentMetadata message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateDocumentMetadata.verify|verify} messages. + * @param message CreateDocumentMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.ICreateDocumentMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateDocumentMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateDocumentMetadata + * @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.cloud.contentwarehouse.v1.CreateDocumentMetadata; + + /** + * Decodes a CreateDocumentMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateDocumentMetadata + * @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.cloud.contentwarehouse.v1.CreateDocumentMetadata; + + /** + * Verifies a CreateDocumentMetadata 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 CreateDocumentMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateDocumentMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.CreateDocumentMetadata; + + /** + * Creates a plain object from a CreateDocumentMetadata message. Also converts values to other types if specified. + * @param message CreateDocumentMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.CreateDocumentMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateDocumentMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateDocumentMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateDocumentMetadata. */ + interface IUpdateDocumentMetadata { + } + + /** Represents an UpdateDocumentMetadata. */ + class UpdateDocumentMetadata implements IUpdateDocumentMetadata { + + /** + * Constructs a new UpdateDocumentMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IUpdateDocumentMetadata); + + /** + * Creates a new UpdateDocumentMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateDocumentMetadata instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IUpdateDocumentMetadata): google.cloud.contentwarehouse.v1.UpdateDocumentMetadata; + + /** + * Encodes the specified UpdateDocumentMetadata message. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateDocumentMetadata.verify|verify} messages. + * @param message UpdateDocumentMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IUpdateDocumentMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateDocumentMetadata message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateDocumentMetadata.verify|verify} messages. + * @param message UpdateDocumentMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IUpdateDocumentMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateDocumentMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateDocumentMetadata + * @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.cloud.contentwarehouse.v1.UpdateDocumentMetadata; + + /** + * Decodes an UpdateDocumentMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateDocumentMetadata + * @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.cloud.contentwarehouse.v1.UpdateDocumentMetadata; + + /** + * Verifies an UpdateDocumentMetadata 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 UpdateDocumentMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateDocumentMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.UpdateDocumentMetadata; + + /** + * Creates a plain object from an UpdateDocumentMetadata message. Also converts values to other types if specified. + * @param message UpdateDocumentMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.UpdateDocumentMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateDocumentMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateDocumentMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RequestMetadata. */ + interface IRequestMetadata { + + /** RequestMetadata userInfo */ + userInfo?: (google.cloud.contentwarehouse.v1.IUserInfo|null); + } + + /** Represents a RequestMetadata. */ + class RequestMetadata implements IRequestMetadata { + + /** + * Constructs a new RequestMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IRequestMetadata); + + /** RequestMetadata userInfo. */ + public userInfo?: (google.cloud.contentwarehouse.v1.IUserInfo|null); + + /** + * Creates a new RequestMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns RequestMetadata instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IRequestMetadata): google.cloud.contentwarehouse.v1.RequestMetadata; + + /** + * Encodes the specified RequestMetadata message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RequestMetadata.verify|verify} messages. + * @param message RequestMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IRequestMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RequestMetadata message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RequestMetadata.verify|verify} messages. + * @param message RequestMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IRequestMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RequestMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RequestMetadata + * @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.cloud.contentwarehouse.v1.RequestMetadata; + + /** + * Decodes a RequestMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RequestMetadata + * @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.cloud.contentwarehouse.v1.RequestMetadata; + + /** + * Verifies a RequestMetadata 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 RequestMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RequestMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.RequestMetadata; + + /** + * Creates a plain object from a RequestMetadata message. Also converts values to other types if specified. + * @param message RequestMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.RequestMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RequestMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RequestMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ResponseMetadata. */ + interface IResponseMetadata { + + /** ResponseMetadata requestId */ + requestId?: (string|null); + } + + /** Represents a ResponseMetadata. */ + class ResponseMetadata implements IResponseMetadata { + + /** + * Constructs a new ResponseMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IResponseMetadata); + + /** ResponseMetadata requestId. */ + public requestId: string; + + /** + * Creates a new ResponseMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ResponseMetadata instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IResponseMetadata): google.cloud.contentwarehouse.v1.ResponseMetadata; + + /** + * Encodes the specified ResponseMetadata message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ResponseMetadata.verify|verify} messages. + * @param message ResponseMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IResponseMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResponseMetadata message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ResponseMetadata.verify|verify} messages. + * @param message ResponseMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IResponseMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResponseMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResponseMetadata + * @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.cloud.contentwarehouse.v1.ResponseMetadata; + + /** + * Decodes a ResponseMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResponseMetadata + * @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.cloud.contentwarehouse.v1.ResponseMetadata; + + /** + * Verifies a ResponseMetadata 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 ResponseMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResponseMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.ResponseMetadata; + + /** + * Creates a plain object from a ResponseMetadata message. Also converts values to other types if specified. + * @param message ResponseMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.ResponseMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResponseMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResponseMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UserInfo. */ + interface IUserInfo { + + /** UserInfo id */ + id?: (string|null); + + /** UserInfo groupIds */ + groupIds?: (string[]|null); + } + + /** Represents a UserInfo. */ + class UserInfo implements IUserInfo { + + /** + * Constructs a new UserInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IUserInfo); + + /** UserInfo id. */ + public id: string; + + /** UserInfo groupIds. */ + public groupIds: string[]; + + /** + * Creates a new UserInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns UserInfo instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IUserInfo): google.cloud.contentwarehouse.v1.UserInfo; + + /** + * Encodes the specified UserInfo message. Does not implicitly {@link google.cloud.contentwarehouse.v1.UserInfo.verify|verify} messages. + * @param message UserInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IUserInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UserInfo message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.UserInfo.verify|verify} messages. + * @param message UserInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IUserInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UserInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UserInfo + * @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.cloud.contentwarehouse.v1.UserInfo; + + /** + * Decodes a UserInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UserInfo + * @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.cloud.contentwarehouse.v1.UserInfo; + + /** + * Verifies a UserInfo 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 UserInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UserInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.UserInfo; + + /** + * Creates a plain object from a UserInfo message. Also converts values to other types if specified. + * @param message UserInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.UserInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UserInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UserInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateOptions. */ + interface IUpdateOptions { + + /** UpdateOptions updateType */ + updateType?: (google.cloud.contentwarehouse.v1.UpdateType|keyof typeof google.cloud.contentwarehouse.v1.UpdateType|null); + + /** UpdateOptions updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateOptions mergeFieldsOptions */ + mergeFieldsOptions?: (google.cloud.contentwarehouse.v1.IMergeFieldsOptions|null); + } + + /** Represents an UpdateOptions. */ + class UpdateOptions implements IUpdateOptions { + + /** + * Constructs a new UpdateOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IUpdateOptions); + + /** UpdateOptions updateType. */ + public updateType: (google.cloud.contentwarehouse.v1.UpdateType|keyof typeof google.cloud.contentwarehouse.v1.UpdateType); + + /** UpdateOptions updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateOptions mergeFieldsOptions. */ + public mergeFieldsOptions?: (google.cloud.contentwarehouse.v1.IMergeFieldsOptions|null); + + /** + * Creates a new UpdateOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateOptions instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IUpdateOptions): google.cloud.contentwarehouse.v1.UpdateOptions; + + /** + * Encodes the specified UpdateOptions message. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateOptions.verify|verify} messages. + * @param message UpdateOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IUpdateOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateOptions message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateOptions.verify|verify} messages. + * @param message UpdateOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IUpdateOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateOptions + * @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.cloud.contentwarehouse.v1.UpdateOptions; + + /** + * Decodes an UpdateOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateOptions + * @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.cloud.contentwarehouse.v1.UpdateOptions; + + /** + * Verifies an UpdateOptions 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 UpdateOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.UpdateOptions; + + /** + * Creates a plain object from an UpdateOptions message. Also converts values to other types if specified. + * @param message UpdateOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.UpdateOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MergeFieldsOptions. */ + interface IMergeFieldsOptions { + + /** MergeFieldsOptions replaceMessageFields */ + replaceMessageFields?: (boolean|null); + + /** MergeFieldsOptions replaceRepeatedFields */ + replaceRepeatedFields?: (boolean|null); + } + + /** Represents a MergeFieldsOptions. */ + class MergeFieldsOptions implements IMergeFieldsOptions { + + /** + * Constructs a new MergeFieldsOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IMergeFieldsOptions); + + /** MergeFieldsOptions replaceMessageFields. */ + public replaceMessageFields?: (boolean|null); + + /** MergeFieldsOptions replaceRepeatedFields. */ + public replaceRepeatedFields?: (boolean|null); + + /** + * Creates a new MergeFieldsOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MergeFieldsOptions instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IMergeFieldsOptions): google.cloud.contentwarehouse.v1.MergeFieldsOptions; + + /** + * Encodes the specified MergeFieldsOptions message. Does not implicitly {@link google.cloud.contentwarehouse.v1.MergeFieldsOptions.verify|verify} messages. + * @param message MergeFieldsOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IMergeFieldsOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MergeFieldsOptions message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.MergeFieldsOptions.verify|verify} messages. + * @param message MergeFieldsOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IMergeFieldsOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MergeFieldsOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MergeFieldsOptions + * @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.cloud.contentwarehouse.v1.MergeFieldsOptions; + + /** + * Decodes a MergeFieldsOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MergeFieldsOptions + * @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.cloud.contentwarehouse.v1.MergeFieldsOptions; + + /** + * Verifies a MergeFieldsOptions 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 MergeFieldsOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MergeFieldsOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.MergeFieldsOptions; + + /** + * Creates a plain object from a MergeFieldsOptions message. Also converts values to other types if specified. + * @param message MergeFieldsOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.MergeFieldsOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MergeFieldsOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MergeFieldsOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** UpdateType enum. */ + enum UpdateType { + UPDATE_TYPE_UNSPECIFIED = 0, + UPDATE_TYPE_REPLACE = 1, + UPDATE_TYPE_MERGE = 2, + UPDATE_TYPE_INSERT_PROPERTIES_BY_NAMES = 3, + UPDATE_TYPE_REPLACE_PROPERTIES_BY_NAMES = 4, + UPDATE_TYPE_DELETE_PROPERTIES_BY_NAMES = 5, + UPDATE_TYPE_MERGE_AND_REPLACE_OR_INSERT_PROPERTIES_BY_NAMES = 6 + } + + /** DatabaseType enum. */ + enum DatabaseType { + DB_UNKNOWN = 0, + DB_INFRA_SPANNER = 1, + DB_CLOUD_SQL_POSTGRES = 2 + } + + /** AccessControlMode enum. */ + enum AccessControlMode { + ACL_MODE_UNKNOWN = 0, + ACL_MODE_UNIVERSAL_ACCESS = 1, + ACL_MODE_DOCUMENT_LEVEL_ACCESS_CONTROL_BYOID = 2, + ACL_MODE_DOCUMENT_LEVEL_ACCESS_CONTROL_GCI = 3 + } + + /** DocumentCreatorDefaultRole enum. */ + enum DocumentCreatorDefaultRole { + DOCUMENT_CREATOR_DEFAULT_ROLE_UNSPECIFIED = 0, + DOCUMENT_ADMIN = 1, + DOCUMENT_EDITOR = 2, + DOCUMENT_VIEWER = 3 + } + + /** Properties of a Document. */ + interface IDocument { + + /** Document name */ + name?: (string|null); + + /** Document referenceId */ + referenceId?: (string|null); + + /** Document displayName */ + displayName?: (string|null); + + /** Document title */ + title?: (string|null); + + /** Document displayUri */ + displayUri?: (string|null); + + /** Document documentSchemaName */ + documentSchemaName?: (string|null); + + /** Document plainText */ + plainText?: (string|null); + + /** Document cloudAiDocument */ + cloudAiDocument?: (google.cloud.documentai.v1.IDocument|null); + + /** Document structuredContentUri */ + structuredContentUri?: (string|null); + + /** Document rawDocumentPath */ + rawDocumentPath?: (string|null); + + /** Document inlineRawDocument */ + inlineRawDocument?: (Uint8Array|Buffer|string|null); + + /** Document properties */ + properties?: (google.cloud.contentwarehouse.v1.IProperty[]|null); + + /** Document updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Document createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Document rawDocumentFileType */ + rawDocumentFileType?: (google.cloud.contentwarehouse.v1.RawDocumentFileType|keyof typeof google.cloud.contentwarehouse.v1.RawDocumentFileType|null); + + /** Document asyncEnabled */ + asyncEnabled?: (boolean|null); + + /** Document contentCategory */ + contentCategory?: (google.cloud.contentwarehouse.v1.ContentCategory|keyof typeof google.cloud.contentwarehouse.v1.ContentCategory|null); + + /** Document textExtractionDisabled */ + textExtractionDisabled?: (boolean|null); + + /** Document textExtractionEnabled */ + textExtractionEnabled?: (boolean|null); + + /** Document creator */ + creator?: (string|null); + + /** Document updater */ + updater?: (string|null); + + /** Document dispositionTime */ + dispositionTime?: (google.protobuf.ITimestamp|null); + + /** Document legalHold */ + legalHold?: (boolean|null); + } + + /** Represents a Document. */ + class Document implements IDocument { + + /** + * Constructs a new Document. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IDocument); + + /** Document name. */ + public name: string; + + /** Document referenceId. */ + public referenceId: string; + + /** Document displayName. */ + public displayName: string; + + /** Document title. */ + public title: string; + + /** Document displayUri. */ + public displayUri: string; + + /** Document documentSchemaName. */ + public documentSchemaName: string; + + /** Document plainText. */ + public plainText?: (string|null); + + /** Document cloudAiDocument. */ + public cloudAiDocument?: (google.cloud.documentai.v1.IDocument|null); + + /** Document structuredContentUri. */ + public structuredContentUri: string; + + /** Document rawDocumentPath. */ + public rawDocumentPath?: (string|null); + + /** Document inlineRawDocument. */ + public inlineRawDocument?: (Uint8Array|Buffer|string|null); + + /** Document properties. */ + public properties: google.cloud.contentwarehouse.v1.IProperty[]; + + /** Document updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Document createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Document rawDocumentFileType. */ + public rawDocumentFileType: (google.cloud.contentwarehouse.v1.RawDocumentFileType|keyof typeof google.cloud.contentwarehouse.v1.RawDocumentFileType); + + /** Document asyncEnabled. */ + public asyncEnabled: boolean; + + /** Document contentCategory. */ + public contentCategory: (google.cloud.contentwarehouse.v1.ContentCategory|keyof typeof google.cloud.contentwarehouse.v1.ContentCategory); + + /** Document textExtractionDisabled. */ + public textExtractionDisabled: boolean; + + /** Document textExtractionEnabled. */ + public textExtractionEnabled: boolean; + + /** Document creator. */ + public creator: string; + + /** Document updater. */ + public updater: string; + + /** Document dispositionTime. */ + public dispositionTime?: (google.protobuf.ITimestamp|null); + + /** Document legalHold. */ + public legalHold: boolean; + + /** Document structuredContent. */ + public structuredContent?: ("plainText"|"cloudAiDocument"); + + /** Document rawDocument. */ + public rawDocument?: ("rawDocumentPath"|"inlineRawDocument"); + + /** + * Creates a new Document instance using the specified properties. + * @param [properties] Properties to set + * @returns Document instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IDocument): google.cloud.contentwarehouse.v1.Document; + + /** + * Encodes the specified Document message. Does not implicitly {@link google.cloud.contentwarehouse.v1.Document.verify|verify} messages. + * @param message Document message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IDocument, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Document message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.Document.verify|verify} messages. + * @param message Document message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IDocument, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Document message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Document + * @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.cloud.contentwarehouse.v1.Document; + + /** + * Decodes a Document message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Document + * @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.cloud.contentwarehouse.v1.Document; + + /** + * Verifies a Document 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 Document message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Document + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.Document; + + /** + * Creates a plain object from a Document message. Also converts values to other types if specified. + * @param message Document + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.Document, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Document to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Document + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DocumentReference. */ + interface IDocumentReference { + + /** DocumentReference documentName */ + documentName?: (string|null); + + /** DocumentReference displayName */ + displayName?: (string|null); + + /** DocumentReference snippet */ + snippet?: (string|null); + + /** DocumentReference documentIsFolder */ + documentIsFolder?: (boolean|null); + + /** DocumentReference updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** DocumentReference createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** DocumentReference deleteTime */ + deleteTime?: (google.protobuf.ITimestamp|null); + + /** DocumentReference documentIsRetentionFolder */ + documentIsRetentionFolder?: (boolean|null); + + /** DocumentReference documentIsLegalHoldFolder */ + documentIsLegalHoldFolder?: (boolean|null); + } + + /** Represents a DocumentReference. */ + class DocumentReference implements IDocumentReference { + + /** + * Constructs a new DocumentReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IDocumentReference); + + /** DocumentReference documentName. */ + public documentName: string; + + /** DocumentReference displayName. */ + public displayName: string; + + /** DocumentReference snippet. */ + public snippet: string; + + /** DocumentReference documentIsFolder. */ + public documentIsFolder: boolean; + + /** DocumentReference updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** DocumentReference createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** DocumentReference deleteTime. */ + public deleteTime?: (google.protobuf.ITimestamp|null); + + /** DocumentReference documentIsRetentionFolder. */ + public documentIsRetentionFolder: boolean; + + /** DocumentReference documentIsLegalHoldFolder. */ + public documentIsLegalHoldFolder: boolean; + + /** + * Creates a new DocumentReference instance using the specified properties. + * @param [properties] Properties to set + * @returns DocumentReference instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IDocumentReference): google.cloud.contentwarehouse.v1.DocumentReference; + + /** + * Encodes the specified DocumentReference message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DocumentReference.verify|verify} messages. + * @param message DocumentReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IDocumentReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DocumentReference message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DocumentReference.verify|verify} messages. + * @param message DocumentReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IDocumentReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DocumentReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DocumentReference + * @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.cloud.contentwarehouse.v1.DocumentReference; + + /** + * Decodes a DocumentReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DocumentReference + * @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.cloud.contentwarehouse.v1.DocumentReference; + + /** + * Verifies a DocumentReference 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 DocumentReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DocumentReference + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.DocumentReference; + + /** + * Creates a plain object from a DocumentReference message. Also converts values to other types if specified. + * @param message DocumentReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.DocumentReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DocumentReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DocumentReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Property. */ + interface IProperty { + + /** Property name */ + name?: (string|null); + + /** Property integerValues */ + integerValues?: (google.cloud.contentwarehouse.v1.IIntegerArray|null); + + /** Property floatValues */ + floatValues?: (google.cloud.contentwarehouse.v1.IFloatArray|null); + + /** Property textValues */ + textValues?: (google.cloud.contentwarehouse.v1.ITextArray|null); + + /** Property enumValues */ + enumValues?: (google.cloud.contentwarehouse.v1.IEnumArray|null); + + /** Property propertyValues */ + propertyValues?: (google.cloud.contentwarehouse.v1.IPropertyArray|null); + + /** Property dateTimeValues */ + dateTimeValues?: (google.cloud.contentwarehouse.v1.IDateTimeArray|null); + + /** Property mapProperty */ + mapProperty?: (google.cloud.contentwarehouse.v1.IMapProperty|null); + + /** Property timestampValues */ + timestampValues?: (google.cloud.contentwarehouse.v1.ITimestampArray|null); + } + + /** Represents a Property. */ + class Property implements IProperty { + + /** + * Constructs a new Property. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IProperty); + + /** Property name. */ + public name: string; + + /** Property integerValues. */ + public integerValues?: (google.cloud.contentwarehouse.v1.IIntegerArray|null); + + /** Property floatValues. */ + public floatValues?: (google.cloud.contentwarehouse.v1.IFloatArray|null); + + /** Property textValues. */ + public textValues?: (google.cloud.contentwarehouse.v1.ITextArray|null); + + /** Property enumValues. */ + public enumValues?: (google.cloud.contentwarehouse.v1.IEnumArray|null); + + /** Property propertyValues. */ + public propertyValues?: (google.cloud.contentwarehouse.v1.IPropertyArray|null); + + /** Property dateTimeValues. */ + public dateTimeValues?: (google.cloud.contentwarehouse.v1.IDateTimeArray|null); + + /** Property mapProperty. */ + public mapProperty?: (google.cloud.contentwarehouse.v1.IMapProperty|null); + + /** Property timestampValues. */ + public timestampValues?: (google.cloud.contentwarehouse.v1.ITimestampArray|null); + + /** Property values. */ + public values?: ("integerValues"|"floatValues"|"textValues"|"enumValues"|"propertyValues"|"dateTimeValues"|"mapProperty"|"timestampValues"); + + /** + * Creates a new Property instance using the specified properties. + * @param [properties] Properties to set + * @returns Property instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IProperty): google.cloud.contentwarehouse.v1.Property; + + /** + * Encodes the specified Property message. Does not implicitly {@link google.cloud.contentwarehouse.v1.Property.verify|verify} messages. + * @param message Property message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IProperty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Property message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.Property.verify|verify} messages. + * @param message Property message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IProperty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Property message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Property + * @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.cloud.contentwarehouse.v1.Property; + + /** + * Decodes a Property message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Property + * @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.cloud.contentwarehouse.v1.Property; + + /** + * Verifies a Property 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 Property message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Property + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.Property; + + /** + * Creates a plain object from a Property message. Also converts values to other types if specified. + * @param message Property + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.Property, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Property to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Property + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IntegerArray. */ + interface IIntegerArray { + + /** IntegerArray values */ + values?: (number[]|null); + } + + /** Represents an IntegerArray. */ + class IntegerArray implements IIntegerArray { + + /** + * Constructs a new IntegerArray. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IIntegerArray); + + /** IntegerArray values. */ + public values: number[]; + + /** + * Creates a new IntegerArray instance using the specified properties. + * @param [properties] Properties to set + * @returns IntegerArray instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IIntegerArray): google.cloud.contentwarehouse.v1.IntegerArray; + + /** + * Encodes the specified IntegerArray message. Does not implicitly {@link google.cloud.contentwarehouse.v1.IntegerArray.verify|verify} messages. + * @param message IntegerArray message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IIntegerArray, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IntegerArray message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.IntegerArray.verify|verify} messages. + * @param message IntegerArray message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IIntegerArray, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IntegerArray message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IntegerArray + * @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.cloud.contentwarehouse.v1.IntegerArray; + + /** + * Decodes an IntegerArray message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IntegerArray + * @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.cloud.contentwarehouse.v1.IntegerArray; + + /** + * Verifies an IntegerArray 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 IntegerArray message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IntegerArray + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.IntegerArray; + + /** + * Creates a plain object from an IntegerArray message. Also converts values to other types if specified. + * @param message IntegerArray + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.IntegerArray, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IntegerArray to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IntegerArray + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatArray. */ + interface IFloatArray { + + /** FloatArray values */ + values?: (number[]|null); + } + + /** Represents a FloatArray. */ + class FloatArray implements IFloatArray { + + /** + * Constructs a new FloatArray. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IFloatArray); + + /** FloatArray values. */ + public values: number[]; + + /** + * Creates a new FloatArray instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatArray instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IFloatArray): google.cloud.contentwarehouse.v1.FloatArray; + + /** + * Encodes the specified FloatArray message. Does not implicitly {@link google.cloud.contentwarehouse.v1.FloatArray.verify|verify} messages. + * @param message FloatArray message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IFloatArray, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FloatArray message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.FloatArray.verify|verify} messages. + * @param message FloatArray message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IFloatArray, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatArray message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FloatArray + * @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.cloud.contentwarehouse.v1.FloatArray; + + /** + * Decodes a FloatArray message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FloatArray + * @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.cloud.contentwarehouse.v1.FloatArray; + + /** + * Verifies a FloatArray 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 FloatArray message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FloatArray + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.FloatArray; + + /** + * Creates a plain object from a FloatArray message. Also converts values to other types if specified. + * @param message FloatArray + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.FloatArray, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FloatArray to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FloatArray + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextArray. */ + interface ITextArray { + + /** TextArray values */ + values?: (string[]|null); + } + + /** Represents a TextArray. */ + class TextArray implements ITextArray { + + /** + * Constructs a new TextArray. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.ITextArray); + + /** TextArray values. */ + public values: string[]; + + /** + * Creates a new TextArray instance using the specified properties. + * @param [properties] Properties to set + * @returns TextArray instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.ITextArray): google.cloud.contentwarehouse.v1.TextArray; + + /** + * Encodes the specified TextArray message. Does not implicitly {@link google.cloud.contentwarehouse.v1.TextArray.verify|verify} messages. + * @param message TextArray message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.ITextArray, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextArray message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.TextArray.verify|verify} messages. + * @param message TextArray message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.ITextArray, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextArray message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextArray + * @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.cloud.contentwarehouse.v1.TextArray; + + /** + * Decodes a TextArray message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextArray + * @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.cloud.contentwarehouse.v1.TextArray; + + /** + * Verifies a TextArray 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 TextArray message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextArray + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.TextArray; + + /** + * Creates a plain object from a TextArray message. Also converts values to other types if specified. + * @param message TextArray + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.TextArray, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextArray to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextArray + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumArray. */ + interface IEnumArray { + + /** EnumArray values */ + values?: (string[]|null); + } + + /** Represents an EnumArray. */ + class EnumArray implements IEnumArray { + + /** + * Constructs a new EnumArray. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IEnumArray); + + /** EnumArray values. */ + public values: string[]; + + /** + * Creates a new EnumArray instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumArray instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IEnumArray): google.cloud.contentwarehouse.v1.EnumArray; + + /** + * Encodes the specified EnumArray message. Does not implicitly {@link google.cloud.contentwarehouse.v1.EnumArray.verify|verify} messages. + * @param message EnumArray message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IEnumArray, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumArray message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.EnumArray.verify|verify} messages. + * @param message EnumArray message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IEnumArray, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumArray message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumArray + * @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.cloud.contentwarehouse.v1.EnumArray; + + /** + * Decodes an EnumArray message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumArray + * @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.cloud.contentwarehouse.v1.EnumArray; + + /** + * Verifies an EnumArray 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 EnumArray message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumArray + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.EnumArray; + + /** + * Creates a plain object from an EnumArray message. Also converts values to other types if specified. + * @param message EnumArray + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.EnumArray, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumArray to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumArray + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DateTimeArray. */ + interface IDateTimeArray { + + /** DateTimeArray values */ + values?: (google.type.IDateTime[]|null); + } + + /** Represents a DateTimeArray. */ + class DateTimeArray implements IDateTimeArray { + + /** + * Constructs a new DateTimeArray. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IDateTimeArray); + + /** DateTimeArray values. */ + public values: google.type.IDateTime[]; + + /** + * Creates a new DateTimeArray instance using the specified properties. + * @param [properties] Properties to set + * @returns DateTimeArray instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IDateTimeArray): google.cloud.contentwarehouse.v1.DateTimeArray; + + /** + * Encodes the specified DateTimeArray message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DateTimeArray.verify|verify} messages. + * @param message DateTimeArray message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IDateTimeArray, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DateTimeArray message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DateTimeArray.verify|verify} messages. + * @param message DateTimeArray message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IDateTimeArray, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DateTimeArray message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DateTimeArray + * @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.cloud.contentwarehouse.v1.DateTimeArray; + + /** + * Decodes a DateTimeArray message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DateTimeArray + * @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.cloud.contentwarehouse.v1.DateTimeArray; + + /** + * Verifies a DateTimeArray 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 DateTimeArray message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DateTimeArray + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.DateTimeArray; + + /** + * Creates a plain object from a DateTimeArray message. Also converts values to other types if specified. + * @param message DateTimeArray + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.DateTimeArray, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DateTimeArray to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DateTimeArray + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampArray. */ + interface ITimestampArray { + + /** TimestampArray values */ + values?: (google.cloud.contentwarehouse.v1.ITimestampValue[]|null); + } + + /** Represents a TimestampArray. */ + class TimestampArray implements ITimestampArray { + + /** + * Constructs a new TimestampArray. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.ITimestampArray); + + /** TimestampArray values. */ + public values: google.cloud.contentwarehouse.v1.ITimestampValue[]; + + /** + * Creates a new TimestampArray instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampArray instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.ITimestampArray): google.cloud.contentwarehouse.v1.TimestampArray; + + /** + * Encodes the specified TimestampArray message. Does not implicitly {@link google.cloud.contentwarehouse.v1.TimestampArray.verify|verify} messages. + * @param message TimestampArray message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.ITimestampArray, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimestampArray message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.TimestampArray.verify|verify} messages. + * @param message TimestampArray message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.ITimestampArray, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampArray message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimestampArray + * @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.cloud.contentwarehouse.v1.TimestampArray; + + /** + * Decodes a TimestampArray message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimestampArray + * @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.cloud.contentwarehouse.v1.TimestampArray; + + /** + * Verifies a TimestampArray 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 TimestampArray message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimestampArray + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.TimestampArray; + + /** + * Creates a plain object from a TimestampArray message. Also converts values to other types if specified. + * @param message TimestampArray + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.TimestampArray, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimestampArray to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimestampArray + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampValue. */ + interface ITimestampValue { + + /** TimestampValue timestampValue */ + timestampValue?: (google.protobuf.ITimestamp|null); + + /** TimestampValue textValue */ + textValue?: (string|null); + } + + /** Represents a TimestampValue. */ + class TimestampValue implements ITimestampValue { + + /** + * Constructs a new TimestampValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.ITimestampValue); + + /** TimestampValue timestampValue. */ + public timestampValue?: (google.protobuf.ITimestamp|null); + + /** TimestampValue textValue. */ + public textValue?: (string|null); + + /** TimestampValue value. */ + public value?: ("timestampValue"|"textValue"); + + /** + * Creates a new TimestampValue instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampValue instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.ITimestampValue): google.cloud.contentwarehouse.v1.TimestampValue; + + /** + * Encodes the specified TimestampValue message. Does not implicitly {@link google.cloud.contentwarehouse.v1.TimestampValue.verify|verify} messages. + * @param message TimestampValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.ITimestampValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimestampValue message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.TimestampValue.verify|verify} messages. + * @param message TimestampValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.ITimestampValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimestampValue + * @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.cloud.contentwarehouse.v1.TimestampValue; + + /** + * Decodes a TimestampValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimestampValue + * @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.cloud.contentwarehouse.v1.TimestampValue; + + /** + * Verifies a TimestampValue 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 TimestampValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimestampValue + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.TimestampValue; + + /** + * Creates a plain object from a TimestampValue message. Also converts values to other types if specified. + * @param message TimestampValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.TimestampValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimestampValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimestampValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PropertyArray. */ + interface IPropertyArray { + + /** PropertyArray properties */ + properties?: (google.cloud.contentwarehouse.v1.IProperty[]|null); + } + + /** Represents a PropertyArray. */ + class PropertyArray implements IPropertyArray { + + /** + * Constructs a new PropertyArray. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IPropertyArray); + + /** PropertyArray properties. */ + public properties: google.cloud.contentwarehouse.v1.IProperty[]; + + /** + * Creates a new PropertyArray instance using the specified properties. + * @param [properties] Properties to set + * @returns PropertyArray instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IPropertyArray): google.cloud.contentwarehouse.v1.PropertyArray; + + /** + * Encodes the specified PropertyArray message. Does not implicitly {@link google.cloud.contentwarehouse.v1.PropertyArray.verify|verify} messages. + * @param message PropertyArray message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IPropertyArray, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PropertyArray message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.PropertyArray.verify|verify} messages. + * @param message PropertyArray message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IPropertyArray, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PropertyArray message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PropertyArray + * @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.cloud.contentwarehouse.v1.PropertyArray; + + /** + * Decodes a PropertyArray message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PropertyArray + * @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.cloud.contentwarehouse.v1.PropertyArray; + + /** + * Verifies a PropertyArray 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 PropertyArray message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PropertyArray + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.PropertyArray; + + /** + * Creates a plain object from a PropertyArray message. Also converts values to other types if specified. + * @param message PropertyArray + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.PropertyArray, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PropertyArray to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PropertyArray + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MapProperty. */ + interface IMapProperty { + + /** MapProperty fields */ + fields?: ({ [k: string]: google.cloud.contentwarehouse.v1.IValue }|null); + } + + /** Represents a MapProperty. */ + class MapProperty implements IMapProperty { + + /** + * Constructs a new MapProperty. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IMapProperty); + + /** MapProperty fields. */ + public fields: { [k: string]: google.cloud.contentwarehouse.v1.IValue }; + + /** + * Creates a new MapProperty instance using the specified properties. + * @param [properties] Properties to set + * @returns MapProperty instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IMapProperty): google.cloud.contentwarehouse.v1.MapProperty; + + /** + * Encodes the specified MapProperty message. Does not implicitly {@link google.cloud.contentwarehouse.v1.MapProperty.verify|verify} messages. + * @param message MapProperty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IMapProperty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MapProperty message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.MapProperty.verify|verify} messages. + * @param message MapProperty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IMapProperty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MapProperty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MapProperty + * @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.cloud.contentwarehouse.v1.MapProperty; + + /** + * Decodes a MapProperty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MapProperty + * @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.cloud.contentwarehouse.v1.MapProperty; + + /** + * Verifies a MapProperty 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 MapProperty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MapProperty + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.MapProperty; + + /** + * Creates a plain object from a MapProperty message. Also converts values to other types if specified. + * @param message MapProperty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.MapProperty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MapProperty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MapProperty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Value. */ + interface IValue { + + /** Value floatValue */ + floatValue?: (number|null); + + /** Value intValue */ + intValue?: (number|null); + + /** Value stringValue */ + stringValue?: (string|null); + + /** Value enumValue */ + enumValue?: (google.cloud.contentwarehouse.v1.IEnumValue|null); + + /** Value datetimeValue */ + datetimeValue?: (google.type.IDateTime|null); + + /** Value timestampValue */ + timestampValue?: (google.cloud.contentwarehouse.v1.ITimestampValue|null); + + /** Value booleanValue */ + booleanValue?: (boolean|null); + } + + /** Represents a Value. */ + class Value implements IValue { + + /** + * Constructs a new Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IValue); + + /** Value floatValue. */ + public floatValue?: (number|null); + + /** Value intValue. */ + public intValue?: (number|null); + + /** Value stringValue. */ + public stringValue?: (string|null); + + /** Value enumValue. */ + public enumValue?: (google.cloud.contentwarehouse.v1.IEnumValue|null); + + /** Value datetimeValue. */ + public datetimeValue?: (google.type.IDateTime|null); + + /** Value timestampValue. */ + public timestampValue?: (google.cloud.contentwarehouse.v1.ITimestampValue|null); + + /** Value booleanValue. */ + public booleanValue?: (boolean|null); + + /** Value kind. */ + public kind?: ("floatValue"|"intValue"|"stringValue"|"enumValue"|"datetimeValue"|"timestampValue"|"booleanValue"); + + /** + * Creates a new Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Value instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IValue): google.cloud.contentwarehouse.v1.Value; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.cloud.contentwarehouse.v1.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.cloud.contentwarehouse.v1.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.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.cloud.contentwarehouse.v1.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.cloud.contentwarehouse.v1.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.cloud.contentwarehouse.v1.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.cloud.contentwarehouse.v1.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.cloud.contentwarehouse.v1.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumValue. */ + interface IEnumValue { + + /** EnumValue value */ + value?: (string|null); + } + + /** Represents an EnumValue. */ + class EnumValue implements IEnumValue { + + /** + * Constructs a new EnumValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IEnumValue); + + /** EnumValue value. */ + public value: string; + + /** + * Creates a new EnumValue instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValue instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IEnumValue): google.cloud.contentwarehouse.v1.EnumValue; + + /** + * Encodes the specified EnumValue message. Does not implicitly {@link google.cloud.contentwarehouse.v1.EnumValue.verify|verify} messages. + * @param message EnumValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IEnumValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValue message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.EnumValue.verify|verify} messages. + * @param message EnumValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IEnumValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValue + * @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.cloud.contentwarehouse.v1.EnumValue; + + /** + * Decodes an EnumValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValue + * @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.cloud.contentwarehouse.v1.EnumValue; + + /** + * Verifies an EnumValue 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 EnumValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValue + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.EnumValue; + + /** + * Creates a plain object from an EnumValue message. Also converts values to other types if specified. + * @param message EnumValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.EnumValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** RawDocumentFileType enum. */ + enum RawDocumentFileType { + RAW_DOCUMENT_FILE_TYPE_UNSPECIFIED = 0, + RAW_DOCUMENT_FILE_TYPE_PDF = 1, + RAW_DOCUMENT_FILE_TYPE_DOCX = 2, + RAW_DOCUMENT_FILE_TYPE_XLSX = 3, + RAW_DOCUMENT_FILE_TYPE_PPTX = 4, + RAW_DOCUMENT_FILE_TYPE_TEXT = 5, + RAW_DOCUMENT_FILE_TYPE_TIFF = 6 + } + + /** ContentCategory enum. */ + enum ContentCategory { + CONTENT_CATEGORY_UNSPECIFIED = 0, + CONTENT_CATEGORY_IMAGE = 1, + CONTENT_CATEGORY_AUDIO = 2, + CONTENT_CATEGORY_VIDEO = 3 + } + + /** Represents a DocumentLinkService */ + class DocumentLinkService extends $protobuf.rpc.Service { + + /** + * Constructs a new DocumentLinkService 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 DocumentLinkService 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): DocumentLinkService; + + /** + * Calls ListLinkedTargets. + * @param request ListLinkedTargetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListLinkedTargetsResponse + */ + public listLinkedTargets(request: google.cloud.contentwarehouse.v1.IListLinkedTargetsRequest, callback: google.cloud.contentwarehouse.v1.DocumentLinkService.ListLinkedTargetsCallback): void; + + /** + * Calls ListLinkedTargets. + * @param request ListLinkedTargetsRequest message or plain object + * @returns Promise + */ + public listLinkedTargets(request: google.cloud.contentwarehouse.v1.IListLinkedTargetsRequest): Promise; + + /** + * Calls ListLinkedSources. + * @param request ListLinkedSourcesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListLinkedSourcesResponse + */ + public listLinkedSources(request: google.cloud.contentwarehouse.v1.IListLinkedSourcesRequest, callback: google.cloud.contentwarehouse.v1.DocumentLinkService.ListLinkedSourcesCallback): void; + + /** + * Calls ListLinkedSources. + * @param request ListLinkedSourcesRequest message or plain object + * @returns Promise + */ + public listLinkedSources(request: google.cloud.contentwarehouse.v1.IListLinkedSourcesRequest): Promise; + + /** + * Calls CreateDocumentLink. + * @param request CreateDocumentLinkRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DocumentLink + */ + public createDocumentLink(request: google.cloud.contentwarehouse.v1.ICreateDocumentLinkRequest, callback: google.cloud.contentwarehouse.v1.DocumentLinkService.CreateDocumentLinkCallback): void; + + /** + * Calls CreateDocumentLink. + * @param request CreateDocumentLinkRequest message or plain object + * @returns Promise + */ + public createDocumentLink(request: google.cloud.contentwarehouse.v1.ICreateDocumentLinkRequest): Promise; + + /** + * Calls DeleteDocumentLink. + * @param request DeleteDocumentLinkRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteDocumentLink(request: google.cloud.contentwarehouse.v1.IDeleteDocumentLinkRequest, callback: google.cloud.contentwarehouse.v1.DocumentLinkService.DeleteDocumentLinkCallback): void; + + /** + * Calls DeleteDocumentLink. + * @param request DeleteDocumentLinkRequest message or plain object + * @returns Promise + */ + public deleteDocumentLink(request: google.cloud.contentwarehouse.v1.IDeleteDocumentLinkRequest): Promise; + } + + namespace DocumentLinkService { + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentLinkService|listLinkedTargets}. + * @param error Error, if any + * @param [response] ListLinkedTargetsResponse + */ + type ListLinkedTargetsCallback = (error: (Error|null), response?: google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse) => void; + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentLinkService|listLinkedSources}. + * @param error Error, if any + * @param [response] ListLinkedSourcesResponse + */ + type ListLinkedSourcesCallback = (error: (Error|null), response?: google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse) => void; + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentLinkService|createDocumentLink}. + * @param error Error, if any + * @param [response] DocumentLink + */ + type CreateDocumentLinkCallback = (error: (Error|null), response?: google.cloud.contentwarehouse.v1.DocumentLink) => void; + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentLinkService|deleteDocumentLink}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteDocumentLinkCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a ListLinkedTargetsResponse. */ + interface IListLinkedTargetsResponse { + + /** ListLinkedTargetsResponse documentLinks */ + documentLinks?: (google.cloud.contentwarehouse.v1.IDocumentLink[]|null); + + /** ListLinkedTargetsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListLinkedTargetsResponse. */ + class ListLinkedTargetsResponse implements IListLinkedTargetsResponse { + + /** + * Constructs a new ListLinkedTargetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IListLinkedTargetsResponse); + + /** ListLinkedTargetsResponse documentLinks. */ + public documentLinks: google.cloud.contentwarehouse.v1.IDocumentLink[]; + + /** ListLinkedTargetsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListLinkedTargetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListLinkedTargetsResponse instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IListLinkedTargetsResponse): google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse; + + /** + * Encodes the specified ListLinkedTargetsResponse message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse.verify|verify} messages. + * @param message ListLinkedTargetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IListLinkedTargetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListLinkedTargetsResponse message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse.verify|verify} messages. + * @param message ListLinkedTargetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IListLinkedTargetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListLinkedTargetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListLinkedTargetsResponse + * @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.cloud.contentwarehouse.v1.ListLinkedTargetsResponse; + + /** + * Decodes a ListLinkedTargetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListLinkedTargetsResponse + * @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.cloud.contentwarehouse.v1.ListLinkedTargetsResponse; + + /** + * Verifies a ListLinkedTargetsResponse 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 ListLinkedTargetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListLinkedTargetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse; + + /** + * Creates a plain object from a ListLinkedTargetsResponse message. Also converts values to other types if specified. + * @param message ListLinkedTargetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListLinkedTargetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListLinkedTargetsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListLinkedTargetsRequest. */ + interface IListLinkedTargetsRequest { + + /** ListLinkedTargetsRequest parent */ + parent?: (string|null); + + /** ListLinkedTargetsRequest requestMetadata */ + requestMetadata?: (google.cloud.contentwarehouse.v1.IRequestMetadata|null); + } + + /** Represents a ListLinkedTargetsRequest. */ + class ListLinkedTargetsRequest implements IListLinkedTargetsRequest { + + /** + * Constructs a new ListLinkedTargetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IListLinkedTargetsRequest); + + /** ListLinkedTargetsRequest parent. */ + public parent: string; + + /** ListLinkedTargetsRequest requestMetadata. */ + public requestMetadata?: (google.cloud.contentwarehouse.v1.IRequestMetadata|null); + + /** + * Creates a new ListLinkedTargetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListLinkedTargetsRequest instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IListLinkedTargetsRequest): google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest; + + /** + * Encodes the specified ListLinkedTargetsRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest.verify|verify} messages. + * @param message ListLinkedTargetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IListLinkedTargetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListLinkedTargetsRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest.verify|verify} messages. + * @param message ListLinkedTargetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IListLinkedTargetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListLinkedTargetsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListLinkedTargetsRequest + * @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.cloud.contentwarehouse.v1.ListLinkedTargetsRequest; + + /** + * Decodes a ListLinkedTargetsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListLinkedTargetsRequest + * @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.cloud.contentwarehouse.v1.ListLinkedTargetsRequest; + + /** + * Verifies a ListLinkedTargetsRequest 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 ListLinkedTargetsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListLinkedTargetsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest; + + /** + * Creates a plain object from a ListLinkedTargetsRequest message. Also converts values to other types if specified. + * @param message ListLinkedTargetsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListLinkedTargetsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListLinkedTargetsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListLinkedSourcesResponse. */ + interface IListLinkedSourcesResponse { + + /** ListLinkedSourcesResponse documentLinks */ + documentLinks?: (google.cloud.contentwarehouse.v1.IDocumentLink[]|null); + + /** ListLinkedSourcesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListLinkedSourcesResponse. */ + class ListLinkedSourcesResponse implements IListLinkedSourcesResponse { + + /** + * Constructs a new ListLinkedSourcesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IListLinkedSourcesResponse); + + /** ListLinkedSourcesResponse documentLinks. */ + public documentLinks: google.cloud.contentwarehouse.v1.IDocumentLink[]; + + /** ListLinkedSourcesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListLinkedSourcesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListLinkedSourcesResponse instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IListLinkedSourcesResponse): google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse; + + /** + * Encodes the specified ListLinkedSourcesResponse message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse.verify|verify} messages. + * @param message ListLinkedSourcesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IListLinkedSourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListLinkedSourcesResponse message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse.verify|verify} messages. + * @param message ListLinkedSourcesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IListLinkedSourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListLinkedSourcesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListLinkedSourcesResponse + * @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.cloud.contentwarehouse.v1.ListLinkedSourcesResponse; + + /** + * Decodes a ListLinkedSourcesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListLinkedSourcesResponse + * @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.cloud.contentwarehouse.v1.ListLinkedSourcesResponse; + + /** + * Verifies a ListLinkedSourcesResponse 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 ListLinkedSourcesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListLinkedSourcesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse; + + /** + * Creates a plain object from a ListLinkedSourcesResponse message. Also converts values to other types if specified. + * @param message ListLinkedSourcesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListLinkedSourcesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListLinkedSourcesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListLinkedSourcesRequest. */ + interface IListLinkedSourcesRequest { + + /** ListLinkedSourcesRequest parent */ + parent?: (string|null); + + /** ListLinkedSourcesRequest pageSize */ + pageSize?: (number|null); + + /** ListLinkedSourcesRequest pageToken */ + pageToken?: (string|null); + + /** ListLinkedSourcesRequest requestMetadata */ + requestMetadata?: (google.cloud.contentwarehouse.v1.IRequestMetadata|null); + } + + /** Represents a ListLinkedSourcesRequest. */ + class ListLinkedSourcesRequest implements IListLinkedSourcesRequest { + + /** + * Constructs a new ListLinkedSourcesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IListLinkedSourcesRequest); + + /** ListLinkedSourcesRequest parent. */ + public parent: string; + + /** ListLinkedSourcesRequest pageSize. */ + public pageSize: number; + + /** ListLinkedSourcesRequest pageToken. */ + public pageToken: string; + + /** ListLinkedSourcesRequest requestMetadata. */ + public requestMetadata?: (google.cloud.contentwarehouse.v1.IRequestMetadata|null); + + /** + * Creates a new ListLinkedSourcesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListLinkedSourcesRequest instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IListLinkedSourcesRequest): google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest; + + /** + * Encodes the specified ListLinkedSourcesRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest.verify|verify} messages. + * @param message ListLinkedSourcesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IListLinkedSourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListLinkedSourcesRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest.verify|verify} messages. + * @param message ListLinkedSourcesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IListLinkedSourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListLinkedSourcesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListLinkedSourcesRequest + * @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.cloud.contentwarehouse.v1.ListLinkedSourcesRequest; + + /** + * Decodes a ListLinkedSourcesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListLinkedSourcesRequest + * @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.cloud.contentwarehouse.v1.ListLinkedSourcesRequest; + + /** + * Verifies a ListLinkedSourcesRequest 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 ListLinkedSourcesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListLinkedSourcesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest; + + /** + * Creates a plain object from a ListLinkedSourcesRequest message. Also converts values to other types if specified. + * @param message ListLinkedSourcesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListLinkedSourcesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListLinkedSourcesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DocumentLink. */ + interface IDocumentLink { + + /** DocumentLink name */ + name?: (string|null); + + /** DocumentLink sourceDocumentReference */ + sourceDocumentReference?: (google.cloud.contentwarehouse.v1.IDocumentReference|null); + + /** DocumentLink targetDocumentReference */ + targetDocumentReference?: (google.cloud.contentwarehouse.v1.IDocumentReference|null); + + /** DocumentLink description */ + description?: (string|null); + + /** DocumentLink updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** DocumentLink createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** DocumentLink state */ + state?: (google.cloud.contentwarehouse.v1.DocumentLink.State|keyof typeof google.cloud.contentwarehouse.v1.DocumentLink.State|null); + } + + /** Represents a DocumentLink. */ + class DocumentLink implements IDocumentLink { + + /** + * Constructs a new DocumentLink. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IDocumentLink); + + /** DocumentLink name. */ + public name: string; + + /** DocumentLink sourceDocumentReference. */ + public sourceDocumentReference?: (google.cloud.contentwarehouse.v1.IDocumentReference|null); + + /** DocumentLink targetDocumentReference. */ + public targetDocumentReference?: (google.cloud.contentwarehouse.v1.IDocumentReference|null); + + /** DocumentLink description. */ + public description: string; + + /** DocumentLink updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** DocumentLink createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** DocumentLink state. */ + public state: (google.cloud.contentwarehouse.v1.DocumentLink.State|keyof typeof google.cloud.contentwarehouse.v1.DocumentLink.State); + + /** + * Creates a new DocumentLink instance using the specified properties. + * @param [properties] Properties to set + * @returns DocumentLink instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IDocumentLink): google.cloud.contentwarehouse.v1.DocumentLink; + + /** + * Encodes the specified DocumentLink message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DocumentLink.verify|verify} messages. + * @param message DocumentLink message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IDocumentLink, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DocumentLink message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DocumentLink.verify|verify} messages. + * @param message DocumentLink message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IDocumentLink, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DocumentLink message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DocumentLink + * @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.cloud.contentwarehouse.v1.DocumentLink; + + /** + * Decodes a DocumentLink message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DocumentLink + * @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.cloud.contentwarehouse.v1.DocumentLink; + + /** + * Verifies a DocumentLink 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 DocumentLink message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DocumentLink + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.DocumentLink; + + /** + * Creates a plain object from a DocumentLink message. Also converts values to other types if specified. + * @param message DocumentLink + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.DocumentLink, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DocumentLink to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DocumentLink + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DocumentLink { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + SOFT_DELETED = 2 + } + } + + /** Properties of a CreateDocumentLinkRequest. */ + interface ICreateDocumentLinkRequest { + + /** CreateDocumentLinkRequest parent */ + parent?: (string|null); + + /** CreateDocumentLinkRequest documentLink */ + documentLink?: (google.cloud.contentwarehouse.v1.IDocumentLink|null); + + /** CreateDocumentLinkRequest requestMetadata */ + requestMetadata?: (google.cloud.contentwarehouse.v1.IRequestMetadata|null); + } + + /** Represents a CreateDocumentLinkRequest. */ + class CreateDocumentLinkRequest implements ICreateDocumentLinkRequest { + + /** + * Constructs a new CreateDocumentLinkRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.ICreateDocumentLinkRequest); + + /** CreateDocumentLinkRequest parent. */ + public parent: string; + + /** CreateDocumentLinkRequest documentLink. */ + public documentLink?: (google.cloud.contentwarehouse.v1.IDocumentLink|null); + + /** CreateDocumentLinkRequest requestMetadata. */ + public requestMetadata?: (google.cloud.contentwarehouse.v1.IRequestMetadata|null); + + /** + * Creates a new CreateDocumentLinkRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateDocumentLinkRequest instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.ICreateDocumentLinkRequest): google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest; + + /** + * Encodes the specified CreateDocumentLinkRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest.verify|verify} messages. + * @param message CreateDocumentLinkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.ICreateDocumentLinkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateDocumentLinkRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest.verify|verify} messages. + * @param message CreateDocumentLinkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.ICreateDocumentLinkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateDocumentLinkRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateDocumentLinkRequest + * @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.cloud.contentwarehouse.v1.CreateDocumentLinkRequest; + + /** + * Decodes a CreateDocumentLinkRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateDocumentLinkRequest + * @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.cloud.contentwarehouse.v1.CreateDocumentLinkRequest; + + /** + * Verifies a CreateDocumentLinkRequest 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 CreateDocumentLinkRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateDocumentLinkRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest; + + /** + * Creates a plain object from a CreateDocumentLinkRequest message. Also converts values to other types if specified. + * @param message CreateDocumentLinkRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateDocumentLinkRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateDocumentLinkRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteDocumentLinkRequest. */ + interface IDeleteDocumentLinkRequest { + + /** DeleteDocumentLinkRequest name */ + name?: (string|null); + + /** DeleteDocumentLinkRequest requestMetadata */ + requestMetadata?: (google.cloud.contentwarehouse.v1.IRequestMetadata|null); + } + + /** Represents a DeleteDocumentLinkRequest. */ + class DeleteDocumentLinkRequest implements IDeleteDocumentLinkRequest { + + /** + * Constructs a new DeleteDocumentLinkRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IDeleteDocumentLinkRequest); + + /** DeleteDocumentLinkRequest name. */ + public name: string; + + /** DeleteDocumentLinkRequest requestMetadata. */ + public requestMetadata?: (google.cloud.contentwarehouse.v1.IRequestMetadata|null); + + /** + * Creates a new DeleteDocumentLinkRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteDocumentLinkRequest instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IDeleteDocumentLinkRequest): google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest; + + /** + * Encodes the specified DeleteDocumentLinkRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest.verify|verify} messages. + * @param message DeleteDocumentLinkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IDeleteDocumentLinkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteDocumentLinkRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest.verify|verify} messages. + * @param message DeleteDocumentLinkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IDeleteDocumentLinkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteDocumentLinkRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteDocumentLinkRequest + * @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.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest; + + /** + * Decodes a DeleteDocumentLinkRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteDocumentLinkRequest + * @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.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest; + + /** + * Verifies a DeleteDocumentLinkRequest 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 DeleteDocumentLinkRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteDocumentLinkRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest; + + /** + * Creates a plain object from a DeleteDocumentLinkRequest message. Also converts values to other types if specified. + * @param message DeleteDocumentLinkRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteDocumentLinkRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteDocumentLinkRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DocumentSchema. */ + interface IDocumentSchema { + + /** DocumentSchema name */ + name?: (string|null); + + /** DocumentSchema displayName */ + displayName?: (string|null); + + /** DocumentSchema propertyDefinitions */ + propertyDefinitions?: (google.cloud.contentwarehouse.v1.IPropertyDefinition[]|null); + + /** DocumentSchema documentIsFolder */ + documentIsFolder?: (boolean|null); + + /** DocumentSchema updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** DocumentSchema createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** DocumentSchema description */ + description?: (string|null); + } + + /** Represents a DocumentSchema. */ + class DocumentSchema implements IDocumentSchema { + + /** + * Constructs a new DocumentSchema. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IDocumentSchema); + + /** DocumentSchema name. */ + public name: string; + + /** DocumentSchema displayName. */ + public displayName: string; + + /** DocumentSchema propertyDefinitions. */ + public propertyDefinitions: google.cloud.contentwarehouse.v1.IPropertyDefinition[]; + + /** DocumentSchema documentIsFolder. */ + public documentIsFolder: boolean; + + /** DocumentSchema updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** DocumentSchema createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** DocumentSchema description. */ + public description: string; + + /** + * Creates a new DocumentSchema instance using the specified properties. + * @param [properties] Properties to set + * @returns DocumentSchema instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IDocumentSchema): google.cloud.contentwarehouse.v1.DocumentSchema; + + /** + * Encodes the specified DocumentSchema message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DocumentSchema.verify|verify} messages. + * @param message DocumentSchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IDocumentSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DocumentSchema message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DocumentSchema.verify|verify} messages. + * @param message DocumentSchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IDocumentSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DocumentSchema message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DocumentSchema + * @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.cloud.contentwarehouse.v1.DocumentSchema; + + /** + * Decodes a DocumentSchema message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DocumentSchema + * @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.cloud.contentwarehouse.v1.DocumentSchema; + + /** + * Verifies a DocumentSchema 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 DocumentSchema message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DocumentSchema + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.DocumentSchema; + + /** + * Creates a plain object from a DocumentSchema message. Also converts values to other types if specified. + * @param message DocumentSchema + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.DocumentSchema, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DocumentSchema to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DocumentSchema + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PropertyDefinition. */ + interface IPropertyDefinition { + + /** PropertyDefinition name */ + name?: (string|null); + + /** PropertyDefinition displayName */ + displayName?: (string|null); + + /** PropertyDefinition isRepeatable */ + isRepeatable?: (boolean|null); + + /** PropertyDefinition isFilterable */ + isFilterable?: (boolean|null); + + /** PropertyDefinition isSearchable */ + isSearchable?: (boolean|null); + + /** PropertyDefinition isMetadata */ + isMetadata?: (boolean|null); + + /** PropertyDefinition isRequired */ + isRequired?: (boolean|null); + + /** PropertyDefinition retrievalImportance */ + retrievalImportance?: (google.cloud.contentwarehouse.v1.PropertyDefinition.RetrievalImportance|keyof typeof google.cloud.contentwarehouse.v1.PropertyDefinition.RetrievalImportance|null); + + /** PropertyDefinition integerTypeOptions */ + integerTypeOptions?: (google.cloud.contentwarehouse.v1.IIntegerTypeOptions|null); + + /** PropertyDefinition floatTypeOptions */ + floatTypeOptions?: (google.cloud.contentwarehouse.v1.IFloatTypeOptions|null); + + /** PropertyDefinition textTypeOptions */ + textTypeOptions?: (google.cloud.contentwarehouse.v1.ITextTypeOptions|null); + + /** PropertyDefinition propertyTypeOptions */ + propertyTypeOptions?: (google.cloud.contentwarehouse.v1.IPropertyTypeOptions|null); + + /** PropertyDefinition enumTypeOptions */ + enumTypeOptions?: (google.cloud.contentwarehouse.v1.IEnumTypeOptions|null); + + /** PropertyDefinition dateTimeTypeOptions */ + dateTimeTypeOptions?: (google.cloud.contentwarehouse.v1.IDateTimeTypeOptions|null); + + /** PropertyDefinition mapTypeOptions */ + mapTypeOptions?: (google.cloud.contentwarehouse.v1.IMapTypeOptions|null); + + /** PropertyDefinition timestampTypeOptions */ + timestampTypeOptions?: (google.cloud.contentwarehouse.v1.ITimestampTypeOptions|null); + + /** PropertyDefinition schemaSources */ + schemaSources?: (google.cloud.contentwarehouse.v1.PropertyDefinition.ISchemaSource[]|null); + } + + /** Represents a PropertyDefinition. */ + class PropertyDefinition implements IPropertyDefinition { + + /** + * Constructs a new PropertyDefinition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IPropertyDefinition); + + /** PropertyDefinition name. */ + public name: string; + + /** PropertyDefinition displayName. */ + public displayName: string; + + /** PropertyDefinition isRepeatable. */ + public isRepeatable: boolean; + + /** PropertyDefinition isFilterable. */ + public isFilterable: boolean; + + /** PropertyDefinition isSearchable. */ + public isSearchable: boolean; + + /** PropertyDefinition isMetadata. */ + public isMetadata: boolean; + + /** PropertyDefinition isRequired. */ + public isRequired: boolean; + + /** PropertyDefinition retrievalImportance. */ + public retrievalImportance: (google.cloud.contentwarehouse.v1.PropertyDefinition.RetrievalImportance|keyof typeof google.cloud.contentwarehouse.v1.PropertyDefinition.RetrievalImportance); + + /** PropertyDefinition integerTypeOptions. */ + public integerTypeOptions?: (google.cloud.contentwarehouse.v1.IIntegerTypeOptions|null); + + /** PropertyDefinition floatTypeOptions. */ + public floatTypeOptions?: (google.cloud.contentwarehouse.v1.IFloatTypeOptions|null); + + /** PropertyDefinition textTypeOptions. */ + public textTypeOptions?: (google.cloud.contentwarehouse.v1.ITextTypeOptions|null); + + /** PropertyDefinition propertyTypeOptions. */ + public propertyTypeOptions?: (google.cloud.contentwarehouse.v1.IPropertyTypeOptions|null); + + /** PropertyDefinition enumTypeOptions. */ + public enumTypeOptions?: (google.cloud.contentwarehouse.v1.IEnumTypeOptions|null); + + /** PropertyDefinition dateTimeTypeOptions. */ + public dateTimeTypeOptions?: (google.cloud.contentwarehouse.v1.IDateTimeTypeOptions|null); + + /** PropertyDefinition mapTypeOptions. */ + public mapTypeOptions?: (google.cloud.contentwarehouse.v1.IMapTypeOptions|null); + + /** PropertyDefinition timestampTypeOptions. */ + public timestampTypeOptions?: (google.cloud.contentwarehouse.v1.ITimestampTypeOptions|null); + + /** PropertyDefinition schemaSources. */ + public schemaSources: google.cloud.contentwarehouse.v1.PropertyDefinition.ISchemaSource[]; + + /** PropertyDefinition valueTypeOptions. */ + public valueTypeOptions?: ("integerTypeOptions"|"floatTypeOptions"|"textTypeOptions"|"propertyTypeOptions"|"enumTypeOptions"|"dateTimeTypeOptions"|"mapTypeOptions"|"timestampTypeOptions"); + + /** + * Creates a new PropertyDefinition instance using the specified properties. + * @param [properties] Properties to set + * @returns PropertyDefinition instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IPropertyDefinition): google.cloud.contentwarehouse.v1.PropertyDefinition; + + /** + * Encodes the specified PropertyDefinition message. Does not implicitly {@link google.cloud.contentwarehouse.v1.PropertyDefinition.verify|verify} messages. + * @param message PropertyDefinition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IPropertyDefinition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PropertyDefinition message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.PropertyDefinition.verify|verify} messages. + * @param message PropertyDefinition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IPropertyDefinition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PropertyDefinition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PropertyDefinition + * @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.cloud.contentwarehouse.v1.PropertyDefinition; + + /** + * Decodes a PropertyDefinition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PropertyDefinition + * @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.cloud.contentwarehouse.v1.PropertyDefinition; + + /** + * Verifies a PropertyDefinition 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 PropertyDefinition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PropertyDefinition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.PropertyDefinition; + + /** + * Creates a plain object from a PropertyDefinition message. Also converts values to other types if specified. + * @param message PropertyDefinition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.PropertyDefinition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PropertyDefinition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PropertyDefinition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PropertyDefinition { + + /** RetrievalImportance enum. */ + enum RetrievalImportance { + RETRIEVAL_IMPORTANCE_UNSPECIFIED = 0, + HIGHEST = 1, + HIGHER = 2, + HIGH = 3, + MEDIUM = 4, + LOW = 5, + LOWEST = 6 + } + + /** Properties of a SchemaSource. */ + interface ISchemaSource { + + /** SchemaSource name */ + name?: (string|null); + + /** SchemaSource processorType */ + processorType?: (string|null); + } + + /** Represents a SchemaSource. */ + class SchemaSource implements ISchemaSource { + + /** + * Constructs a new SchemaSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.PropertyDefinition.ISchemaSource); + + /** SchemaSource name. */ + public name: string; + + /** SchemaSource processorType. */ + public processorType: string; + + /** + * Creates a new SchemaSource instance using the specified properties. + * @param [properties] Properties to set + * @returns SchemaSource instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.PropertyDefinition.ISchemaSource): google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource; + + /** + * Encodes the specified SchemaSource message. Does not implicitly {@link google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource.verify|verify} messages. + * @param message SchemaSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.PropertyDefinition.ISchemaSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SchemaSource message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource.verify|verify} messages. + * @param message SchemaSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.PropertyDefinition.ISchemaSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SchemaSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SchemaSource + * @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.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource; + + /** + * Decodes a SchemaSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SchemaSource + * @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.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource; + + /** + * Verifies a SchemaSource 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 SchemaSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SchemaSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource; + + /** + * Creates a plain object from a SchemaSource message. Also converts values to other types if specified. + * @param message SchemaSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SchemaSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SchemaSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an IntegerTypeOptions. */ + interface IIntegerTypeOptions { + } + + /** Represents an IntegerTypeOptions. */ + class IntegerTypeOptions implements IIntegerTypeOptions { + + /** + * Constructs a new IntegerTypeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IIntegerTypeOptions); + + /** + * Creates a new IntegerTypeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns IntegerTypeOptions instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IIntegerTypeOptions): google.cloud.contentwarehouse.v1.IntegerTypeOptions; + + /** + * Encodes the specified IntegerTypeOptions message. Does not implicitly {@link google.cloud.contentwarehouse.v1.IntegerTypeOptions.verify|verify} messages. + * @param message IntegerTypeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IIntegerTypeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IntegerTypeOptions message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.IntegerTypeOptions.verify|verify} messages. + * @param message IntegerTypeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IIntegerTypeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IntegerTypeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IntegerTypeOptions + * @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.cloud.contentwarehouse.v1.IntegerTypeOptions; + + /** + * Decodes an IntegerTypeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IntegerTypeOptions + * @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.cloud.contentwarehouse.v1.IntegerTypeOptions; + + /** + * Verifies an IntegerTypeOptions 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 IntegerTypeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IntegerTypeOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.IntegerTypeOptions; + + /** + * Creates a plain object from an IntegerTypeOptions message. Also converts values to other types if specified. + * @param message IntegerTypeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.IntegerTypeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IntegerTypeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IntegerTypeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatTypeOptions. */ + interface IFloatTypeOptions { + } + + /** Represents a FloatTypeOptions. */ + class FloatTypeOptions implements IFloatTypeOptions { + + /** + * Constructs a new FloatTypeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IFloatTypeOptions); + + /** + * Creates a new FloatTypeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatTypeOptions instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IFloatTypeOptions): google.cloud.contentwarehouse.v1.FloatTypeOptions; + + /** + * Encodes the specified FloatTypeOptions message. Does not implicitly {@link google.cloud.contentwarehouse.v1.FloatTypeOptions.verify|verify} messages. + * @param message FloatTypeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IFloatTypeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FloatTypeOptions message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.FloatTypeOptions.verify|verify} messages. + * @param message FloatTypeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IFloatTypeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatTypeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FloatTypeOptions + * @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.cloud.contentwarehouse.v1.FloatTypeOptions; + + /** + * Decodes a FloatTypeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FloatTypeOptions + * @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.cloud.contentwarehouse.v1.FloatTypeOptions; + + /** + * Verifies a FloatTypeOptions 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 FloatTypeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FloatTypeOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.FloatTypeOptions; + + /** + * Creates a plain object from a FloatTypeOptions message. Also converts values to other types if specified. + * @param message FloatTypeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.FloatTypeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FloatTypeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FloatTypeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextTypeOptions. */ + interface ITextTypeOptions { + } + + /** Represents a TextTypeOptions. */ + class TextTypeOptions implements ITextTypeOptions { + + /** + * Constructs a new TextTypeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.ITextTypeOptions); + + /** + * Creates a new TextTypeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns TextTypeOptions instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.ITextTypeOptions): google.cloud.contentwarehouse.v1.TextTypeOptions; + + /** + * Encodes the specified TextTypeOptions message. Does not implicitly {@link google.cloud.contentwarehouse.v1.TextTypeOptions.verify|verify} messages. + * @param message TextTypeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.ITextTypeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextTypeOptions message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.TextTypeOptions.verify|verify} messages. + * @param message TextTypeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.ITextTypeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextTypeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextTypeOptions + * @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.cloud.contentwarehouse.v1.TextTypeOptions; + + /** + * Decodes a TextTypeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextTypeOptions + * @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.cloud.contentwarehouse.v1.TextTypeOptions; + + /** + * Verifies a TextTypeOptions 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 TextTypeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextTypeOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.TextTypeOptions; + + /** + * Creates a plain object from a TextTypeOptions message. Also converts values to other types if specified. + * @param message TextTypeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.TextTypeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextTypeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextTypeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DateTimeTypeOptions. */ + interface IDateTimeTypeOptions { + } + + /** Represents a DateTimeTypeOptions. */ + class DateTimeTypeOptions implements IDateTimeTypeOptions { + + /** + * Constructs a new DateTimeTypeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IDateTimeTypeOptions); + + /** + * Creates a new DateTimeTypeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns DateTimeTypeOptions instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IDateTimeTypeOptions): google.cloud.contentwarehouse.v1.DateTimeTypeOptions; + + /** + * Encodes the specified DateTimeTypeOptions message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DateTimeTypeOptions.verify|verify} messages. + * @param message DateTimeTypeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IDateTimeTypeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DateTimeTypeOptions message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DateTimeTypeOptions.verify|verify} messages. + * @param message DateTimeTypeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IDateTimeTypeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DateTimeTypeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DateTimeTypeOptions + * @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.cloud.contentwarehouse.v1.DateTimeTypeOptions; + + /** + * Decodes a DateTimeTypeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DateTimeTypeOptions + * @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.cloud.contentwarehouse.v1.DateTimeTypeOptions; + + /** + * Verifies a DateTimeTypeOptions 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 DateTimeTypeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DateTimeTypeOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.DateTimeTypeOptions; + + /** + * Creates a plain object from a DateTimeTypeOptions message. Also converts values to other types if specified. + * @param message DateTimeTypeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.DateTimeTypeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DateTimeTypeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DateTimeTypeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MapTypeOptions. */ + interface IMapTypeOptions { + } + + /** Represents a MapTypeOptions. */ + class MapTypeOptions implements IMapTypeOptions { + + /** + * Constructs a new MapTypeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IMapTypeOptions); + + /** + * Creates a new MapTypeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MapTypeOptions instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IMapTypeOptions): google.cloud.contentwarehouse.v1.MapTypeOptions; + + /** + * Encodes the specified MapTypeOptions message. Does not implicitly {@link google.cloud.contentwarehouse.v1.MapTypeOptions.verify|verify} messages. + * @param message MapTypeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IMapTypeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MapTypeOptions message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.MapTypeOptions.verify|verify} messages. + * @param message MapTypeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IMapTypeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MapTypeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MapTypeOptions + * @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.cloud.contentwarehouse.v1.MapTypeOptions; + + /** + * Decodes a MapTypeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MapTypeOptions + * @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.cloud.contentwarehouse.v1.MapTypeOptions; + + /** + * Verifies a MapTypeOptions 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 MapTypeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MapTypeOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.MapTypeOptions; + + /** + * Creates a plain object from a MapTypeOptions message. Also converts values to other types if specified. + * @param message MapTypeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.MapTypeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MapTypeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MapTypeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampTypeOptions. */ + interface ITimestampTypeOptions { + } + + /** Represents a TimestampTypeOptions. */ + class TimestampTypeOptions implements ITimestampTypeOptions { + + /** + * Constructs a new TimestampTypeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.ITimestampTypeOptions); + + /** + * Creates a new TimestampTypeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampTypeOptions instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.ITimestampTypeOptions): google.cloud.contentwarehouse.v1.TimestampTypeOptions; + + /** + * Encodes the specified TimestampTypeOptions message. Does not implicitly {@link google.cloud.contentwarehouse.v1.TimestampTypeOptions.verify|verify} messages. + * @param message TimestampTypeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.ITimestampTypeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimestampTypeOptions message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.TimestampTypeOptions.verify|verify} messages. + * @param message TimestampTypeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.ITimestampTypeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampTypeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimestampTypeOptions + * @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.cloud.contentwarehouse.v1.TimestampTypeOptions; + + /** + * Decodes a TimestampTypeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimestampTypeOptions + * @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.cloud.contentwarehouse.v1.TimestampTypeOptions; + + /** + * Verifies a TimestampTypeOptions 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 TimestampTypeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimestampTypeOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.TimestampTypeOptions; + + /** + * Creates a plain object from a TimestampTypeOptions message. Also converts values to other types if specified. + * @param message TimestampTypeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.TimestampTypeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimestampTypeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimestampTypeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PropertyTypeOptions. */ + interface IPropertyTypeOptions { + + /** PropertyTypeOptions propertyDefinitions */ + propertyDefinitions?: (google.cloud.contentwarehouse.v1.IPropertyDefinition[]|null); + } + + /** Represents a PropertyTypeOptions. */ + class PropertyTypeOptions implements IPropertyTypeOptions { + + /** + * Constructs a new PropertyTypeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IPropertyTypeOptions); + + /** PropertyTypeOptions propertyDefinitions. */ + public propertyDefinitions: google.cloud.contentwarehouse.v1.IPropertyDefinition[]; + + /** + * Creates a new PropertyTypeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns PropertyTypeOptions instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IPropertyTypeOptions): google.cloud.contentwarehouse.v1.PropertyTypeOptions; + + /** + * Encodes the specified PropertyTypeOptions message. Does not implicitly {@link google.cloud.contentwarehouse.v1.PropertyTypeOptions.verify|verify} messages. + * @param message PropertyTypeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IPropertyTypeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PropertyTypeOptions message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.PropertyTypeOptions.verify|verify} messages. + * @param message PropertyTypeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IPropertyTypeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PropertyTypeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PropertyTypeOptions + * @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.cloud.contentwarehouse.v1.PropertyTypeOptions; + + /** + * Decodes a PropertyTypeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PropertyTypeOptions + * @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.cloud.contentwarehouse.v1.PropertyTypeOptions; + + /** + * Verifies a PropertyTypeOptions 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 PropertyTypeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PropertyTypeOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.PropertyTypeOptions; + + /** + * Creates a plain object from a PropertyTypeOptions message. Also converts values to other types if specified. + * @param message PropertyTypeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.PropertyTypeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PropertyTypeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PropertyTypeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumTypeOptions. */ + interface IEnumTypeOptions { + + /** EnumTypeOptions possibleValues */ + possibleValues?: (string[]|null); + + /** EnumTypeOptions validationCheckDisabled */ + validationCheckDisabled?: (boolean|null); + } + + /** Represents an EnumTypeOptions. */ + class EnumTypeOptions implements IEnumTypeOptions { + + /** + * Constructs a new EnumTypeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IEnumTypeOptions); + + /** EnumTypeOptions possibleValues. */ + public possibleValues: string[]; + + /** EnumTypeOptions validationCheckDisabled. */ + public validationCheckDisabled: boolean; + + /** + * Creates a new EnumTypeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumTypeOptions instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IEnumTypeOptions): google.cloud.contentwarehouse.v1.EnumTypeOptions; + + /** + * Encodes the specified EnumTypeOptions message. Does not implicitly {@link google.cloud.contentwarehouse.v1.EnumTypeOptions.verify|verify} messages. + * @param message EnumTypeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IEnumTypeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumTypeOptions message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.EnumTypeOptions.verify|verify} messages. + * @param message EnumTypeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IEnumTypeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumTypeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumTypeOptions + * @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.cloud.contentwarehouse.v1.EnumTypeOptions; + + /** + * Decodes an EnumTypeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumTypeOptions + * @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.cloud.contentwarehouse.v1.EnumTypeOptions; + + /** + * Verifies an EnumTypeOptions 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 EnumTypeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumTypeOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.EnumTypeOptions; + + /** + * Creates a plain object from an EnumTypeOptions message. Also converts values to other types if specified. + * @param message EnumTypeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.EnumTypeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumTypeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumTypeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a DocumentSchemaService */ + class DocumentSchemaService extends $protobuf.rpc.Service { + + /** + * Constructs a new DocumentSchemaService 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 DocumentSchemaService 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): DocumentSchemaService; + + /** + * Calls CreateDocumentSchema. + * @param request CreateDocumentSchemaRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DocumentSchema + */ + public createDocumentSchema(request: google.cloud.contentwarehouse.v1.ICreateDocumentSchemaRequest, callback: google.cloud.contentwarehouse.v1.DocumentSchemaService.CreateDocumentSchemaCallback): void; + + /** + * Calls CreateDocumentSchema. + * @param request CreateDocumentSchemaRequest message or plain object + * @returns Promise + */ + public createDocumentSchema(request: google.cloud.contentwarehouse.v1.ICreateDocumentSchemaRequest): Promise; + + /** + * Calls UpdateDocumentSchema. + * @param request UpdateDocumentSchemaRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DocumentSchema + */ + public updateDocumentSchema(request: google.cloud.contentwarehouse.v1.IUpdateDocumentSchemaRequest, callback: google.cloud.contentwarehouse.v1.DocumentSchemaService.UpdateDocumentSchemaCallback): void; + + /** + * Calls UpdateDocumentSchema. + * @param request UpdateDocumentSchemaRequest message or plain object + * @returns Promise + */ + public updateDocumentSchema(request: google.cloud.contentwarehouse.v1.IUpdateDocumentSchemaRequest): Promise; + + /** + * Calls GetDocumentSchema. + * @param request GetDocumentSchemaRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DocumentSchema + */ + public getDocumentSchema(request: google.cloud.contentwarehouse.v1.IGetDocumentSchemaRequest, callback: google.cloud.contentwarehouse.v1.DocumentSchemaService.GetDocumentSchemaCallback): void; + + /** + * Calls GetDocumentSchema. + * @param request GetDocumentSchemaRequest message or plain object + * @returns Promise + */ + public getDocumentSchema(request: google.cloud.contentwarehouse.v1.IGetDocumentSchemaRequest): Promise; + + /** + * Calls DeleteDocumentSchema. + * @param request DeleteDocumentSchemaRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteDocumentSchema(request: google.cloud.contentwarehouse.v1.IDeleteDocumentSchemaRequest, callback: google.cloud.contentwarehouse.v1.DocumentSchemaService.DeleteDocumentSchemaCallback): void; + + /** + * Calls DeleteDocumentSchema. + * @param request DeleteDocumentSchemaRequest message or plain object + * @returns Promise + */ + public deleteDocumentSchema(request: google.cloud.contentwarehouse.v1.IDeleteDocumentSchemaRequest): Promise; + + /** + * Calls ListDocumentSchemas. + * @param request ListDocumentSchemasRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDocumentSchemasResponse + */ + public listDocumentSchemas(request: google.cloud.contentwarehouse.v1.IListDocumentSchemasRequest, callback: google.cloud.contentwarehouse.v1.DocumentSchemaService.ListDocumentSchemasCallback): void; + + /** + * Calls ListDocumentSchemas. + * @param request ListDocumentSchemasRequest message or plain object + * @returns Promise + */ + public listDocumentSchemas(request: google.cloud.contentwarehouse.v1.IListDocumentSchemasRequest): Promise; + } + + namespace DocumentSchemaService { + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentSchemaService|createDocumentSchema}. + * @param error Error, if any + * @param [response] DocumentSchema + */ + type CreateDocumentSchemaCallback = (error: (Error|null), response?: google.cloud.contentwarehouse.v1.DocumentSchema) => void; + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentSchemaService|updateDocumentSchema}. + * @param error Error, if any + * @param [response] DocumentSchema + */ + type UpdateDocumentSchemaCallback = (error: (Error|null), response?: google.cloud.contentwarehouse.v1.DocumentSchema) => void; + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentSchemaService|getDocumentSchema}. + * @param error Error, if any + * @param [response] DocumentSchema + */ + type GetDocumentSchemaCallback = (error: (Error|null), response?: google.cloud.contentwarehouse.v1.DocumentSchema) => void; + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentSchemaService|deleteDocumentSchema}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteDocumentSchemaCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentSchemaService|listDocumentSchemas}. + * @param error Error, if any + * @param [response] ListDocumentSchemasResponse + */ + type ListDocumentSchemasCallback = (error: (Error|null), response?: google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse) => void; + } + + /** Properties of a CreateDocumentSchemaRequest. */ + interface ICreateDocumentSchemaRequest { + + /** CreateDocumentSchemaRequest parent */ + parent?: (string|null); + + /** CreateDocumentSchemaRequest documentSchema */ + documentSchema?: (google.cloud.contentwarehouse.v1.IDocumentSchema|null); + } + + /** Represents a CreateDocumentSchemaRequest. */ + class CreateDocumentSchemaRequest implements ICreateDocumentSchemaRequest { + + /** + * Constructs a new CreateDocumentSchemaRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.ICreateDocumentSchemaRequest); + + /** CreateDocumentSchemaRequest parent. */ + public parent: string; + + /** CreateDocumentSchemaRequest documentSchema. */ + public documentSchema?: (google.cloud.contentwarehouse.v1.IDocumentSchema|null); + + /** + * Creates a new CreateDocumentSchemaRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateDocumentSchemaRequest instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.ICreateDocumentSchemaRequest): google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest; + + /** + * Encodes the specified CreateDocumentSchemaRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest.verify|verify} messages. + * @param message CreateDocumentSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.ICreateDocumentSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateDocumentSchemaRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest.verify|verify} messages. + * @param message CreateDocumentSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.ICreateDocumentSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateDocumentSchemaRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateDocumentSchemaRequest + * @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.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest; + + /** + * Decodes a CreateDocumentSchemaRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateDocumentSchemaRequest + * @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.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest; + + /** + * Verifies a CreateDocumentSchemaRequest 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 CreateDocumentSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateDocumentSchemaRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest; + + /** + * Creates a plain object from a CreateDocumentSchemaRequest message. Also converts values to other types if specified. + * @param message CreateDocumentSchemaRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateDocumentSchemaRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateDocumentSchemaRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetDocumentSchemaRequest. */ + interface IGetDocumentSchemaRequest { + + /** GetDocumentSchemaRequest name */ + name?: (string|null); + } + + /** Represents a GetDocumentSchemaRequest. */ + class GetDocumentSchemaRequest implements IGetDocumentSchemaRequest { + + /** + * Constructs a new GetDocumentSchemaRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IGetDocumentSchemaRequest); + + /** GetDocumentSchemaRequest name. */ + public name: string; + + /** + * Creates a new GetDocumentSchemaRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDocumentSchemaRequest instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IGetDocumentSchemaRequest): google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest; + + /** + * Encodes the specified GetDocumentSchemaRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest.verify|verify} messages. + * @param message GetDocumentSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IGetDocumentSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDocumentSchemaRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest.verify|verify} messages. + * @param message GetDocumentSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IGetDocumentSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDocumentSchemaRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDocumentSchemaRequest + * @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.cloud.contentwarehouse.v1.GetDocumentSchemaRequest; + + /** + * Decodes a GetDocumentSchemaRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDocumentSchemaRequest + * @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.cloud.contentwarehouse.v1.GetDocumentSchemaRequest; + + /** + * Verifies a GetDocumentSchemaRequest 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 GetDocumentSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDocumentSchemaRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest; + + /** + * Creates a plain object from a GetDocumentSchemaRequest message. Also converts values to other types if specified. + * @param message GetDocumentSchemaRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDocumentSchemaRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetDocumentSchemaRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateDocumentSchemaRequest. */ + interface IUpdateDocumentSchemaRequest { + + /** UpdateDocumentSchemaRequest name */ + name?: (string|null); + + /** UpdateDocumentSchemaRequest documentSchema */ + documentSchema?: (google.cloud.contentwarehouse.v1.IDocumentSchema|null); + } + + /** Represents an UpdateDocumentSchemaRequest. */ + class UpdateDocumentSchemaRequest implements IUpdateDocumentSchemaRequest { + + /** + * Constructs a new UpdateDocumentSchemaRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IUpdateDocumentSchemaRequest); + + /** UpdateDocumentSchemaRequest name. */ + public name: string; + + /** UpdateDocumentSchemaRequest documentSchema. */ + public documentSchema?: (google.cloud.contentwarehouse.v1.IDocumentSchema|null); + + /** + * Creates a new UpdateDocumentSchemaRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateDocumentSchemaRequest instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IUpdateDocumentSchemaRequest): google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest; + + /** + * Encodes the specified UpdateDocumentSchemaRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest.verify|verify} messages. + * @param message UpdateDocumentSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IUpdateDocumentSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateDocumentSchemaRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest.verify|verify} messages. + * @param message UpdateDocumentSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IUpdateDocumentSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateDocumentSchemaRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateDocumentSchemaRequest + * @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.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest; + + /** + * Decodes an UpdateDocumentSchemaRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateDocumentSchemaRequest + * @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.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest; + + /** + * Verifies an UpdateDocumentSchemaRequest 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 UpdateDocumentSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateDocumentSchemaRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest; + + /** + * Creates a plain object from an UpdateDocumentSchemaRequest message. Also converts values to other types if specified. + * @param message UpdateDocumentSchemaRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateDocumentSchemaRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateDocumentSchemaRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteDocumentSchemaRequest. */ + interface IDeleteDocumentSchemaRequest { + + /** DeleteDocumentSchemaRequest name */ + name?: (string|null); + } + + /** Represents a DeleteDocumentSchemaRequest. */ + class DeleteDocumentSchemaRequest implements IDeleteDocumentSchemaRequest { + + /** + * Constructs a new DeleteDocumentSchemaRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IDeleteDocumentSchemaRequest); + + /** DeleteDocumentSchemaRequest name. */ + public name: string; + + /** + * Creates a new DeleteDocumentSchemaRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteDocumentSchemaRequest instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IDeleteDocumentSchemaRequest): google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest; + + /** + * Encodes the specified DeleteDocumentSchemaRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest.verify|verify} messages. + * @param message DeleteDocumentSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IDeleteDocumentSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteDocumentSchemaRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest.verify|verify} messages. + * @param message DeleteDocumentSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IDeleteDocumentSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteDocumentSchemaRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteDocumentSchemaRequest + * @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.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest; + + /** + * Decodes a DeleteDocumentSchemaRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteDocumentSchemaRequest + * @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.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest; + + /** + * Verifies a DeleteDocumentSchemaRequest 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 DeleteDocumentSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteDocumentSchemaRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest; + + /** + * Creates a plain object from a DeleteDocumentSchemaRequest message. Also converts values to other types if specified. + * @param message DeleteDocumentSchemaRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteDocumentSchemaRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteDocumentSchemaRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDocumentSchemasRequest. */ + interface IListDocumentSchemasRequest { + + /** ListDocumentSchemasRequest parent */ + parent?: (string|null); + + /** ListDocumentSchemasRequest pageSize */ + pageSize?: (number|null); + + /** ListDocumentSchemasRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListDocumentSchemasRequest. */ + class ListDocumentSchemasRequest implements IListDocumentSchemasRequest { + + /** + * Constructs a new ListDocumentSchemasRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IListDocumentSchemasRequest); + + /** ListDocumentSchemasRequest parent. */ + public parent: string; + + /** ListDocumentSchemasRequest pageSize. */ + public pageSize: number; + + /** ListDocumentSchemasRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListDocumentSchemasRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDocumentSchemasRequest instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IListDocumentSchemasRequest): google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest; + + /** + * Encodes the specified ListDocumentSchemasRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest.verify|verify} messages. + * @param message ListDocumentSchemasRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IListDocumentSchemasRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDocumentSchemasRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest.verify|verify} messages. + * @param message ListDocumentSchemasRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IListDocumentSchemasRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDocumentSchemasRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDocumentSchemasRequest + * @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.cloud.contentwarehouse.v1.ListDocumentSchemasRequest; + + /** + * Decodes a ListDocumentSchemasRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDocumentSchemasRequest + * @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.cloud.contentwarehouse.v1.ListDocumentSchemasRequest; + + /** + * Verifies a ListDocumentSchemasRequest 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 ListDocumentSchemasRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDocumentSchemasRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest; + + /** + * Creates a plain object from a ListDocumentSchemasRequest message. Also converts values to other types if specified. + * @param message ListDocumentSchemasRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDocumentSchemasRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDocumentSchemasRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDocumentSchemasResponse. */ + interface IListDocumentSchemasResponse { + + /** ListDocumentSchemasResponse documentSchemas */ + documentSchemas?: (google.cloud.contentwarehouse.v1.IDocumentSchema[]|null); + + /** ListDocumentSchemasResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListDocumentSchemasResponse. */ + class ListDocumentSchemasResponse implements IListDocumentSchemasResponse { + + /** + * Constructs a new ListDocumentSchemasResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IListDocumentSchemasResponse); + + /** ListDocumentSchemasResponse documentSchemas. */ + public documentSchemas: google.cloud.contentwarehouse.v1.IDocumentSchema[]; + + /** ListDocumentSchemasResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListDocumentSchemasResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDocumentSchemasResponse instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IListDocumentSchemasResponse): google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse; + + /** + * Encodes the specified ListDocumentSchemasResponse message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse.verify|verify} messages. + * @param message ListDocumentSchemasResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IListDocumentSchemasResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDocumentSchemasResponse message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse.verify|verify} messages. + * @param message ListDocumentSchemasResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IListDocumentSchemasResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDocumentSchemasResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDocumentSchemasResponse + * @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.cloud.contentwarehouse.v1.ListDocumentSchemasResponse; + + /** + * Decodes a ListDocumentSchemasResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDocumentSchemasResponse + * @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.cloud.contentwarehouse.v1.ListDocumentSchemasResponse; + + /** + * Verifies a ListDocumentSchemasResponse 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 ListDocumentSchemasResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDocumentSchemasResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse; + + /** + * Creates a plain object from a ListDocumentSchemasResponse message. Also converts values to other types if specified. + * @param message ListDocumentSchemasResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDocumentSchemasResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDocumentSchemasResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a DocumentService */ + class DocumentService extends $protobuf.rpc.Service { + + /** + * Constructs a new DocumentService 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 DocumentService 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): DocumentService; + + /** + * Calls CreateDocument. + * @param request CreateDocumentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CreateDocumentResponse + */ + public createDocument(request: google.cloud.contentwarehouse.v1.ICreateDocumentRequest, callback: google.cloud.contentwarehouse.v1.DocumentService.CreateDocumentCallback): void; + + /** + * Calls CreateDocument. + * @param request CreateDocumentRequest message or plain object + * @returns Promise + */ + public createDocument(request: google.cloud.contentwarehouse.v1.ICreateDocumentRequest): Promise; + + /** + * Calls GetDocument. + * @param request GetDocumentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Document + */ + public getDocument(request: google.cloud.contentwarehouse.v1.IGetDocumentRequest, callback: google.cloud.contentwarehouse.v1.DocumentService.GetDocumentCallback): void; + + /** + * Calls GetDocument. + * @param request GetDocumentRequest message or plain object + * @returns Promise + */ + public getDocument(request: google.cloud.contentwarehouse.v1.IGetDocumentRequest): Promise; + + /** + * Calls UpdateDocument. + * @param request UpdateDocumentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and UpdateDocumentResponse + */ + public updateDocument(request: google.cloud.contentwarehouse.v1.IUpdateDocumentRequest, callback: google.cloud.contentwarehouse.v1.DocumentService.UpdateDocumentCallback): void; + + /** + * Calls UpdateDocument. + * @param request UpdateDocumentRequest message or plain object + * @returns Promise + */ + public updateDocument(request: google.cloud.contentwarehouse.v1.IUpdateDocumentRequest): Promise; + + /** + * Calls DeleteDocument. + * @param request DeleteDocumentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteDocument(request: google.cloud.contentwarehouse.v1.IDeleteDocumentRequest, callback: google.cloud.contentwarehouse.v1.DocumentService.DeleteDocumentCallback): void; + + /** + * Calls DeleteDocument. + * @param request DeleteDocumentRequest message or plain object + * @returns Promise + */ + public deleteDocument(request: google.cloud.contentwarehouse.v1.IDeleteDocumentRequest): Promise; + + /** + * Calls SearchDocuments. + * @param request SearchDocumentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchDocumentsResponse + */ + public searchDocuments(request: google.cloud.contentwarehouse.v1.ISearchDocumentsRequest, callback: google.cloud.contentwarehouse.v1.DocumentService.SearchDocumentsCallback): void; + + /** + * Calls SearchDocuments. + * @param request SearchDocumentsRequest message or plain object + * @returns Promise + */ + public searchDocuments(request: google.cloud.contentwarehouse.v1.ISearchDocumentsRequest): Promise; + + /** + * Calls LockDocument. + * @param request LockDocumentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Document + */ + public lockDocument(request: google.cloud.contentwarehouse.v1.ILockDocumentRequest, callback: google.cloud.contentwarehouse.v1.DocumentService.LockDocumentCallback): void; + + /** + * Calls LockDocument. + * @param request LockDocumentRequest message or plain object + * @returns Promise + */ + public lockDocument(request: google.cloud.contentwarehouse.v1.ILockDocumentRequest): Promise; + + /** + * Calls FetchAcl. + * @param request FetchAclRequest message or plain object + * @param callback Node-style callback called with the error, if any, and FetchAclResponse + */ + public fetchAcl(request: google.cloud.contentwarehouse.v1.IFetchAclRequest, callback: google.cloud.contentwarehouse.v1.DocumentService.FetchAclCallback): void; + + /** + * Calls FetchAcl. + * @param request FetchAclRequest message or plain object + * @returns Promise + */ + public fetchAcl(request: google.cloud.contentwarehouse.v1.IFetchAclRequest): Promise; + + /** + * Calls SetAcl. + * @param request SetAclRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SetAclResponse + */ + public setAcl(request: google.cloud.contentwarehouse.v1.ISetAclRequest, callback: google.cloud.contentwarehouse.v1.DocumentService.SetAclCallback): void; + + /** + * Calls SetAcl. + * @param request SetAclRequest message or plain object + * @returns Promise + */ + public setAcl(request: google.cloud.contentwarehouse.v1.ISetAclRequest): Promise; + } + + namespace DocumentService { + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentService|createDocument}. + * @param error Error, if any + * @param [response] CreateDocumentResponse + */ + type CreateDocumentCallback = (error: (Error|null), response?: google.cloud.contentwarehouse.v1.CreateDocumentResponse) => void; + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentService|getDocument}. + * @param error Error, if any + * @param [response] Document + */ + type GetDocumentCallback = (error: (Error|null), response?: google.cloud.contentwarehouse.v1.Document) => void; + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentService|updateDocument}. + * @param error Error, if any + * @param [response] UpdateDocumentResponse + */ + type UpdateDocumentCallback = (error: (Error|null), response?: google.cloud.contentwarehouse.v1.UpdateDocumentResponse) => void; + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentService|deleteDocument}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteDocumentCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentService|searchDocuments}. + * @param error Error, if any + * @param [response] SearchDocumentsResponse + */ + type SearchDocumentsCallback = (error: (Error|null), response?: google.cloud.contentwarehouse.v1.SearchDocumentsResponse) => void; + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentService|lockDocument}. + * @param error Error, if any + * @param [response] Document + */ + type LockDocumentCallback = (error: (Error|null), response?: google.cloud.contentwarehouse.v1.Document) => void; + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentService|fetchAcl}. + * @param error Error, if any + * @param [response] FetchAclResponse + */ + type FetchAclCallback = (error: (Error|null), response?: google.cloud.contentwarehouse.v1.FetchAclResponse) => void; + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentService|setAcl}. + * @param error Error, if any + * @param [response] SetAclResponse + */ + type SetAclCallback = (error: (Error|null), response?: google.cloud.contentwarehouse.v1.SetAclResponse) => void; + } + + /** Properties of a CreateDocumentResponse. */ + interface ICreateDocumentResponse { + + /** CreateDocumentResponse document */ + document?: (google.cloud.contentwarehouse.v1.IDocument|null); + + /** CreateDocumentResponse ruleEngineOutput */ + ruleEngineOutput?: (google.cloud.contentwarehouse.v1.IRuleEngineOutput|null); + + /** CreateDocumentResponse metadata */ + metadata?: (google.cloud.contentwarehouse.v1.IResponseMetadata|null); + + /** CreateDocumentResponse longRunningOperations */ + longRunningOperations?: (google.longrunning.IOperation[]|null); + } + + /** Represents a CreateDocumentResponse. */ + class CreateDocumentResponse implements ICreateDocumentResponse { + + /** + * Constructs a new CreateDocumentResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.ICreateDocumentResponse); + + /** CreateDocumentResponse document. */ + public document?: (google.cloud.contentwarehouse.v1.IDocument|null); + + /** CreateDocumentResponse ruleEngineOutput. */ + public ruleEngineOutput?: (google.cloud.contentwarehouse.v1.IRuleEngineOutput|null); + + /** CreateDocumentResponse metadata. */ + public metadata?: (google.cloud.contentwarehouse.v1.IResponseMetadata|null); + + /** CreateDocumentResponse longRunningOperations. */ + public longRunningOperations: google.longrunning.IOperation[]; + + /** + * Creates a new CreateDocumentResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateDocumentResponse instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.ICreateDocumentResponse): google.cloud.contentwarehouse.v1.CreateDocumentResponse; + + /** + * Encodes the specified CreateDocumentResponse message. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateDocumentResponse.verify|verify} messages. + * @param message CreateDocumentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.ICreateDocumentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateDocumentResponse message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateDocumentResponse.verify|verify} messages. + * @param message CreateDocumentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.ICreateDocumentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateDocumentResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateDocumentResponse + * @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.cloud.contentwarehouse.v1.CreateDocumentResponse; + + /** + * Decodes a CreateDocumentResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateDocumentResponse + * @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.cloud.contentwarehouse.v1.CreateDocumentResponse; + + /** + * Verifies a CreateDocumentResponse 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 CreateDocumentResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateDocumentResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.CreateDocumentResponse; + + /** + * Creates a plain object from a CreateDocumentResponse message. Also converts values to other types if specified. + * @param message CreateDocumentResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.CreateDocumentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateDocumentResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateDocumentResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateDocumentResponse. */ + interface IUpdateDocumentResponse { + + /** UpdateDocumentResponse document */ + document?: (google.cloud.contentwarehouse.v1.IDocument|null); + + /** UpdateDocumentResponse ruleEngineOutput */ + ruleEngineOutput?: (google.cloud.contentwarehouse.v1.IRuleEngineOutput|null); + + /** UpdateDocumentResponse metadata */ + metadata?: (google.cloud.contentwarehouse.v1.IResponseMetadata|null); + } + + /** Represents an UpdateDocumentResponse. */ + class UpdateDocumentResponse implements IUpdateDocumentResponse { + + /** + * Constructs a new UpdateDocumentResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IUpdateDocumentResponse); + + /** UpdateDocumentResponse document. */ + public document?: (google.cloud.contentwarehouse.v1.IDocument|null); + + /** UpdateDocumentResponse ruleEngineOutput. */ + public ruleEngineOutput?: (google.cloud.contentwarehouse.v1.IRuleEngineOutput|null); + + /** UpdateDocumentResponse metadata. */ + public metadata?: (google.cloud.contentwarehouse.v1.IResponseMetadata|null); + + /** + * Creates a new UpdateDocumentResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateDocumentResponse instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IUpdateDocumentResponse): google.cloud.contentwarehouse.v1.UpdateDocumentResponse; + + /** + * Encodes the specified UpdateDocumentResponse message. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateDocumentResponse.verify|verify} messages. + * @param message UpdateDocumentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IUpdateDocumentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateDocumentResponse message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateDocumentResponse.verify|verify} messages. + * @param message UpdateDocumentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IUpdateDocumentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateDocumentResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateDocumentResponse + * @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.cloud.contentwarehouse.v1.UpdateDocumentResponse; + + /** + * Decodes an UpdateDocumentResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateDocumentResponse + * @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.cloud.contentwarehouse.v1.UpdateDocumentResponse; + + /** + * Verifies an UpdateDocumentResponse 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 UpdateDocumentResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateDocumentResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.UpdateDocumentResponse; + + /** + * Creates a plain object from an UpdateDocumentResponse message. Also converts values to other types if specified. + * @param message UpdateDocumentResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.UpdateDocumentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateDocumentResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateDocumentResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a QAResult. */ + interface IQAResult { + + /** QAResult highlights */ + highlights?: (google.cloud.contentwarehouse.v1.QAResult.IHighlight[]|null); + + /** QAResult confidenceScore */ + confidenceScore?: (number|null); + } + + /** Represents a QAResult. */ + class QAResult implements IQAResult { + + /** + * Constructs a new QAResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IQAResult); + + /** QAResult highlights. */ + public highlights: google.cloud.contentwarehouse.v1.QAResult.IHighlight[]; + + /** QAResult confidenceScore. */ + public confidenceScore: number; + + /** + * Creates a new QAResult instance using the specified properties. + * @param [properties] Properties to set + * @returns QAResult instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IQAResult): google.cloud.contentwarehouse.v1.QAResult; + + /** + * Encodes the specified QAResult message. Does not implicitly {@link google.cloud.contentwarehouse.v1.QAResult.verify|verify} messages. + * @param message QAResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IQAResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QAResult message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.QAResult.verify|verify} messages. + * @param message QAResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IQAResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QAResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QAResult + * @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.cloud.contentwarehouse.v1.QAResult; + + /** + * Decodes a QAResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QAResult + * @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.cloud.contentwarehouse.v1.QAResult; + + /** + * Verifies a QAResult 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 QAResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QAResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.QAResult; + + /** + * Creates a plain object from a QAResult message. Also converts values to other types if specified. + * @param message QAResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.QAResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QAResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QAResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace QAResult { + + /** Properties of a Highlight. */ + interface IHighlight { + + /** Highlight startIndex */ + startIndex?: (number|null); + + /** Highlight endIndex */ + endIndex?: (number|null); + } + + /** Represents a Highlight. */ + class Highlight implements IHighlight { + + /** + * Constructs a new Highlight. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.QAResult.IHighlight); + + /** Highlight startIndex. */ + public startIndex: number; + + /** Highlight endIndex. */ + public endIndex: number; + + /** + * Creates a new Highlight instance using the specified properties. + * @param [properties] Properties to set + * @returns Highlight instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.QAResult.IHighlight): google.cloud.contentwarehouse.v1.QAResult.Highlight; + + /** + * Encodes the specified Highlight message. Does not implicitly {@link google.cloud.contentwarehouse.v1.QAResult.Highlight.verify|verify} messages. + * @param message Highlight message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.QAResult.IHighlight, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Highlight message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.QAResult.Highlight.verify|verify} messages. + * @param message Highlight message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.QAResult.IHighlight, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Highlight message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Highlight + * @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.cloud.contentwarehouse.v1.QAResult.Highlight; + + /** + * Decodes a Highlight message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Highlight + * @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.cloud.contentwarehouse.v1.QAResult.Highlight; + + /** + * Verifies a Highlight 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 Highlight message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Highlight + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.QAResult.Highlight; + + /** + * Creates a plain object from a Highlight message. Also converts values to other types if specified. + * @param message Highlight + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.QAResult.Highlight, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Highlight to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Highlight + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SearchDocumentsResponse. */ + interface ISearchDocumentsResponse { + + /** SearchDocumentsResponse matchingDocuments */ + matchingDocuments?: (google.cloud.contentwarehouse.v1.SearchDocumentsResponse.IMatchingDocument[]|null); + + /** SearchDocumentsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** SearchDocumentsResponse totalSize */ + totalSize?: (number|null); + + /** SearchDocumentsResponse metadata */ + metadata?: (google.cloud.contentwarehouse.v1.IResponseMetadata|null); + + /** SearchDocumentsResponse histogramQueryResults */ + histogramQueryResults?: (google.cloud.contentwarehouse.v1.IHistogramQueryResult[]|null); + + /** SearchDocumentsResponse questionAnswer */ + questionAnswer?: (string|null); + } + + /** Represents a SearchDocumentsResponse. */ + class SearchDocumentsResponse implements ISearchDocumentsResponse { + + /** + * Constructs a new SearchDocumentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.ISearchDocumentsResponse); + + /** SearchDocumentsResponse matchingDocuments. */ + public matchingDocuments: google.cloud.contentwarehouse.v1.SearchDocumentsResponse.IMatchingDocument[]; + + /** SearchDocumentsResponse nextPageToken. */ + public nextPageToken: string; + + /** SearchDocumentsResponse totalSize. */ + public totalSize: number; + + /** SearchDocumentsResponse metadata. */ + public metadata?: (google.cloud.contentwarehouse.v1.IResponseMetadata|null); + + /** SearchDocumentsResponse histogramQueryResults. */ + public histogramQueryResults: google.cloud.contentwarehouse.v1.IHistogramQueryResult[]; + + /** SearchDocumentsResponse questionAnswer. */ + public questionAnswer: string; + + /** + * Creates a new SearchDocumentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchDocumentsResponse instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.ISearchDocumentsResponse): google.cloud.contentwarehouse.v1.SearchDocumentsResponse; + + /** + * Encodes the specified SearchDocumentsResponse message. Does not implicitly {@link google.cloud.contentwarehouse.v1.SearchDocumentsResponse.verify|verify} messages. + * @param message SearchDocumentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.ISearchDocumentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchDocumentsResponse message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.SearchDocumentsResponse.verify|verify} messages. + * @param message SearchDocumentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.ISearchDocumentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchDocumentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchDocumentsResponse + * @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.cloud.contentwarehouse.v1.SearchDocumentsResponse; + + /** + * Decodes a SearchDocumentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchDocumentsResponse + * @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.cloud.contentwarehouse.v1.SearchDocumentsResponse; + + /** + * Verifies a SearchDocumentsResponse 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 SearchDocumentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchDocumentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.SearchDocumentsResponse; + + /** + * Creates a plain object from a SearchDocumentsResponse message. Also converts values to other types if specified. + * @param message SearchDocumentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.SearchDocumentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchDocumentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchDocumentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SearchDocumentsResponse { + + /** Properties of a MatchingDocument. */ + interface IMatchingDocument { + + /** MatchingDocument document */ + document?: (google.cloud.contentwarehouse.v1.IDocument|null); + + /** MatchingDocument searchTextSnippet */ + searchTextSnippet?: (string|null); + + /** MatchingDocument qaResult */ + qaResult?: (google.cloud.contentwarehouse.v1.IQAResult|null); + + /** MatchingDocument matchedTokenPageIndices */ + matchedTokenPageIndices?: ((number|Long|string)[]|null); + } + + /** Represents a MatchingDocument. */ + class MatchingDocument implements IMatchingDocument { + + /** + * Constructs a new MatchingDocument. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.SearchDocumentsResponse.IMatchingDocument); + + /** MatchingDocument document. */ + public document?: (google.cloud.contentwarehouse.v1.IDocument|null); + + /** MatchingDocument searchTextSnippet. */ + public searchTextSnippet: string; + + /** MatchingDocument qaResult. */ + public qaResult?: (google.cloud.contentwarehouse.v1.IQAResult|null); + + /** MatchingDocument matchedTokenPageIndices. */ + public matchedTokenPageIndices: (number|Long|string)[]; + + /** + * Creates a new MatchingDocument instance using the specified properties. + * @param [properties] Properties to set + * @returns MatchingDocument instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.SearchDocumentsResponse.IMatchingDocument): google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument; + + /** + * Encodes the specified MatchingDocument message. Does not implicitly {@link google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument.verify|verify} messages. + * @param message MatchingDocument message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.SearchDocumentsResponse.IMatchingDocument, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MatchingDocument message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument.verify|verify} messages. + * @param message MatchingDocument message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.SearchDocumentsResponse.IMatchingDocument, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MatchingDocument message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MatchingDocument + * @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.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument; + + /** + * Decodes a MatchingDocument message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MatchingDocument + * @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.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument; + + /** + * Verifies a MatchingDocument 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 MatchingDocument message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MatchingDocument + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument; + + /** + * Creates a plain object from a MatchingDocument message. Also converts values to other types if specified. + * @param message MatchingDocument + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MatchingDocument to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MatchingDocument + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a FetchAclResponse. */ + interface IFetchAclResponse { + + /** FetchAclResponse policy */ + policy?: (google.iam.v1.IPolicy|null); + + /** FetchAclResponse metadata */ + metadata?: (google.cloud.contentwarehouse.v1.IResponseMetadata|null); + } + + /** Represents a FetchAclResponse. */ + class FetchAclResponse implements IFetchAclResponse { + + /** + * Constructs a new FetchAclResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IFetchAclResponse); + + /** FetchAclResponse policy. */ + public policy?: (google.iam.v1.IPolicy|null); + + /** FetchAclResponse metadata. */ + public metadata?: (google.cloud.contentwarehouse.v1.IResponseMetadata|null); + + /** + * Creates a new FetchAclResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns FetchAclResponse instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IFetchAclResponse): google.cloud.contentwarehouse.v1.FetchAclResponse; + + /** + * Encodes the specified FetchAclResponse message. Does not implicitly {@link google.cloud.contentwarehouse.v1.FetchAclResponse.verify|verify} messages. + * @param message FetchAclResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IFetchAclResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FetchAclResponse message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.FetchAclResponse.verify|verify} messages. + * @param message FetchAclResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IFetchAclResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FetchAclResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FetchAclResponse + * @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.cloud.contentwarehouse.v1.FetchAclResponse; + + /** + * Decodes a FetchAclResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FetchAclResponse + * @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.cloud.contentwarehouse.v1.FetchAclResponse; + + /** + * Verifies a FetchAclResponse 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 FetchAclResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FetchAclResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.FetchAclResponse; + + /** + * Creates a plain object from a FetchAclResponse message. Also converts values to other types if specified. + * @param message FetchAclResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.FetchAclResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FetchAclResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FetchAclResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SetAclResponse. */ + interface ISetAclResponse { + + /** SetAclResponse policy */ + policy?: (google.iam.v1.IPolicy|null); + + /** SetAclResponse metadata */ + metadata?: (google.cloud.contentwarehouse.v1.IResponseMetadata|null); + } + + /** Represents a SetAclResponse. */ + class SetAclResponse implements ISetAclResponse { + + /** + * Constructs a new SetAclResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.ISetAclResponse); + + /** SetAclResponse policy. */ + public policy?: (google.iam.v1.IPolicy|null); + + /** SetAclResponse metadata. */ + public metadata?: (google.cloud.contentwarehouse.v1.IResponseMetadata|null); + + /** + * Creates a new SetAclResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SetAclResponse instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.ISetAclResponse): google.cloud.contentwarehouse.v1.SetAclResponse; + + /** + * Encodes the specified SetAclResponse message. Does not implicitly {@link google.cloud.contentwarehouse.v1.SetAclResponse.verify|verify} messages. + * @param message SetAclResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.ISetAclResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetAclResponse message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.SetAclResponse.verify|verify} messages. + * @param message SetAclResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.ISetAclResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetAclResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetAclResponse + * @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.cloud.contentwarehouse.v1.SetAclResponse; + + /** + * Decodes a SetAclResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetAclResponse + * @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.cloud.contentwarehouse.v1.SetAclResponse; + + /** + * Verifies a SetAclResponse 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 SetAclResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetAclResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.SetAclResponse; + + /** + * Creates a plain object from a SetAclResponse message. Also converts values to other types if specified. + * @param message SetAclResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.SetAclResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetAclResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SetAclResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CloudAIDocumentOption. */ + interface ICloudAIDocumentOption { + + /** CloudAIDocumentOption enableEntitiesConversions */ + enableEntitiesConversions?: (boolean|null); + + /** CloudAIDocumentOption customizedEntitiesPropertiesConversions */ + customizedEntitiesPropertiesConversions?: ({ [k: string]: string }|null); + } + + /** Represents a CloudAIDocumentOption. */ + class CloudAIDocumentOption implements ICloudAIDocumentOption { + + /** + * Constructs a new CloudAIDocumentOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.ICloudAIDocumentOption); + + /** CloudAIDocumentOption enableEntitiesConversions. */ + public enableEntitiesConversions: boolean; + + /** CloudAIDocumentOption customizedEntitiesPropertiesConversions. */ + public customizedEntitiesPropertiesConversions: { [k: string]: string }; + + /** + * Creates a new CloudAIDocumentOption instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudAIDocumentOption instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.ICloudAIDocumentOption): google.cloud.contentwarehouse.v1.CloudAIDocumentOption; + + /** + * Encodes the specified CloudAIDocumentOption message. Does not implicitly {@link google.cloud.contentwarehouse.v1.CloudAIDocumentOption.verify|verify} messages. + * @param message CloudAIDocumentOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.ICloudAIDocumentOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudAIDocumentOption message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.CloudAIDocumentOption.verify|verify} messages. + * @param message CloudAIDocumentOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.ICloudAIDocumentOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudAIDocumentOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudAIDocumentOption + * @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.cloud.contentwarehouse.v1.CloudAIDocumentOption; + + /** + * Decodes a CloudAIDocumentOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudAIDocumentOption + * @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.cloud.contentwarehouse.v1.CloudAIDocumentOption; + + /** + * Verifies a CloudAIDocumentOption 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 CloudAIDocumentOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudAIDocumentOption + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.CloudAIDocumentOption; + + /** + * Creates a plain object from a CloudAIDocumentOption message. Also converts values to other types if specified. + * @param message CloudAIDocumentOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.CloudAIDocumentOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudAIDocumentOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudAIDocumentOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateDocumentRequest. */ + interface ICreateDocumentRequest { + + /** CreateDocumentRequest parent */ + parent?: (string|null); + + /** CreateDocumentRequest document */ + document?: (google.cloud.contentwarehouse.v1.IDocument|null); + + /** CreateDocumentRequest requestMetadata */ + requestMetadata?: (google.cloud.contentwarehouse.v1.IRequestMetadata|null); + + /** CreateDocumentRequest policy */ + policy?: (google.iam.v1.IPolicy|null); + + /** CreateDocumentRequest cloudAiDocumentOption */ + cloudAiDocumentOption?: (google.cloud.contentwarehouse.v1.ICloudAIDocumentOption|null); + + /** CreateDocumentRequest createMask */ + createMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents a CreateDocumentRequest. */ + class CreateDocumentRequest implements ICreateDocumentRequest { + + /** + * Constructs a new CreateDocumentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.ICreateDocumentRequest); + + /** CreateDocumentRequest parent. */ + public parent: string; + + /** CreateDocumentRequest document. */ + public document?: (google.cloud.contentwarehouse.v1.IDocument|null); + + /** CreateDocumentRequest requestMetadata. */ + public requestMetadata?: (google.cloud.contentwarehouse.v1.IRequestMetadata|null); + + /** CreateDocumentRequest policy. */ + public policy?: (google.iam.v1.IPolicy|null); + + /** CreateDocumentRequest cloudAiDocumentOption. */ + public cloudAiDocumentOption?: (google.cloud.contentwarehouse.v1.ICloudAIDocumentOption|null); + + /** CreateDocumentRequest createMask. */ + public createMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new CreateDocumentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateDocumentRequest instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.ICreateDocumentRequest): google.cloud.contentwarehouse.v1.CreateDocumentRequest; + + /** + * Encodes the specified CreateDocumentRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateDocumentRequest.verify|verify} messages. + * @param message CreateDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.ICreateDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateDocumentRequest.verify|verify} messages. + * @param message CreateDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.ICreateDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateDocumentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateDocumentRequest + * @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.cloud.contentwarehouse.v1.CreateDocumentRequest; + + /** + * Decodes a CreateDocumentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateDocumentRequest + * @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.cloud.contentwarehouse.v1.CreateDocumentRequest; + + /** + * Verifies a CreateDocumentRequest 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 CreateDocumentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateDocumentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.CreateDocumentRequest; + + /** + * Creates a plain object from a CreateDocumentRequest message. Also converts values to other types if specified. + * @param message CreateDocumentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.CreateDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateDocumentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateDocumentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetDocumentRequest. */ + interface IGetDocumentRequest { + + /** GetDocumentRequest name */ + name?: (string|null); + + /** GetDocumentRequest requestMetadata */ + requestMetadata?: (google.cloud.contentwarehouse.v1.IRequestMetadata|null); + } + + /** Represents a GetDocumentRequest. */ + class GetDocumentRequest implements IGetDocumentRequest { + + /** + * Constructs a new GetDocumentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IGetDocumentRequest); + + /** GetDocumentRequest name. */ + public name: string; + + /** GetDocumentRequest requestMetadata. */ + public requestMetadata?: (google.cloud.contentwarehouse.v1.IRequestMetadata|null); + + /** + * Creates a new GetDocumentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDocumentRequest instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IGetDocumentRequest): google.cloud.contentwarehouse.v1.GetDocumentRequest; + + /** + * Encodes the specified GetDocumentRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.GetDocumentRequest.verify|verify} messages. + * @param message GetDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IGetDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.GetDocumentRequest.verify|verify} messages. + * @param message GetDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IGetDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDocumentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDocumentRequest + * @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.cloud.contentwarehouse.v1.GetDocumentRequest; + + /** + * Decodes a GetDocumentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDocumentRequest + * @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.cloud.contentwarehouse.v1.GetDocumentRequest; + + /** + * Verifies a GetDocumentRequest 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 GetDocumentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDocumentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.GetDocumentRequest; + + /** + * Creates a plain object from a GetDocumentRequest message. Also converts values to other types if specified. + * @param message GetDocumentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.GetDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDocumentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetDocumentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateDocumentRequest. */ + interface IUpdateDocumentRequest { + + /** UpdateDocumentRequest name */ + name?: (string|null); + + /** UpdateDocumentRequest document */ + document?: (google.cloud.contentwarehouse.v1.IDocument|null); + + /** UpdateDocumentRequest requestMetadata */ + requestMetadata?: (google.cloud.contentwarehouse.v1.IRequestMetadata|null); + + /** UpdateDocumentRequest cloudAiDocumentOption */ + cloudAiDocumentOption?: (google.cloud.contentwarehouse.v1.ICloudAIDocumentOption|null); + + /** UpdateDocumentRequest updateOptions */ + updateOptions?: (google.cloud.contentwarehouse.v1.IUpdateOptions|null); + } + + /** Represents an UpdateDocumentRequest. */ + class UpdateDocumentRequest implements IUpdateDocumentRequest { + + /** + * Constructs a new UpdateDocumentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IUpdateDocumentRequest); + + /** UpdateDocumentRequest name. */ + public name: string; + + /** UpdateDocumentRequest document. */ + public document?: (google.cloud.contentwarehouse.v1.IDocument|null); + + /** UpdateDocumentRequest requestMetadata. */ + public requestMetadata?: (google.cloud.contentwarehouse.v1.IRequestMetadata|null); + + /** UpdateDocumentRequest cloudAiDocumentOption. */ + public cloudAiDocumentOption?: (google.cloud.contentwarehouse.v1.ICloudAIDocumentOption|null); + + /** UpdateDocumentRequest updateOptions. */ + public updateOptions?: (google.cloud.contentwarehouse.v1.IUpdateOptions|null); + + /** + * Creates a new UpdateDocumentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateDocumentRequest instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IUpdateDocumentRequest): google.cloud.contentwarehouse.v1.UpdateDocumentRequest; + + /** + * Encodes the specified UpdateDocumentRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateDocumentRequest.verify|verify} messages. + * @param message UpdateDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IUpdateDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateDocumentRequest.verify|verify} messages. + * @param message UpdateDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IUpdateDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateDocumentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateDocumentRequest + * @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.cloud.contentwarehouse.v1.UpdateDocumentRequest; + + /** + * Decodes an UpdateDocumentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateDocumentRequest + * @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.cloud.contentwarehouse.v1.UpdateDocumentRequest; + + /** + * Verifies an UpdateDocumentRequest 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 UpdateDocumentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateDocumentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.UpdateDocumentRequest; + + /** + * Creates a plain object from an UpdateDocumentRequest message. Also converts values to other types if specified. + * @param message UpdateDocumentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.UpdateDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateDocumentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateDocumentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteDocumentRequest. */ + interface IDeleteDocumentRequest { + + /** DeleteDocumentRequest name */ + name?: (string|null); + + /** DeleteDocumentRequest requestMetadata */ + requestMetadata?: (google.cloud.contentwarehouse.v1.IRequestMetadata|null); + } + + /** Represents a DeleteDocumentRequest. */ + class DeleteDocumentRequest implements IDeleteDocumentRequest { + + /** + * Constructs a new DeleteDocumentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IDeleteDocumentRequest); + + /** DeleteDocumentRequest name. */ + public name: string; + + /** DeleteDocumentRequest requestMetadata. */ + public requestMetadata?: (google.cloud.contentwarehouse.v1.IRequestMetadata|null); + + /** + * Creates a new DeleteDocumentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteDocumentRequest instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IDeleteDocumentRequest): google.cloud.contentwarehouse.v1.DeleteDocumentRequest; + + /** + * Encodes the specified DeleteDocumentRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DeleteDocumentRequest.verify|verify} messages. + * @param message DeleteDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IDeleteDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DeleteDocumentRequest.verify|verify} messages. + * @param message DeleteDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IDeleteDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteDocumentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteDocumentRequest + * @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.cloud.contentwarehouse.v1.DeleteDocumentRequest; + + /** + * Decodes a DeleteDocumentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteDocumentRequest + * @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.cloud.contentwarehouse.v1.DeleteDocumentRequest; + + /** + * Verifies a DeleteDocumentRequest 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 DeleteDocumentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteDocumentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.DeleteDocumentRequest; + + /** + * Creates a plain object from a DeleteDocumentRequest message. Also converts values to other types if specified. + * @param message DeleteDocumentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.DeleteDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteDocumentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteDocumentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchDocumentsRequest. */ + interface ISearchDocumentsRequest { + + /** SearchDocumentsRequest parent */ + parent?: (string|null); + + /** SearchDocumentsRequest requestMetadata */ + requestMetadata?: (google.cloud.contentwarehouse.v1.IRequestMetadata|null); + + /** SearchDocumentsRequest documentQuery */ + documentQuery?: (google.cloud.contentwarehouse.v1.IDocumentQuery|null); + + /** SearchDocumentsRequest offset */ + offset?: (number|null); + + /** SearchDocumentsRequest pageSize */ + pageSize?: (number|null); + + /** SearchDocumentsRequest pageToken */ + pageToken?: (string|null); + + /** SearchDocumentsRequest orderBy */ + orderBy?: (string|null); + + /** SearchDocumentsRequest histogramQueries */ + histogramQueries?: (google.cloud.contentwarehouse.v1.IHistogramQuery[]|null); + + /** SearchDocumentsRequest requireTotalSize */ + requireTotalSize?: (boolean|null); + + /** SearchDocumentsRequest totalResultSize */ + totalResultSize?: (google.cloud.contentwarehouse.v1.SearchDocumentsRequest.TotalResultSize|keyof typeof google.cloud.contentwarehouse.v1.SearchDocumentsRequest.TotalResultSize|null); + + /** SearchDocumentsRequest qaSizeLimit */ + qaSizeLimit?: (number|null); + } + + /** Represents a SearchDocumentsRequest. */ + class SearchDocumentsRequest implements ISearchDocumentsRequest { + + /** + * Constructs a new SearchDocumentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.ISearchDocumentsRequest); + + /** SearchDocumentsRequest parent. */ + public parent: string; + + /** SearchDocumentsRequest requestMetadata. */ + public requestMetadata?: (google.cloud.contentwarehouse.v1.IRequestMetadata|null); + + /** SearchDocumentsRequest documentQuery. */ + public documentQuery?: (google.cloud.contentwarehouse.v1.IDocumentQuery|null); + + /** SearchDocumentsRequest offset. */ + public offset: number; + + /** SearchDocumentsRequest pageSize. */ + public pageSize: number; + + /** SearchDocumentsRequest pageToken. */ + public pageToken: string; + + /** SearchDocumentsRequest orderBy. */ + public orderBy: string; + + /** SearchDocumentsRequest histogramQueries. */ + public histogramQueries: google.cloud.contentwarehouse.v1.IHistogramQuery[]; + + /** SearchDocumentsRequest requireTotalSize. */ + public requireTotalSize: boolean; + + /** SearchDocumentsRequest totalResultSize. */ + public totalResultSize: (google.cloud.contentwarehouse.v1.SearchDocumentsRequest.TotalResultSize|keyof typeof google.cloud.contentwarehouse.v1.SearchDocumentsRequest.TotalResultSize); + + /** SearchDocumentsRequest qaSizeLimit. */ + public qaSizeLimit: number; + + /** + * Creates a new SearchDocumentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchDocumentsRequest instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.ISearchDocumentsRequest): google.cloud.contentwarehouse.v1.SearchDocumentsRequest; + + /** + * Encodes the specified SearchDocumentsRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.SearchDocumentsRequest.verify|verify} messages. + * @param message SearchDocumentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.ISearchDocumentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchDocumentsRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.SearchDocumentsRequest.verify|verify} messages. + * @param message SearchDocumentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.ISearchDocumentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchDocumentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchDocumentsRequest + * @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.cloud.contentwarehouse.v1.SearchDocumentsRequest; + + /** + * Decodes a SearchDocumentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchDocumentsRequest + * @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.cloud.contentwarehouse.v1.SearchDocumentsRequest; + + /** + * Verifies a SearchDocumentsRequest 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 SearchDocumentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchDocumentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.SearchDocumentsRequest; + + /** + * Creates a plain object from a SearchDocumentsRequest message. Also converts values to other types if specified. + * @param message SearchDocumentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.SearchDocumentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchDocumentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchDocumentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SearchDocumentsRequest { + + /** TotalResultSize enum. */ + enum TotalResultSize { + TOTAL_RESULT_SIZE_UNSPECIFIED = 0, + ESTIMATED_SIZE = 1, + ACTUAL_SIZE = 2 + } + } + + /** Properties of a LockDocumentRequest. */ + interface ILockDocumentRequest { + + /** LockDocumentRequest name */ + name?: (string|null); + + /** LockDocumentRequest collectionId */ + collectionId?: (string|null); + + /** LockDocumentRequest lockingUser */ + lockingUser?: (google.cloud.contentwarehouse.v1.IUserInfo|null); + } + + /** Represents a LockDocumentRequest. */ + class LockDocumentRequest implements ILockDocumentRequest { + + /** + * Constructs a new LockDocumentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.ILockDocumentRequest); + + /** LockDocumentRequest name. */ + public name: string; + + /** LockDocumentRequest collectionId. */ + public collectionId: string; + + /** LockDocumentRequest lockingUser. */ + public lockingUser?: (google.cloud.contentwarehouse.v1.IUserInfo|null); + + /** + * Creates a new LockDocumentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns LockDocumentRequest instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.ILockDocumentRequest): google.cloud.contentwarehouse.v1.LockDocumentRequest; + + /** + * Encodes the specified LockDocumentRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.LockDocumentRequest.verify|verify} messages. + * @param message LockDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.ILockDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LockDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.LockDocumentRequest.verify|verify} messages. + * @param message LockDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.ILockDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LockDocumentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LockDocumentRequest + * @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.cloud.contentwarehouse.v1.LockDocumentRequest; + + /** + * Decodes a LockDocumentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LockDocumentRequest + * @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.cloud.contentwarehouse.v1.LockDocumentRequest; + + /** + * Verifies a LockDocumentRequest 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 LockDocumentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LockDocumentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.LockDocumentRequest; + + /** + * Creates a plain object from a LockDocumentRequest message. Also converts values to other types if specified. + * @param message LockDocumentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.LockDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LockDocumentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LockDocumentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FetchAclRequest. */ + interface IFetchAclRequest { + + /** FetchAclRequest resource */ + resource?: (string|null); + + /** FetchAclRequest requestMetadata */ + requestMetadata?: (google.cloud.contentwarehouse.v1.IRequestMetadata|null); + + /** FetchAclRequest projectOwner */ + projectOwner?: (boolean|null); + } + + /** Represents a FetchAclRequest. */ + class FetchAclRequest implements IFetchAclRequest { + + /** + * Constructs a new FetchAclRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IFetchAclRequest); + + /** FetchAclRequest resource. */ + public resource: string; + + /** FetchAclRequest requestMetadata. */ + public requestMetadata?: (google.cloud.contentwarehouse.v1.IRequestMetadata|null); + + /** FetchAclRequest projectOwner. */ + public projectOwner: boolean; + + /** + * Creates a new FetchAclRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns FetchAclRequest instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IFetchAclRequest): google.cloud.contentwarehouse.v1.FetchAclRequest; + + /** + * Encodes the specified FetchAclRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.FetchAclRequest.verify|verify} messages. + * @param message FetchAclRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IFetchAclRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FetchAclRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.FetchAclRequest.verify|verify} messages. + * @param message FetchAclRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IFetchAclRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FetchAclRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FetchAclRequest + * @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.cloud.contentwarehouse.v1.FetchAclRequest; + + /** + * Decodes a FetchAclRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FetchAclRequest + * @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.cloud.contentwarehouse.v1.FetchAclRequest; + + /** + * Verifies a FetchAclRequest 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 FetchAclRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FetchAclRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.FetchAclRequest; + + /** + * Creates a plain object from a FetchAclRequest message. Also converts values to other types if specified. + * @param message FetchAclRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.FetchAclRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FetchAclRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FetchAclRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SetAclRequest. */ + interface ISetAclRequest { + + /** SetAclRequest resource */ + resource?: (string|null); + + /** SetAclRequest policy */ + policy?: (google.iam.v1.IPolicy|null); + + /** SetAclRequest requestMetadata */ + requestMetadata?: (google.cloud.contentwarehouse.v1.IRequestMetadata|null); + + /** SetAclRequest projectOwner */ + projectOwner?: (boolean|null); + } + + /** Represents a SetAclRequest. */ + class SetAclRequest implements ISetAclRequest { + + /** + * Constructs a new SetAclRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.ISetAclRequest); + + /** SetAclRequest resource. */ + public resource: string; + + /** SetAclRequest policy. */ + public policy?: (google.iam.v1.IPolicy|null); + + /** SetAclRequest requestMetadata. */ + public requestMetadata?: (google.cloud.contentwarehouse.v1.IRequestMetadata|null); + + /** SetAclRequest projectOwner. */ + public projectOwner: boolean; + + /** + * Creates a new SetAclRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetAclRequest instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.ISetAclRequest): google.cloud.contentwarehouse.v1.SetAclRequest; + + /** + * Encodes the specified SetAclRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.SetAclRequest.verify|verify} messages. + * @param message SetAclRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.ISetAclRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetAclRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.SetAclRequest.verify|verify} messages. + * @param message SetAclRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.ISetAclRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetAclRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetAclRequest + * @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.cloud.contentwarehouse.v1.SetAclRequest; + + /** + * Decodes a SetAclRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetAclRequest + * @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.cloud.contentwarehouse.v1.SetAclRequest; + + /** + * Verifies a SetAclRequest 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 SetAclRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetAclRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.SetAclRequest; + + /** + * Creates a plain object from a SetAclRequest message. Also converts values to other types if specified. + * @param message SetAclRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.SetAclRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetAclRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SetAclRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DocumentQuery. */ + interface IDocumentQuery { + + /** DocumentQuery query */ + query?: (string|null); + + /** DocumentQuery isNlQuery */ + isNlQuery?: (boolean|null); + + /** DocumentQuery customPropertyFilter */ + customPropertyFilter?: (string|null); + + /** DocumentQuery timeFilters */ + timeFilters?: (google.cloud.contentwarehouse.v1.ITimeFilter[]|null); + + /** DocumentQuery documentSchemaNames */ + documentSchemaNames?: (string[]|null); + + /** DocumentQuery propertyFilter */ + propertyFilter?: (google.cloud.contentwarehouse.v1.IPropertyFilter[]|null); + + /** DocumentQuery fileTypeFilter */ + fileTypeFilter?: (google.cloud.contentwarehouse.v1.IFileTypeFilter|null); + + /** DocumentQuery folderNameFilter */ + folderNameFilter?: (string|null); + + /** DocumentQuery documentNameFilter */ + documentNameFilter?: (string[]|null); + + /** DocumentQuery queryContext */ + queryContext?: (string[]|null); + + /** DocumentQuery documentCreatorFilter */ + documentCreatorFilter?: (string[]|null); + + /** DocumentQuery customWeightsMetadata */ + customWeightsMetadata?: (google.cloud.contentwarehouse.v1.ICustomWeightsMetadata|null); + } + + /** Represents a DocumentQuery. */ + class DocumentQuery implements IDocumentQuery { + + /** + * Constructs a new DocumentQuery. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IDocumentQuery); + + /** DocumentQuery query. */ + public query: string; + + /** DocumentQuery isNlQuery. */ + public isNlQuery: boolean; + + /** DocumentQuery customPropertyFilter. */ + public customPropertyFilter: string; + + /** DocumentQuery timeFilters. */ + public timeFilters: google.cloud.contentwarehouse.v1.ITimeFilter[]; + + /** DocumentQuery documentSchemaNames. */ + public documentSchemaNames: string[]; + + /** DocumentQuery propertyFilter. */ + public propertyFilter: google.cloud.contentwarehouse.v1.IPropertyFilter[]; + + /** DocumentQuery fileTypeFilter. */ + public fileTypeFilter?: (google.cloud.contentwarehouse.v1.IFileTypeFilter|null); + + /** DocumentQuery folderNameFilter. */ + public folderNameFilter: string; + + /** DocumentQuery documentNameFilter. */ + public documentNameFilter: string[]; + + /** DocumentQuery queryContext. */ + public queryContext: string[]; + + /** DocumentQuery documentCreatorFilter. */ + public documentCreatorFilter: string[]; + + /** DocumentQuery customWeightsMetadata. */ + public customWeightsMetadata?: (google.cloud.contentwarehouse.v1.ICustomWeightsMetadata|null); + + /** + * Creates a new DocumentQuery instance using the specified properties. + * @param [properties] Properties to set + * @returns DocumentQuery instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IDocumentQuery): google.cloud.contentwarehouse.v1.DocumentQuery; + + /** + * Encodes the specified DocumentQuery message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DocumentQuery.verify|verify} messages. + * @param message DocumentQuery message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IDocumentQuery, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DocumentQuery message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DocumentQuery.verify|verify} messages. + * @param message DocumentQuery message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IDocumentQuery, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DocumentQuery message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DocumentQuery + * @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.cloud.contentwarehouse.v1.DocumentQuery; + + /** + * Decodes a DocumentQuery message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DocumentQuery + * @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.cloud.contentwarehouse.v1.DocumentQuery; + + /** + * Verifies a DocumentQuery 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 DocumentQuery message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DocumentQuery + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.DocumentQuery; + + /** + * Creates a plain object from a DocumentQuery message. Also converts values to other types if specified. + * @param message DocumentQuery + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.DocumentQuery, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DocumentQuery to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DocumentQuery + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimeFilter. */ + interface ITimeFilter { + + /** TimeFilter timeRange */ + timeRange?: (google.type.IInterval|null); + + /** TimeFilter timeField */ + timeField?: (google.cloud.contentwarehouse.v1.TimeFilter.TimeField|keyof typeof google.cloud.contentwarehouse.v1.TimeFilter.TimeField|null); + } + + /** Represents a TimeFilter. */ + class TimeFilter implements ITimeFilter { + + /** + * Constructs a new TimeFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.ITimeFilter); + + /** TimeFilter timeRange. */ + public timeRange?: (google.type.IInterval|null); + + /** TimeFilter timeField. */ + public timeField: (google.cloud.contentwarehouse.v1.TimeFilter.TimeField|keyof typeof google.cloud.contentwarehouse.v1.TimeFilter.TimeField); + + /** + * Creates a new TimeFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeFilter instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.ITimeFilter): google.cloud.contentwarehouse.v1.TimeFilter; + + /** + * Encodes the specified TimeFilter message. Does not implicitly {@link google.cloud.contentwarehouse.v1.TimeFilter.verify|verify} messages. + * @param message TimeFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.ITimeFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeFilter message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.TimeFilter.verify|verify} messages. + * @param message TimeFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.ITimeFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimeFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimeFilter + * @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.cloud.contentwarehouse.v1.TimeFilter; + + /** + * Decodes a TimeFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimeFilter + * @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.cloud.contentwarehouse.v1.TimeFilter; + + /** + * Verifies a TimeFilter 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 TimeFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimeFilter + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.TimeFilter; + + /** + * Creates a plain object from a TimeFilter message. Also converts values to other types if specified. + * @param message TimeFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.TimeFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimeFilter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TimeFilter { + + /** TimeField enum. */ + enum TimeField { + TIME_FIELD_UNSPECIFIED = 0, + CREATE_TIME = 1, + UPDATE_TIME = 2, + DISPOSITION_TIME = 3 + } + } + + /** Properties of a PropertyFilter. */ + interface IPropertyFilter { + + /** PropertyFilter documentSchemaName */ + documentSchemaName?: (string|null); + + /** PropertyFilter condition */ + condition?: (string|null); + } + + /** Represents a PropertyFilter. */ + class PropertyFilter implements IPropertyFilter { + + /** + * Constructs a new PropertyFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IPropertyFilter); + + /** PropertyFilter documentSchemaName. */ + public documentSchemaName: string; + + /** PropertyFilter condition. */ + public condition: string; + + /** + * Creates a new PropertyFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns PropertyFilter instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IPropertyFilter): google.cloud.contentwarehouse.v1.PropertyFilter; + + /** + * Encodes the specified PropertyFilter message. Does not implicitly {@link google.cloud.contentwarehouse.v1.PropertyFilter.verify|verify} messages. + * @param message PropertyFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IPropertyFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PropertyFilter message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.PropertyFilter.verify|verify} messages. + * @param message PropertyFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IPropertyFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PropertyFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PropertyFilter + * @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.cloud.contentwarehouse.v1.PropertyFilter; + + /** + * Decodes a PropertyFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PropertyFilter + * @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.cloud.contentwarehouse.v1.PropertyFilter; + + /** + * Verifies a PropertyFilter 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 PropertyFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PropertyFilter + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.PropertyFilter; + + /** + * Creates a plain object from a PropertyFilter message. Also converts values to other types if specified. + * @param message PropertyFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.PropertyFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PropertyFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PropertyFilter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileTypeFilter. */ + interface IFileTypeFilter { + + /** FileTypeFilter fileType */ + fileType?: (google.cloud.contentwarehouse.v1.FileTypeFilter.FileType|keyof typeof google.cloud.contentwarehouse.v1.FileTypeFilter.FileType|null); + } + + /** Represents a FileTypeFilter. */ + class FileTypeFilter implements IFileTypeFilter { + + /** + * Constructs a new FileTypeFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IFileTypeFilter); + + /** FileTypeFilter fileType. */ + public fileType: (google.cloud.contentwarehouse.v1.FileTypeFilter.FileType|keyof typeof google.cloud.contentwarehouse.v1.FileTypeFilter.FileType); + + /** + * Creates a new FileTypeFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns FileTypeFilter instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IFileTypeFilter): google.cloud.contentwarehouse.v1.FileTypeFilter; + + /** + * Encodes the specified FileTypeFilter message. Does not implicitly {@link google.cloud.contentwarehouse.v1.FileTypeFilter.verify|verify} messages. + * @param message FileTypeFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IFileTypeFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileTypeFilter message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.FileTypeFilter.verify|verify} messages. + * @param message FileTypeFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IFileTypeFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileTypeFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileTypeFilter + * @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.cloud.contentwarehouse.v1.FileTypeFilter; + + /** + * Decodes a FileTypeFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileTypeFilter + * @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.cloud.contentwarehouse.v1.FileTypeFilter; + + /** + * Verifies a FileTypeFilter 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 FileTypeFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileTypeFilter + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.FileTypeFilter; + + /** + * Creates a plain object from a FileTypeFilter message. Also converts values to other types if specified. + * @param message FileTypeFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.FileTypeFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileTypeFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileTypeFilter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileTypeFilter { + + /** FileType enum. */ + enum FileType { + FILE_TYPE_UNSPECIFIED = 0, + ALL = 1, + FOLDER = 2, + DOCUMENT = 3, + ROOT_FOLDER = 4 + } + } + + /** Properties of a CustomWeightsMetadata. */ + interface ICustomWeightsMetadata { + + /** CustomWeightsMetadata weightedSchemaProperties */ + weightedSchemaProperties?: (google.cloud.contentwarehouse.v1.IWeightedSchemaProperty[]|null); + } + + /** Represents a CustomWeightsMetadata. */ + class CustomWeightsMetadata implements ICustomWeightsMetadata { + + /** + * Constructs a new CustomWeightsMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.ICustomWeightsMetadata); + + /** CustomWeightsMetadata weightedSchemaProperties. */ + public weightedSchemaProperties: google.cloud.contentwarehouse.v1.IWeightedSchemaProperty[]; + + /** + * Creates a new CustomWeightsMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomWeightsMetadata instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.ICustomWeightsMetadata): google.cloud.contentwarehouse.v1.CustomWeightsMetadata; + + /** + * Encodes the specified CustomWeightsMetadata message. Does not implicitly {@link google.cloud.contentwarehouse.v1.CustomWeightsMetadata.verify|verify} messages. + * @param message CustomWeightsMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.ICustomWeightsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomWeightsMetadata message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.CustomWeightsMetadata.verify|verify} messages. + * @param message CustomWeightsMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.ICustomWeightsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomWeightsMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomWeightsMetadata + * @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.cloud.contentwarehouse.v1.CustomWeightsMetadata; + + /** + * Decodes a CustomWeightsMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomWeightsMetadata + * @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.cloud.contentwarehouse.v1.CustomWeightsMetadata; + + /** + * Verifies a CustomWeightsMetadata 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 CustomWeightsMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomWeightsMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.CustomWeightsMetadata; + + /** + * Creates a plain object from a CustomWeightsMetadata message. Also converts values to other types if specified. + * @param message CustomWeightsMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.CustomWeightsMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomWeightsMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomWeightsMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WeightedSchemaProperty. */ + interface IWeightedSchemaProperty { + + /** WeightedSchemaProperty documentSchemaName */ + documentSchemaName?: (string|null); + + /** WeightedSchemaProperty propertyNames */ + propertyNames?: (string[]|null); + } + + /** Represents a WeightedSchemaProperty. */ + class WeightedSchemaProperty implements IWeightedSchemaProperty { + + /** + * Constructs a new WeightedSchemaProperty. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IWeightedSchemaProperty); + + /** WeightedSchemaProperty documentSchemaName. */ + public documentSchemaName: string; + + /** WeightedSchemaProperty propertyNames. */ + public propertyNames: string[]; + + /** + * Creates a new WeightedSchemaProperty instance using the specified properties. + * @param [properties] Properties to set + * @returns WeightedSchemaProperty instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IWeightedSchemaProperty): google.cloud.contentwarehouse.v1.WeightedSchemaProperty; + + /** + * Encodes the specified WeightedSchemaProperty message. Does not implicitly {@link google.cloud.contentwarehouse.v1.WeightedSchemaProperty.verify|verify} messages. + * @param message WeightedSchemaProperty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IWeightedSchemaProperty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WeightedSchemaProperty message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.WeightedSchemaProperty.verify|verify} messages. + * @param message WeightedSchemaProperty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IWeightedSchemaProperty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WeightedSchemaProperty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WeightedSchemaProperty + * @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.cloud.contentwarehouse.v1.WeightedSchemaProperty; + + /** + * Decodes a WeightedSchemaProperty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WeightedSchemaProperty + * @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.cloud.contentwarehouse.v1.WeightedSchemaProperty; + + /** + * Verifies a WeightedSchemaProperty 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 WeightedSchemaProperty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WeightedSchemaProperty + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.WeightedSchemaProperty; + + /** + * Creates a plain object from a WeightedSchemaProperty message. Also converts values to other types if specified. + * @param message WeightedSchemaProperty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.WeightedSchemaProperty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WeightedSchemaProperty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WeightedSchemaProperty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HistogramQuery. */ + interface IHistogramQuery { + + /** HistogramQuery histogramQuery */ + histogramQuery?: (string|null); + + /** HistogramQuery requirePreciseResultSize */ + requirePreciseResultSize?: (boolean|null); + + /** HistogramQuery filters */ + filters?: (google.cloud.contentwarehouse.v1.IHistogramQueryPropertyNameFilter|null); + } + + /** Represents a HistogramQuery. */ + class HistogramQuery implements IHistogramQuery { + + /** + * Constructs a new HistogramQuery. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IHistogramQuery); + + /** HistogramQuery histogramQuery. */ + public histogramQuery: string; + + /** HistogramQuery requirePreciseResultSize. */ + public requirePreciseResultSize: boolean; + + /** HistogramQuery filters. */ + public filters?: (google.cloud.contentwarehouse.v1.IHistogramQueryPropertyNameFilter|null); + + /** + * Creates a new HistogramQuery instance using the specified properties. + * @param [properties] Properties to set + * @returns HistogramQuery instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IHistogramQuery): google.cloud.contentwarehouse.v1.HistogramQuery; + + /** + * Encodes the specified HistogramQuery message. Does not implicitly {@link google.cloud.contentwarehouse.v1.HistogramQuery.verify|verify} messages. + * @param message HistogramQuery message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IHistogramQuery, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HistogramQuery message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.HistogramQuery.verify|verify} messages. + * @param message HistogramQuery message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IHistogramQuery, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HistogramQuery message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HistogramQuery + * @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.cloud.contentwarehouse.v1.HistogramQuery; + + /** + * Decodes a HistogramQuery message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HistogramQuery + * @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.cloud.contentwarehouse.v1.HistogramQuery; + + /** + * Verifies a HistogramQuery 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 HistogramQuery message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HistogramQuery + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.HistogramQuery; + + /** + * Creates a plain object from a HistogramQuery message. Also converts values to other types if specified. + * @param message HistogramQuery + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.HistogramQuery, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HistogramQuery to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HistogramQuery + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HistogramQueryPropertyNameFilter. */ + interface IHistogramQueryPropertyNameFilter { + + /** HistogramQueryPropertyNameFilter documentSchemas */ + documentSchemas?: (string[]|null); + + /** HistogramQueryPropertyNameFilter propertyNames */ + propertyNames?: (string[]|null); + + /** HistogramQueryPropertyNameFilter yAxis */ + yAxis?: (google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.HistogramYAxis|keyof typeof google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.HistogramYAxis|null); + } + + /** Represents a HistogramQueryPropertyNameFilter. */ + class HistogramQueryPropertyNameFilter implements IHistogramQueryPropertyNameFilter { + + /** + * Constructs a new HistogramQueryPropertyNameFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IHistogramQueryPropertyNameFilter); + + /** HistogramQueryPropertyNameFilter documentSchemas. */ + public documentSchemas: string[]; + + /** HistogramQueryPropertyNameFilter propertyNames. */ + public propertyNames: string[]; + + /** HistogramQueryPropertyNameFilter yAxis. */ + public yAxis: (google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.HistogramYAxis|keyof typeof google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.HistogramYAxis); + + /** + * Creates a new HistogramQueryPropertyNameFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns HistogramQueryPropertyNameFilter instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IHistogramQueryPropertyNameFilter): google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter; + + /** + * Encodes the specified HistogramQueryPropertyNameFilter message. Does not implicitly {@link google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.verify|verify} messages. + * @param message HistogramQueryPropertyNameFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IHistogramQueryPropertyNameFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HistogramQueryPropertyNameFilter message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.verify|verify} messages. + * @param message HistogramQueryPropertyNameFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IHistogramQueryPropertyNameFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HistogramQueryPropertyNameFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HistogramQueryPropertyNameFilter + * @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.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter; + + /** + * Decodes a HistogramQueryPropertyNameFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HistogramQueryPropertyNameFilter + * @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.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter; + + /** + * Verifies a HistogramQueryPropertyNameFilter 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 HistogramQueryPropertyNameFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HistogramQueryPropertyNameFilter + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter; + + /** + * Creates a plain object from a HistogramQueryPropertyNameFilter message. Also converts values to other types if specified. + * @param message HistogramQueryPropertyNameFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HistogramQueryPropertyNameFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HistogramQueryPropertyNameFilter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace HistogramQueryPropertyNameFilter { + + /** HistogramYAxis enum. */ + enum HistogramYAxis { + HISTOGRAM_YAXIS_DOCUMENT = 0, + HISTOGRAM_YAXIS_PROPERTY = 1 + } + } + + /** Properties of a HistogramQueryResult. */ + interface IHistogramQueryResult { + + /** HistogramQueryResult histogramQuery */ + histogramQuery?: (string|null); + + /** HistogramQueryResult histogram */ + histogram?: ({ [k: string]: (number|Long|string) }|null); + } + + /** Represents a HistogramQueryResult. */ + class HistogramQueryResult implements IHistogramQueryResult { + + /** + * Constructs a new HistogramQueryResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IHistogramQueryResult); + + /** HistogramQueryResult histogramQuery. */ + public histogramQuery: string; + + /** HistogramQueryResult histogram. */ + public histogram: { [k: string]: (number|Long|string) }; + + /** + * Creates a new HistogramQueryResult instance using the specified properties. + * @param [properties] Properties to set + * @returns HistogramQueryResult instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IHistogramQueryResult): google.cloud.contentwarehouse.v1.HistogramQueryResult; + + /** + * Encodes the specified HistogramQueryResult message. Does not implicitly {@link google.cloud.contentwarehouse.v1.HistogramQueryResult.verify|verify} messages. + * @param message HistogramQueryResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IHistogramQueryResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HistogramQueryResult message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.HistogramQueryResult.verify|verify} messages. + * @param message HistogramQueryResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IHistogramQueryResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HistogramQueryResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HistogramQueryResult + * @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.cloud.contentwarehouse.v1.HistogramQueryResult; + + /** + * Decodes a HistogramQueryResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HistogramQueryResult + * @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.cloud.contentwarehouse.v1.HistogramQueryResult; + + /** + * Verifies a HistogramQueryResult 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 HistogramQueryResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HistogramQueryResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.HistogramQueryResult; + + /** + * Creates a plain object from a HistogramQueryResult message. Also converts values to other types if specified. + * @param message HistogramQueryResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.HistogramQueryResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HistogramQueryResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HistogramQueryResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RuleSet. */ + interface IRuleSet { + + /** RuleSet name */ + name?: (string|null); + + /** RuleSet description */ + description?: (string|null); + + /** RuleSet source */ + source?: (string|null); + + /** RuleSet rules */ + rules?: (google.cloud.contentwarehouse.v1.IRule[]|null); + } + + /** Represents a RuleSet. */ + class RuleSet implements IRuleSet { + + /** + * Constructs a new RuleSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IRuleSet); + + /** RuleSet name. */ + public name: string; + + /** RuleSet description. */ + public description: string; + + /** RuleSet source. */ + public source: string; + + /** RuleSet rules. */ + public rules: google.cloud.contentwarehouse.v1.IRule[]; + + /** + * Creates a new RuleSet instance using the specified properties. + * @param [properties] Properties to set + * @returns RuleSet instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IRuleSet): google.cloud.contentwarehouse.v1.RuleSet; + + /** + * Encodes the specified RuleSet message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RuleSet.verify|verify} messages. + * @param message RuleSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IRuleSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RuleSet message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RuleSet.verify|verify} messages. + * @param message RuleSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IRuleSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RuleSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RuleSet + * @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.cloud.contentwarehouse.v1.RuleSet; + + /** + * Decodes a RuleSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RuleSet + * @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.cloud.contentwarehouse.v1.RuleSet; + + /** + * Verifies a RuleSet 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 RuleSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RuleSet + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.RuleSet; + + /** + * Creates a plain object from a RuleSet message. Also converts values to other types if specified. + * @param message RuleSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.RuleSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RuleSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RuleSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Rule. */ + interface IRule { + + /** Rule description */ + description?: (string|null); + + /** Rule ruleId */ + ruleId?: (string|null); + + /** Rule triggerType */ + triggerType?: (google.cloud.contentwarehouse.v1.Rule.TriggerType|keyof typeof google.cloud.contentwarehouse.v1.Rule.TriggerType|null); + + /** Rule condition */ + condition?: (string|null); + + /** Rule actions */ + actions?: (google.cloud.contentwarehouse.v1.IAction[]|null); + } + + /** Represents a Rule. */ + class Rule implements IRule { + + /** + * Constructs a new Rule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IRule); + + /** Rule description. */ + public description: string; + + /** Rule ruleId. */ + public ruleId: string; + + /** Rule triggerType. */ + public triggerType: (google.cloud.contentwarehouse.v1.Rule.TriggerType|keyof typeof google.cloud.contentwarehouse.v1.Rule.TriggerType); + + /** Rule condition. */ + public condition: string; + + /** Rule actions. */ + public actions: google.cloud.contentwarehouse.v1.IAction[]; + + /** + * Creates a new Rule instance using the specified properties. + * @param [properties] Properties to set + * @returns Rule instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IRule): google.cloud.contentwarehouse.v1.Rule; + + /** + * Encodes the specified Rule message. Does not implicitly {@link google.cloud.contentwarehouse.v1.Rule.verify|verify} messages. + * @param message Rule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Rule message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.Rule.verify|verify} messages. + * @param message Rule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Rule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Rule + * @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.cloud.contentwarehouse.v1.Rule; + + /** + * Decodes a Rule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Rule + * @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.cloud.contentwarehouse.v1.Rule; + + /** + * Verifies a Rule 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 Rule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Rule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.Rule; + + /** + * Creates a plain object from a Rule message. Also converts values to other types if specified. + * @param message Rule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.Rule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Rule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Rule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Rule { + + /** TriggerType enum. */ + enum TriggerType { + UNKNOWN = 0, + ON_CREATE = 1, + ON_UPDATE = 4, + ON_CREATE_LINK = 7, + ON_DELETE_LINK = 8 + } + } + + /** Properties of an Action. */ + interface IAction { + + /** Action actionId */ + actionId?: (string|null); + + /** Action accessControl */ + accessControl?: (google.cloud.contentwarehouse.v1.IAccessControlAction|null); + + /** Action dataValidation */ + dataValidation?: (google.cloud.contentwarehouse.v1.IDataValidationAction|null); + + /** Action dataUpdate */ + dataUpdate?: (google.cloud.contentwarehouse.v1.IDataUpdateAction|null); + + /** Action addToFolder */ + addToFolder?: (google.cloud.contentwarehouse.v1.IAddToFolderAction|null); + + /** Action publishToPubSub */ + publishToPubSub?: (google.cloud.contentwarehouse.v1.IPublishAction|null); + + /** Action removeFromFolderAction */ + removeFromFolderAction?: (google.cloud.contentwarehouse.v1.IRemoveFromFolderAction|null); + + /** Action deleteDocumentAction */ + deleteDocumentAction?: (google.cloud.contentwarehouse.v1.IDeleteDocumentAction|null); + } + + /** Represents an Action. */ + class Action implements IAction { + + /** + * Constructs a new Action. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IAction); + + /** Action actionId. */ + public actionId: string; + + /** Action accessControl. */ + public accessControl?: (google.cloud.contentwarehouse.v1.IAccessControlAction|null); + + /** Action dataValidation. */ + public dataValidation?: (google.cloud.contentwarehouse.v1.IDataValidationAction|null); + + /** Action dataUpdate. */ + public dataUpdate?: (google.cloud.contentwarehouse.v1.IDataUpdateAction|null); + + /** Action addToFolder. */ + public addToFolder?: (google.cloud.contentwarehouse.v1.IAddToFolderAction|null); + + /** Action publishToPubSub. */ + public publishToPubSub?: (google.cloud.contentwarehouse.v1.IPublishAction|null); + + /** Action removeFromFolderAction. */ + public removeFromFolderAction?: (google.cloud.contentwarehouse.v1.IRemoveFromFolderAction|null); + + /** Action deleteDocumentAction. */ + public deleteDocumentAction?: (google.cloud.contentwarehouse.v1.IDeleteDocumentAction|null); + + /** Action action. */ + public action?: ("accessControl"|"dataValidation"|"dataUpdate"|"addToFolder"|"publishToPubSub"|"removeFromFolderAction"|"deleteDocumentAction"); + + /** + * Creates a new Action instance using the specified properties. + * @param [properties] Properties to set + * @returns Action instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IAction): google.cloud.contentwarehouse.v1.Action; + + /** + * Encodes the specified Action message. Does not implicitly {@link google.cloud.contentwarehouse.v1.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.cloud.contentwarehouse.v1.IAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Action message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.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.cloud.contentwarehouse.v1.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.cloud.contentwarehouse.v1.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.cloud.contentwarehouse.v1.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.cloud.contentwarehouse.v1.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.cloud.contentwarehouse.v1.Action, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Action to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Action + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccessControlAction. */ + interface IAccessControlAction { + + /** AccessControlAction operationType */ + operationType?: (google.cloud.contentwarehouse.v1.AccessControlAction.OperationType|keyof typeof google.cloud.contentwarehouse.v1.AccessControlAction.OperationType|null); + + /** AccessControlAction policy */ + policy?: (google.iam.v1.IPolicy|null); + } + + /** Represents an AccessControlAction. */ + class AccessControlAction implements IAccessControlAction { + + /** + * Constructs a new AccessControlAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IAccessControlAction); + + /** AccessControlAction operationType. */ + public operationType: (google.cloud.contentwarehouse.v1.AccessControlAction.OperationType|keyof typeof google.cloud.contentwarehouse.v1.AccessControlAction.OperationType); + + /** AccessControlAction policy. */ + public policy?: (google.iam.v1.IPolicy|null); + + /** + * Creates a new AccessControlAction instance using the specified properties. + * @param [properties] Properties to set + * @returns AccessControlAction instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IAccessControlAction): google.cloud.contentwarehouse.v1.AccessControlAction; + + /** + * Encodes the specified AccessControlAction message. Does not implicitly {@link google.cloud.contentwarehouse.v1.AccessControlAction.verify|verify} messages. + * @param message AccessControlAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IAccessControlAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccessControlAction message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.AccessControlAction.verify|verify} messages. + * @param message AccessControlAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IAccessControlAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccessControlAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccessControlAction + * @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.cloud.contentwarehouse.v1.AccessControlAction; + + /** + * Decodes an AccessControlAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccessControlAction + * @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.cloud.contentwarehouse.v1.AccessControlAction; + + /** + * Verifies an AccessControlAction 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 AccessControlAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccessControlAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.AccessControlAction; + + /** + * Creates a plain object from an AccessControlAction message. Also converts values to other types if specified. + * @param message AccessControlAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.AccessControlAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccessControlAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccessControlAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AccessControlAction { + + /** OperationType enum. */ + enum OperationType { + UNKNOWN = 0, + ADD_POLICY_BINDING = 1, + REMOVE_POLICY_BINDING = 2, + REPLACE_POLICY_BINDING = 3 + } + } + + /** Properties of a DataValidationAction. */ + interface IDataValidationAction { + + /** DataValidationAction conditions */ + conditions?: ({ [k: string]: string }|null); + } + + /** Represents a DataValidationAction. */ + class DataValidationAction implements IDataValidationAction { + + /** + * Constructs a new DataValidationAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IDataValidationAction); + + /** DataValidationAction conditions. */ + public conditions: { [k: string]: string }; + + /** + * Creates a new DataValidationAction instance using the specified properties. + * @param [properties] Properties to set + * @returns DataValidationAction instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IDataValidationAction): google.cloud.contentwarehouse.v1.DataValidationAction; + + /** + * Encodes the specified DataValidationAction message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DataValidationAction.verify|verify} messages. + * @param message DataValidationAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IDataValidationAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataValidationAction message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DataValidationAction.verify|verify} messages. + * @param message DataValidationAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IDataValidationAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataValidationAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataValidationAction + * @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.cloud.contentwarehouse.v1.DataValidationAction; + + /** + * Decodes a DataValidationAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataValidationAction + * @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.cloud.contentwarehouse.v1.DataValidationAction; + + /** + * Verifies a DataValidationAction 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 DataValidationAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataValidationAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.DataValidationAction; + + /** + * Creates a plain object from a DataValidationAction message. Also converts values to other types if specified. + * @param message DataValidationAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.DataValidationAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataValidationAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataValidationAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DataUpdateAction. */ + interface IDataUpdateAction { + + /** DataUpdateAction entries */ + entries?: ({ [k: string]: string }|null); + } + + /** Represents a DataUpdateAction. */ + class DataUpdateAction implements IDataUpdateAction { + + /** + * Constructs a new DataUpdateAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IDataUpdateAction); + + /** DataUpdateAction entries. */ + public entries: { [k: string]: string }; + + /** + * Creates a new DataUpdateAction instance using the specified properties. + * @param [properties] Properties to set + * @returns DataUpdateAction instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IDataUpdateAction): google.cloud.contentwarehouse.v1.DataUpdateAction; + + /** + * Encodes the specified DataUpdateAction message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DataUpdateAction.verify|verify} messages. + * @param message DataUpdateAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IDataUpdateAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataUpdateAction message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DataUpdateAction.verify|verify} messages. + * @param message DataUpdateAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IDataUpdateAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataUpdateAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataUpdateAction + * @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.cloud.contentwarehouse.v1.DataUpdateAction; + + /** + * Decodes a DataUpdateAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataUpdateAction + * @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.cloud.contentwarehouse.v1.DataUpdateAction; + + /** + * Verifies a DataUpdateAction 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 DataUpdateAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataUpdateAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.DataUpdateAction; + + /** + * Creates a plain object from a DataUpdateAction message. Also converts values to other types if specified. + * @param message DataUpdateAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.DataUpdateAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataUpdateAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataUpdateAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AddToFolderAction. */ + interface IAddToFolderAction { + + /** AddToFolderAction folders */ + folders?: (string[]|null); + } + + /** Represents an AddToFolderAction. */ + class AddToFolderAction implements IAddToFolderAction { + + /** + * Constructs a new AddToFolderAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IAddToFolderAction); + + /** AddToFolderAction folders. */ + public folders: string[]; + + /** + * Creates a new AddToFolderAction instance using the specified properties. + * @param [properties] Properties to set + * @returns AddToFolderAction instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IAddToFolderAction): google.cloud.contentwarehouse.v1.AddToFolderAction; + + /** + * Encodes the specified AddToFolderAction message. Does not implicitly {@link google.cloud.contentwarehouse.v1.AddToFolderAction.verify|verify} messages. + * @param message AddToFolderAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IAddToFolderAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AddToFolderAction message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.AddToFolderAction.verify|verify} messages. + * @param message AddToFolderAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IAddToFolderAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AddToFolderAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AddToFolderAction + * @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.cloud.contentwarehouse.v1.AddToFolderAction; + + /** + * Decodes an AddToFolderAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AddToFolderAction + * @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.cloud.contentwarehouse.v1.AddToFolderAction; + + /** + * Verifies an AddToFolderAction 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 AddToFolderAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AddToFolderAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.AddToFolderAction; + + /** + * Creates a plain object from an AddToFolderAction message. Also converts values to other types if specified. + * @param message AddToFolderAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.AddToFolderAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AddToFolderAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AddToFolderAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RemoveFromFolderAction. */ + interface IRemoveFromFolderAction { + + /** RemoveFromFolderAction condition */ + condition?: (string|null); + + /** RemoveFromFolderAction folder */ + folder?: (string|null); + } + + /** Represents a RemoveFromFolderAction. */ + class RemoveFromFolderAction implements IRemoveFromFolderAction { + + /** + * Constructs a new RemoveFromFolderAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IRemoveFromFolderAction); + + /** RemoveFromFolderAction condition. */ + public condition: string; + + /** RemoveFromFolderAction folder. */ + public folder: string; + + /** + * Creates a new RemoveFromFolderAction instance using the specified properties. + * @param [properties] Properties to set + * @returns RemoveFromFolderAction instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IRemoveFromFolderAction): google.cloud.contentwarehouse.v1.RemoveFromFolderAction; + + /** + * Encodes the specified RemoveFromFolderAction message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RemoveFromFolderAction.verify|verify} messages. + * @param message RemoveFromFolderAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IRemoveFromFolderAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RemoveFromFolderAction message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RemoveFromFolderAction.verify|verify} messages. + * @param message RemoveFromFolderAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IRemoveFromFolderAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RemoveFromFolderAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RemoveFromFolderAction + * @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.cloud.contentwarehouse.v1.RemoveFromFolderAction; + + /** + * Decodes a RemoveFromFolderAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RemoveFromFolderAction + * @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.cloud.contentwarehouse.v1.RemoveFromFolderAction; + + /** + * Verifies a RemoveFromFolderAction 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 RemoveFromFolderAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RemoveFromFolderAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.RemoveFromFolderAction; + + /** + * Creates a plain object from a RemoveFromFolderAction message. Also converts values to other types if specified. + * @param message RemoveFromFolderAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.RemoveFromFolderAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RemoveFromFolderAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RemoveFromFolderAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PublishAction. */ + interface IPublishAction { + + /** PublishAction topicId */ + topicId?: (string|null); + + /** PublishAction messages */ + messages?: (string[]|null); + } + + /** Represents a PublishAction. */ + class PublishAction implements IPublishAction { + + /** + * Constructs a new PublishAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IPublishAction); + + /** PublishAction topicId. */ + public topicId: string; + + /** PublishAction messages. */ + public messages: string[]; + + /** + * Creates a new PublishAction instance using the specified properties. + * @param [properties] Properties to set + * @returns PublishAction instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IPublishAction): google.cloud.contentwarehouse.v1.PublishAction; + + /** + * Encodes the specified PublishAction message. Does not implicitly {@link google.cloud.contentwarehouse.v1.PublishAction.verify|verify} messages. + * @param message PublishAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IPublishAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PublishAction message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.PublishAction.verify|verify} messages. + * @param message PublishAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IPublishAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PublishAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PublishAction + * @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.cloud.contentwarehouse.v1.PublishAction; + + /** + * Decodes a PublishAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PublishAction + * @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.cloud.contentwarehouse.v1.PublishAction; + + /** + * Verifies a PublishAction 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 PublishAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PublishAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.PublishAction; + + /** + * Creates a plain object from a PublishAction message. Also converts values to other types if specified. + * @param message PublishAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.PublishAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PublishAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PublishAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteDocumentAction. */ + interface IDeleteDocumentAction { + + /** DeleteDocumentAction enableHardDelete */ + enableHardDelete?: (boolean|null); + } + + /** Represents a DeleteDocumentAction. */ + class DeleteDocumentAction implements IDeleteDocumentAction { + + /** + * Constructs a new DeleteDocumentAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IDeleteDocumentAction); + + /** DeleteDocumentAction enableHardDelete. */ + public enableHardDelete: boolean; + + /** + * Creates a new DeleteDocumentAction instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteDocumentAction instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IDeleteDocumentAction): google.cloud.contentwarehouse.v1.DeleteDocumentAction; + + /** + * Encodes the specified DeleteDocumentAction message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DeleteDocumentAction.verify|verify} messages. + * @param message DeleteDocumentAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IDeleteDocumentAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteDocumentAction message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DeleteDocumentAction.verify|verify} messages. + * @param message DeleteDocumentAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IDeleteDocumentAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteDocumentAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteDocumentAction + * @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.cloud.contentwarehouse.v1.DeleteDocumentAction; + + /** + * Decodes a DeleteDocumentAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteDocumentAction + * @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.cloud.contentwarehouse.v1.DeleteDocumentAction; + + /** + * Verifies a DeleteDocumentAction 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 DeleteDocumentAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteDocumentAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.DeleteDocumentAction; + + /** + * Creates a plain object from a DeleteDocumentAction message. Also converts values to other types if specified. + * @param message DeleteDocumentAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.DeleteDocumentAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteDocumentAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteDocumentAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RuleEngineOutput. */ + interface IRuleEngineOutput { + + /** RuleEngineOutput documentName */ + documentName?: (string|null); + + /** RuleEngineOutput ruleEvaluatorOutput */ + ruleEvaluatorOutput?: (google.cloud.contentwarehouse.v1.IRuleEvaluatorOutput|null); + + /** RuleEngineOutput actionExecutorOutput */ + actionExecutorOutput?: (google.cloud.contentwarehouse.v1.IActionExecutorOutput|null); + } + + /** Represents a RuleEngineOutput. */ + class RuleEngineOutput implements IRuleEngineOutput { + + /** + * Constructs a new RuleEngineOutput. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IRuleEngineOutput); + + /** RuleEngineOutput documentName. */ + public documentName: string; + + /** RuleEngineOutput ruleEvaluatorOutput. */ + public ruleEvaluatorOutput?: (google.cloud.contentwarehouse.v1.IRuleEvaluatorOutput|null); + + /** RuleEngineOutput actionExecutorOutput. */ + public actionExecutorOutput?: (google.cloud.contentwarehouse.v1.IActionExecutorOutput|null); + + /** + * Creates a new RuleEngineOutput instance using the specified properties. + * @param [properties] Properties to set + * @returns RuleEngineOutput instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IRuleEngineOutput): google.cloud.contentwarehouse.v1.RuleEngineOutput; + + /** + * Encodes the specified RuleEngineOutput message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RuleEngineOutput.verify|verify} messages. + * @param message RuleEngineOutput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IRuleEngineOutput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RuleEngineOutput message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RuleEngineOutput.verify|verify} messages. + * @param message RuleEngineOutput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IRuleEngineOutput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RuleEngineOutput message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RuleEngineOutput + * @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.cloud.contentwarehouse.v1.RuleEngineOutput; + + /** + * Decodes a RuleEngineOutput message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RuleEngineOutput + * @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.cloud.contentwarehouse.v1.RuleEngineOutput; + + /** + * Verifies a RuleEngineOutput 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 RuleEngineOutput message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RuleEngineOutput + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.RuleEngineOutput; + + /** + * Creates a plain object from a RuleEngineOutput message. Also converts values to other types if specified. + * @param message RuleEngineOutput + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.RuleEngineOutput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RuleEngineOutput to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RuleEngineOutput + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RuleEvaluatorOutput. */ + interface IRuleEvaluatorOutput { + + /** RuleEvaluatorOutput triggeredRules */ + triggeredRules?: (google.cloud.contentwarehouse.v1.IRule[]|null); + + /** RuleEvaluatorOutput matchedRules */ + matchedRules?: (google.cloud.contentwarehouse.v1.IRule[]|null); + + /** RuleEvaluatorOutput invalidRules */ + invalidRules?: (google.cloud.contentwarehouse.v1.IInvalidRule[]|null); + } + + /** Represents a RuleEvaluatorOutput. */ + class RuleEvaluatorOutput implements IRuleEvaluatorOutput { + + /** + * Constructs a new RuleEvaluatorOutput. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IRuleEvaluatorOutput); + + /** RuleEvaluatorOutput triggeredRules. */ + public triggeredRules: google.cloud.contentwarehouse.v1.IRule[]; + + /** RuleEvaluatorOutput matchedRules. */ + public matchedRules: google.cloud.contentwarehouse.v1.IRule[]; + + /** RuleEvaluatorOutput invalidRules. */ + public invalidRules: google.cloud.contentwarehouse.v1.IInvalidRule[]; + + /** + * Creates a new RuleEvaluatorOutput instance using the specified properties. + * @param [properties] Properties to set + * @returns RuleEvaluatorOutput instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IRuleEvaluatorOutput): google.cloud.contentwarehouse.v1.RuleEvaluatorOutput; + + /** + * Encodes the specified RuleEvaluatorOutput message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RuleEvaluatorOutput.verify|verify} messages. + * @param message RuleEvaluatorOutput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IRuleEvaluatorOutput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RuleEvaluatorOutput message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RuleEvaluatorOutput.verify|verify} messages. + * @param message RuleEvaluatorOutput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IRuleEvaluatorOutput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RuleEvaluatorOutput message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RuleEvaluatorOutput + * @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.cloud.contentwarehouse.v1.RuleEvaluatorOutput; + + /** + * Decodes a RuleEvaluatorOutput message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RuleEvaluatorOutput + * @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.cloud.contentwarehouse.v1.RuleEvaluatorOutput; + + /** + * Verifies a RuleEvaluatorOutput 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 RuleEvaluatorOutput message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RuleEvaluatorOutput + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.RuleEvaluatorOutput; + + /** + * Creates a plain object from a RuleEvaluatorOutput message. Also converts values to other types if specified. + * @param message RuleEvaluatorOutput + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.RuleEvaluatorOutput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RuleEvaluatorOutput to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RuleEvaluatorOutput + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InvalidRule. */ + interface IInvalidRule { + + /** InvalidRule rule */ + rule?: (google.cloud.contentwarehouse.v1.IRule|null); + + /** InvalidRule error */ + error?: (string|null); + } + + /** Represents an InvalidRule. */ + class InvalidRule implements IInvalidRule { + + /** + * Constructs a new InvalidRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IInvalidRule); + + /** InvalidRule rule. */ + public rule?: (google.cloud.contentwarehouse.v1.IRule|null); + + /** InvalidRule error. */ + public error: string; + + /** + * Creates a new InvalidRule instance using the specified properties. + * @param [properties] Properties to set + * @returns InvalidRule instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IInvalidRule): google.cloud.contentwarehouse.v1.InvalidRule; + + /** + * Encodes the specified InvalidRule message. Does not implicitly {@link google.cloud.contentwarehouse.v1.InvalidRule.verify|verify} messages. + * @param message InvalidRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IInvalidRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InvalidRule message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.InvalidRule.verify|verify} messages. + * @param message InvalidRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IInvalidRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InvalidRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InvalidRule + * @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.cloud.contentwarehouse.v1.InvalidRule; + + /** + * Decodes an InvalidRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InvalidRule + * @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.cloud.contentwarehouse.v1.InvalidRule; + + /** + * Verifies an InvalidRule 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 InvalidRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InvalidRule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.InvalidRule; + + /** + * Creates a plain object from an InvalidRule message. Also converts values to other types if specified. + * @param message InvalidRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.InvalidRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InvalidRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InvalidRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ActionExecutorOutput. */ + interface IActionExecutorOutput { + + /** ActionExecutorOutput ruleActionsPairs */ + ruleActionsPairs?: (google.cloud.contentwarehouse.v1.IRuleActionsPair[]|null); + } + + /** Represents an ActionExecutorOutput. */ + class ActionExecutorOutput implements IActionExecutorOutput { + + /** + * Constructs a new ActionExecutorOutput. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IActionExecutorOutput); + + /** ActionExecutorOutput ruleActionsPairs. */ + public ruleActionsPairs: google.cloud.contentwarehouse.v1.IRuleActionsPair[]; + + /** + * Creates a new ActionExecutorOutput instance using the specified properties. + * @param [properties] Properties to set + * @returns ActionExecutorOutput instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IActionExecutorOutput): google.cloud.contentwarehouse.v1.ActionExecutorOutput; + + /** + * Encodes the specified ActionExecutorOutput message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ActionExecutorOutput.verify|verify} messages. + * @param message ActionExecutorOutput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IActionExecutorOutput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ActionExecutorOutput message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ActionExecutorOutput.verify|verify} messages. + * @param message ActionExecutorOutput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IActionExecutorOutput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ActionExecutorOutput message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ActionExecutorOutput + * @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.cloud.contentwarehouse.v1.ActionExecutorOutput; + + /** + * Decodes an ActionExecutorOutput message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ActionExecutorOutput + * @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.cloud.contentwarehouse.v1.ActionExecutorOutput; + + /** + * Verifies an ActionExecutorOutput 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 ActionExecutorOutput message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ActionExecutorOutput + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.ActionExecutorOutput; + + /** + * Creates a plain object from an ActionExecutorOutput message. Also converts values to other types if specified. + * @param message ActionExecutorOutput + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.ActionExecutorOutput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ActionExecutorOutput to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ActionExecutorOutput + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RuleActionsPair. */ + interface IRuleActionsPair { + + /** RuleActionsPair rule */ + rule?: (google.cloud.contentwarehouse.v1.IRule|null); + + /** RuleActionsPair actionOutputs */ + actionOutputs?: (google.cloud.contentwarehouse.v1.IActionOutput[]|null); + } + + /** Represents a RuleActionsPair. */ + class RuleActionsPair implements IRuleActionsPair { + + /** + * Constructs a new RuleActionsPair. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IRuleActionsPair); + + /** RuleActionsPair rule. */ + public rule?: (google.cloud.contentwarehouse.v1.IRule|null); + + /** RuleActionsPair actionOutputs. */ + public actionOutputs: google.cloud.contentwarehouse.v1.IActionOutput[]; + + /** + * Creates a new RuleActionsPair instance using the specified properties. + * @param [properties] Properties to set + * @returns RuleActionsPair instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IRuleActionsPair): google.cloud.contentwarehouse.v1.RuleActionsPair; + + /** + * Encodes the specified RuleActionsPair message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RuleActionsPair.verify|verify} messages. + * @param message RuleActionsPair message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IRuleActionsPair, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RuleActionsPair message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RuleActionsPair.verify|verify} messages. + * @param message RuleActionsPair message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IRuleActionsPair, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RuleActionsPair message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RuleActionsPair + * @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.cloud.contentwarehouse.v1.RuleActionsPair; + + /** + * Decodes a RuleActionsPair message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RuleActionsPair + * @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.cloud.contentwarehouse.v1.RuleActionsPair; + + /** + * Verifies a RuleActionsPair 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 RuleActionsPair message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RuleActionsPair + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.RuleActionsPair; + + /** + * Creates a plain object from a RuleActionsPair message. Also converts values to other types if specified. + * @param message RuleActionsPair + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.RuleActionsPair, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RuleActionsPair to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RuleActionsPair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ActionOutput. */ + interface IActionOutput { + + /** ActionOutput actionId */ + actionId?: (string|null); + + /** ActionOutput actionState */ + actionState?: (google.cloud.contentwarehouse.v1.ActionOutput.State|keyof typeof google.cloud.contentwarehouse.v1.ActionOutput.State|null); + + /** ActionOutput outputMessage */ + outputMessage?: (string|null); + } + + /** Represents an ActionOutput. */ + class ActionOutput implements IActionOutput { + + /** + * Constructs a new ActionOutput. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IActionOutput); + + /** ActionOutput actionId. */ + public actionId: string; + + /** ActionOutput actionState. */ + public actionState: (google.cloud.contentwarehouse.v1.ActionOutput.State|keyof typeof google.cloud.contentwarehouse.v1.ActionOutput.State); + + /** ActionOutput outputMessage. */ + public outputMessage: string; + + /** + * Creates a new ActionOutput instance using the specified properties. + * @param [properties] Properties to set + * @returns ActionOutput instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IActionOutput): google.cloud.contentwarehouse.v1.ActionOutput; + + /** + * Encodes the specified ActionOutput message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ActionOutput.verify|verify} messages. + * @param message ActionOutput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IActionOutput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ActionOutput message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ActionOutput.verify|verify} messages. + * @param message ActionOutput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IActionOutput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ActionOutput message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ActionOutput + * @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.cloud.contentwarehouse.v1.ActionOutput; + + /** + * Decodes an ActionOutput message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ActionOutput + * @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.cloud.contentwarehouse.v1.ActionOutput; + + /** + * Verifies an ActionOutput 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 ActionOutput message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ActionOutput + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.ActionOutput; + + /** + * Creates a plain object from an ActionOutput message. Also converts values to other types if specified. + * @param message ActionOutput + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.ActionOutput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ActionOutput to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ActionOutput + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ActionOutput { + + /** State enum. */ + enum State { + UNKNOWN = 0, + ACTION_SUCCEEDED = 1, + ACTION_FAILED = 2, + ACTION_TIMED_OUT = 3, + ACTION_PENDING = 4 + } + } + + /** Represents a PipelineService */ + class PipelineService extends $protobuf.rpc.Service { + + /** + * Constructs a new PipelineService 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 PipelineService 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): PipelineService; + + /** + * Calls RunPipeline. + * @param request RunPipelineRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public runPipeline(request: google.cloud.contentwarehouse.v1.IRunPipelineRequest, callback: google.cloud.contentwarehouse.v1.PipelineService.RunPipelineCallback): void; + + /** + * Calls RunPipeline. + * @param request RunPipelineRequest message or plain object + * @returns Promise + */ + public runPipeline(request: google.cloud.contentwarehouse.v1.IRunPipelineRequest): Promise; + } + + namespace PipelineService { + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.PipelineService|runPipeline}. + * @param error Error, if any + * @param [response] Operation + */ + type RunPipelineCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a RunPipelineRequest. */ + interface IRunPipelineRequest { + + /** RunPipelineRequest name */ + name?: (string|null); + + /** RunPipelineRequest gcsIngestPipeline */ + gcsIngestPipeline?: (google.cloud.contentwarehouse.v1.IGcsIngestPipeline|null); + + /** RunPipelineRequest gcsIngestWithDocAiProcessorsPipeline */ + gcsIngestWithDocAiProcessorsPipeline?: (google.cloud.contentwarehouse.v1.IGcsIngestWithDocAiProcessorsPipeline|null); + + /** RunPipelineRequest exportCdwPipeline */ + exportCdwPipeline?: (google.cloud.contentwarehouse.v1.IExportToCdwPipeline|null); + + /** RunPipelineRequest processWithDocAiPipeline */ + processWithDocAiPipeline?: (google.cloud.contentwarehouse.v1.IProcessWithDocAiPipeline|null); + + /** RunPipelineRequest requestMetadata */ + requestMetadata?: (google.cloud.contentwarehouse.v1.IRequestMetadata|null); + } + + /** Represents a RunPipelineRequest. */ + class RunPipelineRequest implements IRunPipelineRequest { + + /** + * Constructs a new RunPipelineRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IRunPipelineRequest); + + /** RunPipelineRequest name. */ + public name: string; + + /** RunPipelineRequest gcsIngestPipeline. */ + public gcsIngestPipeline?: (google.cloud.contentwarehouse.v1.IGcsIngestPipeline|null); + + /** RunPipelineRequest gcsIngestWithDocAiProcessorsPipeline. */ + public gcsIngestWithDocAiProcessorsPipeline?: (google.cloud.contentwarehouse.v1.IGcsIngestWithDocAiProcessorsPipeline|null); + + /** RunPipelineRequest exportCdwPipeline. */ + public exportCdwPipeline?: (google.cloud.contentwarehouse.v1.IExportToCdwPipeline|null); + + /** RunPipelineRequest processWithDocAiPipeline. */ + public processWithDocAiPipeline?: (google.cloud.contentwarehouse.v1.IProcessWithDocAiPipeline|null); + + /** RunPipelineRequest requestMetadata. */ + public requestMetadata?: (google.cloud.contentwarehouse.v1.IRequestMetadata|null); + + /** RunPipelineRequest pipeline. */ + public pipeline?: ("gcsIngestPipeline"|"gcsIngestWithDocAiProcessorsPipeline"|"exportCdwPipeline"|"processWithDocAiPipeline"); + + /** + * Creates a new RunPipelineRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RunPipelineRequest instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IRunPipelineRequest): google.cloud.contentwarehouse.v1.RunPipelineRequest; + + /** + * Encodes the specified RunPipelineRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineRequest.verify|verify} messages. + * @param message RunPipelineRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IRunPipelineRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunPipelineRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineRequest.verify|verify} messages. + * @param message RunPipelineRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IRunPipelineRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunPipelineRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunPipelineRequest + * @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.cloud.contentwarehouse.v1.RunPipelineRequest; + + /** + * Decodes a RunPipelineRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunPipelineRequest + * @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.cloud.contentwarehouse.v1.RunPipelineRequest; + + /** + * Verifies a RunPipelineRequest 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 RunPipelineRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunPipelineRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.RunPipelineRequest; + + /** + * Creates a plain object from a RunPipelineRequest message. Also converts values to other types if specified. + * @param message RunPipelineRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.RunPipelineRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunPipelineRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunPipelineRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RunPipelineResponse. */ + interface IRunPipelineResponse { + } + + /** Represents a RunPipelineResponse. */ + class RunPipelineResponse implements IRunPipelineResponse { + + /** + * Constructs a new RunPipelineResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IRunPipelineResponse); + + /** + * Creates a new RunPipelineResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RunPipelineResponse instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IRunPipelineResponse): google.cloud.contentwarehouse.v1.RunPipelineResponse; + + /** + * Encodes the specified RunPipelineResponse message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineResponse.verify|verify} messages. + * @param message RunPipelineResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IRunPipelineResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunPipelineResponse message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineResponse.verify|verify} messages. + * @param message RunPipelineResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IRunPipelineResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunPipelineResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunPipelineResponse + * @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.cloud.contentwarehouse.v1.RunPipelineResponse; + + /** + * Decodes a RunPipelineResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunPipelineResponse + * @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.cloud.contentwarehouse.v1.RunPipelineResponse; + + /** + * Verifies a RunPipelineResponse 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 RunPipelineResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunPipelineResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.RunPipelineResponse; + + /** + * Creates a plain object from a RunPipelineResponse message. Also converts values to other types if specified. + * @param message RunPipelineResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.RunPipelineResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunPipelineResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunPipelineResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RunPipelineMetadata. */ + interface IRunPipelineMetadata { + + /** RunPipelineMetadata totalFileCount */ + totalFileCount?: (number|null); + + /** RunPipelineMetadata failedFileCount */ + failedFileCount?: (number|null); + + /** RunPipelineMetadata userInfo */ + userInfo?: (google.cloud.contentwarehouse.v1.IUserInfo|null); + + /** RunPipelineMetadata gcsIngestPipelineMetadata */ + gcsIngestPipelineMetadata?: (google.cloud.contentwarehouse.v1.RunPipelineMetadata.IGcsIngestPipelineMetadata|null); + + /** RunPipelineMetadata exportToCdwPipelineMetadata */ + exportToCdwPipelineMetadata?: (google.cloud.contentwarehouse.v1.RunPipelineMetadata.IExportToCdwPipelineMetadata|null); + + /** RunPipelineMetadata processWithDocAiPipelineMetadata */ + processWithDocAiPipelineMetadata?: (google.cloud.contentwarehouse.v1.RunPipelineMetadata.IProcessWithDocAiPipelineMetadata|null); + + /** RunPipelineMetadata individualDocumentStatuses */ + individualDocumentStatuses?: (google.cloud.contentwarehouse.v1.RunPipelineMetadata.IIndividualDocumentStatus[]|null); + } + + /** Represents a RunPipelineMetadata. */ + class RunPipelineMetadata implements IRunPipelineMetadata { + + /** + * Constructs a new RunPipelineMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IRunPipelineMetadata); + + /** RunPipelineMetadata totalFileCount. */ + public totalFileCount: number; + + /** RunPipelineMetadata failedFileCount. */ + public failedFileCount: number; + + /** RunPipelineMetadata userInfo. */ + public userInfo?: (google.cloud.contentwarehouse.v1.IUserInfo|null); + + /** RunPipelineMetadata gcsIngestPipelineMetadata. */ + public gcsIngestPipelineMetadata?: (google.cloud.contentwarehouse.v1.RunPipelineMetadata.IGcsIngestPipelineMetadata|null); + + /** RunPipelineMetadata exportToCdwPipelineMetadata. */ + public exportToCdwPipelineMetadata?: (google.cloud.contentwarehouse.v1.RunPipelineMetadata.IExportToCdwPipelineMetadata|null); + + /** RunPipelineMetadata processWithDocAiPipelineMetadata. */ + public processWithDocAiPipelineMetadata?: (google.cloud.contentwarehouse.v1.RunPipelineMetadata.IProcessWithDocAiPipelineMetadata|null); + + /** RunPipelineMetadata individualDocumentStatuses. */ + public individualDocumentStatuses: google.cloud.contentwarehouse.v1.RunPipelineMetadata.IIndividualDocumentStatus[]; + + /** RunPipelineMetadata pipelineMetadata. */ + public pipelineMetadata?: ("gcsIngestPipelineMetadata"|"exportToCdwPipelineMetadata"|"processWithDocAiPipelineMetadata"); + + /** + * Creates a new RunPipelineMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns RunPipelineMetadata instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IRunPipelineMetadata): google.cloud.contentwarehouse.v1.RunPipelineMetadata; + + /** + * Encodes the specified RunPipelineMetadata message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineMetadata.verify|verify} messages. + * @param message RunPipelineMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IRunPipelineMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunPipelineMetadata message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineMetadata.verify|verify} messages. + * @param message RunPipelineMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IRunPipelineMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunPipelineMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunPipelineMetadata + * @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.cloud.contentwarehouse.v1.RunPipelineMetadata; + + /** + * Decodes a RunPipelineMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunPipelineMetadata + * @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.cloud.contentwarehouse.v1.RunPipelineMetadata; + + /** + * Verifies a RunPipelineMetadata 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 RunPipelineMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunPipelineMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.RunPipelineMetadata; + + /** + * Creates a plain object from a RunPipelineMetadata message. Also converts values to other types if specified. + * @param message RunPipelineMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.RunPipelineMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunPipelineMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunPipelineMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RunPipelineMetadata { + + /** Properties of a GcsIngestPipelineMetadata. */ + interface IGcsIngestPipelineMetadata { + + /** GcsIngestPipelineMetadata inputPath */ + inputPath?: (string|null); + } + + /** Represents a GcsIngestPipelineMetadata. */ + class GcsIngestPipelineMetadata implements IGcsIngestPipelineMetadata { + + /** + * Constructs a new GcsIngestPipelineMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.RunPipelineMetadata.IGcsIngestPipelineMetadata); + + /** GcsIngestPipelineMetadata inputPath. */ + public inputPath: string; + + /** + * Creates a new GcsIngestPipelineMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsIngestPipelineMetadata instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.RunPipelineMetadata.IGcsIngestPipelineMetadata): google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata; + + /** + * Encodes the specified GcsIngestPipelineMetadata message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata.verify|verify} messages. + * @param message GcsIngestPipelineMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.RunPipelineMetadata.IGcsIngestPipelineMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsIngestPipelineMetadata message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata.verify|verify} messages. + * @param message GcsIngestPipelineMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.RunPipelineMetadata.IGcsIngestPipelineMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsIngestPipelineMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsIngestPipelineMetadata + * @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.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata; + + /** + * Decodes a GcsIngestPipelineMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsIngestPipelineMetadata + * @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.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata; + + /** + * Verifies a GcsIngestPipelineMetadata 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 GcsIngestPipelineMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsIngestPipelineMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata; + + /** + * Creates a plain object from a GcsIngestPipelineMetadata message. Also converts values to other types if specified. + * @param message GcsIngestPipelineMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsIngestPipelineMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcsIngestPipelineMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportToCdwPipelineMetadata. */ + interface IExportToCdwPipelineMetadata { + + /** ExportToCdwPipelineMetadata documents */ + documents?: (string[]|null); + + /** ExportToCdwPipelineMetadata docAiDataset */ + docAiDataset?: (string|null); + + /** ExportToCdwPipelineMetadata outputPath */ + outputPath?: (string|null); + } + + /** Represents an ExportToCdwPipelineMetadata. */ + class ExportToCdwPipelineMetadata implements IExportToCdwPipelineMetadata { + + /** + * Constructs a new ExportToCdwPipelineMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.RunPipelineMetadata.IExportToCdwPipelineMetadata); + + /** ExportToCdwPipelineMetadata documents. */ + public documents: string[]; + + /** ExportToCdwPipelineMetadata docAiDataset. */ + public docAiDataset: string; + + /** ExportToCdwPipelineMetadata outputPath. */ + public outputPath: string; + + /** + * Creates a new ExportToCdwPipelineMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportToCdwPipelineMetadata instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.RunPipelineMetadata.IExportToCdwPipelineMetadata): google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata; + + /** + * Encodes the specified ExportToCdwPipelineMetadata message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata.verify|verify} messages. + * @param message ExportToCdwPipelineMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.RunPipelineMetadata.IExportToCdwPipelineMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportToCdwPipelineMetadata message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata.verify|verify} messages. + * @param message ExportToCdwPipelineMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.RunPipelineMetadata.IExportToCdwPipelineMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportToCdwPipelineMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportToCdwPipelineMetadata + * @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.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata; + + /** + * Decodes an ExportToCdwPipelineMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportToCdwPipelineMetadata + * @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.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata; + + /** + * Verifies an ExportToCdwPipelineMetadata 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 ExportToCdwPipelineMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportToCdwPipelineMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata; + + /** + * Creates a plain object from an ExportToCdwPipelineMetadata message. Also converts values to other types if specified. + * @param message ExportToCdwPipelineMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportToCdwPipelineMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportToCdwPipelineMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ProcessWithDocAiPipelineMetadata. */ + interface IProcessWithDocAiPipelineMetadata { + + /** ProcessWithDocAiPipelineMetadata documents */ + documents?: (string[]|null); + + /** ProcessWithDocAiPipelineMetadata processorInfo */ + processorInfo?: (google.cloud.contentwarehouse.v1.IProcessorInfo|null); + } + + /** Represents a ProcessWithDocAiPipelineMetadata. */ + class ProcessWithDocAiPipelineMetadata implements IProcessWithDocAiPipelineMetadata { + + /** + * Constructs a new ProcessWithDocAiPipelineMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.RunPipelineMetadata.IProcessWithDocAiPipelineMetadata); + + /** ProcessWithDocAiPipelineMetadata documents. */ + public documents: string[]; + + /** ProcessWithDocAiPipelineMetadata processorInfo. */ + public processorInfo?: (google.cloud.contentwarehouse.v1.IProcessorInfo|null); + + /** + * Creates a new ProcessWithDocAiPipelineMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ProcessWithDocAiPipelineMetadata instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.RunPipelineMetadata.IProcessWithDocAiPipelineMetadata): google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata; + + /** + * Encodes the specified ProcessWithDocAiPipelineMetadata message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata.verify|verify} messages. + * @param message ProcessWithDocAiPipelineMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.RunPipelineMetadata.IProcessWithDocAiPipelineMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProcessWithDocAiPipelineMetadata message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata.verify|verify} messages. + * @param message ProcessWithDocAiPipelineMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.RunPipelineMetadata.IProcessWithDocAiPipelineMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProcessWithDocAiPipelineMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProcessWithDocAiPipelineMetadata + * @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.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata; + + /** + * Decodes a ProcessWithDocAiPipelineMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProcessWithDocAiPipelineMetadata + * @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.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata; + + /** + * Verifies a ProcessWithDocAiPipelineMetadata 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 ProcessWithDocAiPipelineMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProcessWithDocAiPipelineMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata; + + /** + * Creates a plain object from a ProcessWithDocAiPipelineMetadata message. Also converts values to other types if specified. + * @param message ProcessWithDocAiPipelineMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProcessWithDocAiPipelineMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ProcessWithDocAiPipelineMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IndividualDocumentStatus. */ + interface IIndividualDocumentStatus { + + /** IndividualDocumentStatus documentId */ + documentId?: (string|null); + + /** IndividualDocumentStatus status */ + status?: (google.rpc.IStatus|null); + } + + /** Represents an IndividualDocumentStatus. */ + class IndividualDocumentStatus implements IIndividualDocumentStatus { + + /** + * Constructs a new IndividualDocumentStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.RunPipelineMetadata.IIndividualDocumentStatus); + + /** IndividualDocumentStatus documentId. */ + public documentId: string; + + /** IndividualDocumentStatus status. */ + public status?: (google.rpc.IStatus|null); + + /** + * Creates a new IndividualDocumentStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns IndividualDocumentStatus instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.RunPipelineMetadata.IIndividualDocumentStatus): google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus; + + /** + * Encodes the specified IndividualDocumentStatus message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus.verify|verify} messages. + * @param message IndividualDocumentStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.RunPipelineMetadata.IIndividualDocumentStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IndividualDocumentStatus message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus.verify|verify} messages. + * @param message IndividualDocumentStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.RunPipelineMetadata.IIndividualDocumentStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IndividualDocumentStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IndividualDocumentStatus + * @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.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus; + + /** + * Decodes an IndividualDocumentStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IndividualDocumentStatus + * @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.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus; + + /** + * Verifies an IndividualDocumentStatus 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 IndividualDocumentStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IndividualDocumentStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus; + + /** + * Creates a plain object from an IndividualDocumentStatus message. Also converts values to other types if specified. + * @param message IndividualDocumentStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IndividualDocumentStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IndividualDocumentStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ProcessorInfo. */ + interface IProcessorInfo { + + /** ProcessorInfo processorName */ + processorName?: (string|null); + + /** ProcessorInfo documentType */ + documentType?: (string|null); + + /** ProcessorInfo schemaName */ + schemaName?: (string|null); + } + + /** Represents a ProcessorInfo. */ + class ProcessorInfo implements IProcessorInfo { + + /** + * Constructs a new ProcessorInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IProcessorInfo); + + /** ProcessorInfo processorName. */ + public processorName: string; + + /** ProcessorInfo documentType. */ + public documentType: string; + + /** ProcessorInfo schemaName. */ + public schemaName: string; + + /** + * Creates a new ProcessorInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ProcessorInfo instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IProcessorInfo): google.cloud.contentwarehouse.v1.ProcessorInfo; + + /** + * Encodes the specified ProcessorInfo message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ProcessorInfo.verify|verify} messages. + * @param message ProcessorInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IProcessorInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProcessorInfo message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ProcessorInfo.verify|verify} messages. + * @param message ProcessorInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IProcessorInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProcessorInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProcessorInfo + * @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.cloud.contentwarehouse.v1.ProcessorInfo; + + /** + * Decodes a ProcessorInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProcessorInfo + * @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.cloud.contentwarehouse.v1.ProcessorInfo; + + /** + * Verifies a ProcessorInfo 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 ProcessorInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProcessorInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.ProcessorInfo; + + /** + * Creates a plain object from a ProcessorInfo message. Also converts values to other types if specified. + * @param message ProcessorInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.ProcessorInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProcessorInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ProcessorInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IngestPipelineConfig. */ + interface IIngestPipelineConfig { + + /** IngestPipelineConfig documentAclPolicy */ + documentAclPolicy?: (google.iam.v1.IPolicy|null); + + /** IngestPipelineConfig enableDocumentTextExtraction */ + enableDocumentTextExtraction?: (boolean|null); + + /** IngestPipelineConfig folder */ + folder?: (string|null); + + /** IngestPipelineConfig cloudFunction */ + cloudFunction?: (string|null); + } + + /** Represents an IngestPipelineConfig. */ + class IngestPipelineConfig implements IIngestPipelineConfig { + + /** + * Constructs a new IngestPipelineConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IIngestPipelineConfig); + + /** IngestPipelineConfig documentAclPolicy. */ + public documentAclPolicy?: (google.iam.v1.IPolicy|null); + + /** IngestPipelineConfig enableDocumentTextExtraction. */ + public enableDocumentTextExtraction: boolean; + + /** IngestPipelineConfig folder. */ + public folder: string; + + /** IngestPipelineConfig cloudFunction. */ + public cloudFunction: string; + + /** + * Creates a new IngestPipelineConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns IngestPipelineConfig instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IIngestPipelineConfig): google.cloud.contentwarehouse.v1.IngestPipelineConfig; + + /** + * Encodes the specified IngestPipelineConfig message. Does not implicitly {@link google.cloud.contentwarehouse.v1.IngestPipelineConfig.verify|verify} messages. + * @param message IngestPipelineConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IIngestPipelineConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IngestPipelineConfig message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.IngestPipelineConfig.verify|verify} messages. + * @param message IngestPipelineConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IIngestPipelineConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IngestPipelineConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IngestPipelineConfig + * @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.cloud.contentwarehouse.v1.IngestPipelineConfig; + + /** + * Decodes an IngestPipelineConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IngestPipelineConfig + * @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.cloud.contentwarehouse.v1.IngestPipelineConfig; + + /** + * Verifies an IngestPipelineConfig 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 IngestPipelineConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IngestPipelineConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.IngestPipelineConfig; + + /** + * Creates a plain object from an IngestPipelineConfig message. Also converts values to other types if specified. + * @param message IngestPipelineConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.IngestPipelineConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IngestPipelineConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IngestPipelineConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GcsIngestPipeline. */ + interface IGcsIngestPipeline { + + /** GcsIngestPipeline inputPath */ + inputPath?: (string|null); + + /** GcsIngestPipeline schemaName */ + schemaName?: (string|null); + + /** GcsIngestPipeline processorType */ + processorType?: (string|null); + + /** GcsIngestPipeline skipIngestedDocuments */ + skipIngestedDocuments?: (boolean|null); + + /** GcsIngestPipeline pipelineConfig */ + pipelineConfig?: (google.cloud.contentwarehouse.v1.IIngestPipelineConfig|null); + } + + /** Represents a GcsIngestPipeline. */ + class GcsIngestPipeline implements IGcsIngestPipeline { + + /** + * Constructs a new GcsIngestPipeline. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IGcsIngestPipeline); + + /** GcsIngestPipeline inputPath. */ + public inputPath: string; + + /** GcsIngestPipeline schemaName. */ + public schemaName: string; + + /** GcsIngestPipeline processorType. */ + public processorType: string; + + /** GcsIngestPipeline skipIngestedDocuments. */ + public skipIngestedDocuments: boolean; + + /** GcsIngestPipeline pipelineConfig. */ + public pipelineConfig?: (google.cloud.contentwarehouse.v1.IIngestPipelineConfig|null); + + /** + * Creates a new GcsIngestPipeline instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsIngestPipeline instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IGcsIngestPipeline): google.cloud.contentwarehouse.v1.GcsIngestPipeline; + + /** + * Encodes the specified GcsIngestPipeline message. Does not implicitly {@link google.cloud.contentwarehouse.v1.GcsIngestPipeline.verify|verify} messages. + * @param message GcsIngestPipeline message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IGcsIngestPipeline, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsIngestPipeline message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.GcsIngestPipeline.verify|verify} messages. + * @param message GcsIngestPipeline message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IGcsIngestPipeline, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsIngestPipeline message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsIngestPipeline + * @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.cloud.contentwarehouse.v1.GcsIngestPipeline; + + /** + * Decodes a GcsIngestPipeline message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsIngestPipeline + * @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.cloud.contentwarehouse.v1.GcsIngestPipeline; + + /** + * Verifies a GcsIngestPipeline 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 GcsIngestPipeline message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsIngestPipeline + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.GcsIngestPipeline; + + /** + * Creates a plain object from a GcsIngestPipeline message. Also converts values to other types if specified. + * @param message GcsIngestPipeline + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.GcsIngestPipeline, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsIngestPipeline to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcsIngestPipeline + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GcsIngestWithDocAiProcessorsPipeline. */ + interface IGcsIngestWithDocAiProcessorsPipeline { + + /** GcsIngestWithDocAiProcessorsPipeline inputPath */ + inputPath?: (string|null); + + /** GcsIngestWithDocAiProcessorsPipeline splitClassifyProcessorInfo */ + splitClassifyProcessorInfo?: (google.cloud.contentwarehouse.v1.IProcessorInfo|null); + + /** GcsIngestWithDocAiProcessorsPipeline extractProcessorInfos */ + extractProcessorInfos?: (google.cloud.contentwarehouse.v1.IProcessorInfo[]|null); + + /** GcsIngestWithDocAiProcessorsPipeline processorResultsFolderPath */ + processorResultsFolderPath?: (string|null); + + /** GcsIngestWithDocAiProcessorsPipeline skipIngestedDocuments */ + skipIngestedDocuments?: (boolean|null); + + /** GcsIngestWithDocAiProcessorsPipeline pipelineConfig */ + pipelineConfig?: (google.cloud.contentwarehouse.v1.IIngestPipelineConfig|null); + } + + /** Represents a GcsIngestWithDocAiProcessorsPipeline. */ + class GcsIngestWithDocAiProcessorsPipeline implements IGcsIngestWithDocAiProcessorsPipeline { + + /** + * Constructs a new GcsIngestWithDocAiProcessorsPipeline. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IGcsIngestWithDocAiProcessorsPipeline); + + /** GcsIngestWithDocAiProcessorsPipeline inputPath. */ + public inputPath: string; + + /** GcsIngestWithDocAiProcessorsPipeline splitClassifyProcessorInfo. */ + public splitClassifyProcessorInfo?: (google.cloud.contentwarehouse.v1.IProcessorInfo|null); + + /** GcsIngestWithDocAiProcessorsPipeline extractProcessorInfos. */ + public extractProcessorInfos: google.cloud.contentwarehouse.v1.IProcessorInfo[]; + + /** GcsIngestWithDocAiProcessorsPipeline processorResultsFolderPath. */ + public processorResultsFolderPath: string; + + /** GcsIngestWithDocAiProcessorsPipeline skipIngestedDocuments. */ + public skipIngestedDocuments: boolean; + + /** GcsIngestWithDocAiProcessorsPipeline pipelineConfig. */ + public pipelineConfig?: (google.cloud.contentwarehouse.v1.IIngestPipelineConfig|null); + + /** + * Creates a new GcsIngestWithDocAiProcessorsPipeline instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsIngestWithDocAiProcessorsPipeline instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IGcsIngestWithDocAiProcessorsPipeline): google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline; + + /** + * Encodes the specified GcsIngestWithDocAiProcessorsPipeline message. Does not implicitly {@link google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline.verify|verify} messages. + * @param message GcsIngestWithDocAiProcessorsPipeline message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IGcsIngestWithDocAiProcessorsPipeline, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsIngestWithDocAiProcessorsPipeline message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline.verify|verify} messages. + * @param message GcsIngestWithDocAiProcessorsPipeline message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IGcsIngestWithDocAiProcessorsPipeline, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsIngestWithDocAiProcessorsPipeline message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsIngestWithDocAiProcessorsPipeline + * @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.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline; + + /** + * Decodes a GcsIngestWithDocAiProcessorsPipeline message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsIngestWithDocAiProcessorsPipeline + * @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.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline; + + /** + * Verifies a GcsIngestWithDocAiProcessorsPipeline 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 GcsIngestWithDocAiProcessorsPipeline message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsIngestWithDocAiProcessorsPipeline + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline; + + /** + * Creates a plain object from a GcsIngestWithDocAiProcessorsPipeline message. Also converts values to other types if specified. + * @param message GcsIngestWithDocAiProcessorsPipeline + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsIngestWithDocAiProcessorsPipeline to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcsIngestWithDocAiProcessorsPipeline + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportToCdwPipeline. */ + interface IExportToCdwPipeline { + + /** ExportToCdwPipeline documents */ + documents?: (string[]|null); + + /** ExportToCdwPipeline exportFolderPath */ + exportFolderPath?: (string|null); + + /** ExportToCdwPipeline docAiDataset */ + docAiDataset?: (string|null); + + /** ExportToCdwPipeline trainingSplitRatio */ + trainingSplitRatio?: (number|null); + } + + /** Represents an ExportToCdwPipeline. */ + class ExportToCdwPipeline implements IExportToCdwPipeline { + + /** + * Constructs a new ExportToCdwPipeline. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IExportToCdwPipeline); + + /** ExportToCdwPipeline documents. */ + public documents: string[]; + + /** ExportToCdwPipeline exportFolderPath. */ + public exportFolderPath: string; + + /** ExportToCdwPipeline docAiDataset. */ + public docAiDataset: string; + + /** ExportToCdwPipeline trainingSplitRatio. */ + public trainingSplitRatio: number; + + /** + * Creates a new ExportToCdwPipeline instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportToCdwPipeline instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IExportToCdwPipeline): google.cloud.contentwarehouse.v1.ExportToCdwPipeline; + + /** + * Encodes the specified ExportToCdwPipeline message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ExportToCdwPipeline.verify|verify} messages. + * @param message ExportToCdwPipeline message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IExportToCdwPipeline, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportToCdwPipeline message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ExportToCdwPipeline.verify|verify} messages. + * @param message ExportToCdwPipeline message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IExportToCdwPipeline, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportToCdwPipeline message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportToCdwPipeline + * @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.cloud.contentwarehouse.v1.ExportToCdwPipeline; + + /** + * Decodes an ExportToCdwPipeline message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportToCdwPipeline + * @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.cloud.contentwarehouse.v1.ExportToCdwPipeline; + + /** + * Verifies an ExportToCdwPipeline 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 ExportToCdwPipeline message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportToCdwPipeline + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.ExportToCdwPipeline; + + /** + * Creates a plain object from an ExportToCdwPipeline message. Also converts values to other types if specified. + * @param message ExportToCdwPipeline + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.ExportToCdwPipeline, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportToCdwPipeline to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportToCdwPipeline + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ProcessWithDocAiPipeline. */ + interface IProcessWithDocAiPipeline { + + /** ProcessWithDocAiPipeline documents */ + documents?: (string[]|null); + + /** ProcessWithDocAiPipeline exportFolderPath */ + exportFolderPath?: (string|null); + + /** ProcessWithDocAiPipeline processorInfo */ + processorInfo?: (google.cloud.contentwarehouse.v1.IProcessorInfo|null); + + /** ProcessWithDocAiPipeline processorResultsFolderPath */ + processorResultsFolderPath?: (string|null); + } + + /** Represents a ProcessWithDocAiPipeline. */ + class ProcessWithDocAiPipeline implements IProcessWithDocAiPipeline { + + /** + * Constructs a new ProcessWithDocAiPipeline. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IProcessWithDocAiPipeline); + + /** ProcessWithDocAiPipeline documents. */ + public documents: string[]; + + /** ProcessWithDocAiPipeline exportFolderPath. */ + public exportFolderPath: string; + + /** ProcessWithDocAiPipeline processorInfo. */ + public processorInfo?: (google.cloud.contentwarehouse.v1.IProcessorInfo|null); + + /** ProcessWithDocAiPipeline processorResultsFolderPath. */ + public processorResultsFolderPath: string; + + /** + * Creates a new ProcessWithDocAiPipeline instance using the specified properties. + * @param [properties] Properties to set + * @returns ProcessWithDocAiPipeline instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IProcessWithDocAiPipeline): google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline; + + /** + * Encodes the specified ProcessWithDocAiPipeline message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline.verify|verify} messages. + * @param message ProcessWithDocAiPipeline message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IProcessWithDocAiPipeline, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProcessWithDocAiPipeline message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline.verify|verify} messages. + * @param message ProcessWithDocAiPipeline message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IProcessWithDocAiPipeline, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProcessWithDocAiPipeline message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProcessWithDocAiPipeline + * @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.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline; + + /** + * Decodes a ProcessWithDocAiPipeline message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProcessWithDocAiPipeline + * @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.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline; + + /** + * Verifies a ProcessWithDocAiPipeline 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 ProcessWithDocAiPipeline message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProcessWithDocAiPipeline + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline; + + /** + * Creates a plain object from a ProcessWithDocAiPipeline message. Also converts values to other types if specified. + * @param message ProcessWithDocAiPipeline + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProcessWithDocAiPipeline to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ProcessWithDocAiPipeline + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a RuleSetService */ + class RuleSetService extends $protobuf.rpc.Service { + + /** + * Constructs a new RuleSetService 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 RuleSetService 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): RuleSetService; + + /** + * Calls CreateRuleSet. + * @param request CreateRuleSetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RuleSet + */ + public createRuleSet(request: google.cloud.contentwarehouse.v1.ICreateRuleSetRequest, callback: google.cloud.contentwarehouse.v1.RuleSetService.CreateRuleSetCallback): void; + + /** + * Calls CreateRuleSet. + * @param request CreateRuleSetRequest message or plain object + * @returns Promise + */ + public createRuleSet(request: google.cloud.contentwarehouse.v1.ICreateRuleSetRequest): Promise; + + /** + * Calls GetRuleSet. + * @param request GetRuleSetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RuleSet + */ + public getRuleSet(request: google.cloud.contentwarehouse.v1.IGetRuleSetRequest, callback: google.cloud.contentwarehouse.v1.RuleSetService.GetRuleSetCallback): void; + + /** + * Calls GetRuleSet. + * @param request GetRuleSetRequest message or plain object + * @returns Promise + */ + public getRuleSet(request: google.cloud.contentwarehouse.v1.IGetRuleSetRequest): Promise; + + /** + * Calls UpdateRuleSet. + * @param request UpdateRuleSetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RuleSet + */ + public updateRuleSet(request: google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest, callback: google.cloud.contentwarehouse.v1.RuleSetService.UpdateRuleSetCallback): void; + + /** + * Calls UpdateRuleSet. + * @param request UpdateRuleSetRequest message or plain object + * @returns Promise + */ + public updateRuleSet(request: google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest): Promise; + + /** + * Calls DeleteRuleSet. + * @param request DeleteRuleSetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteRuleSet(request: google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest, callback: google.cloud.contentwarehouse.v1.RuleSetService.DeleteRuleSetCallback): void; + + /** + * Calls DeleteRuleSet. + * @param request DeleteRuleSetRequest message or plain object + * @returns Promise + */ + public deleteRuleSet(request: google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest): Promise; + + /** + * Calls ListRuleSets. + * @param request ListRuleSetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListRuleSetsResponse + */ + public listRuleSets(request: google.cloud.contentwarehouse.v1.IListRuleSetsRequest, callback: google.cloud.contentwarehouse.v1.RuleSetService.ListRuleSetsCallback): void; + + /** + * Calls ListRuleSets. + * @param request ListRuleSetsRequest message or plain object + * @returns Promise + */ + public listRuleSets(request: google.cloud.contentwarehouse.v1.IListRuleSetsRequest): Promise; + } + + namespace RuleSetService { + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.RuleSetService|createRuleSet}. + * @param error Error, if any + * @param [response] RuleSet + */ + type CreateRuleSetCallback = (error: (Error|null), response?: google.cloud.contentwarehouse.v1.RuleSet) => void; + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.RuleSetService|getRuleSet}. + * @param error Error, if any + * @param [response] RuleSet + */ + type GetRuleSetCallback = (error: (Error|null), response?: google.cloud.contentwarehouse.v1.RuleSet) => void; + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.RuleSetService|updateRuleSet}. + * @param error Error, if any + * @param [response] RuleSet + */ + type UpdateRuleSetCallback = (error: (Error|null), response?: google.cloud.contentwarehouse.v1.RuleSet) => void; + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.RuleSetService|deleteRuleSet}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteRuleSetCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.RuleSetService|listRuleSets}. + * @param error Error, if any + * @param [response] ListRuleSetsResponse + */ + type ListRuleSetsCallback = (error: (Error|null), response?: google.cloud.contentwarehouse.v1.ListRuleSetsResponse) => void; + } + + /** Properties of a CreateRuleSetRequest. */ + interface ICreateRuleSetRequest { + + /** CreateRuleSetRequest parent */ + parent?: (string|null); + + /** CreateRuleSetRequest ruleSet */ + ruleSet?: (google.cloud.contentwarehouse.v1.IRuleSet|null); + } + + /** Represents a CreateRuleSetRequest. */ + class CreateRuleSetRequest implements ICreateRuleSetRequest { + + /** + * Constructs a new CreateRuleSetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.ICreateRuleSetRequest); + + /** CreateRuleSetRequest parent. */ + public parent: string; + + /** CreateRuleSetRequest ruleSet. */ + public ruleSet?: (google.cloud.contentwarehouse.v1.IRuleSet|null); + + /** + * Creates a new CreateRuleSetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateRuleSetRequest instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.ICreateRuleSetRequest): google.cloud.contentwarehouse.v1.CreateRuleSetRequest; + + /** + * Encodes the specified CreateRuleSetRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateRuleSetRequest.verify|verify} messages. + * @param message CreateRuleSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.ICreateRuleSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateRuleSetRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateRuleSetRequest.verify|verify} messages. + * @param message CreateRuleSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.ICreateRuleSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateRuleSetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateRuleSetRequest + * @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.cloud.contentwarehouse.v1.CreateRuleSetRequest; + + /** + * Decodes a CreateRuleSetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateRuleSetRequest + * @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.cloud.contentwarehouse.v1.CreateRuleSetRequest; + + /** + * Verifies a CreateRuleSetRequest 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 CreateRuleSetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateRuleSetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.CreateRuleSetRequest; + + /** + * Creates a plain object from a CreateRuleSetRequest message. Also converts values to other types if specified. + * @param message CreateRuleSetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.CreateRuleSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateRuleSetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateRuleSetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetRuleSetRequest. */ + interface IGetRuleSetRequest { + + /** GetRuleSetRequest name */ + name?: (string|null); + } + + /** Represents a GetRuleSetRequest. */ + class GetRuleSetRequest implements IGetRuleSetRequest { + + /** + * Constructs a new GetRuleSetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IGetRuleSetRequest); + + /** GetRuleSetRequest name. */ + public name: string; + + /** + * Creates a new GetRuleSetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetRuleSetRequest instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IGetRuleSetRequest): google.cloud.contentwarehouse.v1.GetRuleSetRequest; + + /** + * Encodes the specified GetRuleSetRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.GetRuleSetRequest.verify|verify} messages. + * @param message GetRuleSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IGetRuleSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetRuleSetRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.GetRuleSetRequest.verify|verify} messages. + * @param message GetRuleSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IGetRuleSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetRuleSetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetRuleSetRequest + * @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.cloud.contentwarehouse.v1.GetRuleSetRequest; + + /** + * Decodes a GetRuleSetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetRuleSetRequest + * @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.cloud.contentwarehouse.v1.GetRuleSetRequest; + + /** + * Verifies a GetRuleSetRequest 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 GetRuleSetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetRuleSetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.GetRuleSetRequest; + + /** + * Creates a plain object from a GetRuleSetRequest message. Also converts values to other types if specified. + * @param message GetRuleSetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.GetRuleSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetRuleSetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetRuleSetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateRuleSetRequest. */ + interface IUpdateRuleSetRequest { + + /** UpdateRuleSetRequest name */ + name?: (string|null); + + /** UpdateRuleSetRequest ruleSet */ + ruleSet?: (google.cloud.contentwarehouse.v1.IRuleSet|null); + } + + /** Represents an UpdateRuleSetRequest. */ + class UpdateRuleSetRequest implements IUpdateRuleSetRequest { + + /** + * Constructs a new UpdateRuleSetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest); + + /** UpdateRuleSetRequest name. */ + public name: string; + + /** UpdateRuleSetRequest ruleSet. */ + public ruleSet?: (google.cloud.contentwarehouse.v1.IRuleSet|null); + + /** + * Creates a new UpdateRuleSetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateRuleSetRequest instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest): google.cloud.contentwarehouse.v1.UpdateRuleSetRequest; + + /** + * Encodes the specified UpdateRuleSetRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateRuleSetRequest.verify|verify} messages. + * @param message UpdateRuleSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateRuleSetRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateRuleSetRequest.verify|verify} messages. + * @param message UpdateRuleSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateRuleSetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateRuleSetRequest + * @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.cloud.contentwarehouse.v1.UpdateRuleSetRequest; + + /** + * Decodes an UpdateRuleSetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateRuleSetRequest + * @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.cloud.contentwarehouse.v1.UpdateRuleSetRequest; + + /** + * Verifies an UpdateRuleSetRequest 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 UpdateRuleSetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateRuleSetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.UpdateRuleSetRequest; + + /** + * Creates a plain object from an UpdateRuleSetRequest message. Also converts values to other types if specified. + * @param message UpdateRuleSetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.UpdateRuleSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateRuleSetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateRuleSetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteRuleSetRequest. */ + interface IDeleteRuleSetRequest { + + /** DeleteRuleSetRequest name */ + name?: (string|null); + } + + /** Represents a DeleteRuleSetRequest. */ + class DeleteRuleSetRequest implements IDeleteRuleSetRequest { + + /** + * Constructs a new DeleteRuleSetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest); + + /** DeleteRuleSetRequest name. */ + public name: string; + + /** + * Creates a new DeleteRuleSetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteRuleSetRequest instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest): google.cloud.contentwarehouse.v1.DeleteRuleSetRequest; + + /** + * Encodes the specified DeleteRuleSetRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DeleteRuleSetRequest.verify|verify} messages. + * @param message DeleteRuleSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteRuleSetRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DeleteRuleSetRequest.verify|verify} messages. + * @param message DeleteRuleSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteRuleSetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteRuleSetRequest + * @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.cloud.contentwarehouse.v1.DeleteRuleSetRequest; + + /** + * Decodes a DeleteRuleSetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteRuleSetRequest + * @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.cloud.contentwarehouse.v1.DeleteRuleSetRequest; + + /** + * Verifies a DeleteRuleSetRequest 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 DeleteRuleSetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteRuleSetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.DeleteRuleSetRequest; + + /** + * Creates a plain object from a DeleteRuleSetRequest message. Also converts values to other types if specified. + * @param message DeleteRuleSetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.DeleteRuleSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteRuleSetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteRuleSetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListRuleSetsRequest. */ + interface IListRuleSetsRequest { + + /** ListRuleSetsRequest parent */ + parent?: (string|null); + + /** ListRuleSetsRequest pageSize */ + pageSize?: (number|null); + + /** ListRuleSetsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListRuleSetsRequest. */ + class ListRuleSetsRequest implements IListRuleSetsRequest { + + /** + * Constructs a new ListRuleSetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IListRuleSetsRequest); + + /** ListRuleSetsRequest parent. */ + public parent: string; + + /** ListRuleSetsRequest pageSize. */ + public pageSize: number; + + /** ListRuleSetsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListRuleSetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRuleSetsRequest instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IListRuleSetsRequest): google.cloud.contentwarehouse.v1.ListRuleSetsRequest; + + /** + * Encodes the specified ListRuleSetsRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListRuleSetsRequest.verify|verify} messages. + * @param message ListRuleSetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IListRuleSetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRuleSetsRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListRuleSetsRequest.verify|verify} messages. + * @param message ListRuleSetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IListRuleSetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRuleSetsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRuleSetsRequest + * @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.cloud.contentwarehouse.v1.ListRuleSetsRequest; + + /** + * Decodes a ListRuleSetsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRuleSetsRequest + * @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.cloud.contentwarehouse.v1.ListRuleSetsRequest; + + /** + * Verifies a ListRuleSetsRequest 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 ListRuleSetsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRuleSetsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.ListRuleSetsRequest; + + /** + * Creates a plain object from a ListRuleSetsRequest message. Also converts values to other types if specified. + * @param message ListRuleSetsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.ListRuleSetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRuleSetsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListRuleSetsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListRuleSetsResponse. */ + interface IListRuleSetsResponse { + + /** ListRuleSetsResponse ruleSets */ + ruleSets?: (google.cloud.contentwarehouse.v1.IRuleSet[]|null); + + /** ListRuleSetsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListRuleSetsResponse. */ + class ListRuleSetsResponse implements IListRuleSetsResponse { + + /** + * Constructs a new ListRuleSetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IListRuleSetsResponse); + + /** ListRuleSetsResponse ruleSets. */ + public ruleSets: google.cloud.contentwarehouse.v1.IRuleSet[]; + + /** ListRuleSetsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListRuleSetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRuleSetsResponse instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IListRuleSetsResponse): google.cloud.contentwarehouse.v1.ListRuleSetsResponse; + + /** + * Encodes the specified ListRuleSetsResponse message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListRuleSetsResponse.verify|verify} messages. + * @param message ListRuleSetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IListRuleSetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRuleSetsResponse message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListRuleSetsResponse.verify|verify} messages. + * @param message ListRuleSetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IListRuleSetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRuleSetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRuleSetsResponse + * @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.cloud.contentwarehouse.v1.ListRuleSetsResponse; + + /** + * Decodes a ListRuleSetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRuleSetsResponse + * @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.cloud.contentwarehouse.v1.ListRuleSetsResponse; + + /** + * Verifies a ListRuleSetsResponse 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 ListRuleSetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRuleSetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.ListRuleSetsResponse; + + /** + * Creates a plain object from a ListRuleSetsResponse message. Also converts values to other types if specified. + * @param message ListRuleSetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.ListRuleSetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRuleSetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListRuleSetsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SynonymSet. */ + interface ISynonymSet { + + /** SynonymSet name */ + name?: (string|null); + + /** SynonymSet context */ + context?: (string|null); + + /** SynonymSet synonyms */ + synonyms?: (google.cloud.contentwarehouse.v1.SynonymSet.ISynonym[]|null); + } + + /** Represents a SynonymSet. */ + class SynonymSet implements ISynonymSet { + + /** + * Constructs a new SynonymSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.ISynonymSet); + + /** SynonymSet name. */ + public name: string; + + /** SynonymSet context. */ + public context: string; + + /** SynonymSet synonyms. */ + public synonyms: google.cloud.contentwarehouse.v1.SynonymSet.ISynonym[]; + + /** + * Creates a new SynonymSet instance using the specified properties. + * @param [properties] Properties to set + * @returns SynonymSet instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.ISynonymSet): google.cloud.contentwarehouse.v1.SynonymSet; + + /** + * Encodes the specified SynonymSet message. Does not implicitly {@link google.cloud.contentwarehouse.v1.SynonymSet.verify|verify} messages. + * @param message SynonymSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.ISynonymSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SynonymSet message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.SynonymSet.verify|verify} messages. + * @param message SynonymSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.ISynonymSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SynonymSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SynonymSet + * @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.cloud.contentwarehouse.v1.SynonymSet; + + /** + * Decodes a SynonymSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SynonymSet + * @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.cloud.contentwarehouse.v1.SynonymSet; + + /** + * Verifies a SynonymSet 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 SynonymSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SynonymSet + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.SynonymSet; + + /** + * Creates a plain object from a SynonymSet message. Also converts values to other types if specified. + * @param message SynonymSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.SynonymSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SynonymSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SynonymSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SynonymSet { + + /** Properties of a Synonym. */ + interface ISynonym { + + /** Synonym words */ + words?: (string[]|null); + } + + /** Represents a Synonym. */ + class Synonym implements ISynonym { + + /** + * Constructs a new Synonym. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.SynonymSet.ISynonym); + + /** Synonym words. */ + public words: string[]; + + /** + * Creates a new Synonym instance using the specified properties. + * @param [properties] Properties to set + * @returns Synonym instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.SynonymSet.ISynonym): google.cloud.contentwarehouse.v1.SynonymSet.Synonym; + + /** + * Encodes the specified Synonym message. Does not implicitly {@link google.cloud.contentwarehouse.v1.SynonymSet.Synonym.verify|verify} messages. + * @param message Synonym message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.SynonymSet.ISynonym, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Synonym message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.SynonymSet.Synonym.verify|verify} messages. + * @param message Synonym message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.SynonymSet.ISynonym, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Synonym message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Synonym + * @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.cloud.contentwarehouse.v1.SynonymSet.Synonym; + + /** + * Decodes a Synonym message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Synonym + * @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.cloud.contentwarehouse.v1.SynonymSet.Synonym; + + /** + * Verifies a Synonym 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 Synonym message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Synonym + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.SynonymSet.Synonym; + + /** + * Creates a plain object from a Synonym message. Also converts values to other types if specified. + * @param message Synonym + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.SynonymSet.Synonym, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Synonym to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Synonym + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Represents a SynonymSetService */ + class SynonymSetService extends $protobuf.rpc.Service { + + /** + * Constructs a new SynonymSetService 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 SynonymSetService 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): SynonymSetService; + + /** + * Calls CreateSynonymSet. + * @param request CreateSynonymSetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SynonymSet + */ + public createSynonymSet(request: google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest, callback: google.cloud.contentwarehouse.v1.SynonymSetService.CreateSynonymSetCallback): void; + + /** + * Calls CreateSynonymSet. + * @param request CreateSynonymSetRequest message or plain object + * @returns Promise + */ + public createSynonymSet(request: google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest): Promise; + + /** + * Calls GetSynonymSet. + * @param request GetSynonymSetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SynonymSet + */ + public getSynonymSet(request: google.cloud.contentwarehouse.v1.IGetSynonymSetRequest, callback: google.cloud.contentwarehouse.v1.SynonymSetService.GetSynonymSetCallback): void; + + /** + * Calls GetSynonymSet. + * @param request GetSynonymSetRequest message or plain object + * @returns Promise + */ + public getSynonymSet(request: google.cloud.contentwarehouse.v1.IGetSynonymSetRequest): Promise; + + /** + * Calls UpdateSynonymSet. + * @param request UpdateSynonymSetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SynonymSet + */ + public updateSynonymSet(request: google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest, callback: google.cloud.contentwarehouse.v1.SynonymSetService.UpdateSynonymSetCallback): void; + + /** + * Calls UpdateSynonymSet. + * @param request UpdateSynonymSetRequest message or plain object + * @returns Promise + */ + public updateSynonymSet(request: google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest): Promise; + + /** + * Calls DeleteSynonymSet. + * @param request DeleteSynonymSetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteSynonymSet(request: google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest, callback: google.cloud.contentwarehouse.v1.SynonymSetService.DeleteSynonymSetCallback): void; + + /** + * Calls DeleteSynonymSet. + * @param request DeleteSynonymSetRequest message or plain object + * @returns Promise + */ + public deleteSynonymSet(request: google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest): Promise; + + /** + * Calls ListSynonymSets. + * @param request ListSynonymSetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSynonymSetsResponse + */ + public listSynonymSets(request: google.cloud.contentwarehouse.v1.IListSynonymSetsRequest, callback: google.cloud.contentwarehouse.v1.SynonymSetService.ListSynonymSetsCallback): void; + + /** + * Calls ListSynonymSets. + * @param request ListSynonymSetsRequest message or plain object + * @returns Promise + */ + public listSynonymSets(request: google.cloud.contentwarehouse.v1.IListSynonymSetsRequest): Promise; + } + + namespace SynonymSetService { + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.SynonymSetService|createSynonymSet}. + * @param error Error, if any + * @param [response] SynonymSet + */ + type CreateSynonymSetCallback = (error: (Error|null), response?: google.cloud.contentwarehouse.v1.SynonymSet) => void; + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.SynonymSetService|getSynonymSet}. + * @param error Error, if any + * @param [response] SynonymSet + */ + type GetSynonymSetCallback = (error: (Error|null), response?: google.cloud.contentwarehouse.v1.SynonymSet) => void; + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.SynonymSetService|updateSynonymSet}. + * @param error Error, if any + * @param [response] SynonymSet + */ + type UpdateSynonymSetCallback = (error: (Error|null), response?: google.cloud.contentwarehouse.v1.SynonymSet) => void; + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.SynonymSetService|deleteSynonymSet}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteSynonymSetCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.SynonymSetService|listSynonymSets}. + * @param error Error, if any + * @param [response] ListSynonymSetsResponse + */ + type ListSynonymSetsCallback = (error: (Error|null), response?: google.cloud.contentwarehouse.v1.ListSynonymSetsResponse) => void; + } + + /** Properties of a CreateSynonymSetRequest. */ + interface ICreateSynonymSetRequest { + + /** CreateSynonymSetRequest parent */ + parent?: (string|null); + + /** CreateSynonymSetRequest synonymSet */ + synonymSet?: (google.cloud.contentwarehouse.v1.ISynonymSet|null); + } + + /** Represents a CreateSynonymSetRequest. */ + class CreateSynonymSetRequest implements ICreateSynonymSetRequest { + + /** + * Constructs a new CreateSynonymSetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest); + + /** CreateSynonymSetRequest parent. */ + public parent: string; + + /** CreateSynonymSetRequest synonymSet. */ + public synonymSet?: (google.cloud.contentwarehouse.v1.ISynonymSet|null); + + /** + * Creates a new CreateSynonymSetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSynonymSetRequest instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest): google.cloud.contentwarehouse.v1.CreateSynonymSetRequest; + + /** + * Encodes the specified CreateSynonymSetRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateSynonymSetRequest.verify|verify} messages. + * @param message CreateSynonymSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateSynonymSetRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateSynonymSetRequest.verify|verify} messages. + * @param message CreateSynonymSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateSynonymSetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSynonymSetRequest + * @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.cloud.contentwarehouse.v1.CreateSynonymSetRequest; + + /** + * Decodes a CreateSynonymSetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSynonymSetRequest + * @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.cloud.contentwarehouse.v1.CreateSynonymSetRequest; + + /** + * Verifies a CreateSynonymSetRequest 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 CreateSynonymSetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSynonymSetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.CreateSynonymSetRequest; + + /** + * Creates a plain object from a CreateSynonymSetRequest message. Also converts values to other types if specified. + * @param message CreateSynonymSetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.CreateSynonymSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateSynonymSetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateSynonymSetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetSynonymSetRequest. */ + interface IGetSynonymSetRequest { + + /** GetSynonymSetRequest name */ + name?: (string|null); + } + + /** Represents a GetSynonymSetRequest. */ + class GetSynonymSetRequest implements IGetSynonymSetRequest { + + /** + * Constructs a new GetSynonymSetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IGetSynonymSetRequest); + + /** GetSynonymSetRequest name. */ + public name: string; + + /** + * Creates a new GetSynonymSetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSynonymSetRequest instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IGetSynonymSetRequest): google.cloud.contentwarehouse.v1.GetSynonymSetRequest; + + /** + * Encodes the specified GetSynonymSetRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.GetSynonymSetRequest.verify|verify} messages. + * @param message GetSynonymSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IGetSynonymSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSynonymSetRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.GetSynonymSetRequest.verify|verify} messages. + * @param message GetSynonymSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IGetSynonymSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSynonymSetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSynonymSetRequest + * @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.cloud.contentwarehouse.v1.GetSynonymSetRequest; + + /** + * Decodes a GetSynonymSetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSynonymSetRequest + * @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.cloud.contentwarehouse.v1.GetSynonymSetRequest; + + /** + * Verifies a GetSynonymSetRequest 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 GetSynonymSetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSynonymSetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.GetSynonymSetRequest; + + /** + * Creates a plain object from a GetSynonymSetRequest message. Also converts values to other types if specified. + * @param message GetSynonymSetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.GetSynonymSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSynonymSetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSynonymSetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSynonymSetsRequest. */ + interface IListSynonymSetsRequest { + + /** ListSynonymSetsRequest parent */ + parent?: (string|null); + + /** ListSynonymSetsRequest pageSize */ + pageSize?: (number|null); + + /** ListSynonymSetsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListSynonymSetsRequest. */ + class ListSynonymSetsRequest implements IListSynonymSetsRequest { + + /** + * Constructs a new ListSynonymSetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IListSynonymSetsRequest); + + /** ListSynonymSetsRequest parent. */ + public parent: string; + + /** ListSynonymSetsRequest pageSize. */ + public pageSize: number; + + /** ListSynonymSetsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListSynonymSetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSynonymSetsRequest instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IListSynonymSetsRequest): google.cloud.contentwarehouse.v1.ListSynonymSetsRequest; + + /** + * Encodes the specified ListSynonymSetsRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListSynonymSetsRequest.verify|verify} messages. + * @param message ListSynonymSetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IListSynonymSetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSynonymSetsRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListSynonymSetsRequest.verify|verify} messages. + * @param message ListSynonymSetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IListSynonymSetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSynonymSetsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSynonymSetsRequest + * @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.cloud.contentwarehouse.v1.ListSynonymSetsRequest; + + /** + * Decodes a ListSynonymSetsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSynonymSetsRequest + * @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.cloud.contentwarehouse.v1.ListSynonymSetsRequest; + + /** + * Verifies a ListSynonymSetsRequest 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 ListSynonymSetsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSynonymSetsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.ListSynonymSetsRequest; + + /** + * Creates a plain object from a ListSynonymSetsRequest message. Also converts values to other types if specified. + * @param message ListSynonymSetsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.ListSynonymSetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSynonymSetsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSynonymSetsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSynonymSetsResponse. */ + interface IListSynonymSetsResponse { + + /** ListSynonymSetsResponse synonymSets */ + synonymSets?: (google.cloud.contentwarehouse.v1.ISynonymSet[]|null); + + /** ListSynonymSetsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListSynonymSetsResponse. */ + class ListSynonymSetsResponse implements IListSynonymSetsResponse { + + /** + * Constructs a new ListSynonymSetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IListSynonymSetsResponse); + + /** ListSynonymSetsResponse synonymSets. */ + public synonymSets: google.cloud.contentwarehouse.v1.ISynonymSet[]; + + /** ListSynonymSetsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListSynonymSetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSynonymSetsResponse instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IListSynonymSetsResponse): google.cloud.contentwarehouse.v1.ListSynonymSetsResponse; + + /** + * Encodes the specified ListSynonymSetsResponse message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListSynonymSetsResponse.verify|verify} messages. + * @param message ListSynonymSetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IListSynonymSetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSynonymSetsResponse message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListSynonymSetsResponse.verify|verify} messages. + * @param message ListSynonymSetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IListSynonymSetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSynonymSetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSynonymSetsResponse + * @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.cloud.contentwarehouse.v1.ListSynonymSetsResponse; + + /** + * Decodes a ListSynonymSetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSynonymSetsResponse + * @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.cloud.contentwarehouse.v1.ListSynonymSetsResponse; + + /** + * Verifies a ListSynonymSetsResponse 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 ListSynonymSetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSynonymSetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.ListSynonymSetsResponse; + + /** + * Creates a plain object from a ListSynonymSetsResponse message. Also converts values to other types if specified. + * @param message ListSynonymSetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.ListSynonymSetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSynonymSetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSynonymSetsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateSynonymSetRequest. */ + interface IUpdateSynonymSetRequest { + + /** UpdateSynonymSetRequest name */ + name?: (string|null); + + /** UpdateSynonymSetRequest synonymSet */ + synonymSet?: (google.cloud.contentwarehouse.v1.ISynonymSet|null); + } + + /** Represents an UpdateSynonymSetRequest. */ + class UpdateSynonymSetRequest implements IUpdateSynonymSetRequest { + + /** + * Constructs a new UpdateSynonymSetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest); + + /** UpdateSynonymSetRequest name. */ + public name: string; + + /** UpdateSynonymSetRequest synonymSet. */ + public synonymSet?: (google.cloud.contentwarehouse.v1.ISynonymSet|null); + + /** + * Creates a new UpdateSynonymSetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSynonymSetRequest instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest): google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest; + + /** + * Encodes the specified UpdateSynonymSetRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest.verify|verify} messages. + * @param message UpdateSynonymSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateSynonymSetRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest.verify|verify} messages. + * @param message UpdateSynonymSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateSynonymSetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSynonymSetRequest + * @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.cloud.contentwarehouse.v1.UpdateSynonymSetRequest; + + /** + * Decodes an UpdateSynonymSetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSynonymSetRequest + * @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.cloud.contentwarehouse.v1.UpdateSynonymSetRequest; + + /** + * Verifies an UpdateSynonymSetRequest 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 UpdateSynonymSetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSynonymSetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest; + + /** + * Creates a plain object from an UpdateSynonymSetRequest message. Also converts values to other types if specified. + * @param message UpdateSynonymSetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateSynonymSetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateSynonymSetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteSynonymSetRequest. */ + interface IDeleteSynonymSetRequest { + + /** DeleteSynonymSetRequest name */ + name?: (string|null); + } + + /** Represents a DeleteSynonymSetRequest. */ + class DeleteSynonymSetRequest implements IDeleteSynonymSetRequest { + + /** + * Constructs a new DeleteSynonymSetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest); + + /** DeleteSynonymSetRequest name. */ + public name: string; + + /** + * Creates a new DeleteSynonymSetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteSynonymSetRequest instance + */ + public static create(properties?: google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest): google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest; + + /** + * Encodes the specified DeleteSynonymSetRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest.verify|verify} messages. + * @param message DeleteSynonymSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteSynonymSetRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest.verify|verify} messages. + * @param message DeleteSynonymSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteSynonymSetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteSynonymSetRequest + * @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.cloud.contentwarehouse.v1.DeleteSynonymSetRequest; + + /** + * Decodes a DeleteSynonymSetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteSynonymSetRequest + * @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.cloud.contentwarehouse.v1.DeleteSynonymSetRequest; + + /** + * Verifies a DeleteSynonymSetRequest 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 DeleteSynonymSetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteSynonymSetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest; + + /** + * Creates a plain object from a DeleteSynonymSetRequest message. Also converts values to other types if specified. + * @param message DeleteSynonymSetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteSynonymSetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteSynonymSetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Namespace documentai. */ + namespace documentai { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of a Document. */ + interface IDocument { + + /** Document uri */ + uri?: (string|null); + + /** Document content */ + content?: (Uint8Array|Buffer|string|null); + + /** Document docid */ + docid?: (string|null); + + /** Document mimeType */ + mimeType?: (string|null); + + /** Document text */ + text?: (string|null); + + /** Document textStyles */ + textStyles?: (google.cloud.documentai.v1.Document.IStyle[]|null); + + /** Document pages */ + pages?: (google.cloud.documentai.v1.Document.IPage[]|null); + + /** Document entities */ + entities?: (google.cloud.documentai.v1.Document.IEntity[]|null); + + /** Document entityRelations */ + entityRelations?: (google.cloud.documentai.v1.Document.IEntityRelation[]|null); + + /** Document textChanges */ + textChanges?: (google.cloud.documentai.v1.Document.ITextChange[]|null); + + /** Document shardInfo */ + shardInfo?: (google.cloud.documentai.v1.Document.IShardInfo|null); + + /** Document error */ + error?: (google.rpc.IStatus|null); + + /** Document revisions */ + revisions?: (google.cloud.documentai.v1.Document.IRevision[]|null); + + /** Document documentLayout */ + documentLayout?: (google.cloud.documentai.v1.Document.IDocumentLayout|null); + + /** Document chunkedDocument */ + chunkedDocument?: (google.cloud.documentai.v1.Document.IChunkedDocument|null); + + /** Document entityValidationOutput */ + entityValidationOutput?: (google.cloud.documentai.v1.Document.IEntityValidationOutput|null); + + /** Document entitiesRevisions */ + entitiesRevisions?: (google.cloud.documentai.v1.Document.IEntitiesRevision[]|null); + + /** Document entitiesRevisionId */ + entitiesRevisionId?: (string|null); + } + + /** Represents a Document. */ + class Document implements IDocument { + + /** + * Constructs a new Document. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IDocument); + + /** Document uri. */ + public uri?: (string|null); + + /** Document content. */ + public content?: (Uint8Array|Buffer|string|null); + + /** Document docid. */ + public docid: string; + + /** Document mimeType. */ + public mimeType: string; + + /** Document text. */ + public text: string; + + /** Document textStyles. */ + public textStyles: google.cloud.documentai.v1.Document.IStyle[]; + + /** Document pages. */ + public pages: google.cloud.documentai.v1.Document.IPage[]; + + /** Document entities. */ + public entities: google.cloud.documentai.v1.Document.IEntity[]; + + /** Document entityRelations. */ + public entityRelations: google.cloud.documentai.v1.Document.IEntityRelation[]; + + /** Document textChanges. */ + public textChanges: google.cloud.documentai.v1.Document.ITextChange[]; + + /** Document shardInfo. */ + public shardInfo?: (google.cloud.documentai.v1.Document.IShardInfo|null); + + /** Document error. */ + public error?: (google.rpc.IStatus|null); + + /** Document revisions. */ + public revisions: google.cloud.documentai.v1.Document.IRevision[]; + + /** Document documentLayout. */ + public documentLayout?: (google.cloud.documentai.v1.Document.IDocumentLayout|null); + + /** Document chunkedDocument. */ + public chunkedDocument?: (google.cloud.documentai.v1.Document.IChunkedDocument|null); + + /** Document entityValidationOutput. */ + public entityValidationOutput?: (google.cloud.documentai.v1.Document.IEntityValidationOutput|null); + + /** Document entitiesRevisions. */ + public entitiesRevisions: google.cloud.documentai.v1.Document.IEntitiesRevision[]; + + /** Document entitiesRevisionId. */ + public entitiesRevisionId: string; + + /** Document source. */ + public source?: ("uri"|"content"); + + /** + * Creates a new Document instance using the specified properties. + * @param [properties] Properties to set + * @returns Document instance + */ + public static create(properties?: google.cloud.documentai.v1.IDocument): google.cloud.documentai.v1.Document; + + /** + * Encodes the specified Document message. Does not implicitly {@link google.cloud.documentai.v1.Document.verify|verify} messages. + * @param message Document message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IDocument, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Document message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.verify|verify} messages. + * @param message Document message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IDocument, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Document message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Document + * @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.cloud.documentai.v1.Document; + + /** + * Decodes a Document message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Document + * @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.cloud.documentai.v1.Document; + + /** + * Verifies a Document 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 Document message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Document + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document; + + /** + * Creates a plain object from a Document message. Also converts values to other types if specified. + * @param message Document + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Document to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Document + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Document { + + /** Properties of a ShardInfo. */ + interface IShardInfo { + + /** ShardInfo shardIndex */ + shardIndex?: (number|Long|string|null); + + /** ShardInfo shardCount */ + shardCount?: (number|Long|string|null); + + /** ShardInfo textOffset */ + textOffset?: (number|Long|string|null); + } + + /** Represents a ShardInfo. */ + class ShardInfo implements IShardInfo { + + /** + * Constructs a new ShardInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.IShardInfo); + + /** ShardInfo shardIndex. */ + public shardIndex: (number|Long|string); + + /** ShardInfo shardCount. */ + public shardCount: (number|Long|string); + + /** ShardInfo textOffset. */ + public textOffset: (number|Long|string); + + /** + * Creates a new ShardInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardInfo instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.IShardInfo): google.cloud.documentai.v1.Document.ShardInfo; + + /** + * Encodes the specified ShardInfo message. Does not implicitly {@link google.cloud.documentai.v1.Document.ShardInfo.verify|verify} messages. + * @param message ShardInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.IShardInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ShardInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.ShardInfo.verify|verify} messages. + * @param message ShardInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.IShardInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ShardInfo + * @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.cloud.documentai.v1.Document.ShardInfo; + + /** + * Decodes a ShardInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ShardInfo + * @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.cloud.documentai.v1.Document.ShardInfo; + + /** + * Verifies a ShardInfo 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 ShardInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ShardInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.ShardInfo; + + /** + * Creates a plain object from a ShardInfo message. Also converts values to other types if specified. + * @param message ShardInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.ShardInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ShardInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ShardInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Style. */ + interface IStyle { + + /** Style textAnchor */ + textAnchor?: (google.cloud.documentai.v1.Document.ITextAnchor|null); + + /** Style color */ + color?: (google.type.IColor|null); + + /** Style backgroundColor */ + backgroundColor?: (google.type.IColor|null); + + /** Style fontWeight */ + fontWeight?: (string|null); + + /** Style textStyle */ + textStyle?: (string|null); + + /** Style textDecoration */ + textDecoration?: (string|null); + + /** Style fontSize */ + fontSize?: (google.cloud.documentai.v1.Document.Style.IFontSize|null); + + /** Style fontFamily */ + fontFamily?: (string|null); + } + + /** Represents a Style. */ + class Style implements IStyle { + + /** + * Constructs a new Style. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.IStyle); + + /** Style textAnchor. */ + public textAnchor?: (google.cloud.documentai.v1.Document.ITextAnchor|null); + + /** Style color. */ + public color?: (google.type.IColor|null); + + /** Style backgroundColor. */ + public backgroundColor?: (google.type.IColor|null); + + /** Style fontWeight. */ + public fontWeight: string; + + /** Style textStyle. */ + public textStyle: string; + + /** Style textDecoration. */ + public textDecoration: string; + + /** Style fontSize. */ + public fontSize?: (google.cloud.documentai.v1.Document.Style.IFontSize|null); + + /** Style fontFamily. */ + public fontFamily: string; + + /** + * Creates a new Style instance using the specified properties. + * @param [properties] Properties to set + * @returns Style instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.IStyle): google.cloud.documentai.v1.Document.Style; + + /** + * Encodes the specified Style message. Does not implicitly {@link google.cloud.documentai.v1.Document.Style.verify|verify} messages. + * @param message Style message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.IStyle, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Style message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Style.verify|verify} messages. + * @param message Style message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.IStyle, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Style message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Style + * @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.cloud.documentai.v1.Document.Style; + + /** + * Decodes a Style message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Style + * @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.cloud.documentai.v1.Document.Style; + + /** + * Verifies a Style 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 Style message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Style + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Style; + + /** + * Creates a plain object from a Style message. Also converts values to other types if specified. + * @param message Style + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.Style, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Style to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Style + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Style { + + /** Properties of a FontSize. */ + interface IFontSize { + + /** FontSize size */ + size?: (number|null); + + /** FontSize unit */ + unit?: (string|null); + } + + /** Represents a FontSize. */ + class FontSize implements IFontSize { + + /** + * Constructs a new FontSize. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.Style.IFontSize); + + /** FontSize size. */ + public size: number; + + /** FontSize unit. */ + public unit: string; + + /** + * Creates a new FontSize instance using the specified properties. + * @param [properties] Properties to set + * @returns FontSize instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.Style.IFontSize): google.cloud.documentai.v1.Document.Style.FontSize; + + /** + * Encodes the specified FontSize message. Does not implicitly {@link google.cloud.documentai.v1.Document.Style.FontSize.verify|verify} messages. + * @param message FontSize message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.Style.IFontSize, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FontSize message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Style.FontSize.verify|verify} messages. + * @param message FontSize message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.Style.IFontSize, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FontSize message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FontSize + * @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.cloud.documentai.v1.Document.Style.FontSize; + + /** + * Decodes a FontSize message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FontSize + * @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.cloud.documentai.v1.Document.Style.FontSize; + + /** + * Verifies a FontSize 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 FontSize message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FontSize + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Style.FontSize; + + /** + * Creates a plain object from a FontSize message. Also converts values to other types if specified. + * @param message FontSize + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.Style.FontSize, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FontSize to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FontSize + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Page. */ + interface IPage { + + /** Page pageNumber */ + pageNumber?: (number|null); + + /** Page image */ + image?: (google.cloud.documentai.v1.Document.Page.IImage|null); + + /** Page transforms */ + transforms?: (google.cloud.documentai.v1.Document.Page.IMatrix[]|null); + + /** Page dimension */ + dimension?: (google.cloud.documentai.v1.Document.Page.IDimension|null); + + /** Page layout */ + layout?: (google.cloud.documentai.v1.Document.Page.ILayout|null); + + /** Page detectedLanguages */ + detectedLanguages?: (google.cloud.documentai.v1.Document.Page.IDetectedLanguage[]|null); + + /** Page blocks */ + blocks?: (google.cloud.documentai.v1.Document.Page.IBlock[]|null); + + /** Page paragraphs */ + paragraphs?: (google.cloud.documentai.v1.Document.Page.IParagraph[]|null); + + /** Page lines */ + lines?: (google.cloud.documentai.v1.Document.Page.ILine[]|null); + + /** Page tokens */ + tokens?: (google.cloud.documentai.v1.Document.Page.IToken[]|null); + + /** Page visualElements */ + visualElements?: (google.cloud.documentai.v1.Document.Page.IVisualElement[]|null); + + /** Page tables */ + tables?: (google.cloud.documentai.v1.Document.Page.ITable[]|null); + + /** Page formFields */ + formFields?: (google.cloud.documentai.v1.Document.Page.IFormField[]|null); + + /** Page symbols */ + symbols?: (google.cloud.documentai.v1.Document.Page.ISymbol[]|null); + + /** Page detectedBarcodes */ + detectedBarcodes?: (google.cloud.documentai.v1.Document.Page.IDetectedBarcode[]|null); + + /** Page imageQualityScores */ + imageQualityScores?: (google.cloud.documentai.v1.Document.Page.IImageQualityScores|null); + + /** Page provenance */ + provenance?: (google.cloud.documentai.v1.Document.IProvenance|null); + } + + /** Represents a Page. */ + class Page implements IPage { + + /** + * Constructs a new Page. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.IPage); + + /** Page pageNumber. */ + public pageNumber: number; + + /** Page image. */ + public image?: (google.cloud.documentai.v1.Document.Page.IImage|null); + + /** Page transforms. */ + public transforms: google.cloud.documentai.v1.Document.Page.IMatrix[]; + + /** Page dimension. */ + public dimension?: (google.cloud.documentai.v1.Document.Page.IDimension|null); + + /** Page layout. */ + public layout?: (google.cloud.documentai.v1.Document.Page.ILayout|null); + + /** Page detectedLanguages. */ + public detectedLanguages: google.cloud.documentai.v1.Document.Page.IDetectedLanguage[]; + + /** Page blocks. */ + public blocks: google.cloud.documentai.v1.Document.Page.IBlock[]; + + /** Page paragraphs. */ + public paragraphs: google.cloud.documentai.v1.Document.Page.IParagraph[]; + + /** Page lines. */ + public lines: google.cloud.documentai.v1.Document.Page.ILine[]; + + /** Page tokens. */ + public tokens: google.cloud.documentai.v1.Document.Page.IToken[]; + + /** Page visualElements. */ + public visualElements: google.cloud.documentai.v1.Document.Page.IVisualElement[]; + + /** Page tables. */ + public tables: google.cloud.documentai.v1.Document.Page.ITable[]; + + /** Page formFields. */ + public formFields: google.cloud.documentai.v1.Document.Page.IFormField[]; + + /** Page symbols. */ + public symbols: google.cloud.documentai.v1.Document.Page.ISymbol[]; + + /** Page detectedBarcodes. */ + public detectedBarcodes: google.cloud.documentai.v1.Document.Page.IDetectedBarcode[]; + + /** Page imageQualityScores. */ + public imageQualityScores?: (google.cloud.documentai.v1.Document.Page.IImageQualityScores|null); + + /** Page provenance. */ + public provenance?: (google.cloud.documentai.v1.Document.IProvenance|null); + + /** + * Creates a new Page instance using the specified properties. + * @param [properties] Properties to set + * @returns Page instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.IPage): google.cloud.documentai.v1.Document.Page; + + /** + * Encodes the specified Page message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.verify|verify} messages. + * @param message Page message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.IPage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Page message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.verify|verify} messages. + * @param message Page message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.IPage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Page message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Page + * @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.cloud.documentai.v1.Document.Page; + + /** + * Decodes a Page message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Page + * @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.cloud.documentai.v1.Document.Page; + + /** + * Verifies a Page 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 Page message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Page + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Page; + + /** + * Creates a plain object from a Page message. Also converts values to other types if specified. + * @param message Page + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.Page, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Page to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Page + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Page { + + /** Properties of a Dimension. */ + interface IDimension { + + /** Dimension width */ + width?: (number|null); + + /** Dimension height */ + height?: (number|null); + + /** Dimension unit */ + unit?: (string|null); + } + + /** Represents a Dimension. */ + class Dimension implements IDimension { + + /** + * Constructs a new Dimension. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.Page.IDimension); + + /** Dimension width. */ + public width: number; + + /** Dimension height. */ + public height: number; + + /** Dimension unit. */ + public unit: string; + + /** + * Creates a new Dimension instance using the specified properties. + * @param [properties] Properties to set + * @returns Dimension instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.Page.IDimension): google.cloud.documentai.v1.Document.Page.Dimension; + + /** + * Encodes the specified Dimension message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Dimension.verify|verify} messages. + * @param message Dimension message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.Page.IDimension, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Dimension message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Dimension.verify|verify} messages. + * @param message Dimension message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.Page.IDimension, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Dimension message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Dimension + * @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.cloud.documentai.v1.Document.Page.Dimension; + + /** + * Decodes a Dimension message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Dimension + * @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.cloud.documentai.v1.Document.Page.Dimension; + + /** + * Verifies a Dimension 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 Dimension message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Dimension + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Page.Dimension; + + /** + * Creates a plain object from a Dimension message. Also converts values to other types if specified. + * @param message Dimension + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.Page.Dimension, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Dimension to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Dimension + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Image. */ + interface IImage { + + /** Image content */ + content?: (Uint8Array|Buffer|string|null); + + /** Image mimeType */ + mimeType?: (string|null); + + /** Image width */ + width?: (number|null); + + /** Image height */ + height?: (number|null); + } + + /** Represents an Image. */ + class Image implements IImage { + + /** + * Constructs a new Image. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.Page.IImage); + + /** Image content. */ + public content: (Uint8Array|Buffer|string); + + /** Image mimeType. */ + public mimeType: string; + + /** Image width. */ + public width: number; + + /** Image height. */ + public height: number; + + /** + * Creates a new Image instance using the specified properties. + * @param [properties] Properties to set + * @returns Image instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.Page.IImage): google.cloud.documentai.v1.Document.Page.Image; + + /** + * Encodes the specified Image message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Image.verify|verify} messages. + * @param message Image message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.Page.IImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Image.verify|verify} messages. + * @param message Image message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.Page.IImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Image message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Image + * @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.cloud.documentai.v1.Document.Page.Image; + + /** + * Decodes an Image message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Image + * @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.cloud.documentai.v1.Document.Page.Image; + + /** + * Verifies an Image 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 Image message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Image + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Page.Image; + + /** + * Creates a plain object from an Image message. Also converts values to other types if specified. + * @param message Image + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.Page.Image, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Image to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Image + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Matrix. */ + interface IMatrix { + + /** Matrix rows */ + rows?: (number|null); + + /** Matrix cols */ + cols?: (number|null); + + /** Matrix type */ + type?: (number|null); + + /** Matrix data */ + data?: (Uint8Array|Buffer|string|null); + } + + /** Represents a Matrix. */ + class Matrix implements IMatrix { + + /** + * Constructs a new Matrix. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.Page.IMatrix); + + /** Matrix rows. */ + public rows: number; + + /** Matrix cols. */ + public cols: number; + + /** Matrix type. */ + public type: number; + + /** Matrix data. */ + public data: (Uint8Array|Buffer|string); + + /** + * Creates a new Matrix instance using the specified properties. + * @param [properties] Properties to set + * @returns Matrix instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.Page.IMatrix): google.cloud.documentai.v1.Document.Page.Matrix; + + /** + * Encodes the specified Matrix message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Matrix.verify|verify} messages. + * @param message Matrix message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.Page.IMatrix, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Matrix message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Matrix.verify|verify} messages. + * @param message Matrix message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.Page.IMatrix, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Matrix message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Matrix + * @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.cloud.documentai.v1.Document.Page.Matrix; + + /** + * Decodes a Matrix message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Matrix + * @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.cloud.documentai.v1.Document.Page.Matrix; + + /** + * Verifies a Matrix 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 Matrix message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Matrix + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Page.Matrix; + + /** + * Creates a plain object from a Matrix message. Also converts values to other types if specified. + * @param message Matrix + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.Page.Matrix, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Matrix to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Matrix + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Layout. */ + interface ILayout { + + /** Layout textAnchor */ + textAnchor?: (google.cloud.documentai.v1.Document.ITextAnchor|null); + + /** Layout confidence */ + confidence?: (number|null); + + /** Layout boundingPoly */ + boundingPoly?: (google.cloud.documentai.v1.IBoundingPoly|null); + + /** Layout orientation */ + orientation?: (google.cloud.documentai.v1.Document.Page.Layout.Orientation|keyof typeof google.cloud.documentai.v1.Document.Page.Layout.Orientation|null); + } + + /** Represents a Layout. */ + class Layout implements ILayout { + + /** + * Constructs a new Layout. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.Page.ILayout); + + /** Layout textAnchor. */ + public textAnchor?: (google.cloud.documentai.v1.Document.ITextAnchor|null); + + /** Layout confidence. */ + public confidence: number; + + /** Layout boundingPoly. */ + public boundingPoly?: (google.cloud.documentai.v1.IBoundingPoly|null); + + /** Layout orientation. */ + public orientation: (google.cloud.documentai.v1.Document.Page.Layout.Orientation|keyof typeof google.cloud.documentai.v1.Document.Page.Layout.Orientation); + + /** + * Creates a new Layout instance using the specified properties. + * @param [properties] Properties to set + * @returns Layout instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.Page.ILayout): google.cloud.documentai.v1.Document.Page.Layout; + + /** + * Encodes the specified Layout message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Layout.verify|verify} messages. + * @param message Layout message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.Page.ILayout, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Layout message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Layout.verify|verify} messages. + * @param message Layout message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.Page.ILayout, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Layout message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Layout + * @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.cloud.documentai.v1.Document.Page.Layout; + + /** + * Decodes a Layout message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Layout + * @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.cloud.documentai.v1.Document.Page.Layout; + + /** + * Verifies a Layout 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 Layout message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Layout + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Page.Layout; + + /** + * Creates a plain object from a Layout message. Also converts values to other types if specified. + * @param message Layout + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.Page.Layout, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Layout to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Layout + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Layout { + + /** Orientation enum. */ + enum Orientation { + ORIENTATION_UNSPECIFIED = 0, + PAGE_UP = 1, + PAGE_RIGHT = 2, + PAGE_DOWN = 3, + PAGE_LEFT = 4 + } + } + + /** Properties of a Block. */ + interface IBlock { + + /** Block layout */ + layout?: (google.cloud.documentai.v1.Document.Page.ILayout|null); + + /** Block detectedLanguages */ + detectedLanguages?: (google.cloud.documentai.v1.Document.Page.IDetectedLanguage[]|null); + + /** Block provenance */ + provenance?: (google.cloud.documentai.v1.Document.IProvenance|null); + } + + /** Represents a Block. */ + class Block implements IBlock { + + /** + * Constructs a new Block. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.Page.IBlock); + + /** Block layout. */ + public layout?: (google.cloud.documentai.v1.Document.Page.ILayout|null); + + /** Block detectedLanguages. */ + public detectedLanguages: google.cloud.documentai.v1.Document.Page.IDetectedLanguage[]; + + /** Block provenance. */ + public provenance?: (google.cloud.documentai.v1.Document.IProvenance|null); + + /** + * Creates a new Block instance using the specified properties. + * @param [properties] Properties to set + * @returns Block instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.Page.IBlock): google.cloud.documentai.v1.Document.Page.Block; + + /** + * Encodes the specified Block message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Block.verify|verify} messages. + * @param message Block message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.Page.IBlock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Block message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Block.verify|verify} messages. + * @param message Block message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.Page.IBlock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Block message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Block + * @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.cloud.documentai.v1.Document.Page.Block; + + /** + * Decodes a Block message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Block + * @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.cloud.documentai.v1.Document.Page.Block; + + /** + * Verifies a Block 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 Block message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Block + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Page.Block; + + /** + * Creates a plain object from a Block message. Also converts values to other types if specified. + * @param message Block + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.Page.Block, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Block to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Block + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Paragraph. */ + interface IParagraph { + + /** Paragraph layout */ + layout?: (google.cloud.documentai.v1.Document.Page.ILayout|null); + + /** Paragraph detectedLanguages */ + detectedLanguages?: (google.cloud.documentai.v1.Document.Page.IDetectedLanguage[]|null); + + /** Paragraph provenance */ + provenance?: (google.cloud.documentai.v1.Document.IProvenance|null); + } + + /** Represents a Paragraph. */ + class Paragraph implements IParagraph { + + /** + * Constructs a new Paragraph. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.Page.IParagraph); + + /** Paragraph layout. */ + public layout?: (google.cloud.documentai.v1.Document.Page.ILayout|null); + + /** Paragraph detectedLanguages. */ + public detectedLanguages: google.cloud.documentai.v1.Document.Page.IDetectedLanguage[]; + + /** Paragraph provenance. */ + public provenance?: (google.cloud.documentai.v1.Document.IProvenance|null); + + /** + * Creates a new Paragraph instance using the specified properties. + * @param [properties] Properties to set + * @returns Paragraph instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.Page.IParagraph): google.cloud.documentai.v1.Document.Page.Paragraph; + + /** + * Encodes the specified Paragraph message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Paragraph.verify|verify} messages. + * @param message Paragraph message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.Page.IParagraph, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Paragraph message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Paragraph.verify|verify} messages. + * @param message Paragraph message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.Page.IParagraph, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Paragraph message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Paragraph + * @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.cloud.documentai.v1.Document.Page.Paragraph; + + /** + * Decodes a Paragraph message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Paragraph + * @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.cloud.documentai.v1.Document.Page.Paragraph; + + /** + * Verifies a Paragraph 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 Paragraph message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Paragraph + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Page.Paragraph; + + /** + * Creates a plain object from a Paragraph message. Also converts values to other types if specified. + * @param message Paragraph + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.Page.Paragraph, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Paragraph to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Paragraph + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Line. */ + interface ILine { + + /** Line layout */ + layout?: (google.cloud.documentai.v1.Document.Page.ILayout|null); + + /** Line detectedLanguages */ + detectedLanguages?: (google.cloud.documentai.v1.Document.Page.IDetectedLanguage[]|null); + + /** Line provenance */ + provenance?: (google.cloud.documentai.v1.Document.IProvenance|null); + } + + /** Represents a Line. */ + class Line implements ILine { + + /** + * Constructs a new Line. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.Page.ILine); + + /** Line layout. */ + public layout?: (google.cloud.documentai.v1.Document.Page.ILayout|null); + + /** Line detectedLanguages. */ + public detectedLanguages: google.cloud.documentai.v1.Document.Page.IDetectedLanguage[]; + + /** Line provenance. */ + public provenance?: (google.cloud.documentai.v1.Document.IProvenance|null); + + /** + * Creates a new Line instance using the specified properties. + * @param [properties] Properties to set + * @returns Line instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.Page.ILine): google.cloud.documentai.v1.Document.Page.Line; + + /** + * Encodes the specified Line message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Line.verify|verify} messages. + * @param message Line message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.Page.ILine, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Line message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Line.verify|verify} messages. + * @param message Line message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.Page.ILine, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Line message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Line + * @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.cloud.documentai.v1.Document.Page.Line; + + /** + * Decodes a Line message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Line + * @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.cloud.documentai.v1.Document.Page.Line; + + /** + * Verifies a Line 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 Line message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Line + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Page.Line; + + /** + * Creates a plain object from a Line message. Also converts values to other types if specified. + * @param message Line + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.Page.Line, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Line to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Line + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Token. */ + interface IToken { + + /** Token layout */ + layout?: (google.cloud.documentai.v1.Document.Page.ILayout|null); + + /** Token detectedBreak */ + detectedBreak?: (google.cloud.documentai.v1.Document.Page.Token.IDetectedBreak|null); + + /** Token detectedLanguages */ + detectedLanguages?: (google.cloud.documentai.v1.Document.Page.IDetectedLanguage[]|null); + + /** Token provenance */ + provenance?: (google.cloud.documentai.v1.Document.IProvenance|null); + + /** Token styleInfo */ + styleInfo?: (google.cloud.documentai.v1.Document.Page.Token.IStyleInfo|null); + } + + /** Represents a Token. */ + class Token implements IToken { + + /** + * Constructs a new Token. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.Page.IToken); + + /** Token layout. */ + public layout?: (google.cloud.documentai.v1.Document.Page.ILayout|null); + + /** Token detectedBreak. */ + public detectedBreak?: (google.cloud.documentai.v1.Document.Page.Token.IDetectedBreak|null); + + /** Token detectedLanguages. */ + public detectedLanguages: google.cloud.documentai.v1.Document.Page.IDetectedLanguage[]; + + /** Token provenance. */ + public provenance?: (google.cloud.documentai.v1.Document.IProvenance|null); + + /** Token styleInfo. */ + public styleInfo?: (google.cloud.documentai.v1.Document.Page.Token.IStyleInfo|null); + + /** + * Creates a new Token instance using the specified properties. + * @param [properties] Properties to set + * @returns Token instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.Page.IToken): google.cloud.documentai.v1.Document.Page.Token; + + /** + * Encodes the specified Token message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Token.verify|verify} messages. + * @param message Token message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.Page.IToken, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Token message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Token.verify|verify} messages. + * @param message Token message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.Page.IToken, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Token message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Token + * @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.cloud.documentai.v1.Document.Page.Token; + + /** + * Decodes a Token message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Token + * @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.cloud.documentai.v1.Document.Page.Token; + + /** + * Verifies a Token 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 Token message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Token + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Page.Token; + + /** + * Creates a plain object from a Token message. Also converts values to other types if specified. + * @param message Token + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.Page.Token, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Token to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Token + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Token { + + /** Properties of a DetectedBreak. */ + interface IDetectedBreak { + + /** DetectedBreak type */ + type?: (google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.Type|keyof typeof google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.Type|null); + } + + /** Represents a DetectedBreak. */ + class DetectedBreak implements IDetectedBreak { + + /** + * Constructs a new DetectedBreak. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.Page.Token.IDetectedBreak); + + /** DetectedBreak type. */ + public type: (google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.Type|keyof typeof google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.Type); + + /** + * Creates a new DetectedBreak instance using the specified properties. + * @param [properties] Properties to set + * @returns DetectedBreak instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.Page.Token.IDetectedBreak): google.cloud.documentai.v1.Document.Page.Token.DetectedBreak; + + /** + * Encodes the specified DetectedBreak message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.verify|verify} messages. + * @param message DetectedBreak message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.Page.Token.IDetectedBreak, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DetectedBreak message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.verify|verify} messages. + * @param message DetectedBreak message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.Page.Token.IDetectedBreak, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DetectedBreak message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DetectedBreak + * @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.cloud.documentai.v1.Document.Page.Token.DetectedBreak; + + /** + * Decodes a DetectedBreak message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DetectedBreak + * @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.cloud.documentai.v1.Document.Page.Token.DetectedBreak; + + /** + * Verifies a DetectedBreak 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 DetectedBreak message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DetectedBreak + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Page.Token.DetectedBreak; + + /** + * Creates a plain object from a DetectedBreak message. Also converts values to other types if specified. + * @param message DetectedBreak + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.Page.Token.DetectedBreak, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DetectedBreak to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DetectedBreak + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DetectedBreak { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + SPACE = 1, + WIDE_SPACE = 2, + HYPHEN = 3 + } + } + + /** Properties of a StyleInfo. */ + interface IStyleInfo { + + /** StyleInfo fontSize */ + fontSize?: (number|null); + + /** StyleInfo pixelFontSize */ + pixelFontSize?: (number|null); + + /** StyleInfo letterSpacing */ + letterSpacing?: (number|null); + + /** StyleInfo fontType */ + fontType?: (string|null); + + /** StyleInfo bold */ + bold?: (boolean|null); + + /** StyleInfo italic */ + italic?: (boolean|null); + + /** StyleInfo underlined */ + underlined?: (boolean|null); + + /** StyleInfo strikeout */ + strikeout?: (boolean|null); + + /** StyleInfo subscript */ + subscript?: (boolean|null); + + /** StyleInfo superscript */ + superscript?: (boolean|null); + + /** StyleInfo smallcaps */ + smallcaps?: (boolean|null); + + /** StyleInfo fontWeight */ + fontWeight?: (number|null); + + /** StyleInfo handwritten */ + handwritten?: (boolean|null); + + /** StyleInfo textColor */ + textColor?: (google.type.IColor|null); + + /** StyleInfo backgroundColor */ + backgroundColor?: (google.type.IColor|null); + } + + /** Represents a StyleInfo. */ + class StyleInfo implements IStyleInfo { + + /** + * Constructs a new StyleInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.Page.Token.IStyleInfo); + + /** StyleInfo fontSize. */ + public fontSize: number; + + /** StyleInfo pixelFontSize. */ + public pixelFontSize: number; + + /** StyleInfo letterSpacing. */ + public letterSpacing: number; + + /** StyleInfo fontType. */ + public fontType: string; + + /** StyleInfo bold. */ + public bold: boolean; + + /** StyleInfo italic. */ + public italic: boolean; + + /** StyleInfo underlined. */ + public underlined: boolean; + + /** StyleInfo strikeout. */ + public strikeout: boolean; + + /** StyleInfo subscript. */ + public subscript: boolean; + + /** StyleInfo superscript. */ + public superscript: boolean; + + /** StyleInfo smallcaps. */ + public smallcaps: boolean; + + /** StyleInfo fontWeight. */ + public fontWeight: number; + + /** StyleInfo handwritten. */ + public handwritten: boolean; + + /** StyleInfo textColor. */ + public textColor?: (google.type.IColor|null); + + /** StyleInfo backgroundColor. */ + public backgroundColor?: (google.type.IColor|null); + + /** + * Creates a new StyleInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StyleInfo instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.Page.Token.IStyleInfo): google.cloud.documentai.v1.Document.Page.Token.StyleInfo; + + /** + * Encodes the specified StyleInfo message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Token.StyleInfo.verify|verify} messages. + * @param message StyleInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.Page.Token.IStyleInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StyleInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Token.StyleInfo.verify|verify} messages. + * @param message StyleInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.Page.Token.IStyleInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StyleInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StyleInfo + * @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.cloud.documentai.v1.Document.Page.Token.StyleInfo; + + /** + * Decodes a StyleInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StyleInfo + * @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.cloud.documentai.v1.Document.Page.Token.StyleInfo; + + /** + * Verifies a StyleInfo 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 StyleInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StyleInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Page.Token.StyleInfo; + + /** + * Creates a plain object from a StyleInfo message. Also converts values to other types if specified. + * @param message StyleInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.Page.Token.StyleInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StyleInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StyleInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Symbol. */ + interface ISymbol { + + /** Symbol layout */ + layout?: (google.cloud.documentai.v1.Document.Page.ILayout|null); + + /** Symbol detectedLanguages */ + detectedLanguages?: (google.cloud.documentai.v1.Document.Page.IDetectedLanguage[]|null); + } + + /** Represents a Symbol. */ + class Symbol implements ISymbol { + + /** + * Constructs a new Symbol. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.Page.ISymbol); + + /** Symbol layout. */ + public layout?: (google.cloud.documentai.v1.Document.Page.ILayout|null); + + /** Symbol detectedLanguages. */ + public detectedLanguages: google.cloud.documentai.v1.Document.Page.IDetectedLanguage[]; + + /** + * Creates a new Symbol instance using the specified properties. + * @param [properties] Properties to set + * @returns Symbol instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.Page.ISymbol): google.cloud.documentai.v1.Document.Page.Symbol; + + /** + * Encodes the specified Symbol message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Symbol.verify|verify} messages. + * @param message Symbol message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.Page.ISymbol, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Symbol message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Symbol.verify|verify} messages. + * @param message Symbol message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.Page.ISymbol, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Symbol message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Symbol + * @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.cloud.documentai.v1.Document.Page.Symbol; + + /** + * Decodes a Symbol message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Symbol + * @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.cloud.documentai.v1.Document.Page.Symbol; + + /** + * Verifies a Symbol 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 Symbol message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Symbol + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Page.Symbol; + + /** + * Creates a plain object from a Symbol message. Also converts values to other types if specified. + * @param message Symbol + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.Page.Symbol, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Symbol to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Symbol + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VisualElement. */ + interface IVisualElement { + + /** VisualElement layout */ + layout?: (google.cloud.documentai.v1.Document.Page.ILayout|null); + + /** VisualElement type */ + type?: (string|null); + + /** VisualElement detectedLanguages */ + detectedLanguages?: (google.cloud.documentai.v1.Document.Page.IDetectedLanguage[]|null); + } + + /** Represents a VisualElement. */ + class VisualElement implements IVisualElement { + + /** + * Constructs a new VisualElement. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.Page.IVisualElement); + + /** VisualElement layout. */ + public layout?: (google.cloud.documentai.v1.Document.Page.ILayout|null); + + /** VisualElement type. */ + public type: string; + + /** VisualElement detectedLanguages. */ + public detectedLanguages: google.cloud.documentai.v1.Document.Page.IDetectedLanguage[]; + + /** + * Creates a new VisualElement instance using the specified properties. + * @param [properties] Properties to set + * @returns VisualElement instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.Page.IVisualElement): google.cloud.documentai.v1.Document.Page.VisualElement; + + /** + * Encodes the specified VisualElement message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.VisualElement.verify|verify} messages. + * @param message VisualElement message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.Page.IVisualElement, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VisualElement message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.VisualElement.verify|verify} messages. + * @param message VisualElement message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.Page.IVisualElement, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VisualElement message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VisualElement + * @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.cloud.documentai.v1.Document.Page.VisualElement; + + /** + * Decodes a VisualElement message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VisualElement + * @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.cloud.documentai.v1.Document.Page.VisualElement; + + /** + * Verifies a VisualElement 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 VisualElement message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VisualElement + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Page.VisualElement; + + /** + * Creates a plain object from a VisualElement message. Also converts values to other types if specified. + * @param message VisualElement + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.Page.VisualElement, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VisualElement to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VisualElement + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Table. */ + interface ITable { + + /** Table layout */ + layout?: (google.cloud.documentai.v1.Document.Page.ILayout|null); + + /** Table headerRows */ + headerRows?: (google.cloud.documentai.v1.Document.Page.Table.ITableRow[]|null); + + /** Table bodyRows */ + bodyRows?: (google.cloud.documentai.v1.Document.Page.Table.ITableRow[]|null); + + /** Table detectedLanguages */ + detectedLanguages?: (google.cloud.documentai.v1.Document.Page.IDetectedLanguage[]|null); + + /** Table provenance */ + provenance?: (google.cloud.documentai.v1.Document.IProvenance|null); + } + + /** Represents a Table. */ + class Table implements ITable { + + /** + * Constructs a new Table. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.Page.ITable); + + /** Table layout. */ + public layout?: (google.cloud.documentai.v1.Document.Page.ILayout|null); + + /** Table headerRows. */ + public headerRows: google.cloud.documentai.v1.Document.Page.Table.ITableRow[]; + + /** Table bodyRows. */ + public bodyRows: google.cloud.documentai.v1.Document.Page.Table.ITableRow[]; + + /** Table detectedLanguages. */ + public detectedLanguages: google.cloud.documentai.v1.Document.Page.IDetectedLanguage[]; + + /** Table provenance. */ + public provenance?: (google.cloud.documentai.v1.Document.IProvenance|null); + + /** + * Creates a new Table instance using the specified properties. + * @param [properties] Properties to set + * @returns Table instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.Page.ITable): google.cloud.documentai.v1.Document.Page.Table; + + /** + * Encodes the specified Table message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.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.cloud.documentai.v1.Document.Page.ITable, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Table message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.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.cloud.documentai.v1.Document.Page.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.cloud.documentai.v1.Document.Page.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.cloud.documentai.v1.Document.Page.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.cloud.documentai.v1.Document.Page.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.cloud.documentai.v1.Document.Page.Table, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Table to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Table + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Table { + + /** Properties of a TableRow. */ + interface ITableRow { + + /** TableRow cells */ + cells?: (google.cloud.documentai.v1.Document.Page.Table.ITableCell[]|null); + } + + /** Represents a TableRow. */ + class TableRow implements ITableRow { + + /** + * Constructs a new TableRow. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.Page.Table.ITableRow); + + /** TableRow cells. */ + public cells: google.cloud.documentai.v1.Document.Page.Table.ITableCell[]; + + /** + * Creates a new TableRow instance using the specified properties. + * @param [properties] Properties to set + * @returns TableRow instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.Page.Table.ITableRow): google.cloud.documentai.v1.Document.Page.Table.TableRow; + + /** + * Encodes the specified TableRow message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Table.TableRow.verify|verify} messages. + * @param message TableRow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.Page.Table.ITableRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TableRow message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Table.TableRow.verify|verify} messages. + * @param message TableRow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.Page.Table.ITableRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TableRow message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TableRow + * @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.cloud.documentai.v1.Document.Page.Table.TableRow; + + /** + * Decodes a TableRow message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TableRow + * @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.cloud.documentai.v1.Document.Page.Table.TableRow; + + /** + * Verifies a TableRow 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 TableRow message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TableRow + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Page.Table.TableRow; + + /** + * Creates a plain object from a TableRow message. Also converts values to other types if specified. + * @param message TableRow + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.Page.Table.TableRow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TableRow to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TableRow + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TableCell. */ + interface ITableCell { + + /** TableCell layout */ + layout?: (google.cloud.documentai.v1.Document.Page.ILayout|null); + + /** TableCell rowSpan */ + rowSpan?: (number|null); + + /** TableCell colSpan */ + colSpan?: (number|null); + + /** TableCell detectedLanguages */ + detectedLanguages?: (google.cloud.documentai.v1.Document.Page.IDetectedLanguage[]|null); + } + + /** Represents a TableCell. */ + class TableCell implements ITableCell { + + /** + * Constructs a new TableCell. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.Page.Table.ITableCell); + + /** TableCell layout. */ + public layout?: (google.cloud.documentai.v1.Document.Page.ILayout|null); + + /** TableCell rowSpan. */ + public rowSpan: number; + + /** TableCell colSpan. */ + public colSpan: number; + + /** TableCell detectedLanguages. */ + public detectedLanguages: google.cloud.documentai.v1.Document.Page.IDetectedLanguage[]; + + /** + * Creates a new TableCell instance using the specified properties. + * @param [properties] Properties to set + * @returns TableCell instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.Page.Table.ITableCell): google.cloud.documentai.v1.Document.Page.Table.TableCell; + + /** + * Encodes the specified TableCell message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Table.TableCell.verify|verify} messages. + * @param message TableCell message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.Page.Table.ITableCell, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TableCell message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Table.TableCell.verify|verify} messages. + * @param message TableCell message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.Page.Table.ITableCell, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TableCell message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TableCell + * @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.cloud.documentai.v1.Document.Page.Table.TableCell; + + /** + * Decodes a TableCell message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TableCell + * @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.cloud.documentai.v1.Document.Page.Table.TableCell; + + /** + * Verifies a TableCell 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 TableCell message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TableCell + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Page.Table.TableCell; + + /** + * Creates a plain object from a TableCell message. Also converts values to other types if specified. + * @param message TableCell + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.Page.Table.TableCell, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TableCell to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TableCell + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a FormField. */ + interface IFormField { + + /** FormField fieldName */ + fieldName?: (google.cloud.documentai.v1.Document.Page.ILayout|null); + + /** FormField fieldValue */ + fieldValue?: (google.cloud.documentai.v1.Document.Page.ILayout|null); + + /** FormField nameDetectedLanguages */ + nameDetectedLanguages?: (google.cloud.documentai.v1.Document.Page.IDetectedLanguage[]|null); + + /** FormField valueDetectedLanguages */ + valueDetectedLanguages?: (google.cloud.documentai.v1.Document.Page.IDetectedLanguage[]|null); + + /** FormField valueType */ + valueType?: (string|null); + + /** FormField correctedKeyText */ + correctedKeyText?: (string|null); + + /** FormField correctedValueText */ + correctedValueText?: (string|null); + + /** FormField provenance */ + provenance?: (google.cloud.documentai.v1.Document.IProvenance|null); + } + + /** Represents a FormField. */ + class FormField implements IFormField { + + /** + * Constructs a new FormField. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.Page.IFormField); + + /** FormField fieldName. */ + public fieldName?: (google.cloud.documentai.v1.Document.Page.ILayout|null); + + /** FormField fieldValue. */ + public fieldValue?: (google.cloud.documentai.v1.Document.Page.ILayout|null); + + /** FormField nameDetectedLanguages. */ + public nameDetectedLanguages: google.cloud.documentai.v1.Document.Page.IDetectedLanguage[]; + + /** FormField valueDetectedLanguages. */ + public valueDetectedLanguages: google.cloud.documentai.v1.Document.Page.IDetectedLanguage[]; + + /** FormField valueType. */ + public valueType: string; + + /** FormField correctedKeyText. */ + public correctedKeyText: string; + + /** FormField correctedValueText. */ + public correctedValueText: string; + + /** FormField provenance. */ + public provenance?: (google.cloud.documentai.v1.Document.IProvenance|null); + + /** + * Creates a new FormField instance using the specified properties. + * @param [properties] Properties to set + * @returns FormField instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.Page.IFormField): google.cloud.documentai.v1.Document.Page.FormField; + + /** + * Encodes the specified FormField message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.FormField.verify|verify} messages. + * @param message FormField message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.Page.IFormField, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FormField message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.FormField.verify|verify} messages. + * @param message FormField message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.Page.IFormField, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FormField message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FormField + * @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.cloud.documentai.v1.Document.Page.FormField; + + /** + * Decodes a FormField message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FormField + * @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.cloud.documentai.v1.Document.Page.FormField; + + /** + * Verifies a FormField 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 FormField message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FormField + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Page.FormField; + + /** + * Creates a plain object from a FormField message. Also converts values to other types if specified. + * @param message FormField + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.Page.FormField, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FormField to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FormField + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DetectedBarcode. */ + interface IDetectedBarcode { + + /** DetectedBarcode layout */ + layout?: (google.cloud.documentai.v1.Document.Page.ILayout|null); + + /** DetectedBarcode barcode */ + barcode?: (google.cloud.documentai.v1.IBarcode|null); + } + + /** Represents a DetectedBarcode. */ + class DetectedBarcode implements IDetectedBarcode { + + /** + * Constructs a new DetectedBarcode. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.Page.IDetectedBarcode); + + /** DetectedBarcode layout. */ + public layout?: (google.cloud.documentai.v1.Document.Page.ILayout|null); + + /** DetectedBarcode barcode. */ + public barcode?: (google.cloud.documentai.v1.IBarcode|null); + + /** + * Creates a new DetectedBarcode instance using the specified properties. + * @param [properties] Properties to set + * @returns DetectedBarcode instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.Page.IDetectedBarcode): google.cloud.documentai.v1.Document.Page.DetectedBarcode; + + /** + * Encodes the specified DetectedBarcode message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.DetectedBarcode.verify|verify} messages. + * @param message DetectedBarcode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.Page.IDetectedBarcode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DetectedBarcode message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.DetectedBarcode.verify|verify} messages. + * @param message DetectedBarcode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.Page.IDetectedBarcode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DetectedBarcode message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DetectedBarcode + * @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.cloud.documentai.v1.Document.Page.DetectedBarcode; + + /** + * Decodes a DetectedBarcode message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DetectedBarcode + * @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.cloud.documentai.v1.Document.Page.DetectedBarcode; + + /** + * Verifies a DetectedBarcode 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 DetectedBarcode message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DetectedBarcode + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Page.DetectedBarcode; + + /** + * Creates a plain object from a DetectedBarcode message. Also converts values to other types if specified. + * @param message DetectedBarcode + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.Page.DetectedBarcode, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DetectedBarcode to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DetectedBarcode + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DetectedLanguage. */ + interface IDetectedLanguage { + + /** DetectedLanguage languageCode */ + languageCode?: (string|null); + + /** DetectedLanguage confidence */ + confidence?: (number|null); + } + + /** Represents a DetectedLanguage. */ + class DetectedLanguage implements IDetectedLanguage { + + /** + * Constructs a new DetectedLanguage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.Page.IDetectedLanguage); + + /** DetectedLanguage languageCode. */ + public languageCode: string; + + /** DetectedLanguage confidence. */ + public confidence: number; + + /** + * Creates a new DetectedLanguage instance using the specified properties. + * @param [properties] Properties to set + * @returns DetectedLanguage instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.Page.IDetectedLanguage): google.cloud.documentai.v1.Document.Page.DetectedLanguage; + + /** + * Encodes the specified DetectedLanguage message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.DetectedLanguage.verify|verify} messages. + * @param message DetectedLanguage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.Page.IDetectedLanguage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DetectedLanguage message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.DetectedLanguage.verify|verify} messages. + * @param message DetectedLanguage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.Page.IDetectedLanguage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DetectedLanguage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DetectedLanguage + * @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.cloud.documentai.v1.Document.Page.DetectedLanguage; + + /** + * Decodes a DetectedLanguage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DetectedLanguage + * @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.cloud.documentai.v1.Document.Page.DetectedLanguage; + + /** + * Verifies a DetectedLanguage 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 DetectedLanguage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DetectedLanguage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Page.DetectedLanguage; + + /** + * Creates a plain object from a DetectedLanguage message. Also converts values to other types if specified. + * @param message DetectedLanguage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.Page.DetectedLanguage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DetectedLanguage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DetectedLanguage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImageQualityScores. */ + interface IImageQualityScores { + + /** ImageQualityScores qualityScore */ + qualityScore?: (number|null); + + /** ImageQualityScores detectedDefects */ + detectedDefects?: (google.cloud.documentai.v1.Document.Page.ImageQualityScores.IDetectedDefect[]|null); + } + + /** Represents an ImageQualityScores. */ + class ImageQualityScores implements IImageQualityScores { + + /** + * Constructs a new ImageQualityScores. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.Page.IImageQualityScores); + + /** ImageQualityScores qualityScore. */ + public qualityScore: number; + + /** ImageQualityScores detectedDefects. */ + public detectedDefects: google.cloud.documentai.v1.Document.Page.ImageQualityScores.IDetectedDefect[]; + + /** + * Creates a new ImageQualityScores instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageQualityScores instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.Page.IImageQualityScores): google.cloud.documentai.v1.Document.Page.ImageQualityScores; + + /** + * Encodes the specified ImageQualityScores message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.ImageQualityScores.verify|verify} messages. + * @param message ImageQualityScores message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.Page.IImageQualityScores, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageQualityScores message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.ImageQualityScores.verify|verify} messages. + * @param message ImageQualityScores message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.Page.IImageQualityScores, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageQualityScores message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageQualityScores + * @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.cloud.documentai.v1.Document.Page.ImageQualityScores; + + /** + * Decodes an ImageQualityScores message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageQualityScores + * @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.cloud.documentai.v1.Document.Page.ImageQualityScores; + + /** + * Verifies an ImageQualityScores 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 ImageQualityScores message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageQualityScores + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Page.ImageQualityScores; + + /** + * Creates a plain object from an ImageQualityScores message. Also converts values to other types if specified. + * @param message ImageQualityScores + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.Page.ImageQualityScores, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageQualityScores to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImageQualityScores + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ImageQualityScores { + + /** Properties of a DetectedDefect. */ + interface IDetectedDefect { + + /** DetectedDefect type */ + type?: (string|null); + + /** DetectedDefect confidence */ + confidence?: (number|null); + } + + /** Represents a DetectedDefect. */ + class DetectedDefect implements IDetectedDefect { + + /** + * Constructs a new DetectedDefect. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.Page.ImageQualityScores.IDetectedDefect); + + /** DetectedDefect type. */ + public type: string; + + /** DetectedDefect confidence. */ + public confidence: number; + + /** + * Creates a new DetectedDefect instance using the specified properties. + * @param [properties] Properties to set + * @returns DetectedDefect instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.Page.ImageQualityScores.IDetectedDefect): google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect; + + /** + * Encodes the specified DetectedDefect message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect.verify|verify} messages. + * @param message DetectedDefect message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.Page.ImageQualityScores.IDetectedDefect, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DetectedDefect message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect.verify|verify} messages. + * @param message DetectedDefect message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.Page.ImageQualityScores.IDetectedDefect, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DetectedDefect message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DetectedDefect + * @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.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect; + + /** + * Decodes a DetectedDefect message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DetectedDefect + * @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.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect; + + /** + * Verifies a DetectedDefect 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 DetectedDefect message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DetectedDefect + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect; + + /** + * Creates a plain object from a DetectedDefect message. Also converts values to other types if specified. + * @param message DetectedDefect + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DetectedDefect to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DetectedDefect + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of an Entity. */ + interface IEntity { + + /** Entity textAnchor */ + textAnchor?: (google.cloud.documentai.v1.Document.ITextAnchor|null); + + /** Entity type */ + type?: (string|null); + + /** Entity mentionText */ + mentionText?: (string|null); + + /** Entity mentionId */ + mentionId?: (string|null); + + /** Entity confidence */ + confidence?: (number|null); + + /** Entity pageAnchor */ + pageAnchor?: (google.cloud.documentai.v1.Document.IPageAnchor|null); + + /** Entity id */ + id?: (string|null); + + /** Entity normalizedValue */ + normalizedValue?: (google.cloud.documentai.v1.Document.Entity.INormalizedValue|null); + + /** Entity properties */ + properties?: (google.cloud.documentai.v1.Document.IEntity[]|null); + + /** Entity provenance */ + provenance?: (google.cloud.documentai.v1.Document.IProvenance|null); + + /** Entity redacted */ + redacted?: (boolean|null); + + /** Entity method */ + method?: (google.cloud.documentai.v1.Document.Entity.Method|keyof typeof google.cloud.documentai.v1.Document.Entity.Method|null); + } + + /** Represents an Entity. */ + class Entity implements IEntity { + + /** + * Constructs a new Entity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.IEntity); + + /** Entity textAnchor. */ + public textAnchor?: (google.cloud.documentai.v1.Document.ITextAnchor|null); + + /** Entity type. */ + public type: string; + + /** Entity mentionText. */ + public mentionText: string; + + /** Entity mentionId. */ + public mentionId: string; + + /** Entity confidence. */ + public confidence: number; + + /** Entity pageAnchor. */ + public pageAnchor?: (google.cloud.documentai.v1.Document.IPageAnchor|null); + + /** Entity id. */ + public id: string; + + /** Entity normalizedValue. */ + public normalizedValue?: (google.cloud.documentai.v1.Document.Entity.INormalizedValue|null); + + /** Entity properties. */ + public properties: google.cloud.documentai.v1.Document.IEntity[]; + + /** Entity provenance. */ + public provenance?: (google.cloud.documentai.v1.Document.IProvenance|null); + + /** Entity redacted. */ + public redacted: boolean; + + /** Entity method. */ + public method: (google.cloud.documentai.v1.Document.Entity.Method|keyof typeof google.cloud.documentai.v1.Document.Entity.Method); + + /** + * Creates a new Entity instance using the specified properties. + * @param [properties] Properties to set + * @returns Entity instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.IEntity): google.cloud.documentai.v1.Document.Entity; + + /** + * Encodes the specified Entity message. Does not implicitly {@link google.cloud.documentai.v1.Document.Entity.verify|verify} messages. + * @param message Entity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.IEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Entity message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Entity.verify|verify} messages. + * @param message Entity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.IEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Entity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Entity + * @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.cloud.documentai.v1.Document.Entity; + + /** + * Decodes an Entity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Entity + * @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.cloud.documentai.v1.Document.Entity; + + /** + * Verifies an Entity 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 Entity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Entity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Entity; + + /** + * Creates a plain object from an Entity message. Also converts values to other types if specified. + * @param message Entity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.Entity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Entity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Entity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Entity { + + /** Properties of a NormalizedValue. */ + interface INormalizedValue { + + /** NormalizedValue moneyValue */ + moneyValue?: (google.type.IMoney|null); + + /** NormalizedValue dateValue */ + dateValue?: (google.type.IDate|null); + + /** NormalizedValue datetimeValue */ + datetimeValue?: (google.type.IDateTime|null); + + /** NormalizedValue addressValue */ + addressValue?: (google.type.IPostalAddress|null); + + /** NormalizedValue booleanValue */ + booleanValue?: (boolean|null); + + /** NormalizedValue integerValue */ + integerValue?: (number|null); + + /** NormalizedValue floatValue */ + floatValue?: (number|null); + + /** NormalizedValue signatureValue */ + signatureValue?: (boolean|null); + + /** NormalizedValue text */ + text?: (string|null); + } + + /** Represents a NormalizedValue. */ + class NormalizedValue implements INormalizedValue { + + /** + * Constructs a new NormalizedValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.Entity.INormalizedValue); + + /** NormalizedValue moneyValue. */ + public moneyValue?: (google.type.IMoney|null); + + /** NormalizedValue dateValue. */ + public dateValue?: (google.type.IDate|null); + + /** NormalizedValue datetimeValue. */ + public datetimeValue?: (google.type.IDateTime|null); + + /** NormalizedValue addressValue. */ + public addressValue?: (google.type.IPostalAddress|null); + + /** NormalizedValue booleanValue. */ + public booleanValue?: (boolean|null); + + /** NormalizedValue integerValue. */ + public integerValue?: (number|null); + + /** NormalizedValue floatValue. */ + public floatValue?: (number|null); + + /** NormalizedValue signatureValue. */ + public signatureValue?: (boolean|null); + + /** NormalizedValue text. */ + public text: string; + + /** NormalizedValue structuredValue. */ + public structuredValue?: ("moneyValue"|"dateValue"|"datetimeValue"|"addressValue"|"booleanValue"|"integerValue"|"floatValue"|"signatureValue"); + + /** + * Creates a new NormalizedValue instance using the specified properties. + * @param [properties] Properties to set + * @returns NormalizedValue instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.Entity.INormalizedValue): google.cloud.documentai.v1.Document.Entity.NormalizedValue; + + /** + * Encodes the specified NormalizedValue message. Does not implicitly {@link google.cloud.documentai.v1.Document.Entity.NormalizedValue.verify|verify} messages. + * @param message NormalizedValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.Entity.INormalizedValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NormalizedValue message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Entity.NormalizedValue.verify|verify} messages. + * @param message NormalizedValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.Entity.INormalizedValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NormalizedValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NormalizedValue + * @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.cloud.documentai.v1.Document.Entity.NormalizedValue; + + /** + * Decodes a NormalizedValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NormalizedValue + * @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.cloud.documentai.v1.Document.Entity.NormalizedValue; + + /** + * Verifies a NormalizedValue 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 NormalizedValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NormalizedValue + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Entity.NormalizedValue; + + /** + * Creates a plain object from a NormalizedValue message. Also converts values to other types if specified. + * @param message NormalizedValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.Entity.NormalizedValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NormalizedValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NormalizedValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Method enum. */ + enum Method { + METHOD_UNSPECIFIED = 0, + EXTRACT = 1, + DERIVE = 2 + } + } + + /** Properties of an EntityRelation. */ + interface IEntityRelation { + + /** EntityRelation subjectId */ + subjectId?: (string|null); + + /** EntityRelation objectId */ + objectId?: (string|null); + + /** EntityRelation relation */ + relation?: (string|null); + } + + /** Represents an EntityRelation. */ + class EntityRelation implements IEntityRelation { + + /** + * Constructs a new EntityRelation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.IEntityRelation); + + /** EntityRelation subjectId. */ + public subjectId: string; + + /** EntityRelation objectId. */ + public objectId: string; + + /** EntityRelation relation. */ + public relation: string; + + /** + * Creates a new EntityRelation instance using the specified properties. + * @param [properties] Properties to set + * @returns EntityRelation instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.IEntityRelation): google.cloud.documentai.v1.Document.EntityRelation; + + /** + * Encodes the specified EntityRelation message. Does not implicitly {@link google.cloud.documentai.v1.Document.EntityRelation.verify|verify} messages. + * @param message EntityRelation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.IEntityRelation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EntityRelation message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.EntityRelation.verify|verify} messages. + * @param message EntityRelation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.IEntityRelation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EntityRelation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EntityRelation + * @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.cloud.documentai.v1.Document.EntityRelation; + + /** + * Decodes an EntityRelation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EntityRelation + * @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.cloud.documentai.v1.Document.EntityRelation; + + /** + * Verifies an EntityRelation 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 EntityRelation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EntityRelation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.EntityRelation; + + /** + * Creates a plain object from an EntityRelation message. Also converts values to other types if specified. + * @param message EntityRelation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.EntityRelation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EntityRelation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EntityRelation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextAnchor. */ + interface ITextAnchor { + + /** TextAnchor textSegments */ + textSegments?: (google.cloud.documentai.v1.Document.TextAnchor.ITextSegment[]|null); + + /** TextAnchor content */ + content?: (string|null); + } + + /** Represents a TextAnchor. */ + class TextAnchor implements ITextAnchor { + + /** + * Constructs a new TextAnchor. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.ITextAnchor); + + /** TextAnchor textSegments. */ + public textSegments: google.cloud.documentai.v1.Document.TextAnchor.ITextSegment[]; + + /** TextAnchor content. */ + public content: string; + + /** + * Creates a new TextAnchor instance using the specified properties. + * @param [properties] Properties to set + * @returns TextAnchor instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.ITextAnchor): google.cloud.documentai.v1.Document.TextAnchor; + + /** + * Encodes the specified TextAnchor message. Does not implicitly {@link google.cloud.documentai.v1.Document.TextAnchor.verify|verify} messages. + * @param message TextAnchor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.ITextAnchor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextAnchor message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.TextAnchor.verify|verify} messages. + * @param message TextAnchor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.ITextAnchor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextAnchor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextAnchor + * @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.cloud.documentai.v1.Document.TextAnchor; + + /** + * Decodes a TextAnchor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextAnchor + * @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.cloud.documentai.v1.Document.TextAnchor; + + /** + * Verifies a TextAnchor 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 TextAnchor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextAnchor + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.TextAnchor; + + /** + * Creates a plain object from a TextAnchor message. Also converts values to other types if specified. + * @param message TextAnchor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.TextAnchor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextAnchor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextAnchor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TextAnchor { + + /** Properties of a TextSegment. */ + interface ITextSegment { + + /** TextSegment startIndex */ + startIndex?: (number|Long|string|null); + + /** TextSegment endIndex */ + endIndex?: (number|Long|string|null); + } + + /** Represents a TextSegment. */ + class TextSegment implements ITextSegment { + + /** + * Constructs a new TextSegment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.TextAnchor.ITextSegment); + + /** TextSegment startIndex. */ + public startIndex: (number|Long|string); + + /** TextSegment endIndex. */ + public endIndex: (number|Long|string); + + /** + * Creates a new TextSegment instance using the specified properties. + * @param [properties] Properties to set + * @returns TextSegment instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.TextAnchor.ITextSegment): google.cloud.documentai.v1.Document.TextAnchor.TextSegment; + + /** + * Encodes the specified TextSegment message. Does not implicitly {@link google.cloud.documentai.v1.Document.TextAnchor.TextSegment.verify|verify} messages. + * @param message TextSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.TextAnchor.ITextSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextSegment message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.TextAnchor.TextSegment.verify|verify} messages. + * @param message TextSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.TextAnchor.ITextSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextSegment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextSegment + * @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.cloud.documentai.v1.Document.TextAnchor.TextSegment; + + /** + * Decodes a TextSegment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextSegment + * @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.cloud.documentai.v1.Document.TextAnchor.TextSegment; + + /** + * Verifies a TextSegment 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 TextSegment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextSegment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.TextAnchor.TextSegment; + + /** + * Creates a plain object from a TextSegment message. Also converts values to other types if specified. + * @param message TextSegment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.TextAnchor.TextSegment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextSegment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextSegment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a PageAnchor. */ + interface IPageAnchor { + + /** PageAnchor pageRefs */ + pageRefs?: (google.cloud.documentai.v1.Document.PageAnchor.IPageRef[]|null); + } + + /** Represents a PageAnchor. */ + class PageAnchor implements IPageAnchor { + + /** + * Constructs a new PageAnchor. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.IPageAnchor); + + /** PageAnchor pageRefs. */ + public pageRefs: google.cloud.documentai.v1.Document.PageAnchor.IPageRef[]; + + /** + * Creates a new PageAnchor instance using the specified properties. + * @param [properties] Properties to set + * @returns PageAnchor instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.IPageAnchor): google.cloud.documentai.v1.Document.PageAnchor; + + /** + * Encodes the specified PageAnchor message. Does not implicitly {@link google.cloud.documentai.v1.Document.PageAnchor.verify|verify} messages. + * @param message PageAnchor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.IPageAnchor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PageAnchor message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.PageAnchor.verify|verify} messages. + * @param message PageAnchor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.IPageAnchor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PageAnchor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PageAnchor + * @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.cloud.documentai.v1.Document.PageAnchor; + + /** + * Decodes a PageAnchor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PageAnchor + * @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.cloud.documentai.v1.Document.PageAnchor; + + /** + * Verifies a PageAnchor 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 PageAnchor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PageAnchor + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.PageAnchor; + + /** + * Creates a plain object from a PageAnchor message. Also converts values to other types if specified. + * @param message PageAnchor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.PageAnchor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PageAnchor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PageAnchor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PageAnchor { + + /** Properties of a PageRef. */ + interface IPageRef { + + /** PageRef page */ + page?: (number|Long|string|null); + + /** PageRef layoutType */ + layoutType?: (google.cloud.documentai.v1.Document.PageAnchor.PageRef.LayoutType|keyof typeof google.cloud.documentai.v1.Document.PageAnchor.PageRef.LayoutType|null); + + /** PageRef layoutId */ + layoutId?: (string|null); + + /** PageRef boundingPoly */ + boundingPoly?: (google.cloud.documentai.v1.IBoundingPoly|null); + + /** PageRef confidence */ + confidence?: (number|null); + } + + /** Represents a PageRef. */ + class PageRef implements IPageRef { + + /** + * Constructs a new PageRef. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.PageAnchor.IPageRef); + + /** PageRef page. */ + public page: (number|Long|string); + + /** PageRef layoutType. */ + public layoutType: (google.cloud.documentai.v1.Document.PageAnchor.PageRef.LayoutType|keyof typeof google.cloud.documentai.v1.Document.PageAnchor.PageRef.LayoutType); + + /** PageRef layoutId. */ + public layoutId: string; + + /** PageRef boundingPoly. */ + public boundingPoly?: (google.cloud.documentai.v1.IBoundingPoly|null); + + /** PageRef confidence. */ + public confidence: number; + + /** + * Creates a new PageRef instance using the specified properties. + * @param [properties] Properties to set + * @returns PageRef instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.PageAnchor.IPageRef): google.cloud.documentai.v1.Document.PageAnchor.PageRef; + + /** + * Encodes the specified PageRef message. Does not implicitly {@link google.cloud.documentai.v1.Document.PageAnchor.PageRef.verify|verify} messages. + * @param message PageRef message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.PageAnchor.IPageRef, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PageRef message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.PageAnchor.PageRef.verify|verify} messages. + * @param message PageRef message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.PageAnchor.IPageRef, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PageRef message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PageRef + * @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.cloud.documentai.v1.Document.PageAnchor.PageRef; + + /** + * Decodes a PageRef message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PageRef + * @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.cloud.documentai.v1.Document.PageAnchor.PageRef; + + /** + * Verifies a PageRef 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 PageRef message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PageRef + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.PageAnchor.PageRef; + + /** + * Creates a plain object from a PageRef message. Also converts values to other types if specified. + * @param message PageRef + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.PageAnchor.PageRef, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PageRef to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PageRef + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PageRef { + + /** LayoutType enum. */ + enum LayoutType { + LAYOUT_TYPE_UNSPECIFIED = 0, + BLOCK = 1, + PARAGRAPH = 2, + LINE = 3, + TOKEN = 4, + VISUAL_ELEMENT = 5, + TABLE = 6, + FORM_FIELD = 7 + } + } + } + + /** Properties of a Provenance. */ + interface IProvenance { + + /** Provenance revision */ + revision?: (number|null); + + /** Provenance id */ + id?: (number|null); + + /** Provenance parents */ + parents?: (google.cloud.documentai.v1.Document.Provenance.IParent[]|null); + + /** Provenance type */ + type?: (google.cloud.documentai.v1.Document.Provenance.OperationType|keyof typeof google.cloud.documentai.v1.Document.Provenance.OperationType|null); + } + + /** Represents a Provenance. */ + class Provenance implements IProvenance { + + /** + * Constructs a new Provenance. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.IProvenance); + + /** Provenance revision. */ + public revision: number; + + /** Provenance id. */ + public id: number; + + /** Provenance parents. */ + public parents: google.cloud.documentai.v1.Document.Provenance.IParent[]; + + /** Provenance type. */ + public type: (google.cloud.documentai.v1.Document.Provenance.OperationType|keyof typeof google.cloud.documentai.v1.Document.Provenance.OperationType); + + /** + * Creates a new Provenance instance using the specified properties. + * @param [properties] Properties to set + * @returns Provenance instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.IProvenance): google.cloud.documentai.v1.Document.Provenance; + + /** + * Encodes the specified Provenance message. Does not implicitly {@link google.cloud.documentai.v1.Document.Provenance.verify|verify} messages. + * @param message Provenance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.IProvenance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Provenance message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Provenance.verify|verify} messages. + * @param message Provenance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.IProvenance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Provenance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Provenance + * @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.cloud.documentai.v1.Document.Provenance; + + /** + * Decodes a Provenance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Provenance + * @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.cloud.documentai.v1.Document.Provenance; + + /** + * Verifies a Provenance 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 Provenance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Provenance + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Provenance; + + /** + * Creates a plain object from a Provenance message. Also converts values to other types if specified. + * @param message Provenance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.Provenance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Provenance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Provenance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Provenance { + + /** Properties of a Parent. */ + interface IParent { + + /** Parent revision */ + revision?: (number|null); + + /** Parent index */ + index?: (number|null); + + /** Parent id */ + id?: (number|null); + } + + /** Represents a Parent. */ + class Parent implements IParent { + + /** + * Constructs a new Parent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.Provenance.IParent); + + /** Parent revision. */ + public revision: number; + + /** Parent index. */ + public index: number; + + /** Parent id. */ + public id: number; + + /** + * Creates a new Parent instance using the specified properties. + * @param [properties] Properties to set + * @returns Parent instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.Provenance.IParent): google.cloud.documentai.v1.Document.Provenance.Parent; + + /** + * Encodes the specified Parent message. Does not implicitly {@link google.cloud.documentai.v1.Document.Provenance.Parent.verify|verify} messages. + * @param message Parent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.Provenance.IParent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Parent message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Provenance.Parent.verify|verify} messages. + * @param message Parent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.Provenance.IParent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Parent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Parent + * @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.cloud.documentai.v1.Document.Provenance.Parent; + + /** + * Decodes a Parent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Parent + * @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.cloud.documentai.v1.Document.Provenance.Parent; + + /** + * Verifies a Parent 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 Parent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Parent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Provenance.Parent; + + /** + * Creates a plain object from a Parent message. Also converts values to other types if specified. + * @param message Parent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.Provenance.Parent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Parent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Parent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** OperationType enum. */ + enum OperationType { + OPERATION_TYPE_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2, + UPDATE = 7, + REPLACE = 3, + EVAL_REQUESTED = 4, + EVAL_APPROVED = 5, + EVAL_SKIPPED = 6 + } + } + + /** Properties of a Revision. */ + interface IRevision { + + /** Revision agent */ + agent?: (string|null); + + /** Revision processor */ + processor?: (string|null); + + /** Revision id */ + id?: (string|null); + + /** Revision parent */ + parent?: (number[]|null); + + /** Revision parentIds */ + parentIds?: (string[]|null); + + /** Revision createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Revision humanReview */ + humanReview?: (google.cloud.documentai.v1.Document.Revision.IHumanReview|null); + } + + /** Represents a Revision. */ + class Revision implements IRevision { + + /** + * Constructs a new Revision. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.IRevision); + + /** Revision agent. */ + public agent?: (string|null); + + /** Revision processor. */ + public processor?: (string|null); + + /** Revision id. */ + public id: string; + + /** Revision parent. */ + public parent: number[]; + + /** Revision parentIds. */ + public parentIds: string[]; + + /** Revision createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Revision humanReview. */ + public humanReview?: (google.cloud.documentai.v1.Document.Revision.IHumanReview|null); + + /** Revision source. */ + public source?: ("agent"|"processor"); + + /** + * Creates a new Revision instance using the specified properties. + * @param [properties] Properties to set + * @returns Revision instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.IRevision): google.cloud.documentai.v1.Document.Revision; + + /** + * Encodes the specified Revision message. Does not implicitly {@link google.cloud.documentai.v1.Document.Revision.verify|verify} messages. + * @param message Revision message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.IRevision, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Revision message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Revision.verify|verify} messages. + * @param message Revision message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.IRevision, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Revision message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Revision + * @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.cloud.documentai.v1.Document.Revision; + + /** + * Decodes a Revision message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Revision + * @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.cloud.documentai.v1.Document.Revision; + + /** + * Verifies a Revision 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 Revision message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Revision + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Revision; + + /** + * Creates a plain object from a Revision message. Also converts values to other types if specified. + * @param message Revision + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.Revision, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Revision to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Revision + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Revision { + + /** Properties of a HumanReview. */ + interface IHumanReview { + + /** HumanReview state */ + state?: (string|null); + + /** HumanReview stateMessage */ + stateMessage?: (string|null); + } + + /** Represents a HumanReview. */ + class HumanReview implements IHumanReview { + + /** + * Constructs a new HumanReview. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.Revision.IHumanReview); + + /** HumanReview state. */ + public state: string; + + /** HumanReview stateMessage. */ + public stateMessage: string; + + /** + * Creates a new HumanReview instance using the specified properties. + * @param [properties] Properties to set + * @returns HumanReview instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.Revision.IHumanReview): google.cloud.documentai.v1.Document.Revision.HumanReview; + + /** + * Encodes the specified HumanReview message. Does not implicitly {@link google.cloud.documentai.v1.Document.Revision.HumanReview.verify|verify} messages. + * @param message HumanReview message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.Revision.IHumanReview, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HumanReview message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Revision.HumanReview.verify|verify} messages. + * @param message HumanReview message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.Revision.IHumanReview, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HumanReview message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HumanReview + * @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.cloud.documentai.v1.Document.Revision.HumanReview; + + /** + * Decodes a HumanReview message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HumanReview + * @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.cloud.documentai.v1.Document.Revision.HumanReview; + + /** + * Verifies a HumanReview 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 HumanReview message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HumanReview + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Revision.HumanReview; + + /** + * Creates a plain object from a HumanReview message. Also converts values to other types if specified. + * @param message HumanReview + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.Revision.HumanReview, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HumanReview to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HumanReview + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a TextChange. */ + interface ITextChange { + + /** TextChange textAnchor */ + textAnchor?: (google.cloud.documentai.v1.Document.ITextAnchor|null); + + /** TextChange changedText */ + changedText?: (string|null); + + /** TextChange provenance */ + provenance?: (google.cloud.documentai.v1.Document.IProvenance[]|null); + } + + /** Represents a TextChange. */ + class TextChange implements ITextChange { + + /** + * Constructs a new TextChange. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.ITextChange); + + /** TextChange textAnchor. */ + public textAnchor?: (google.cloud.documentai.v1.Document.ITextAnchor|null); + + /** TextChange changedText. */ + public changedText: string; + + /** TextChange provenance. */ + public provenance: google.cloud.documentai.v1.Document.IProvenance[]; + + /** + * Creates a new TextChange instance using the specified properties. + * @param [properties] Properties to set + * @returns TextChange instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.ITextChange): google.cloud.documentai.v1.Document.TextChange; + + /** + * Encodes the specified TextChange message. Does not implicitly {@link google.cloud.documentai.v1.Document.TextChange.verify|verify} messages. + * @param message TextChange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.ITextChange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextChange message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.TextChange.verify|verify} messages. + * @param message TextChange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.ITextChange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextChange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextChange + * @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.cloud.documentai.v1.Document.TextChange; + + /** + * Decodes a TextChange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextChange + * @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.cloud.documentai.v1.Document.TextChange; + + /** + * Verifies a TextChange 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 TextChange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextChange + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.TextChange; + + /** + * Creates a plain object from a TextChange message. Also converts values to other types if specified. + * @param message TextChange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.TextChange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextChange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextChange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DocumentLayout. */ + interface IDocumentLayout { + + /** DocumentLayout blocks */ + blocks?: (google.cloud.documentai.v1.Document.DocumentLayout.IDocumentLayoutBlock[]|null); + } + + /** Represents a DocumentLayout. */ + class DocumentLayout implements IDocumentLayout { + + /** + * Constructs a new DocumentLayout. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.IDocumentLayout); + + /** DocumentLayout blocks. */ + public blocks: google.cloud.documentai.v1.Document.DocumentLayout.IDocumentLayoutBlock[]; + + /** + * Creates a new DocumentLayout instance using the specified properties. + * @param [properties] Properties to set + * @returns DocumentLayout instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.IDocumentLayout): google.cloud.documentai.v1.Document.DocumentLayout; + + /** + * Encodes the specified DocumentLayout message. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.verify|verify} messages. + * @param message DocumentLayout message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.IDocumentLayout, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DocumentLayout message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.verify|verify} messages. + * @param message DocumentLayout message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.IDocumentLayout, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DocumentLayout message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DocumentLayout + * @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.cloud.documentai.v1.Document.DocumentLayout; + + /** + * Decodes a DocumentLayout message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DocumentLayout + * @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.cloud.documentai.v1.Document.DocumentLayout; + + /** + * Verifies a DocumentLayout 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 DocumentLayout message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DocumentLayout + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.DocumentLayout; + + /** + * Creates a plain object from a DocumentLayout message. Also converts values to other types if specified. + * @param message DocumentLayout + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.DocumentLayout, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DocumentLayout to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DocumentLayout + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DocumentLayout { + + /** Properties of a DocumentLayoutBlock. */ + interface IDocumentLayoutBlock { + + /** DocumentLayoutBlock textBlock */ + textBlock?: (google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTextBlock|null); + + /** DocumentLayoutBlock tableBlock */ + tableBlock?: (google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableBlock|null); + + /** DocumentLayoutBlock listBlock */ + listBlock?: (google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListBlock|null); + + /** DocumentLayoutBlock blockId */ + blockId?: (string|null); + + /** DocumentLayoutBlock pageSpan */ + pageSpan?: (google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutPageSpan|null); + + /** DocumentLayoutBlock boundingBox */ + boundingBox?: (google.cloud.documentai.v1.IBoundingPoly|null); + } + + /** Represents a DocumentLayoutBlock. */ + class DocumentLayoutBlock implements IDocumentLayoutBlock { + + /** + * Constructs a new DocumentLayoutBlock. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.DocumentLayout.IDocumentLayoutBlock); + + /** DocumentLayoutBlock textBlock. */ + public textBlock?: (google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTextBlock|null); + + /** DocumentLayoutBlock tableBlock. */ + public tableBlock?: (google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableBlock|null); + + /** DocumentLayoutBlock listBlock. */ + public listBlock?: (google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListBlock|null); + + /** DocumentLayoutBlock blockId. */ + public blockId: string; + + /** DocumentLayoutBlock pageSpan. */ + public pageSpan?: (google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutPageSpan|null); + + /** DocumentLayoutBlock boundingBox. */ + public boundingBox?: (google.cloud.documentai.v1.IBoundingPoly|null); + + /** DocumentLayoutBlock block. */ + public block?: ("textBlock"|"tableBlock"|"listBlock"); + + /** + * Creates a new DocumentLayoutBlock instance using the specified properties. + * @param [properties] Properties to set + * @returns DocumentLayoutBlock instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.DocumentLayout.IDocumentLayoutBlock): google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock; + + /** + * Encodes the specified DocumentLayoutBlock message. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.verify|verify} messages. + * @param message DocumentLayoutBlock message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.DocumentLayout.IDocumentLayoutBlock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DocumentLayoutBlock message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.verify|verify} messages. + * @param message DocumentLayoutBlock message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.DocumentLayout.IDocumentLayoutBlock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DocumentLayoutBlock message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DocumentLayoutBlock + * @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.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock; + + /** + * Decodes a DocumentLayoutBlock message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DocumentLayoutBlock + * @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.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock; + + /** + * Verifies a DocumentLayoutBlock 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 DocumentLayoutBlock message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DocumentLayoutBlock + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock; + + /** + * Creates a plain object from a DocumentLayoutBlock message. Also converts values to other types if specified. + * @param message DocumentLayoutBlock + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DocumentLayoutBlock to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DocumentLayoutBlock + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DocumentLayoutBlock { + + /** Properties of a LayoutPageSpan. */ + interface ILayoutPageSpan { + + /** LayoutPageSpan pageStart */ + pageStart?: (number|null); + + /** LayoutPageSpan pageEnd */ + pageEnd?: (number|null); + } + + /** Represents a LayoutPageSpan. */ + class LayoutPageSpan implements ILayoutPageSpan { + + /** + * Constructs a new LayoutPageSpan. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutPageSpan); + + /** LayoutPageSpan pageStart. */ + public pageStart: number; + + /** LayoutPageSpan pageEnd. */ + public pageEnd: number; + + /** + * Creates a new LayoutPageSpan instance using the specified properties. + * @param [properties] Properties to set + * @returns LayoutPageSpan instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutPageSpan): google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan; + + /** + * Encodes the specified LayoutPageSpan message. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan.verify|verify} messages. + * @param message LayoutPageSpan message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutPageSpan, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LayoutPageSpan message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan.verify|verify} messages. + * @param message LayoutPageSpan message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutPageSpan, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LayoutPageSpan message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LayoutPageSpan + * @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.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan; + + /** + * Decodes a LayoutPageSpan message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LayoutPageSpan + * @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.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan; + + /** + * Verifies a LayoutPageSpan 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 LayoutPageSpan message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LayoutPageSpan + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan; + + /** + * Creates a plain object from a LayoutPageSpan message. Also converts values to other types if specified. + * @param message LayoutPageSpan + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LayoutPageSpan to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LayoutPageSpan + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LayoutTextBlock. */ + interface ILayoutTextBlock { + + /** LayoutTextBlock text */ + text?: (string|null); + + /** LayoutTextBlock type */ + type?: (string|null); + + /** LayoutTextBlock blocks */ + blocks?: (google.cloud.documentai.v1.Document.DocumentLayout.IDocumentLayoutBlock[]|null); + } + + /** Represents a LayoutTextBlock. */ + class LayoutTextBlock implements ILayoutTextBlock { + + /** + * Constructs a new LayoutTextBlock. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTextBlock); + + /** LayoutTextBlock text. */ + public text: string; + + /** LayoutTextBlock type. */ + public type: string; + + /** LayoutTextBlock blocks. */ + public blocks: google.cloud.documentai.v1.Document.DocumentLayout.IDocumentLayoutBlock[]; + + /** + * Creates a new LayoutTextBlock instance using the specified properties. + * @param [properties] Properties to set + * @returns LayoutTextBlock instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTextBlock): google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock; + + /** + * Encodes the specified LayoutTextBlock message. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock.verify|verify} messages. + * @param message LayoutTextBlock message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTextBlock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LayoutTextBlock message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock.verify|verify} messages. + * @param message LayoutTextBlock message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTextBlock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LayoutTextBlock message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LayoutTextBlock + * @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.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock; + + /** + * Decodes a LayoutTextBlock message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LayoutTextBlock + * @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.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock; + + /** + * Verifies a LayoutTextBlock 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 LayoutTextBlock message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LayoutTextBlock + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock; + + /** + * Creates a plain object from a LayoutTextBlock message. Also converts values to other types if specified. + * @param message LayoutTextBlock + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LayoutTextBlock to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LayoutTextBlock + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LayoutTableBlock. */ + interface ILayoutTableBlock { + + /** LayoutTableBlock headerRows */ + headerRows?: (google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableRow[]|null); + + /** LayoutTableBlock bodyRows */ + bodyRows?: (google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableRow[]|null); + + /** LayoutTableBlock caption */ + caption?: (string|null); + } + + /** Represents a LayoutTableBlock. */ + class LayoutTableBlock implements ILayoutTableBlock { + + /** + * Constructs a new LayoutTableBlock. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableBlock); + + /** LayoutTableBlock headerRows. */ + public headerRows: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableRow[]; + + /** LayoutTableBlock bodyRows. */ + public bodyRows: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableRow[]; + + /** LayoutTableBlock caption. */ + public caption: string; + + /** + * Creates a new LayoutTableBlock instance using the specified properties. + * @param [properties] Properties to set + * @returns LayoutTableBlock instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableBlock): google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock; + + /** + * Encodes the specified LayoutTableBlock message. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock.verify|verify} messages. + * @param message LayoutTableBlock message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableBlock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LayoutTableBlock message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock.verify|verify} messages. + * @param message LayoutTableBlock message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableBlock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LayoutTableBlock message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LayoutTableBlock + * @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.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock; + + /** + * Decodes a LayoutTableBlock message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LayoutTableBlock + * @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.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock; + + /** + * Verifies a LayoutTableBlock 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 LayoutTableBlock message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LayoutTableBlock + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock; + + /** + * Creates a plain object from a LayoutTableBlock message. Also converts values to other types if specified. + * @param message LayoutTableBlock + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LayoutTableBlock to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LayoutTableBlock + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LayoutTableRow. */ + interface ILayoutTableRow { + + /** LayoutTableRow cells */ + cells?: (google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableCell[]|null); + } + + /** Represents a LayoutTableRow. */ + class LayoutTableRow implements ILayoutTableRow { + + /** + * Constructs a new LayoutTableRow. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableRow); + + /** LayoutTableRow cells. */ + public cells: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableCell[]; + + /** + * Creates a new LayoutTableRow instance using the specified properties. + * @param [properties] Properties to set + * @returns LayoutTableRow instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableRow): google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow; + + /** + * Encodes the specified LayoutTableRow message. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow.verify|verify} messages. + * @param message LayoutTableRow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LayoutTableRow message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow.verify|verify} messages. + * @param message LayoutTableRow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LayoutTableRow message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LayoutTableRow + * @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.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow; + + /** + * Decodes a LayoutTableRow message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LayoutTableRow + * @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.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow; + + /** + * Verifies a LayoutTableRow 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 LayoutTableRow message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LayoutTableRow + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow; + + /** + * Creates a plain object from a LayoutTableRow message. Also converts values to other types if specified. + * @param message LayoutTableRow + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LayoutTableRow to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LayoutTableRow + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LayoutTableCell. */ + interface ILayoutTableCell { + + /** LayoutTableCell blocks */ + blocks?: (google.cloud.documentai.v1.Document.DocumentLayout.IDocumentLayoutBlock[]|null); + + /** LayoutTableCell rowSpan */ + rowSpan?: (number|null); + + /** LayoutTableCell colSpan */ + colSpan?: (number|null); + } + + /** Represents a LayoutTableCell. */ + class LayoutTableCell implements ILayoutTableCell { + + /** + * Constructs a new LayoutTableCell. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableCell); + + /** LayoutTableCell blocks. */ + public blocks: google.cloud.documentai.v1.Document.DocumentLayout.IDocumentLayoutBlock[]; + + /** LayoutTableCell rowSpan. */ + public rowSpan: number; + + /** LayoutTableCell colSpan. */ + public colSpan: number; + + /** + * Creates a new LayoutTableCell instance using the specified properties. + * @param [properties] Properties to set + * @returns LayoutTableCell instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableCell): google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell; + + /** + * Encodes the specified LayoutTableCell message. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell.verify|verify} messages. + * @param message LayoutTableCell message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableCell, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LayoutTableCell message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell.verify|verify} messages. + * @param message LayoutTableCell message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableCell, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LayoutTableCell message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LayoutTableCell + * @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.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell; + + /** + * Decodes a LayoutTableCell message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LayoutTableCell + * @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.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell; + + /** + * Verifies a LayoutTableCell 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 LayoutTableCell message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LayoutTableCell + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell; + + /** + * Creates a plain object from a LayoutTableCell message. Also converts values to other types if specified. + * @param message LayoutTableCell + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LayoutTableCell to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LayoutTableCell + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LayoutListBlock. */ + interface ILayoutListBlock { + + /** LayoutListBlock listEntries */ + listEntries?: (google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListEntry[]|null); + + /** LayoutListBlock type */ + type?: (string|null); + } + + /** Represents a LayoutListBlock. */ + class LayoutListBlock implements ILayoutListBlock { + + /** + * Constructs a new LayoutListBlock. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListBlock); + + /** LayoutListBlock listEntries. */ + public listEntries: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListEntry[]; + + /** LayoutListBlock type. */ + public type: string; + + /** + * Creates a new LayoutListBlock instance using the specified properties. + * @param [properties] Properties to set + * @returns LayoutListBlock instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListBlock): google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock; + + /** + * Encodes the specified LayoutListBlock message. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock.verify|verify} messages. + * @param message LayoutListBlock message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListBlock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LayoutListBlock message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock.verify|verify} messages. + * @param message LayoutListBlock message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListBlock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LayoutListBlock message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LayoutListBlock + * @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.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock; + + /** + * Decodes a LayoutListBlock message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LayoutListBlock + * @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.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock; + + /** + * Verifies a LayoutListBlock 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 LayoutListBlock message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LayoutListBlock + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock; + + /** + * Creates a plain object from a LayoutListBlock message. Also converts values to other types if specified. + * @param message LayoutListBlock + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LayoutListBlock to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LayoutListBlock + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LayoutListEntry. */ + interface ILayoutListEntry { + + /** LayoutListEntry blocks */ + blocks?: (google.cloud.documentai.v1.Document.DocumentLayout.IDocumentLayoutBlock[]|null); + } + + /** Represents a LayoutListEntry. */ + class LayoutListEntry implements ILayoutListEntry { + + /** + * Constructs a new LayoutListEntry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListEntry); + + /** LayoutListEntry blocks. */ + public blocks: google.cloud.documentai.v1.Document.DocumentLayout.IDocumentLayoutBlock[]; + + /** + * Creates a new LayoutListEntry instance using the specified properties. + * @param [properties] Properties to set + * @returns LayoutListEntry instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListEntry): google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry; + + /** + * Encodes the specified LayoutListEntry message. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry.verify|verify} messages. + * @param message LayoutListEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LayoutListEntry message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry.verify|verify} messages. + * @param message LayoutListEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LayoutListEntry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LayoutListEntry + * @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.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry; + + /** + * Decodes a LayoutListEntry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LayoutListEntry + * @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.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry; + + /** + * Verifies a LayoutListEntry 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 LayoutListEntry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LayoutListEntry + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry; + + /** + * Creates a plain object from a LayoutListEntry message. Also converts values to other types if specified. + * @param message LayoutListEntry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LayoutListEntry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LayoutListEntry + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of a ChunkedDocument. */ + interface IChunkedDocument { + + /** ChunkedDocument chunks */ + chunks?: (google.cloud.documentai.v1.Document.ChunkedDocument.IChunk[]|null); + } + + /** Represents a ChunkedDocument. */ + class ChunkedDocument implements IChunkedDocument { + + /** + * Constructs a new ChunkedDocument. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.IChunkedDocument); + + /** ChunkedDocument chunks. */ + public chunks: google.cloud.documentai.v1.Document.ChunkedDocument.IChunk[]; + + /** + * Creates a new ChunkedDocument instance using the specified properties. + * @param [properties] Properties to set + * @returns ChunkedDocument instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.IChunkedDocument): google.cloud.documentai.v1.Document.ChunkedDocument; + + /** + * Encodes the specified ChunkedDocument message. Does not implicitly {@link google.cloud.documentai.v1.Document.ChunkedDocument.verify|verify} messages. + * @param message ChunkedDocument message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.IChunkedDocument, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ChunkedDocument message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.ChunkedDocument.verify|verify} messages. + * @param message ChunkedDocument message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.IChunkedDocument, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ChunkedDocument message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ChunkedDocument + * @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.cloud.documentai.v1.Document.ChunkedDocument; + + /** + * Decodes a ChunkedDocument message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ChunkedDocument + * @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.cloud.documentai.v1.Document.ChunkedDocument; + + /** + * Verifies a ChunkedDocument 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 ChunkedDocument message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ChunkedDocument + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.ChunkedDocument; + + /** + * Creates a plain object from a ChunkedDocument message. Also converts values to other types if specified. + * @param message ChunkedDocument + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.ChunkedDocument, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ChunkedDocument to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ChunkedDocument + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ChunkedDocument { + + /** Properties of a Chunk. */ + interface IChunk { + + /** Chunk chunkId */ + chunkId?: (string|null); + + /** Chunk sourceBlockIds */ + sourceBlockIds?: (string[]|null); + + /** Chunk content */ + content?: (string|null); + + /** Chunk pageSpan */ + pageSpan?: (google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageSpan|null); + + /** Chunk pageHeaders */ + pageHeaders?: (google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageHeader[]|null); + + /** Chunk pageFooters */ + pageFooters?: (google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageFooter[]|null); + } + + /** Represents a Chunk. */ + class Chunk implements IChunk { + + /** + * Constructs a new Chunk. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.ChunkedDocument.IChunk); + + /** Chunk chunkId. */ + public chunkId: string; + + /** Chunk sourceBlockIds. */ + public sourceBlockIds: string[]; + + /** Chunk content. */ + public content: string; + + /** Chunk pageSpan. */ + public pageSpan?: (google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageSpan|null); + + /** Chunk pageHeaders. */ + public pageHeaders: google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageHeader[]; + + /** Chunk pageFooters. */ + public pageFooters: google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageFooter[]; + + /** + * Creates a new Chunk instance using the specified properties. + * @param [properties] Properties to set + * @returns Chunk instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.ChunkedDocument.IChunk): google.cloud.documentai.v1.Document.ChunkedDocument.Chunk; + + /** + * Encodes the specified Chunk message. Does not implicitly {@link google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.verify|verify} messages. + * @param message Chunk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.ChunkedDocument.IChunk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Chunk message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.verify|verify} messages. + * @param message Chunk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.ChunkedDocument.IChunk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Chunk message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Chunk + * @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.cloud.documentai.v1.Document.ChunkedDocument.Chunk; + + /** + * Decodes a Chunk message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Chunk + * @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.cloud.documentai.v1.Document.ChunkedDocument.Chunk; + + /** + * Verifies a Chunk 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 Chunk message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Chunk + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.ChunkedDocument.Chunk; + + /** + * Creates a plain object from a Chunk message. Also converts values to other types if specified. + * @param message Chunk + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.ChunkedDocument.Chunk, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Chunk to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Chunk + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Chunk { + + /** Properties of a ChunkPageSpan. */ + interface IChunkPageSpan { + + /** ChunkPageSpan pageStart */ + pageStart?: (number|null); + + /** ChunkPageSpan pageEnd */ + pageEnd?: (number|null); + } + + /** Represents a ChunkPageSpan. */ + class ChunkPageSpan implements IChunkPageSpan { + + /** + * Constructs a new ChunkPageSpan. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageSpan); + + /** ChunkPageSpan pageStart. */ + public pageStart: number; + + /** ChunkPageSpan pageEnd. */ + public pageEnd: number; + + /** + * Creates a new ChunkPageSpan instance using the specified properties. + * @param [properties] Properties to set + * @returns ChunkPageSpan instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageSpan): google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan; + + /** + * Encodes the specified ChunkPageSpan message. Does not implicitly {@link google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan.verify|verify} messages. + * @param message ChunkPageSpan message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageSpan, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ChunkPageSpan message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan.verify|verify} messages. + * @param message ChunkPageSpan message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageSpan, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ChunkPageSpan message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ChunkPageSpan + * @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.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan; + + /** + * Decodes a ChunkPageSpan message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ChunkPageSpan + * @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.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan; + + /** + * Verifies a ChunkPageSpan 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 ChunkPageSpan message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ChunkPageSpan + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan; + + /** + * Creates a plain object from a ChunkPageSpan message. Also converts values to other types if specified. + * @param message ChunkPageSpan + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ChunkPageSpan to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ChunkPageSpan + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ChunkPageHeader. */ + interface IChunkPageHeader { + + /** ChunkPageHeader text */ + text?: (string|null); + + /** ChunkPageHeader pageSpan */ + pageSpan?: (google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageSpan|null); + } + + /** Represents a ChunkPageHeader. */ + class ChunkPageHeader implements IChunkPageHeader { + + /** + * Constructs a new ChunkPageHeader. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageHeader); + + /** ChunkPageHeader text. */ + public text: string; + + /** ChunkPageHeader pageSpan. */ + public pageSpan?: (google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageSpan|null); + + /** + * Creates a new ChunkPageHeader instance using the specified properties. + * @param [properties] Properties to set + * @returns ChunkPageHeader instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageHeader): google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader; + + /** + * Encodes the specified ChunkPageHeader message. Does not implicitly {@link google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader.verify|verify} messages. + * @param message ChunkPageHeader message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageHeader, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ChunkPageHeader message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader.verify|verify} messages. + * @param message ChunkPageHeader message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageHeader, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ChunkPageHeader message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ChunkPageHeader + * @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.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader; + + /** + * Decodes a ChunkPageHeader message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ChunkPageHeader + * @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.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader; + + /** + * Verifies a ChunkPageHeader 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 ChunkPageHeader message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ChunkPageHeader + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader; + + /** + * Creates a plain object from a ChunkPageHeader message. Also converts values to other types if specified. + * @param message ChunkPageHeader + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ChunkPageHeader to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ChunkPageHeader + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ChunkPageFooter. */ + interface IChunkPageFooter { + + /** ChunkPageFooter text */ + text?: (string|null); + + /** ChunkPageFooter pageSpan */ + pageSpan?: (google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageSpan|null); + } + + /** Represents a ChunkPageFooter. */ + class ChunkPageFooter implements IChunkPageFooter { + + /** + * Constructs a new ChunkPageFooter. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageFooter); + + /** ChunkPageFooter text. */ + public text: string; + + /** ChunkPageFooter pageSpan. */ + public pageSpan?: (google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageSpan|null); + + /** + * Creates a new ChunkPageFooter instance using the specified properties. + * @param [properties] Properties to set + * @returns ChunkPageFooter instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageFooter): google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter; + + /** + * Encodes the specified ChunkPageFooter message. Does not implicitly {@link google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter.verify|verify} messages. + * @param message ChunkPageFooter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageFooter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ChunkPageFooter message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter.verify|verify} messages. + * @param message ChunkPageFooter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageFooter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ChunkPageFooter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ChunkPageFooter + * @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.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter; + + /** + * Decodes a ChunkPageFooter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ChunkPageFooter + * @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.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter; + + /** + * Verifies a ChunkPageFooter 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 ChunkPageFooter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ChunkPageFooter + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter; + + /** + * Creates a plain object from a ChunkPageFooter message. Also converts values to other types if specified. + * @param message ChunkPageFooter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ChunkPageFooter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ChunkPageFooter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of an EntityValidationOutput. */ + interface IEntityValidationOutput { + + /** EntityValidationOutput validationResults */ + validationResults?: (google.cloud.documentai.v1.Document.EntityValidationOutput.IValidationResult[]|null); + + /** EntityValidationOutput passAllRules */ + passAllRules?: (boolean|null); + } + + /** Represents an EntityValidationOutput. */ + class EntityValidationOutput implements IEntityValidationOutput { + + /** + * Constructs a new EntityValidationOutput. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.IEntityValidationOutput); + + /** EntityValidationOutput validationResults. */ + public validationResults: google.cloud.documentai.v1.Document.EntityValidationOutput.IValidationResult[]; + + /** EntityValidationOutput passAllRules. */ + public passAllRules: boolean; + + /** + * Creates a new EntityValidationOutput instance using the specified properties. + * @param [properties] Properties to set + * @returns EntityValidationOutput instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.IEntityValidationOutput): google.cloud.documentai.v1.Document.EntityValidationOutput; + + /** + * Encodes the specified EntityValidationOutput message. Does not implicitly {@link google.cloud.documentai.v1.Document.EntityValidationOutput.verify|verify} messages. + * @param message EntityValidationOutput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.IEntityValidationOutput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EntityValidationOutput message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.EntityValidationOutput.verify|verify} messages. + * @param message EntityValidationOutput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.IEntityValidationOutput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EntityValidationOutput message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EntityValidationOutput + * @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.cloud.documentai.v1.Document.EntityValidationOutput; + + /** + * Decodes an EntityValidationOutput message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EntityValidationOutput + * @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.cloud.documentai.v1.Document.EntityValidationOutput; + + /** + * Verifies an EntityValidationOutput 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 EntityValidationOutput message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EntityValidationOutput + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.EntityValidationOutput; + + /** + * Creates a plain object from an EntityValidationOutput message. Also converts values to other types if specified. + * @param message EntityValidationOutput + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.EntityValidationOutput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EntityValidationOutput to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EntityValidationOutput + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EntityValidationOutput { + + /** Properties of a ValidationResult. */ + interface IValidationResult { + + /** ValidationResult ruleName */ + ruleName?: (string|null); + + /** ValidationResult ruleDescription */ + ruleDescription?: (string|null); + + /** ValidationResult validationResultType */ + validationResultType?: (google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult.ValidationResultType|keyof typeof google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult.ValidationResultType|null); + + /** ValidationResult validationDetails */ + validationDetails?: (string|null); + } + + /** Represents a ValidationResult. */ + class ValidationResult implements IValidationResult { + + /** + * Constructs a new ValidationResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.EntityValidationOutput.IValidationResult); + + /** ValidationResult ruleName. */ + public ruleName: string; + + /** ValidationResult ruleDescription. */ + public ruleDescription: string; + + /** ValidationResult validationResultType. */ + public validationResultType: (google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult.ValidationResultType|keyof typeof google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult.ValidationResultType); + + /** ValidationResult validationDetails. */ + public validationDetails: string; + + /** + * Creates a new ValidationResult instance using the specified properties. + * @param [properties] Properties to set + * @returns ValidationResult instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.EntityValidationOutput.IValidationResult): google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult; + + /** + * Encodes the specified ValidationResult message. Does not implicitly {@link google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult.verify|verify} messages. + * @param message ValidationResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.EntityValidationOutput.IValidationResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ValidationResult message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult.verify|verify} messages. + * @param message ValidationResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.EntityValidationOutput.IValidationResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ValidationResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ValidationResult + * @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.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult; + + /** + * Decodes a ValidationResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ValidationResult + * @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.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult; + + /** + * Verifies a ValidationResult 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 ValidationResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ValidationResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult; + + /** + * Creates a plain object from a ValidationResult message. Also converts values to other types if specified. + * @param message ValidationResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ValidationResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ValidationResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ValidationResult { + + /** ValidationResultType enum. */ + enum ValidationResultType { + VALIDATION_RESULT_TYPE_UNSPECIFIED = 0, + VALIDATION_RESULT_TYPE_VALID = 1, + VALIDATION_RESULT_TYPE_INVALID = 2, + VALIDATION_RESULT_TYPE_SKIPPED = 3, + VALIDATION_RESULT_TYPE_NOT_APPLICABLE = 4 + } + } + } + + /** Properties of an EntitiesRevision. */ + interface IEntitiesRevision { + + /** EntitiesRevision revisionId */ + revisionId?: (string|null); + + /** EntitiesRevision entities */ + entities?: (google.cloud.documentai.v1.Document.IEntity[]|null); + + /** EntitiesRevision entityValidationOutput */ + entityValidationOutput?: (google.cloud.documentai.v1.Document.IEntityValidationOutput|null); + } + + /** Represents an EntitiesRevision. */ + class EntitiesRevision implements IEntitiesRevision { + + /** + * Constructs a new EntitiesRevision. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.IEntitiesRevision); + + /** EntitiesRevision revisionId. */ + public revisionId: string; + + /** EntitiesRevision entities. */ + public entities: google.cloud.documentai.v1.Document.IEntity[]; + + /** EntitiesRevision entityValidationOutput. */ + public entityValidationOutput?: (google.cloud.documentai.v1.Document.IEntityValidationOutput|null); + + /** + * Creates a new EntitiesRevision instance using the specified properties. + * @param [properties] Properties to set + * @returns EntitiesRevision instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.IEntitiesRevision): google.cloud.documentai.v1.Document.EntitiesRevision; + + /** + * Encodes the specified EntitiesRevision message. Does not implicitly {@link google.cloud.documentai.v1.Document.EntitiesRevision.verify|verify} messages. + * @param message EntitiesRevision message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.IEntitiesRevision, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EntitiesRevision message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.EntitiesRevision.verify|verify} messages. + * @param message EntitiesRevision message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.IEntitiesRevision, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EntitiesRevision message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EntitiesRevision + * @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.cloud.documentai.v1.Document.EntitiesRevision; + + /** + * Decodes an EntitiesRevision message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EntitiesRevision + * @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.cloud.documentai.v1.Document.EntitiesRevision; + + /** + * Verifies an EntitiesRevision 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 EntitiesRevision message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EntitiesRevision + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.EntitiesRevision; + + /** + * Creates a plain object from an EntitiesRevision message. Also converts values to other types if specified. + * @param message EntitiesRevision + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.EntitiesRevision, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EntitiesRevision to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EntitiesRevision + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Barcode. */ + interface IBarcode { + + /** Barcode format */ + format?: (string|null); + + /** Barcode valueFormat */ + valueFormat?: (string|null); + + /** Barcode rawValue */ + rawValue?: (string|null); + } + + /** Represents a Barcode. */ + class Barcode implements IBarcode { + + /** + * Constructs a new Barcode. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IBarcode); + + /** Barcode format. */ + public format: string; + + /** Barcode valueFormat. */ + public valueFormat: string; + + /** Barcode rawValue. */ + public rawValue: string; + + /** + * Creates a new Barcode instance using the specified properties. + * @param [properties] Properties to set + * @returns Barcode instance + */ + public static create(properties?: google.cloud.documentai.v1.IBarcode): google.cloud.documentai.v1.Barcode; + + /** + * Encodes the specified Barcode message. Does not implicitly {@link google.cloud.documentai.v1.Barcode.verify|verify} messages. + * @param message Barcode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IBarcode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Barcode message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Barcode.verify|verify} messages. + * @param message Barcode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IBarcode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Barcode message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Barcode + * @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.cloud.documentai.v1.Barcode; + + /** + * Decodes a Barcode message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Barcode + * @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.cloud.documentai.v1.Barcode; + + /** + * Verifies a Barcode 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 Barcode message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Barcode + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Barcode; + + /** + * Creates a plain object from a Barcode message. Also converts values to other types if specified. + * @param message Barcode + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Barcode, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Barcode to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Barcode + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Vertex. */ + interface IVertex { + + /** Vertex x */ + x?: (number|null); + + /** Vertex y */ + y?: (number|null); + } + + /** Represents a Vertex. */ + class Vertex implements IVertex { + + /** + * Constructs a new Vertex. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IVertex); + + /** Vertex x. */ + public x: number; + + /** Vertex y. */ + public y: number; + + /** + * Creates a new Vertex instance using the specified properties. + * @param [properties] Properties to set + * @returns Vertex instance + */ + public static create(properties?: google.cloud.documentai.v1.IVertex): google.cloud.documentai.v1.Vertex; + + /** + * Encodes the specified Vertex message. Does not implicitly {@link google.cloud.documentai.v1.Vertex.verify|verify} messages. + * @param message Vertex message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IVertex, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Vertex message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Vertex.verify|verify} messages. + * @param message Vertex message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IVertex, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Vertex message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Vertex + * @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.cloud.documentai.v1.Vertex; + + /** + * Decodes a Vertex message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Vertex + * @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.cloud.documentai.v1.Vertex; + + /** + * Verifies a Vertex 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 Vertex message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Vertex + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Vertex; + + /** + * Creates a plain object from a Vertex message. Also converts values to other types if specified. + * @param message Vertex + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Vertex, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Vertex to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Vertex + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NormalizedVertex. */ + interface INormalizedVertex { + + /** NormalizedVertex x */ + x?: (number|null); + + /** NormalizedVertex y */ + y?: (number|null); + } + + /** Represents a NormalizedVertex. */ + class NormalizedVertex implements INormalizedVertex { + + /** + * Constructs a new NormalizedVertex. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.INormalizedVertex); + + /** NormalizedVertex x. */ + public x: number; + + /** NormalizedVertex y. */ + public y: number; + + /** + * Creates a new NormalizedVertex instance using the specified properties. + * @param [properties] Properties to set + * @returns NormalizedVertex instance + */ + public static create(properties?: google.cloud.documentai.v1.INormalizedVertex): google.cloud.documentai.v1.NormalizedVertex; + + /** + * Encodes the specified NormalizedVertex message. Does not implicitly {@link google.cloud.documentai.v1.NormalizedVertex.verify|verify} messages. + * @param message NormalizedVertex message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.INormalizedVertex, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NormalizedVertex message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.NormalizedVertex.verify|verify} messages. + * @param message NormalizedVertex message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.INormalizedVertex, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NormalizedVertex message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NormalizedVertex + * @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.cloud.documentai.v1.NormalizedVertex; + + /** + * Decodes a NormalizedVertex message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NormalizedVertex + * @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.cloud.documentai.v1.NormalizedVertex; + + /** + * Verifies a NormalizedVertex 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 NormalizedVertex message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NormalizedVertex + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.NormalizedVertex; + + /** + * Creates a plain object from a NormalizedVertex message. Also converts values to other types if specified. + * @param message NormalizedVertex + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.NormalizedVertex, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NormalizedVertex to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NormalizedVertex + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoundingPoly. */ + interface IBoundingPoly { + + /** BoundingPoly vertices */ + vertices?: (google.cloud.documentai.v1.IVertex[]|null); + + /** BoundingPoly normalizedVertices */ + normalizedVertices?: (google.cloud.documentai.v1.INormalizedVertex[]|null); + } + + /** Represents a BoundingPoly. */ + class BoundingPoly implements IBoundingPoly { + + /** + * Constructs a new BoundingPoly. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IBoundingPoly); + + /** BoundingPoly vertices. */ + public vertices: google.cloud.documentai.v1.IVertex[]; + + /** BoundingPoly normalizedVertices. */ + public normalizedVertices: google.cloud.documentai.v1.INormalizedVertex[]; + + /** + * Creates a new BoundingPoly instance using the specified properties. + * @param [properties] Properties to set + * @returns BoundingPoly instance + */ + public static create(properties?: google.cloud.documentai.v1.IBoundingPoly): google.cloud.documentai.v1.BoundingPoly; + + /** + * Encodes the specified BoundingPoly message. Does not implicitly {@link google.cloud.documentai.v1.BoundingPoly.verify|verify} messages. + * @param message BoundingPoly message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IBoundingPoly, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoundingPoly message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.BoundingPoly.verify|verify} messages. + * @param message BoundingPoly message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IBoundingPoly, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoundingPoly message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoundingPoly + * @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.cloud.documentai.v1.BoundingPoly; + + /** + * Decodes a BoundingPoly message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoundingPoly + * @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.cloud.documentai.v1.BoundingPoly; + + /** + * Verifies a BoundingPoly 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 BoundingPoly message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoundingPoly + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.BoundingPoly; + + /** + * Creates a plain object from a BoundingPoly message. Also converts values to other types if specified. + * @param message BoundingPoly + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.BoundingPoly, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoundingPoly to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoundingPoly + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7, + IDENTIFIER = 8 + } + + /** 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 }; + + /** + * Gets the default type url for ResourceDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + 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 }; + + /** + * Gets the default type url for ResourceReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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 }; + + /** + * Gets the default type url for Http + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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|null); + + /** HttpRule put. */ + public put?: (string|null); + + /** HttpRule post. */ + public post?: (string|null); + + /** HttpRule delete. */ + public delete?: (string|null); + + /** HttpRule patch. */ + public patch?: (string|null); + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns 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 }; + + /** + * Gets the default type url for HttpRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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 }; + + /** + * Gets the default type url for CustomHttpPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CommonLanguageSettings. */ + interface ICommonLanguageSettings { + + /** CommonLanguageSettings referenceDocsUri */ + referenceDocsUri?: (string|null); + + /** CommonLanguageSettings destinations */ + destinations?: (google.api.ClientLibraryDestination[]|null); + } + + /** Represents a CommonLanguageSettings. */ + class CommonLanguageSettings implements ICommonLanguageSettings { + + /** + * Constructs a new CommonLanguageSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICommonLanguageSettings); + + /** CommonLanguageSettings referenceDocsUri. */ + public referenceDocsUri: string; + + /** CommonLanguageSettings destinations. */ + public destinations: google.api.ClientLibraryDestination[]; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CommonLanguageSettings instance + */ + public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommonLanguageSettings + * @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.CommonLanguageSettings; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommonLanguageSettings + * @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.CommonLanguageSettings; + + /** + * Verifies a CommonLanguageSettings 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 CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommonLanguageSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @param message CommonLanguageSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommonLanguageSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClientLibrarySettings. */ + interface IClientLibrarySettings { + + /** ClientLibrarySettings version */ + version?: (string|null); + + /** ClientLibrarySettings launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** ClientLibrarySettings restNumericEnums */ + restNumericEnums?: (boolean|null); + + /** ClientLibrarySettings javaSettings */ + javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings */ + cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings */ + phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings */ + pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings */ + nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings */ + dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings */ + rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings */ + goSettings?: (google.api.IGoSettings|null); + } + + /** Represents a ClientLibrarySettings. */ + class ClientLibrarySettings implements IClientLibrarySettings { + + /** + * Constructs a new ClientLibrarySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IClientLibrarySettings); + + /** ClientLibrarySettings version. */ + public version: string; + + /** ClientLibrarySettings launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** ClientLibrarySettings restNumericEnums. */ + public restNumericEnums: boolean; + + /** ClientLibrarySettings javaSettings. */ + public javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings. */ + public cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings. */ + public phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings. */ + public pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings. */ + public nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings. */ + public dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings. */ + public rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings. */ + public goSettings?: (google.api.IGoSettings|null); + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientLibrarySettings instance + */ + public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientLibrarySettings + * @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.ClientLibrarySettings; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientLibrarySettings + * @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.ClientLibrarySettings; + + /** + * Verifies a ClientLibrarySettings 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 ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientLibrarySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @param message ClientLibrarySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientLibrarySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Publishing. */ + interface IPublishing { + + /** Publishing methodSettings */ + methodSettings?: (google.api.IMethodSettings[]|null); + + /** Publishing newIssueUri */ + newIssueUri?: (string|null); + + /** Publishing documentationUri */ + documentationUri?: (string|null); + + /** Publishing apiShortName */ + apiShortName?: (string|null); + + /** Publishing githubLabel */ + githubLabel?: (string|null); + + /** Publishing codeownerGithubTeams */ + codeownerGithubTeams?: (string[]|null); + + /** Publishing docTagPrefix */ + docTagPrefix?: (string|null); + + /** Publishing organization */ + organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); + + /** Publishing librarySettings */ + librarySettings?: (google.api.IClientLibrarySettings[]|null); + + /** Publishing protoReferenceDocumentationUri */ + protoReferenceDocumentationUri?: (string|null); + + /** Publishing restReferenceDocumentationUri */ + restReferenceDocumentationUri?: (string|null); + } + + /** Represents a Publishing. */ + class Publishing implements IPublishing { + + /** + * Constructs a new Publishing. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPublishing); + + /** Publishing methodSettings. */ + public methodSettings: google.api.IMethodSettings[]; + + /** Publishing newIssueUri. */ + public newIssueUri: string; + + /** Publishing documentationUri. */ + public documentationUri: string; + + /** Publishing apiShortName. */ + public apiShortName: string; + + /** Publishing githubLabel. */ + public githubLabel: string; + + /** Publishing codeownerGithubTeams. */ + public codeownerGithubTeams: string[]; + + /** Publishing docTagPrefix. */ + public docTagPrefix: string; + + /** Publishing organization. */ + public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); + + /** Publishing librarySettings. */ + public librarySettings: google.api.IClientLibrarySettings[]; + + /** Publishing protoReferenceDocumentationUri. */ + public protoReferenceDocumentationUri: string; + + /** Publishing restReferenceDocumentationUri. */ + public restReferenceDocumentationUri: string; + + /** + * Creates a new Publishing instance using the specified properties. + * @param [properties] Properties to set + * @returns Publishing instance + */ + public static create(properties?: google.api.IPublishing): google.api.Publishing; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Publishing + * @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.Publishing; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Publishing + * @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.Publishing; + + /** + * Verifies a Publishing 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 Publishing message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Publishing + */ + public static fromObject(object: { [k: string]: any }): google.api.Publishing; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @param message Publishing + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Publishing to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Publishing + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JavaSettings. */ + interface IJavaSettings { + + /** JavaSettings libraryPackage */ + libraryPackage?: (string|null); + + /** JavaSettings serviceClassNames */ + serviceClassNames?: ({ [k: string]: string }|null); + + /** JavaSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a JavaSettings. */ + class JavaSettings implements IJavaSettings { + + /** + * Constructs a new JavaSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IJavaSettings); + + /** JavaSettings libraryPackage. */ + public libraryPackage: string; + + /** JavaSettings serviceClassNames. */ + public serviceClassNames: { [k: string]: string }; + + /** JavaSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new JavaSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns JavaSettings instance + */ + public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JavaSettings + * @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.JavaSettings; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JavaSettings + * @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.JavaSettings; + + /** + * Verifies a JavaSettings 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 JavaSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JavaSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @param message JavaSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JavaSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JavaSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CppSettings. */ + interface ICppSettings { + + /** CppSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a CppSettings. */ + class CppSettings implements ICppSettings { + + /** + * Constructs a new CppSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICppSettings); + + /** CppSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new CppSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CppSettings instance + */ + public static create(properties?: google.api.ICppSettings): google.api.CppSettings; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CppSettings + * @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.CppSettings; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CppSettings + * @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.CppSettings; + + /** + * Verifies a CppSettings 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 CppSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CppSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CppSettings; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @param message CppSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CppSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CppSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PhpSettings. */ + interface IPhpSettings { + + /** PhpSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PhpSettings. */ + class PhpSettings implements IPhpSettings { + + /** + * Constructs a new PhpSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPhpSettings); + + /** PhpSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PhpSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PhpSettings instance + */ + public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PhpSettings + * @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.PhpSettings; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PhpSettings + * @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.PhpSettings; + + /** + * Verifies a PhpSettings 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 PhpSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PhpSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @param message PhpSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PhpSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PhpSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PythonSettings. */ + interface IPythonSettings { + + /** PythonSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PythonSettings. */ + class PythonSettings implements IPythonSettings { + + /** + * Constructs a new PythonSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPythonSettings); + + /** PythonSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PythonSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PythonSettings instance + */ + public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PythonSettings + * @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.PythonSettings; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PythonSettings + * @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.PythonSettings; + + /** + * Verifies a PythonSettings 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 PythonSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PythonSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @param message PythonSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PythonSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PythonSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeSettings. */ + interface INodeSettings { + + /** NodeSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a NodeSettings. */ + class NodeSettings implements INodeSettings { + + /** + * Constructs a new NodeSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.INodeSettings); + + /** NodeSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new NodeSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeSettings instance + */ + public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeSettings + * @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.NodeSettings; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeSettings + * @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.NodeSettings; + + /** + * Verifies a NodeSettings 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 NodeSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @param message NodeSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DotnetSettings. */ + interface IDotnetSettings { + + /** DotnetSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); + + /** DotnetSettings renamedResources */ + renamedResources?: ({ [k: string]: string }|null); + + /** DotnetSettings ignoredResources */ + ignoredResources?: (string[]|null); + + /** DotnetSettings forcedNamespaceAliases */ + forcedNamespaceAliases?: (string[]|null); + + /** DotnetSettings handwrittenSignatures */ + handwrittenSignatures?: (string[]|null); + } + + /** Represents a DotnetSettings. */ + class DotnetSettings implements IDotnetSettings { + + /** + * Constructs a new DotnetSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IDotnetSettings); + + /** DotnetSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + + /** DotnetSettings renamedResources. */ + public renamedResources: { [k: string]: string }; + + /** DotnetSettings ignoredResources. */ + public ignoredResources: string[]; + + /** DotnetSettings forcedNamespaceAliases. */ + public forcedNamespaceAliases: string[]; + + /** DotnetSettings handwrittenSignatures. */ + public handwrittenSignatures: string[]; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns DotnetSettings instance + */ + public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DotnetSettings + * @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.DotnetSettings; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DotnetSettings + * @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.DotnetSettings; + + /** + * Verifies a DotnetSettings 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 DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DotnetSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @param message DotnetSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DotnetSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DotnetSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RubySettings. */ + interface IRubySettings { + + /** RubySettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a RubySettings. */ + class RubySettings implements IRubySettings { + + /** + * Constructs a new RubySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IRubySettings); + + /** RubySettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new RubySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns RubySettings instance + */ + public static create(properties?: google.api.IRubySettings): google.api.RubySettings; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RubySettings + * @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.RubySettings; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RubySettings + * @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.RubySettings; + + /** + * Verifies a RubySettings 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 RubySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RubySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.RubySettings; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @param message RubySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RubySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RubySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GoSettings. */ + interface IGoSettings { + + /** GoSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a GoSettings. */ + class GoSettings implements IGoSettings { + + /** + * Constructs a new GoSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IGoSettings); + + /** GoSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new GoSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns GoSettings instance + */ + public static create(properties?: google.api.IGoSettings): google.api.GoSettings; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoSettings + * @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.GoSettings; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoSettings + * @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.GoSettings; + + /** + * Verifies a GoSettings 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 GoSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.GoSettings; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @param message GoSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodSettings. */ + interface IMethodSettings { + + /** MethodSettings selector */ + selector?: (string|null); + + /** MethodSettings longRunning */ + longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields */ + autoPopulatedFields?: (string[]|null); + } + + /** Represents a MethodSettings. */ + class MethodSettings implements IMethodSettings { + + /** + * Constructs a new MethodSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IMethodSettings); + + /** MethodSettings selector. */ + public selector: string; + + /** MethodSettings longRunning. */ + public longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields. */ + public autoPopulatedFields: string[]; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodSettings instance + */ + public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodSettings + * @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.MethodSettings; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodSettings + * @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.MethodSettings; + + /** + * Verifies a MethodSettings 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 MethodSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @param message MethodSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodSettings { + + /** Properties of a LongRunning. */ + interface ILongRunning { + + /** LongRunning initialPollDelay */ + initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier */ + pollDelayMultiplier?: (number|null); + + /** LongRunning maxPollDelay */ + maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout */ + totalPollTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents a LongRunning. */ + class LongRunning implements ILongRunning { + + /** + * Constructs a new LongRunning. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.MethodSettings.ILongRunning); + + /** LongRunning initialPollDelay. */ + public initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier. */ + public pollDelayMultiplier: number; + + /** LongRunning maxPollDelay. */ + public maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout. */ + public totalPollTimeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new LongRunning instance using the specified properties. + * @param [properties] Properties to set + * @returns LongRunning instance + */ + public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LongRunning + * @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.MethodSettings.LongRunning; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LongRunning + * @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.MethodSettings.LongRunning; + + /** + * Verifies a LongRunning 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 LongRunning message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LongRunning + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @param message LongRunning + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LongRunning to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LongRunning + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** ClientLibraryOrganization enum. */ + enum ClientLibraryOrganization { + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, + CLOUD = 1, + ADS = 2, + PHOTOS = 3, + STREET_VIEW = 4, + SHOPPING = 5, + GEO = 6, + GENERATIVE_AI = 7 + } + + /** ClientLibraryDestination enum. */ + enum ClientLibraryDestination { + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, + GITHUB = 10, + PACKAGE_MANAGER = 20 + } + + /** LaunchStage enum. */ + enum LaunchStage { + LAUNCH_STAGE_UNSPECIFIED = 0, + UNIMPLEMENTED = 6, + PRELAUNCH = 7, + EARLY_ACCESS = 1, + ALPHA = 2, + BETA = 3, + GA = 4, + DEPRECATED = 5 + } + } + + /** 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 }; + + /** + * Gets the default type url for FileDescriptorSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Edition enum. */ + enum Edition { + EDITION_UNKNOWN = 0, + EDITION_PROTO2 = 998, + EDITION_PROTO3 = 999, + EDITION_2023 = 1000, + EDITION_2024 = 1001, + EDITION_1_TEST_ONLY = 1, + EDITION_2_TEST_ONLY = 2, + EDITION_99997_TEST_ONLY = 99997, + EDITION_99998_TEST_ONLY = 99998, + EDITION_99999_TEST_ONLY = 99999, + EDITION_MAX = 2147483647 + } + + /** 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); + + /** FileDescriptorProto edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|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; + + /** FileDescriptorProto edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * 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 }; + + /** + * Gets the default type url for FileDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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 }; + + /** + * Gets the default type url for DescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + 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 }; + + /** + * Gets the default type url for ExtensionRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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 }; + + /** + * Gets the default type url for ReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ExtensionRangeOptions declaration */ + declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); + + /** ExtensionRangeOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification */ + verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|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[]; + + /** ExtensionRangeOptions declaration. */ + public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; + + /** ExtensionRangeOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification. */ + public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); + + /** + * 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 }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExtensionRangeOptions { + + /** Properties of a Declaration. */ + interface IDeclaration { + + /** Declaration number */ + number?: (number|null); + + /** Declaration fullName */ + fullName?: (string|null); + + /** Declaration type */ + type?: (string|null); + + /** Declaration reserved */ + reserved?: (boolean|null); + + /** Declaration repeated */ + repeated?: (boolean|null); + } + + /** Represents a Declaration. */ + class Declaration implements IDeclaration { + + /** + * Constructs a new Declaration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); + + /** Declaration number. */ + public number: number; + + /** Declaration fullName. */ + public fullName: string; + + /** Declaration type. */ + public type: string; + + /** Declaration reserved. */ + public reserved: boolean; + + /** Declaration repeated. */ + public repeated: boolean; + + /** + * Creates a new Declaration instance using the specified properties. + * @param [properties] Properties to set + * @returns Declaration instance + */ + public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Declaration + * @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.Declaration; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Declaration + * @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.Declaration; + + /** + * Verifies a Declaration 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 Declaration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Declaration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @param message Declaration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Declaration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Declaration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** VerificationState enum. */ + enum VerificationState { + DECLARATION = 0, + UNVERIFIED = 1 + } + } + + /** 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 }; + + /** + * Gets the default type url for FieldDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + 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_REPEATED = 3, + LABEL_REQUIRED = 2 + } + } + + /** 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 }; + + /** + * Gets the default type url for OneofDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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 }; + + /** + * Gets the default type url for EnumDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + 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 }; + + /** + * Gets the default type url for EnumReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** 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 }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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 }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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 }; + + /** + * Gets the default type url for MethodDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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 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 features */ + features?: (google.protobuf.IFeatureSet|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 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 features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** 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 }; + + /** + * Gets the default type url for FileOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + 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 deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** MessageOptions features */ + features?: (google.protobuf.IFeatureSet|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 deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** MessageOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** 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 }; + + /** + * Gets the default type url for MessageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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 unverifiedLazy */ + unverifiedLazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions debugRedact */ + debugRedact?: (boolean|null); + + /** FieldOptions retention */ + retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); + + /** FieldOptions targets */ + targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); + + /** FieldOptions editionDefaults */ + editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); + + /** FieldOptions features */ + features?: (google.protobuf.IFeatureSet|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 unverifiedLazy. */ + public unverifiedLazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions debugRedact. */ + public debugRedact: boolean; + + /** FieldOptions retention. */ + public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); + + /** FieldOptions targets. */ + public targets: google.protobuf.FieldOptions.OptionTargetType[]; + + /** FieldOptions editionDefaults. */ + public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; + + /** FieldOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** 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 }; + + /** + * Gets the default type url for FieldOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + 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 + } + + /** OptionRetention enum. */ + enum OptionRetention { + RETENTION_UNKNOWN = 0, + RETENTION_RUNTIME = 1, + RETENTION_SOURCE = 2 + } + + /** OptionTargetType enum. */ + enum OptionTargetType { + TARGET_TYPE_UNKNOWN = 0, + TARGET_TYPE_FILE = 1, + TARGET_TYPE_EXTENSION_RANGE = 2, + TARGET_TYPE_MESSAGE = 3, + TARGET_TYPE_FIELD = 4, + TARGET_TYPE_ONEOF = 5, + TARGET_TYPE_ENUM = 6, + TARGET_TYPE_ENUM_ENTRY = 7, + TARGET_TYPE_SERVICE = 8, + TARGET_TYPE_METHOD = 9 + } + + /** Properties of an EditionDefault. */ + interface IEditionDefault { + + /** EditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** EditionDefault value */ + value?: (string|null); + } + + /** Represents an EditionDefault. */ + class EditionDefault implements IEditionDefault { + + /** + * Constructs a new EditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); + + /** EditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** EditionDefault value. */ + public value: string; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns EditionDefault instance + */ + public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EditionDefault + * @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.EditionDefault; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EditionDefault + * @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.EditionDefault; + + /** + * Verifies an EditionDefault 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 EditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @param message EditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** 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 features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** 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 }; + + /** + * Gets the default type url for OneofOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** EnumOptions features */ + features?: (google.protobuf.IFeatureSet|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 deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** EnumOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** 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 }; + + /** + * Gets the default type url for EnumOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact */ + debugRedact?: (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 features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact. */ + public debugRedact: 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 }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** 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); + + /** ServiceOptions .google.api.apiVersion */ + ".google.api.apiVersion"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** 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 }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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 features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|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 features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** 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 }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + 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|Buffer|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|Buffer|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 }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + 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 }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a FeatureSet. */ + interface IFeatureSet { + + /** FeatureSet fieldPresence */ + fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); + + /** FeatureSet enumType */ + enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); + + /** FeatureSet repeatedFieldEncoding */ + repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); + + /** FeatureSet utf8Validation */ + utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); + + /** FeatureSet messageEncoding */ + messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); + + /** FeatureSet jsonFormat */ + jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + } + + /** Represents a FeatureSet. */ + class FeatureSet implements IFeatureSet { + + /** + * Constructs a new FeatureSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSet); + + /** FeatureSet fieldPresence. */ + public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); + + /** FeatureSet enumType. */ + public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); + + /** FeatureSet repeatedFieldEncoding. */ + public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); + + /** FeatureSet utf8Validation. */ + public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); + + /** FeatureSet messageEncoding. */ + public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); + + /** FeatureSet jsonFormat. */ + public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + + /** + * Creates a new FeatureSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSet instance + */ + public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSet + * @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.FeatureSet; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSet + * @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.FeatureSet; + + /** + * Verifies a FeatureSet 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 FeatureSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @param message FeatureSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSet { + + /** FieldPresence enum. */ + enum FieldPresence { + FIELD_PRESENCE_UNKNOWN = 0, + EXPLICIT = 1, + IMPLICIT = 2, + LEGACY_REQUIRED = 3 + } + + /** EnumType enum. */ + enum EnumType { + ENUM_TYPE_UNKNOWN = 0, + OPEN = 1, + CLOSED = 2 + } + + /** RepeatedFieldEncoding enum. */ + enum RepeatedFieldEncoding { + REPEATED_FIELD_ENCODING_UNKNOWN = 0, + PACKED = 1, + EXPANDED = 2 + } + + /** Utf8Validation enum. */ + enum Utf8Validation { + UTF8_VALIDATION_UNKNOWN = 0, + VERIFY = 2, + NONE = 3 + } + + /** MessageEncoding enum. */ + enum MessageEncoding { + MESSAGE_ENCODING_UNKNOWN = 0, + LENGTH_PREFIXED = 1, + DELIMITED = 2 + } + + /** JsonFormat enum. */ + enum JsonFormat { + JSON_FORMAT_UNKNOWN = 0, + ALLOW = 1, + LEGACY_BEST_EFFORT = 2 + } + } + + /** Properties of a FeatureSetDefaults. */ + interface IFeatureSetDefaults { + + /** FeatureSetDefaults defaults */ + defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); + + /** FeatureSetDefaults minimumEdition */ + minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetDefaults maximumEdition */ + maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSetDefaults. */ + class FeatureSetDefaults implements IFeatureSetDefaults { + + /** + * Constructs a new FeatureSetDefaults. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSetDefaults); + + /** FeatureSetDefaults defaults. */ + public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; + + /** FeatureSetDefaults minimumEdition. */ + public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetDefaults maximumEdition. */ + public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetDefaults instance + */ + public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetDefaults + * @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.FeatureSetDefaults; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetDefaults + * @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.FeatureSetDefaults; + + /** + * Verifies a FeatureSetDefaults 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 FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetDefaults + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @param message FeatureSetDefaults + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetDefaults + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSetDefaults { + + /** Properties of a FeatureSetEditionDefault. */ + interface IFeatureSetEditionDefault { + + /** FeatureSetEditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetEditionDefault features */ + features?: (google.protobuf.IFeatureSet|null); + } + + /** Represents a FeatureSetEditionDefault. */ + class FeatureSetEditionDefault implements IFeatureSetEditionDefault { + + /** + * Constructs a new FeatureSetEditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); + + /** FeatureSetEditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetEditionDefault features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetEditionDefault instance + */ + public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetEditionDefault + * @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.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetEditionDefault + * @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.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Verifies a FeatureSetEditionDefault 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 FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetEditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @param message FeatureSetEditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** 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 }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + 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 }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** 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 }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + 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); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|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; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * 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 }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** 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 }; + + /** + * Gets the default type url for FieldMask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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 }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|Buffer|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|Buffer|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 }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** DoubleValue value */ + value?: (number|null); + } + + /** Represents a DoubleValue. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDoubleValue); + + /** DoubleValue value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DoubleValue + * @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.DoubleValue; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DoubleValue + * @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.DoubleValue; + + /** + * Verifies a DoubleValue 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 DoubleValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DoubleValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DoubleValue; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @param message DoubleValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DoubleValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DoubleValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** FloatValue value */ + value?: (number|null); + } + + /** Represents a FloatValue. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFloatValue); + + /** FloatValue value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FloatValue + * @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.FloatValue; + + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FloatValue + * @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.FloatValue; + + /** + * Verifies a FloatValue 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 FloatValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FloatValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FloatValue; + + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @param message FloatValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FloatValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FloatValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** Int64Value value */ + value?: (number|Long|string|null); + } + + /** Represents an Int64Value. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IInt64Value); + + /** Int64Value value. */ + public value: (number|Long|string); + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int64Value + * @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.Int64Value; + + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int64Value + * @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.Int64Value; + + /** + * Verifies an Int64Value 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 Int64Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int64Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Int64Value; + + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @param message Int64Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Int64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int64Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** UInt64Value value */ + value?: (number|Long|string|null); + } + + /** Represents a UInt64Value. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUInt64Value); + + /** UInt64Value value. */ + public value: (number|Long|string); + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt64Value + * @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.UInt64Value; + + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt64Value + * @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.UInt64Value; + + /** + * Verifies a UInt64Value 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 UInt64Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UInt64Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt64Value; + + /** + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @param message UInt64Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UInt64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UInt64Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** Int32Value value */ + value?: (number|null); + } + + /** Represents an Int32Value. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IInt32Value); + + /** Int32Value value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int32Value + * @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.Int32Value; + + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int32Value + * @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.Int32Value; + + /** + * Verifies an Int32Value 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 Int32Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int32Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Int32Value; + + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @param message Int32Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Int32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int32Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** UInt32Value value */ + value?: (number|null); + } + + /** Represents a UInt32Value. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUInt32Value); + + /** UInt32Value value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt32Value + * @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.UInt32Value; + + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt32Value + * @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.UInt32Value; + + /** + * Verifies a UInt32Value 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 UInt32Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UInt32Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt32Value; + + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @param message UInt32Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UInt32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UInt32Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** BoolValue value */ + value?: (boolean|null); + } + + /** Represents a BoolValue. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IBoolValue); + + /** BoolValue value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoolValue + * @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.BoolValue; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoolValue + * @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.BoolValue; + + /** + * Verifies a BoolValue 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 BoolValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoolValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.BoolValue; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @param message BoolValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.BoolValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoolValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** StringValue value */ + value?: (string|null); + } + + /** Represents a StringValue. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStringValue); + + /** StringValue value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StringValue + * @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.StringValue; + + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StringValue + * @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.StringValue; + + /** + * Verifies a StringValue 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 StringValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StringValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.StringValue; + + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @param message StringValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.StringValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StringValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** BytesValue value */ + value?: (Uint8Array|Buffer|string|null); + } + + /** Represents a BytesValue. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IBytesValue); + + /** BytesValue value. */ + public value: (Uint8Array|Buffer|string); + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BytesValue + * @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.BytesValue; + + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BytesValue + * @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.BytesValue; + + /** + * Verifies a BytesValue 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 BytesValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BytesValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.BytesValue; + + /** + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @param message BytesValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.BytesValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BytesValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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 }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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 }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** 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 }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace type. */ + namespace type { + + /** Properties of a Color. */ + interface IColor { + + /** Color red */ + red?: (number|null); + + /** Color green */ + green?: (number|null); + + /** Color blue */ + blue?: (number|null); + + /** Color alpha */ + alpha?: (google.protobuf.IFloatValue|null); + } + + /** Represents a Color. */ + class Color implements IColor { + + /** + * Constructs a new Color. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IColor); + + /** Color red. */ + public red: number; + + /** Color green. */ + public green: number; + + /** Color blue. */ + public blue: number; + + /** Color alpha. */ + public alpha?: (google.protobuf.IFloatValue|null); + + /** + * Creates a new Color instance using the specified properties. + * @param [properties] Properties to set + * @returns Color instance + */ + public static create(properties?: google.type.IColor): google.type.Color; + + /** + * Encodes the specified Color message. Does not implicitly {@link google.type.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.type.IColor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Color message, length delimited. Does not implicitly {@link google.type.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.type.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.type.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.type.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.type.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.type.Color, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Color to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Color + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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 }; + + /** + * Gets the default type url for Date + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DateTime. */ + interface IDateTime { + + /** DateTime year */ + year?: (number|null); + + /** DateTime month */ + month?: (number|null); + + /** DateTime day */ + day?: (number|null); + + /** DateTime hours */ + hours?: (number|null); + + /** DateTime minutes */ + minutes?: (number|null); + + /** DateTime seconds */ + seconds?: (number|null); + + /** DateTime nanos */ + nanos?: (number|null); + + /** DateTime utcOffset */ + utcOffset?: (google.protobuf.IDuration|null); + + /** DateTime timeZone */ + timeZone?: (google.type.ITimeZone|null); + } + + /** Represents a DateTime. */ + class DateTime implements IDateTime { + + /** + * Constructs a new DateTime. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IDateTime); + + /** DateTime year. */ + public year: number; + + /** DateTime month. */ + public month: number; + + /** DateTime day. */ + public day: number; + + /** DateTime hours. */ + public hours: number; + + /** DateTime minutes. */ + public minutes: number; + + /** DateTime seconds. */ + public seconds: number; + + /** DateTime nanos. */ + public nanos: number; + + /** DateTime utcOffset. */ + public utcOffset?: (google.protobuf.IDuration|null); + + /** DateTime timeZone. */ + public timeZone?: (google.type.ITimeZone|null); + + /** DateTime timeOffset. */ + public timeOffset?: ("utcOffset"|"timeZone"); + + /** + * Creates a new DateTime instance using the specified properties. + * @param [properties] Properties to set + * @returns DateTime instance + */ + public static create(properties?: google.type.IDateTime): google.type.DateTime; + + /** + * Encodes the specified DateTime message. Does not implicitly {@link google.type.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.type.IDateTime, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DateTime message, length delimited. Does not implicitly {@link google.type.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.type.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.type.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.type.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.type.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.type.DateTime, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DateTime to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DateTime + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimeZone. */ + interface ITimeZone { + + /** TimeZone id */ + id?: (string|null); + + /** TimeZone version */ + version?: (string|null); + } + + /** Represents a TimeZone. */ + class TimeZone implements ITimeZone { + + /** + * Constructs a new TimeZone. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.ITimeZone); + + /** TimeZone id. */ + public id: string; + + /** TimeZone version. */ + public version: string; + + /** + * Creates a new TimeZone instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeZone instance + */ + public static create(properties?: google.type.ITimeZone): google.type.TimeZone; + + /** + * Encodes the specified TimeZone message. Does not implicitly {@link google.type.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.type.ITimeZone, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeZone message, length delimited. Does not implicitly {@link google.type.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.type.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.type.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.type.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.type.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.type.TimeZone, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeZone to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimeZone + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Money. */ + interface IMoney { + + /** Money currencyCode */ + currencyCode?: (string|null); + + /** Money units */ + units?: (number|Long|string|null); + + /** Money nanos */ + nanos?: (number|null); + } + + /** Represents a Money. */ + class Money implements IMoney { + + /** + * Constructs a new Money. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IMoney); + + /** Money currencyCode. */ + public currencyCode: string; + + /** Money units. */ + public units: (number|Long|string); + + /** Money nanos. */ + public nanos: number; + + /** + * Creates a new Money instance using the specified properties. + * @param [properties] Properties to set + * @returns Money instance + */ + public static create(properties?: google.type.IMoney): google.type.Money; + + /** + * Encodes the specified Money message. Does not implicitly {@link google.type.Money.verify|verify} messages. + * @param message Money message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IMoney, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Money message, length delimited. Does not implicitly {@link google.type.Money.verify|verify} messages. + * @param message Money message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IMoney, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Money message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Money + * @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.Money; + + /** + * Decodes a Money message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Money + * @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.Money; + + /** + * Verifies a Money 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 Money message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Money + */ + public static fromObject(object: { [k: string]: any }): google.type.Money; + + /** + * Creates a plain object from a Money message. Also converts values to other types if specified. + * @param message Money + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Money, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Money to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Money + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PostalAddress. */ + interface IPostalAddress { + + /** PostalAddress revision */ + revision?: (number|null); + + /** PostalAddress regionCode */ + regionCode?: (string|null); + + /** PostalAddress languageCode */ + languageCode?: (string|null); + + /** PostalAddress postalCode */ + postalCode?: (string|null); + + /** PostalAddress sortingCode */ + sortingCode?: (string|null); + + /** PostalAddress administrativeArea */ + administrativeArea?: (string|null); + + /** PostalAddress locality */ + locality?: (string|null); + + /** PostalAddress sublocality */ + sublocality?: (string|null); + + /** PostalAddress addressLines */ + addressLines?: (string[]|null); + + /** PostalAddress recipients */ + recipients?: (string[]|null); + + /** PostalAddress organization */ + organization?: (string|null); + } + + /** Represents a PostalAddress. */ + class PostalAddress implements IPostalAddress { + + /** + * Constructs a new PostalAddress. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IPostalAddress); + + /** PostalAddress revision. */ + public revision: number; + + /** PostalAddress regionCode. */ + public regionCode: string; + + /** PostalAddress languageCode. */ + public languageCode: string; + + /** PostalAddress postalCode. */ + public postalCode: string; + + /** PostalAddress sortingCode. */ + public sortingCode: string; + + /** PostalAddress administrativeArea. */ + public administrativeArea: string; + + /** PostalAddress locality. */ + public locality: string; + + /** PostalAddress sublocality. */ + public sublocality: string; + + /** PostalAddress addressLines. */ + public addressLines: string[]; + + /** PostalAddress recipients. */ + public recipients: string[]; + + /** PostalAddress organization. */ + public organization: string; + + /** + * Creates a new PostalAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns PostalAddress instance + */ + public static create(properties?: google.type.IPostalAddress): google.type.PostalAddress; + + /** + * Encodes the specified PostalAddress message. Does not implicitly {@link google.type.PostalAddress.verify|verify} messages. + * @param message PostalAddress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IPostalAddress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PostalAddress message, length delimited. Does not implicitly {@link google.type.PostalAddress.verify|verify} messages. + * @param message PostalAddress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IPostalAddress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PostalAddress message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PostalAddress + * @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.PostalAddress; + + /** + * Decodes a PostalAddress message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PostalAddress + * @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.PostalAddress; + + /** + * Verifies a PostalAddress 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 PostalAddress message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PostalAddress + */ + public static fromObject(object: { [k: string]: any }): google.type.PostalAddress; + + /** + * Creates a plain object from a PostalAddress message. Also converts values to other types if specified. + * @param message PostalAddress + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.PostalAddress, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PostalAddress to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PostalAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Interval. */ + interface IInterval { + + /** Interval startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** Interval endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an Interval. */ + class Interval implements IInterval { + + /** + * Constructs a new Interval. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IInterval); + + /** Interval startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** Interval endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new Interval instance using the specified properties. + * @param [properties] Properties to set + * @returns Interval instance + */ + public static create(properties?: google.type.IInterval): google.type.Interval; + + /** + * Encodes the specified Interval message. Does not implicitly {@link google.type.Interval.verify|verify} messages. + * @param message Interval message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IInterval, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Interval message, length delimited. Does not implicitly {@link google.type.Interval.verify|verify} messages. + * @param message Interval message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IInterval, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Interval message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Interval + * @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.Interval; + + /** + * Decodes an Interval message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Interval + * @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.Interval; + + /** + * Verifies an Interval 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 Interval message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Interval + */ + public static fromObject(object: { [k: string]: any }): google.type.Interval; + + /** + * Creates a plain object from an Interval message. Also converts values to other types if specified. + * @param message Interval + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Interval, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Interval to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Interval + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Expr. */ + interface IExpr { + + /** Expr expression */ + expression?: (string|null); + + /** Expr title */ + title?: (string|null); + + /** Expr description */ + description?: (string|null); + + /** Expr location */ + location?: (string|null); + } + + /** Represents an Expr. */ + class Expr implements IExpr { + + /** + * Constructs a new Expr. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IExpr); + + /** Expr expression. */ + public expression: string; + + /** Expr title. */ + public title: string; + + /** Expr description. */ + public description: string; + + /** Expr location. */ + public location: string; + + /** + * Creates a new Expr instance using the specified properties. + * @param [properties] Properties to set + * @returns Expr instance + */ + public static create(properties?: google.type.IExpr): google.type.Expr; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Expr message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Expr + * @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.Expr; + + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Expr + * @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.Expr; + + /** + * Verifies an Expr 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 Expr message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Expr + */ + public static fromObject(object: { [k: string]: any }): google.type.Expr; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @param message Expr + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Expr, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Expr to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Expr + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace iam. */ + namespace iam { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of a Policy. */ + interface IPolicy { + + /** Policy version */ + version?: (number|null); + + /** Policy bindings */ + bindings?: (google.iam.v1.IBinding[]|null); + + /** Policy auditConfigs */ + auditConfigs?: (google.iam.v1.IAuditConfig[]|null); + + /** Policy etag */ + etag?: (Uint8Array|Buffer|string|null); + } + + /** Represents a Policy. */ + class Policy implements IPolicy { + + /** + * Constructs a new Policy. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IPolicy); + + /** Policy version. */ + public version: number; + + /** Policy bindings. */ + public bindings: google.iam.v1.IBinding[]; + + /** Policy auditConfigs. */ + public auditConfigs: google.iam.v1.IAuditConfig[]; + + /** Policy etag. */ + public etag: (Uint8Array|Buffer|string); + + /** + * Creates a new Policy instance using the specified properties. + * @param [properties] Properties to set + * @returns Policy instance + */ + public static create(properties?: google.iam.v1.IPolicy): google.iam.v1.Policy; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Policy + * @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.iam.v1.Policy; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Policy + * @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.iam.v1.Policy; + + /** + * Verifies a Policy 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 Policy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Policy + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.Policy; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @param message Policy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.Policy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Policy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Policy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Binding. */ + interface IBinding { + + /** Binding role */ + role?: (string|null); + + /** Binding members */ + members?: (string[]|null); + + /** Binding condition */ + condition?: (google.type.IExpr|null); + } + + /** Represents a Binding. */ + class Binding implements IBinding { + + /** + * Constructs a new Binding. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IBinding); + + /** Binding role. */ + public role: string; + + /** Binding members. */ + public members: string[]; + + /** Binding condition. */ + public condition?: (google.type.IExpr|null); + + /** + * Creates a new Binding instance using the specified properties. + * @param [properties] Properties to set + * @returns Binding instance + */ + public static create(properties?: google.iam.v1.IBinding): google.iam.v1.Binding; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Binding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Binding + * @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.iam.v1.Binding; + + /** + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Binding + * @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.iam.v1.Binding; + + /** + * Verifies a Binding 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 Binding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Binding + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.Binding; + + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @param message Binding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.Binding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Binding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Binding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuditConfig. */ + interface IAuditConfig { + + /** AuditConfig service */ + service?: (string|null); + + /** AuditConfig auditLogConfigs */ + auditLogConfigs?: (google.iam.v1.IAuditLogConfig[]|null); + } + + /** Represents an AuditConfig. */ + class AuditConfig implements IAuditConfig { + + /** + * Constructs a new AuditConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditConfig); + + /** AuditConfig service. */ + public service: string; + + /** AuditConfig auditLogConfigs. */ + public auditLogConfigs: google.iam.v1.IAuditLogConfig[]; + + /** + * Creates a new AuditConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditConfig instance + */ + public static create(properties?: google.iam.v1.IAuditConfig): google.iam.v1.AuditConfig; + + /** + * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @param message AuditConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @param message AuditConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditConfig + * @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.iam.v1.AuditConfig; + + /** + * Decodes an AuditConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditConfig + * @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.iam.v1.AuditConfig; + + /** + * Verifies an AuditConfig 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 AuditConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditConfig + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfig; + + /** + * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. + * @param message AuditConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuditLogConfig. */ + interface IAuditLogConfig { + + /** AuditLogConfig logType */ + logType?: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType|null); + + /** AuditLogConfig exemptedMembers */ + exemptedMembers?: (string[]|null); + } + + /** Represents an AuditLogConfig. */ + class AuditLogConfig implements IAuditLogConfig { + + /** + * Constructs a new AuditLogConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditLogConfig); + + /** AuditLogConfig logType. */ + public logType: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType); + + /** AuditLogConfig exemptedMembers. */ + public exemptedMembers: string[]; + + /** + * Creates a new AuditLogConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditLogConfig instance + */ + public static create(properties?: google.iam.v1.IAuditLogConfig): google.iam.v1.AuditLogConfig; + + /** + * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @param message AuditLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @param message AuditLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditLogConfig + * @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.iam.v1.AuditLogConfig; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditLogConfig + * @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.iam.v1.AuditLogConfig; + + /** + * Verifies an AuditLogConfig 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 AuditLogConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditLogConfig + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditLogConfig; + + /** + * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. + * @param message AuditLogConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditLogConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditLogConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditLogConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AuditLogConfig { + + /** LogType enum. */ + enum LogType { + LOG_TYPE_UNSPECIFIED = 0, + ADMIN_READ = 1, + DATA_WRITE = 2, + DATA_READ = 3 + } + } + + /** Properties of a PolicyDelta. */ + interface IPolicyDelta { + + /** PolicyDelta bindingDeltas */ + bindingDeltas?: (google.iam.v1.IBindingDelta[]|null); + + /** PolicyDelta auditConfigDeltas */ + auditConfigDeltas?: (google.iam.v1.IAuditConfigDelta[]|null); + } + + /** Represents a PolicyDelta. */ + class PolicyDelta implements IPolicyDelta { + + /** + * Constructs a new PolicyDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IPolicyDelta); + + /** PolicyDelta bindingDeltas. */ + public bindingDeltas: google.iam.v1.IBindingDelta[]; + + /** PolicyDelta auditConfigDeltas. */ + public auditConfigDeltas: google.iam.v1.IAuditConfigDelta[]; + + /** + * Creates a new PolicyDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns PolicyDelta instance + */ + public static create(properties?: google.iam.v1.IPolicyDelta): google.iam.v1.PolicyDelta; + + /** + * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @param message PolicyDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @param message PolicyDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PolicyDelta + * @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.iam.v1.PolicyDelta; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PolicyDelta + * @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.iam.v1.PolicyDelta; + + /** + * Verifies a PolicyDelta 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 PolicyDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PolicyDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.PolicyDelta; + + /** + * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. + * @param message PolicyDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.PolicyDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PolicyDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PolicyDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BindingDelta. */ + interface IBindingDelta { + + /** BindingDelta action */ + action?: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action|null); + + /** BindingDelta role */ + role?: (string|null); + + /** BindingDelta member */ + member?: (string|null); + + /** BindingDelta condition */ + condition?: (google.type.IExpr|null); + } + + /** Represents a BindingDelta. */ + class BindingDelta implements IBindingDelta { + + /** + * Constructs a new BindingDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IBindingDelta); + + /** BindingDelta action. */ + public action: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action); + + /** BindingDelta role. */ + public role: string; + + /** BindingDelta member. */ + public member: string; + + /** BindingDelta condition. */ + public condition?: (google.type.IExpr|null); + + /** + * Creates a new BindingDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns BindingDelta instance + */ + public static create(properties?: google.iam.v1.IBindingDelta): google.iam.v1.BindingDelta; + + /** + * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @param message BindingDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @param message BindingDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BindingDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BindingDelta + * @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.iam.v1.BindingDelta; + + /** + * Decodes a BindingDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BindingDelta + * @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.iam.v1.BindingDelta; + + /** + * Verifies a BindingDelta 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 BindingDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BindingDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.BindingDelta; + + /** + * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. + * @param message BindingDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.BindingDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BindingDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BindingDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BindingDelta { + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } + } + + /** Properties of an AuditConfigDelta. */ + interface IAuditConfigDelta { + + /** AuditConfigDelta action */ + action?: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action|null); + + /** AuditConfigDelta service */ + service?: (string|null); + + /** AuditConfigDelta exemptedMember */ + exemptedMember?: (string|null); + + /** AuditConfigDelta logType */ + logType?: (string|null); + } + + /** Represents an AuditConfigDelta. */ + class AuditConfigDelta implements IAuditConfigDelta { + + /** + * Constructs a new AuditConfigDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditConfigDelta); + + /** AuditConfigDelta action. */ + public action: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action); + + /** AuditConfigDelta service. */ + public service: string; + + /** AuditConfigDelta exemptedMember. */ + public exemptedMember: string; + + /** AuditConfigDelta logType. */ + public logType: string; + + /** + * Creates a new AuditConfigDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditConfigDelta instance + */ + public static create(properties?: google.iam.v1.IAuditConfigDelta): google.iam.v1.AuditConfigDelta; + + /** + * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @param message AuditConfigDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @param message AuditConfigDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditConfigDelta + * @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.iam.v1.AuditConfigDelta; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditConfigDelta + * @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.iam.v1.AuditConfigDelta; + + /** + * Verifies an AuditConfigDelta 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 AuditConfigDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditConfigDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfigDelta; + + /** + * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. + * @param message AuditConfigDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditConfigDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditConfigDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditConfigDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AuditConfigDelta { + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } + } + } + } + + /** Namespace longrunning. */ + namespace longrunning { + + /** Represents an Operations */ + class Operations extends $protobuf.rpc.Service { + + /** + * Constructs a new Operations 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 Operations 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): Operations; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOperationsResponse + */ + public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @returns Promise + */ + public listOperations(request: google.longrunning.IListOperationsRequest): Promise; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @returns Promise + */ + public getOperation(request: google.longrunning.IGetOperationRequest): Promise; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @returns Promise + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @returns Promise + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @returns Promise + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + } + + namespace Operations { + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @param error Error, if any + * @param [response] ListOperationsResponse + */ + type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Operation. */ + interface IOperation { + + /** Operation name */ + name?: (string|null); + + /** Operation metadata */ + metadata?: (google.protobuf.IAny|null); + + /** Operation done */ + done?: (boolean|null); + + /** Operation error */ + error?: (google.rpc.IStatus|null); + + /** Operation response */ + response?: (google.protobuf.IAny|null); + } + + /** Represents an Operation. */ + class Operation implements IOperation { + + /** + * Constructs a new Operation. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperation); + + /** Operation name. */ + public name: string; + + /** Operation metadata. */ + public metadata?: (google.protobuf.IAny|null); + + /** Operation done. */ + public done: boolean; + + /** Operation error. */ + public error?: (google.rpc.IStatus|null); + + /** Operation response. */ + public response?: (google.protobuf.IAny|null); + + /** Operation result. */ + public result?: ("error"|"response"); + + /** + * Creates a new Operation instance using the specified properties. + * @param [properties] Properties to set + * @returns Operation instance + */ + public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Operation + * @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.longrunning.Operation; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Operation + * @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.longrunning.Operation; + + /** + * Verifies an Operation 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 Operation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Operation + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @param message Operation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Operation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { + + /** GetOperationRequest name */ + name?: (string|null); + } + + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { + + /** + * Constructs a new GetOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IGetOperationRequest); + + /** GetOperationRequest name. */ + public name: string; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOperationRequest instance + */ + public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOperationRequest + * @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.longrunning.GetOperationRequest; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOperationRequest + * @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.longrunning.GetOperationRequest; + + /** + * Verifies a GetOperationRequest 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 GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @param message GetOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { + + /** ListOperationsRequest name */ + name?: (string|null); + + /** ListOperationsRequest filter */ + filter?: (string|null); + + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { + + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); + + /** ListOperationsRequest name. */ + public name: string; + + /** ListOperationsRequest filter. */ + public filter: string; + + /** ListOperationsRequest pageSize. */ + public pageSize: number; + + /** ListOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsRequest instance + */ + public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsRequest + * @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.longrunning.ListOperationsRequest; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsRequest + * @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.longrunning.ListOperationsRequest; + + /** + * Verifies a ListOperationsRequest 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 ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @param message ListOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { + + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { + + /** + * Constructs a new ListOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsResponse); + + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsResponse instance + */ + public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsResponse + * @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.longrunning.ListOperationsResponse; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsResponse + * @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.longrunning.ListOperationsResponse; + + /** + * Verifies a ListOperationsResponse 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 ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @param message ListOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { + + /** CancelOperationRequest name */ + name?: (string|null); + } + + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { + + /** + * Constructs a new CancelOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.ICancelOperationRequest); + + /** CancelOperationRequest name. */ + public name: string; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelOperationRequest instance + */ + public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelOperationRequest + * @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.longrunning.CancelOperationRequest; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelOperationRequest + * @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.longrunning.CancelOperationRequest; + + /** + * Verifies a CancelOperationRequest 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 CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @param message CancelOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { + + /** DeleteOperationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { + + /** + * Constructs a new DeleteOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IDeleteOperationRequest); + + /** DeleteOperationRequest name. */ + public name: string; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationRequest instance + */ + public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationRequest + * @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.longrunning.DeleteOperationRequest; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationRequest + * @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.longrunning.DeleteOperationRequest; + + /** + * Verifies a DeleteOperationRequest 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 DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @param message DeleteOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { + + /** WaitOperationRequest name */ + name?: (string|null); + + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { + + /** + * Constructs a new WaitOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IWaitOperationRequest); + + /** WaitOperationRequest name. */ + public name: string; + + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitOperationRequest instance + */ + public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitOperationRequest + * @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.longrunning.WaitOperationRequest; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitOperationRequest + * @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.longrunning.WaitOperationRequest; + + /** + * Verifies a WaitOperationRequest 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 WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @param message WaitOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WaitOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WaitOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationInfo. */ + interface IOperationInfo { + + /** OperationInfo responseType */ + responseType?: (string|null); + + /** OperationInfo metadataType */ + metadataType?: (string|null); + } + + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { + + /** + * Constructs a new OperationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperationInfo); + + /** OperationInfo responseType. */ + public responseType: string; + + /** OperationInfo metadataType. */ + public metadataType: string; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationInfo instance + */ + public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationInfo + * @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.longrunning.OperationInfo; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationInfo + * @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.longrunning.OperationInfo; + + /** + * Verifies an OperationInfo 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 OperationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationInfo + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @param message OperationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/protos.js b/owl-bot-staging/google-cloud-contentwarehouse/protos/protos.js new file mode 100644 index 00000000000..e7b4bd21f14 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/protos/protos.js @@ -0,0 +1,78298 @@ +// Copyright 2026 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/build/src/protobuf").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_contentwarehouse_protos || ($protobuf.roots._google_cloud_contentwarehouse_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.contentwarehouse = (function() { + + /** + * Namespace contentwarehouse. + * @memberof google.cloud + * @namespace + */ + var contentwarehouse = {}; + + contentwarehouse.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.contentwarehouse + * @namespace + */ + var v1 = {}; + + v1.CreateDocumentMetadata = (function() { + + /** + * Properties of a CreateDocumentMetadata. + * @memberof google.cloud.contentwarehouse.v1 + * @interface ICreateDocumentMetadata + */ + + /** + * Constructs a new CreateDocumentMetadata. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a CreateDocumentMetadata. + * @implements ICreateDocumentMetadata + * @constructor + * @param {google.cloud.contentwarehouse.v1.ICreateDocumentMetadata=} [properties] Properties to set + */ + function CreateDocumentMetadata(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 CreateDocumentMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentMetadata + * @static + * @param {google.cloud.contentwarehouse.v1.ICreateDocumentMetadata=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.CreateDocumentMetadata} CreateDocumentMetadata instance + */ + CreateDocumentMetadata.create = function create(properties) { + return new CreateDocumentMetadata(properties); + }; + + /** + * Encodes the specified CreateDocumentMetadata message. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateDocumentMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentMetadata + * @static + * @param {google.cloud.contentwarehouse.v1.ICreateDocumentMetadata} message CreateDocumentMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDocumentMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified CreateDocumentMetadata message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateDocumentMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentMetadata + * @static + * @param {google.cloud.contentwarehouse.v1.ICreateDocumentMetadata} message CreateDocumentMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDocumentMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateDocumentMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.CreateDocumentMetadata} CreateDocumentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDocumentMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.CreateDocumentMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateDocumentMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.CreateDocumentMetadata} CreateDocumentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDocumentMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateDocumentMetadata message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateDocumentMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a CreateDocumentMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.CreateDocumentMetadata} CreateDocumentMetadata + */ + CreateDocumentMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.CreateDocumentMetadata) + return object; + return new $root.google.cloud.contentwarehouse.v1.CreateDocumentMetadata(); + }; + + /** + * Creates a plain object from a CreateDocumentMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentMetadata + * @static + * @param {google.cloud.contentwarehouse.v1.CreateDocumentMetadata} message CreateDocumentMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateDocumentMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this CreateDocumentMetadata to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateDocumentMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateDocumentMetadata + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateDocumentMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.CreateDocumentMetadata"; + }; + + return CreateDocumentMetadata; + })(); + + v1.UpdateDocumentMetadata = (function() { + + /** + * Properties of an UpdateDocumentMetadata. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IUpdateDocumentMetadata + */ + + /** + * Constructs a new UpdateDocumentMetadata. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents an UpdateDocumentMetadata. + * @implements IUpdateDocumentMetadata + * @constructor + * @param {google.cloud.contentwarehouse.v1.IUpdateDocumentMetadata=} [properties] Properties to set + */ + function UpdateDocumentMetadata(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 UpdateDocumentMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentMetadata + * @static + * @param {google.cloud.contentwarehouse.v1.IUpdateDocumentMetadata=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.UpdateDocumentMetadata} UpdateDocumentMetadata instance + */ + UpdateDocumentMetadata.create = function create(properties) { + return new UpdateDocumentMetadata(properties); + }; + + /** + * Encodes the specified UpdateDocumentMetadata message. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateDocumentMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentMetadata + * @static + * @param {google.cloud.contentwarehouse.v1.IUpdateDocumentMetadata} message UpdateDocumentMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDocumentMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified UpdateDocumentMetadata message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateDocumentMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentMetadata + * @static + * @param {google.cloud.contentwarehouse.v1.IUpdateDocumentMetadata} message UpdateDocumentMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDocumentMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDocumentMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.UpdateDocumentMetadata} UpdateDocumentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDocumentMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.UpdateDocumentMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateDocumentMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.UpdateDocumentMetadata} UpdateDocumentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDocumentMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDocumentMetadata message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDocumentMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an UpdateDocumentMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.UpdateDocumentMetadata} UpdateDocumentMetadata + */ + UpdateDocumentMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.UpdateDocumentMetadata) + return object; + return new $root.google.cloud.contentwarehouse.v1.UpdateDocumentMetadata(); + }; + + /** + * Creates a plain object from an UpdateDocumentMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentMetadata + * @static + * @param {google.cloud.contentwarehouse.v1.UpdateDocumentMetadata} message UpdateDocumentMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDocumentMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this UpdateDocumentMetadata to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentMetadata + * @instance + * @returns {Object.} JSON object + */ + UpdateDocumentMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateDocumentMetadata + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateDocumentMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.UpdateDocumentMetadata"; + }; + + return UpdateDocumentMetadata; + })(); + + v1.RequestMetadata = (function() { + + /** + * Properties of a RequestMetadata. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IRequestMetadata + * @property {google.cloud.contentwarehouse.v1.IUserInfo|null} [userInfo] RequestMetadata userInfo + */ + + /** + * Constructs a new RequestMetadata. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a RequestMetadata. + * @implements IRequestMetadata + * @constructor + * @param {google.cloud.contentwarehouse.v1.IRequestMetadata=} [properties] Properties to set + */ + function RequestMetadata(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]]; + } + + /** + * RequestMetadata userInfo. + * @member {google.cloud.contentwarehouse.v1.IUserInfo|null|undefined} userInfo + * @memberof google.cloud.contentwarehouse.v1.RequestMetadata + * @instance + */ + RequestMetadata.prototype.userInfo = null; + + /** + * Creates a new RequestMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.RequestMetadata + * @static + * @param {google.cloud.contentwarehouse.v1.IRequestMetadata=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.RequestMetadata} RequestMetadata instance + */ + RequestMetadata.create = function create(properties) { + return new RequestMetadata(properties); + }; + + /** + * Encodes the specified RequestMetadata message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RequestMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.RequestMetadata + * @static + * @param {google.cloud.contentwarehouse.v1.IRequestMetadata} message RequestMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.userInfo != null && Object.hasOwnProperty.call(message, "userInfo")) + $root.google.cloud.contentwarehouse.v1.UserInfo.encode(message.userInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RequestMetadata message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RequestMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.RequestMetadata + * @static + * @param {google.cloud.contentwarehouse.v1.IRequestMetadata} message RequestMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.RequestMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.RequestMetadata} RequestMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.RequestMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.userInfo = $root.google.cloud.contentwarehouse.v1.UserInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.RequestMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.RequestMetadata} RequestMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestMetadata message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.RequestMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.userInfo != null && message.hasOwnProperty("userInfo")) { + var error = $root.google.cloud.contentwarehouse.v1.UserInfo.verify(message.userInfo); + if (error) + return "userInfo." + error; + } + return null; + }; + + /** + * Creates a RequestMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.RequestMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.RequestMetadata} RequestMetadata + */ + RequestMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.RequestMetadata) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.RequestMetadata(); + if (object.userInfo != null) { + if (typeof object.userInfo !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.RequestMetadata.userInfo: object expected"); + message.userInfo = $root.google.cloud.contentwarehouse.v1.UserInfo.fromObject(object.userInfo); + } + return message; + }; + + /** + * Creates a plain object from a RequestMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.RequestMetadata + * @static + * @param {google.cloud.contentwarehouse.v1.RequestMetadata} message RequestMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.userInfo = null; + if (message.userInfo != null && message.hasOwnProperty("userInfo")) + object.userInfo = $root.google.cloud.contentwarehouse.v1.UserInfo.toObject(message.userInfo, options); + return object; + }; + + /** + * Converts this RequestMetadata to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.RequestMetadata + * @instance + * @returns {Object.} JSON object + */ + RequestMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RequestMetadata + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.RequestMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RequestMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.RequestMetadata"; + }; + + return RequestMetadata; + })(); + + v1.ResponseMetadata = (function() { + + /** + * Properties of a ResponseMetadata. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IResponseMetadata + * @property {string|null} [requestId] ResponseMetadata requestId + */ + + /** + * Constructs a new ResponseMetadata. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a ResponseMetadata. + * @implements IResponseMetadata + * @constructor + * @param {google.cloud.contentwarehouse.v1.IResponseMetadata=} [properties] Properties to set + */ + function ResponseMetadata(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]]; + } + + /** + * ResponseMetadata requestId. + * @member {string} requestId + * @memberof google.cloud.contentwarehouse.v1.ResponseMetadata + * @instance + */ + ResponseMetadata.prototype.requestId = ""; + + /** + * Creates a new ResponseMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.ResponseMetadata + * @static + * @param {google.cloud.contentwarehouse.v1.IResponseMetadata=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.ResponseMetadata} ResponseMetadata instance + */ + ResponseMetadata.create = function create(properties) { + return new ResponseMetadata(properties); + }; + + /** + * Encodes the specified ResponseMetadata message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ResponseMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.ResponseMetadata + * @static + * @param {google.cloud.contentwarehouse.v1.IResponseMetadata} message ResponseMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified ResponseMetadata message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ResponseMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.ResponseMetadata + * @static + * @param {google.cloud.contentwarehouse.v1.IResponseMetadata} message ResponseMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.ResponseMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.ResponseMetadata} ResponseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.ResponseMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.ResponseMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.ResponseMetadata} ResponseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseMetadata message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.ResponseMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a ResponseMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.ResponseMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.ResponseMetadata} ResponseMetadata + */ + ResponseMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.ResponseMetadata) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.ResponseMetadata(); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a ResponseMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.ResponseMetadata + * @static + * @param {google.cloud.contentwarehouse.v1.ResponseMetadata} message ResponseMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.requestId = ""; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this ResponseMetadata to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.ResponseMetadata + * @instance + * @returns {Object.} JSON object + */ + ResponseMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResponseMetadata + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.ResponseMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResponseMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.ResponseMetadata"; + }; + + return ResponseMetadata; + })(); + + v1.UserInfo = (function() { + + /** + * Properties of a UserInfo. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IUserInfo + * @property {string|null} [id] UserInfo id + * @property {Array.|null} [groupIds] UserInfo groupIds + */ + + /** + * Constructs a new UserInfo. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a UserInfo. + * @implements IUserInfo + * @constructor + * @param {google.cloud.contentwarehouse.v1.IUserInfo=} [properties] Properties to set + */ + function UserInfo(properties) { + this.groupIds = []; + 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]]; + } + + /** + * UserInfo id. + * @member {string} id + * @memberof google.cloud.contentwarehouse.v1.UserInfo + * @instance + */ + UserInfo.prototype.id = ""; + + /** + * UserInfo groupIds. + * @member {Array.} groupIds + * @memberof google.cloud.contentwarehouse.v1.UserInfo + * @instance + */ + UserInfo.prototype.groupIds = $util.emptyArray; + + /** + * Creates a new UserInfo instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.UserInfo + * @static + * @param {google.cloud.contentwarehouse.v1.IUserInfo=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.UserInfo} UserInfo instance + */ + UserInfo.create = function create(properties) { + return new UserInfo(properties); + }; + + /** + * Encodes the specified UserInfo message. Does not implicitly {@link google.cloud.contentwarehouse.v1.UserInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.UserInfo + * @static + * @param {google.cloud.contentwarehouse.v1.IUserInfo} message UserInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.groupIds != null && message.groupIds.length) + for (var i = 0; i < message.groupIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.groupIds[i]); + return writer; + }; + + /** + * Encodes the specified UserInfo message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.UserInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.UserInfo + * @static + * @param {google.cloud.contentwarehouse.v1.IUserInfo} message UserInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UserInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.UserInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.UserInfo} UserInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.UserInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + if (!(message.groupIds && message.groupIds.length)) + message.groupIds = []; + message.groupIds.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UserInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.UserInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.UserInfo} UserInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UserInfo message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.UserInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UserInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.groupIds != null && message.hasOwnProperty("groupIds")) { + if (!Array.isArray(message.groupIds)) + return "groupIds: array expected"; + for (var i = 0; i < message.groupIds.length; ++i) + if (!$util.isString(message.groupIds[i])) + return "groupIds: string[] expected"; + } + return null; + }; + + /** + * Creates a UserInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.UserInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.UserInfo} UserInfo + */ + UserInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.UserInfo) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.UserInfo(); + if (object.id != null) + message.id = String(object.id); + if (object.groupIds) { + if (!Array.isArray(object.groupIds)) + throw TypeError(".google.cloud.contentwarehouse.v1.UserInfo.groupIds: array expected"); + message.groupIds = []; + for (var i = 0; i < object.groupIds.length; ++i) + message.groupIds[i] = String(object.groupIds[i]); + } + return message; + }; + + /** + * Creates a plain object from a UserInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.UserInfo + * @static + * @param {google.cloud.contentwarehouse.v1.UserInfo} message UserInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UserInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.groupIds = []; + if (options.defaults) + object.id = ""; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.groupIds && message.groupIds.length) { + object.groupIds = []; + for (var j = 0; j < message.groupIds.length; ++j) + object.groupIds[j] = message.groupIds[j]; + } + return object; + }; + + /** + * Converts this UserInfo to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.UserInfo + * @instance + * @returns {Object.} JSON object + */ + UserInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UserInfo + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.UserInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UserInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.UserInfo"; + }; + + return UserInfo; + })(); + + v1.UpdateOptions = (function() { + + /** + * Properties of an UpdateOptions. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IUpdateOptions + * @property {google.cloud.contentwarehouse.v1.UpdateType|null} [updateType] UpdateOptions updateType + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateOptions updateMask + * @property {google.cloud.contentwarehouse.v1.IMergeFieldsOptions|null} [mergeFieldsOptions] UpdateOptions mergeFieldsOptions + */ + + /** + * Constructs a new UpdateOptions. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents an UpdateOptions. + * @implements IUpdateOptions + * @constructor + * @param {google.cloud.contentwarehouse.v1.IUpdateOptions=} [properties] Properties to set + */ + function UpdateOptions(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]]; + } + + /** + * UpdateOptions updateType. + * @member {google.cloud.contentwarehouse.v1.UpdateType} updateType + * @memberof google.cloud.contentwarehouse.v1.UpdateOptions + * @instance + */ + UpdateOptions.prototype.updateType = 0; + + /** + * UpdateOptions updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.contentwarehouse.v1.UpdateOptions + * @instance + */ + UpdateOptions.prototype.updateMask = null; + + /** + * UpdateOptions mergeFieldsOptions. + * @member {google.cloud.contentwarehouse.v1.IMergeFieldsOptions|null|undefined} mergeFieldsOptions + * @memberof google.cloud.contentwarehouse.v1.UpdateOptions + * @instance + */ + UpdateOptions.prototype.mergeFieldsOptions = null; + + /** + * Creates a new UpdateOptions instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.UpdateOptions + * @static + * @param {google.cloud.contentwarehouse.v1.IUpdateOptions=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.UpdateOptions} UpdateOptions instance + */ + UpdateOptions.create = function create(properties) { + return new UpdateOptions(properties); + }; + + /** + * Encodes the specified UpdateOptions message. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.UpdateOptions + * @static + * @param {google.cloud.contentwarehouse.v1.IUpdateOptions} message UpdateOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateType != null && Object.hasOwnProperty.call(message, "updateType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.updateType); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.mergeFieldsOptions != null && Object.hasOwnProperty.call(message, "mergeFieldsOptions")) + $root.google.cloud.contentwarehouse.v1.MergeFieldsOptions.encode(message.mergeFieldsOptions, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateOptions message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.UpdateOptions + * @static + * @param {google.cloud.contentwarehouse.v1.IUpdateOptions} message UpdateOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.UpdateOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.UpdateOptions} UpdateOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.UpdateOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.updateType = reader.int32(); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.mergeFieldsOptions = $root.google.cloud.contentwarehouse.v1.MergeFieldsOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.UpdateOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.UpdateOptions} UpdateOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateOptions message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.UpdateOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateType != null && message.hasOwnProperty("updateType")) + switch (message.updateType) { + default: + return "updateType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.mergeFieldsOptions != null && message.hasOwnProperty("mergeFieldsOptions")) { + var error = $root.google.cloud.contentwarehouse.v1.MergeFieldsOptions.verify(message.mergeFieldsOptions); + if (error) + return "mergeFieldsOptions." + error; + } + return null; + }; + + /** + * Creates an UpdateOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.UpdateOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.UpdateOptions} UpdateOptions + */ + UpdateOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.UpdateOptions) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.UpdateOptions(); + switch (object.updateType) { + default: + if (typeof object.updateType === "number") { + message.updateType = object.updateType; + break; + } + break; + case "UPDATE_TYPE_UNSPECIFIED": + case 0: + message.updateType = 0; + break; + case "UPDATE_TYPE_REPLACE": + case 1: + message.updateType = 1; + break; + case "UPDATE_TYPE_MERGE": + case 2: + message.updateType = 2; + break; + case "UPDATE_TYPE_INSERT_PROPERTIES_BY_NAMES": + case 3: + message.updateType = 3; + break; + case "UPDATE_TYPE_REPLACE_PROPERTIES_BY_NAMES": + case 4: + message.updateType = 4; + break; + case "UPDATE_TYPE_DELETE_PROPERTIES_BY_NAMES": + case 5: + message.updateType = 5; + break; + case "UPDATE_TYPE_MERGE_AND_REPLACE_OR_INSERT_PROPERTIES_BY_NAMES": + case 6: + message.updateType = 6; + break; + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.UpdateOptions.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.mergeFieldsOptions != null) { + if (typeof object.mergeFieldsOptions !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.UpdateOptions.mergeFieldsOptions: object expected"); + message.mergeFieldsOptions = $root.google.cloud.contentwarehouse.v1.MergeFieldsOptions.fromObject(object.mergeFieldsOptions); + } + return message; + }; + + /** + * Creates a plain object from an UpdateOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.UpdateOptions + * @static + * @param {google.cloud.contentwarehouse.v1.UpdateOptions} message UpdateOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateType = options.enums === String ? "UPDATE_TYPE_UNSPECIFIED" : 0; + object.updateMask = null; + object.mergeFieldsOptions = null; + } + if (message.updateType != null && message.hasOwnProperty("updateType")) + object.updateType = options.enums === String ? $root.google.cloud.contentwarehouse.v1.UpdateType[message.updateType] === undefined ? message.updateType : $root.google.cloud.contentwarehouse.v1.UpdateType[message.updateType] : message.updateType; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.mergeFieldsOptions != null && message.hasOwnProperty("mergeFieldsOptions")) + object.mergeFieldsOptions = $root.google.cloud.contentwarehouse.v1.MergeFieldsOptions.toObject(message.mergeFieldsOptions, options); + return object; + }; + + /** + * Converts this UpdateOptions to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.UpdateOptions + * @instance + * @returns {Object.} JSON object + */ + UpdateOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateOptions + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.UpdateOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.UpdateOptions"; + }; + + return UpdateOptions; + })(); + + v1.MergeFieldsOptions = (function() { + + /** + * Properties of a MergeFieldsOptions. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IMergeFieldsOptions + * @property {boolean|null} [replaceMessageFields] MergeFieldsOptions replaceMessageFields + * @property {boolean|null} [replaceRepeatedFields] MergeFieldsOptions replaceRepeatedFields + */ + + /** + * Constructs a new MergeFieldsOptions. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a MergeFieldsOptions. + * @implements IMergeFieldsOptions + * @constructor + * @param {google.cloud.contentwarehouse.v1.IMergeFieldsOptions=} [properties] Properties to set + */ + function MergeFieldsOptions(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]]; + } + + /** + * MergeFieldsOptions replaceMessageFields. + * @member {boolean|null|undefined} replaceMessageFields + * @memberof google.cloud.contentwarehouse.v1.MergeFieldsOptions + * @instance + */ + MergeFieldsOptions.prototype.replaceMessageFields = null; + + /** + * MergeFieldsOptions replaceRepeatedFields. + * @member {boolean|null|undefined} replaceRepeatedFields + * @memberof google.cloud.contentwarehouse.v1.MergeFieldsOptions + * @instance + */ + MergeFieldsOptions.prototype.replaceRepeatedFields = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MergeFieldsOptions.prototype, "_replaceMessageFields", { + get: $util.oneOfGetter($oneOfFields = ["replaceMessageFields"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MergeFieldsOptions.prototype, "_replaceRepeatedFields", { + get: $util.oneOfGetter($oneOfFields = ["replaceRepeatedFields"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new MergeFieldsOptions instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.MergeFieldsOptions + * @static + * @param {google.cloud.contentwarehouse.v1.IMergeFieldsOptions=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.MergeFieldsOptions} MergeFieldsOptions instance + */ + MergeFieldsOptions.create = function create(properties) { + return new MergeFieldsOptions(properties); + }; + + /** + * Encodes the specified MergeFieldsOptions message. Does not implicitly {@link google.cloud.contentwarehouse.v1.MergeFieldsOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.MergeFieldsOptions + * @static + * @param {google.cloud.contentwarehouse.v1.IMergeFieldsOptions} message MergeFieldsOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MergeFieldsOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.replaceMessageFields != null && Object.hasOwnProperty.call(message, "replaceMessageFields")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.replaceMessageFields); + if (message.replaceRepeatedFields != null && Object.hasOwnProperty.call(message, "replaceRepeatedFields")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.replaceRepeatedFields); + return writer; + }; + + /** + * Encodes the specified MergeFieldsOptions message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.MergeFieldsOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.MergeFieldsOptions + * @static + * @param {google.cloud.contentwarehouse.v1.IMergeFieldsOptions} message MergeFieldsOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MergeFieldsOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MergeFieldsOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.MergeFieldsOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.MergeFieldsOptions} MergeFieldsOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MergeFieldsOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.MergeFieldsOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.replaceMessageFields = reader.bool(); + break; + } + case 2: { + message.replaceRepeatedFields = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MergeFieldsOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.MergeFieldsOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.MergeFieldsOptions} MergeFieldsOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MergeFieldsOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MergeFieldsOptions message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.MergeFieldsOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MergeFieldsOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.replaceMessageFields != null && message.hasOwnProperty("replaceMessageFields")) { + properties._replaceMessageFields = 1; + if (typeof message.replaceMessageFields !== "boolean") + return "replaceMessageFields: boolean expected"; + } + if (message.replaceRepeatedFields != null && message.hasOwnProperty("replaceRepeatedFields")) { + properties._replaceRepeatedFields = 1; + if (typeof message.replaceRepeatedFields !== "boolean") + return "replaceRepeatedFields: boolean expected"; + } + return null; + }; + + /** + * Creates a MergeFieldsOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.MergeFieldsOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.MergeFieldsOptions} MergeFieldsOptions + */ + MergeFieldsOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.MergeFieldsOptions) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.MergeFieldsOptions(); + if (object.replaceMessageFields != null) + message.replaceMessageFields = Boolean(object.replaceMessageFields); + if (object.replaceRepeatedFields != null) + message.replaceRepeatedFields = Boolean(object.replaceRepeatedFields); + return message; + }; + + /** + * Creates a plain object from a MergeFieldsOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.MergeFieldsOptions + * @static + * @param {google.cloud.contentwarehouse.v1.MergeFieldsOptions} message MergeFieldsOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MergeFieldsOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.replaceMessageFields != null && message.hasOwnProperty("replaceMessageFields")) { + object.replaceMessageFields = message.replaceMessageFields; + if (options.oneofs) + object._replaceMessageFields = "replaceMessageFields"; + } + if (message.replaceRepeatedFields != null && message.hasOwnProperty("replaceRepeatedFields")) { + object.replaceRepeatedFields = message.replaceRepeatedFields; + if (options.oneofs) + object._replaceRepeatedFields = "replaceRepeatedFields"; + } + return object; + }; + + /** + * Converts this MergeFieldsOptions to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.MergeFieldsOptions + * @instance + * @returns {Object.} JSON object + */ + MergeFieldsOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MergeFieldsOptions + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.MergeFieldsOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MergeFieldsOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.MergeFieldsOptions"; + }; + + return MergeFieldsOptions; + })(); + + /** + * UpdateType enum. + * @name google.cloud.contentwarehouse.v1.UpdateType + * @enum {number} + * @property {number} UPDATE_TYPE_UNSPECIFIED=0 UPDATE_TYPE_UNSPECIFIED value + * @property {number} UPDATE_TYPE_REPLACE=1 UPDATE_TYPE_REPLACE value + * @property {number} UPDATE_TYPE_MERGE=2 UPDATE_TYPE_MERGE value + * @property {number} UPDATE_TYPE_INSERT_PROPERTIES_BY_NAMES=3 UPDATE_TYPE_INSERT_PROPERTIES_BY_NAMES value + * @property {number} UPDATE_TYPE_REPLACE_PROPERTIES_BY_NAMES=4 UPDATE_TYPE_REPLACE_PROPERTIES_BY_NAMES value + * @property {number} UPDATE_TYPE_DELETE_PROPERTIES_BY_NAMES=5 UPDATE_TYPE_DELETE_PROPERTIES_BY_NAMES value + * @property {number} UPDATE_TYPE_MERGE_AND_REPLACE_OR_INSERT_PROPERTIES_BY_NAMES=6 UPDATE_TYPE_MERGE_AND_REPLACE_OR_INSERT_PROPERTIES_BY_NAMES value + */ + v1.UpdateType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UPDATE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "UPDATE_TYPE_REPLACE"] = 1; + values[valuesById[2] = "UPDATE_TYPE_MERGE"] = 2; + values[valuesById[3] = "UPDATE_TYPE_INSERT_PROPERTIES_BY_NAMES"] = 3; + values[valuesById[4] = "UPDATE_TYPE_REPLACE_PROPERTIES_BY_NAMES"] = 4; + values[valuesById[5] = "UPDATE_TYPE_DELETE_PROPERTIES_BY_NAMES"] = 5; + values[valuesById[6] = "UPDATE_TYPE_MERGE_AND_REPLACE_OR_INSERT_PROPERTIES_BY_NAMES"] = 6; + return values; + })(); + + /** + * DatabaseType enum. + * @name google.cloud.contentwarehouse.v1.DatabaseType + * @enum {number} + * @property {number} DB_UNKNOWN=0 DB_UNKNOWN value + * @property {number} DB_INFRA_SPANNER=1 DB_INFRA_SPANNER value + * @property {number} DB_CLOUD_SQL_POSTGRES=2 DB_CLOUD_SQL_POSTGRES value + */ + v1.DatabaseType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DB_UNKNOWN"] = 0; + values[valuesById[1] = "DB_INFRA_SPANNER"] = 1; + values[valuesById[2] = "DB_CLOUD_SQL_POSTGRES"] = 2; + return values; + })(); + + /** + * AccessControlMode enum. + * @name google.cloud.contentwarehouse.v1.AccessControlMode + * @enum {number} + * @property {number} ACL_MODE_UNKNOWN=0 ACL_MODE_UNKNOWN value + * @property {number} ACL_MODE_UNIVERSAL_ACCESS=1 ACL_MODE_UNIVERSAL_ACCESS value + * @property {number} ACL_MODE_DOCUMENT_LEVEL_ACCESS_CONTROL_BYOID=2 ACL_MODE_DOCUMENT_LEVEL_ACCESS_CONTROL_BYOID value + * @property {number} ACL_MODE_DOCUMENT_LEVEL_ACCESS_CONTROL_GCI=3 ACL_MODE_DOCUMENT_LEVEL_ACCESS_CONTROL_GCI value + */ + v1.AccessControlMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACL_MODE_UNKNOWN"] = 0; + values[valuesById[1] = "ACL_MODE_UNIVERSAL_ACCESS"] = 1; + values[valuesById[2] = "ACL_MODE_DOCUMENT_LEVEL_ACCESS_CONTROL_BYOID"] = 2; + values[valuesById[3] = "ACL_MODE_DOCUMENT_LEVEL_ACCESS_CONTROL_GCI"] = 3; + return values; + })(); + + /** + * DocumentCreatorDefaultRole enum. + * @name google.cloud.contentwarehouse.v1.DocumentCreatorDefaultRole + * @enum {number} + * @property {number} DOCUMENT_CREATOR_DEFAULT_ROLE_UNSPECIFIED=0 DOCUMENT_CREATOR_DEFAULT_ROLE_UNSPECIFIED value + * @property {number} DOCUMENT_ADMIN=1 DOCUMENT_ADMIN value + * @property {number} DOCUMENT_EDITOR=2 DOCUMENT_EDITOR value + * @property {number} DOCUMENT_VIEWER=3 DOCUMENT_VIEWER value + */ + v1.DocumentCreatorDefaultRole = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DOCUMENT_CREATOR_DEFAULT_ROLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DOCUMENT_ADMIN"] = 1; + values[valuesById[2] = "DOCUMENT_EDITOR"] = 2; + values[valuesById[3] = "DOCUMENT_VIEWER"] = 3; + return values; + })(); + + v1.Document = (function() { + + /** + * Properties of a Document. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IDocument + * @property {string|null} [name] Document name + * @property {string|null} [referenceId] Document referenceId + * @property {string|null} [displayName] Document displayName + * @property {string|null} [title] Document title + * @property {string|null} [displayUri] Document displayUri + * @property {string|null} [documentSchemaName] Document documentSchemaName + * @property {string|null} [plainText] Document plainText + * @property {google.cloud.documentai.v1.IDocument|null} [cloudAiDocument] Document cloudAiDocument + * @property {string|null} [structuredContentUri] Document structuredContentUri + * @property {string|null} [rawDocumentPath] Document rawDocumentPath + * @property {Uint8Array|null} [inlineRawDocument] Document inlineRawDocument + * @property {Array.|null} [properties] Document properties + * @property {google.protobuf.ITimestamp|null} [updateTime] Document updateTime + * @property {google.protobuf.ITimestamp|null} [createTime] Document createTime + * @property {google.cloud.contentwarehouse.v1.RawDocumentFileType|null} [rawDocumentFileType] Document rawDocumentFileType + * @property {boolean|null} [asyncEnabled] Document asyncEnabled + * @property {google.cloud.contentwarehouse.v1.ContentCategory|null} [contentCategory] Document contentCategory + * @property {boolean|null} [textExtractionDisabled] Document textExtractionDisabled + * @property {boolean|null} [textExtractionEnabled] Document textExtractionEnabled + * @property {string|null} [creator] Document creator + * @property {string|null} [updater] Document updater + * @property {google.protobuf.ITimestamp|null} [dispositionTime] Document dispositionTime + * @property {boolean|null} [legalHold] Document legalHold + */ + + /** + * Constructs a new Document. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a Document. + * @implements IDocument + * @constructor + * @param {google.cloud.contentwarehouse.v1.IDocument=} [properties] Properties to set + */ + function Document(properties) { + this.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]]; + } + + /** + * Document name. + * @member {string} name + * @memberof google.cloud.contentwarehouse.v1.Document + * @instance + */ + Document.prototype.name = ""; + + /** + * Document referenceId. + * @member {string} referenceId + * @memberof google.cloud.contentwarehouse.v1.Document + * @instance + */ + Document.prototype.referenceId = ""; + + /** + * Document displayName. + * @member {string} displayName + * @memberof google.cloud.contentwarehouse.v1.Document + * @instance + */ + Document.prototype.displayName = ""; + + /** + * Document title. + * @member {string} title + * @memberof google.cloud.contentwarehouse.v1.Document + * @instance + */ + Document.prototype.title = ""; + + /** + * Document displayUri. + * @member {string} displayUri + * @memberof google.cloud.contentwarehouse.v1.Document + * @instance + */ + Document.prototype.displayUri = ""; + + /** + * Document documentSchemaName. + * @member {string} documentSchemaName + * @memberof google.cloud.contentwarehouse.v1.Document + * @instance + */ + Document.prototype.documentSchemaName = ""; + + /** + * Document plainText. + * @member {string|null|undefined} plainText + * @memberof google.cloud.contentwarehouse.v1.Document + * @instance + */ + Document.prototype.plainText = null; + + /** + * Document cloudAiDocument. + * @member {google.cloud.documentai.v1.IDocument|null|undefined} cloudAiDocument + * @memberof google.cloud.contentwarehouse.v1.Document + * @instance + */ + Document.prototype.cloudAiDocument = null; + + /** + * Document structuredContentUri. + * @member {string} structuredContentUri + * @memberof google.cloud.contentwarehouse.v1.Document + * @instance + */ + Document.prototype.structuredContentUri = ""; + + /** + * Document rawDocumentPath. + * @member {string|null|undefined} rawDocumentPath + * @memberof google.cloud.contentwarehouse.v1.Document + * @instance + */ + Document.prototype.rawDocumentPath = null; + + /** + * Document inlineRawDocument. + * @member {Uint8Array|null|undefined} inlineRawDocument + * @memberof google.cloud.contentwarehouse.v1.Document + * @instance + */ + Document.prototype.inlineRawDocument = null; + + /** + * Document properties. + * @member {Array.} properties + * @memberof google.cloud.contentwarehouse.v1.Document + * @instance + */ + Document.prototype.properties = $util.emptyArray; + + /** + * Document updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.contentwarehouse.v1.Document + * @instance + */ + Document.prototype.updateTime = null; + + /** + * Document createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.contentwarehouse.v1.Document + * @instance + */ + Document.prototype.createTime = null; + + /** + * Document rawDocumentFileType. + * @member {google.cloud.contentwarehouse.v1.RawDocumentFileType} rawDocumentFileType + * @memberof google.cloud.contentwarehouse.v1.Document + * @instance + */ + Document.prototype.rawDocumentFileType = 0; + + /** + * Document asyncEnabled. + * @member {boolean} asyncEnabled + * @memberof google.cloud.contentwarehouse.v1.Document + * @instance + */ + Document.prototype.asyncEnabled = false; + + /** + * Document contentCategory. + * @member {google.cloud.contentwarehouse.v1.ContentCategory} contentCategory + * @memberof google.cloud.contentwarehouse.v1.Document + * @instance + */ + Document.prototype.contentCategory = 0; + + /** + * Document textExtractionDisabled. + * @member {boolean} textExtractionDisabled + * @memberof google.cloud.contentwarehouse.v1.Document + * @instance + */ + Document.prototype.textExtractionDisabled = false; + + /** + * Document textExtractionEnabled. + * @member {boolean} textExtractionEnabled + * @memberof google.cloud.contentwarehouse.v1.Document + * @instance + */ + Document.prototype.textExtractionEnabled = false; + + /** + * Document creator. + * @member {string} creator + * @memberof google.cloud.contentwarehouse.v1.Document + * @instance + */ + Document.prototype.creator = ""; + + /** + * Document updater. + * @member {string} updater + * @memberof google.cloud.contentwarehouse.v1.Document + * @instance + */ + Document.prototype.updater = ""; + + /** + * Document dispositionTime. + * @member {google.protobuf.ITimestamp|null|undefined} dispositionTime + * @memberof google.cloud.contentwarehouse.v1.Document + * @instance + */ + Document.prototype.dispositionTime = null; + + /** + * Document legalHold. + * @member {boolean} legalHold + * @memberof google.cloud.contentwarehouse.v1.Document + * @instance + */ + Document.prototype.legalHold = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Document structuredContent. + * @member {"plainText"|"cloudAiDocument"|undefined} structuredContent + * @memberof google.cloud.contentwarehouse.v1.Document + * @instance + */ + Object.defineProperty(Document.prototype, "structuredContent", { + get: $util.oneOfGetter($oneOfFields = ["plainText", "cloudAiDocument"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Document rawDocument. + * @member {"rawDocumentPath"|"inlineRawDocument"|undefined} rawDocument + * @memberof google.cloud.contentwarehouse.v1.Document + * @instance + */ + Object.defineProperty(Document.prototype, "rawDocument", { + get: $util.oneOfGetter($oneOfFields = ["rawDocumentPath", "inlineRawDocument"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Document instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.Document + * @static + * @param {google.cloud.contentwarehouse.v1.IDocument=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.Document} Document instance + */ + Document.create = function create(properties) { + return new Document(properties); + }; + + /** + * Encodes the specified Document message. Does not implicitly {@link google.cloud.contentwarehouse.v1.Document.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.Document + * @static + * @param {google.cloud.contentwarehouse.v1.IDocument} message Document message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Document.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.documentSchemaName != null && Object.hasOwnProperty.call(message, "documentSchemaName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.documentSchemaName); + if (message.cloudAiDocument != null && Object.hasOwnProperty.call(message, "cloudAiDocument")) + $root.google.cloud.documentai.v1.Document.encode(message.cloudAiDocument, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.rawDocumentPath != null && Object.hasOwnProperty.call(message, "rawDocumentPath")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.rawDocumentPath); + if (message.inlineRawDocument != null && Object.hasOwnProperty.call(message, "inlineRawDocument")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.inlineRawDocument); + if (message.properties != null && message.properties.length) + for (var i = 0; i < message.properties.length; ++i) + $root.google.cloud.contentwarehouse.v1.Property.encode(message.properties[i], 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.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.rawDocumentFileType != null && Object.hasOwnProperty.call(message, "rawDocumentFileType")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.rawDocumentFileType); + if (message.referenceId != null && Object.hasOwnProperty.call(message, "referenceId")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.referenceId); + if (message.asyncEnabled != null && Object.hasOwnProperty.call(message, "asyncEnabled")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.asyncEnabled); + if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.creator); + if (message.updater != null && Object.hasOwnProperty.call(message, "updater")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.updater); + if (message.plainText != null && Object.hasOwnProperty.call(message, "plainText")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.plainText); + if (message.structuredContentUri != null && Object.hasOwnProperty.call(message, "structuredContentUri")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.structuredContentUri); + if (message.displayUri != null && Object.hasOwnProperty.call(message, "displayUri")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.displayUri); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.title); + if (message.textExtractionDisabled != null && Object.hasOwnProperty.call(message, "textExtractionDisabled")) + writer.uint32(/* id 19, wireType 0 =*/152).bool(message.textExtractionDisabled); + if (message.contentCategory != null && Object.hasOwnProperty.call(message, "contentCategory")) + writer.uint32(/* id 20, wireType 0 =*/160).int32(message.contentCategory); + if (message.textExtractionEnabled != null && Object.hasOwnProperty.call(message, "textExtractionEnabled")) + writer.uint32(/* id 21, wireType 0 =*/168).bool(message.textExtractionEnabled); + if (message.dispositionTime != null && Object.hasOwnProperty.call(message, "dispositionTime")) + $root.google.protobuf.Timestamp.encode(message.dispositionTime, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.legalHold != null && Object.hasOwnProperty.call(message, "legalHold")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.legalHold); + return writer; + }; + + /** + * Encodes the specified Document message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.Document.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.Document + * @static + * @param {google.cloud.contentwarehouse.v1.IDocument} message Document message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Document.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Document message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.Document + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.Document} Document + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Document.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.Document(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 11: { + message.referenceId = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 18: { + message.title = reader.string(); + break; + } + case 17: { + message.displayUri = reader.string(); + break; + } + case 3: { + message.documentSchemaName = reader.string(); + break; + } + case 15: { + message.plainText = reader.string(); + break; + } + case 4: { + message.cloudAiDocument = $root.google.cloud.documentai.v1.Document.decode(reader, reader.uint32()); + break; + } + case 16: { + message.structuredContentUri = reader.string(); + break; + } + case 5: { + message.rawDocumentPath = reader.string(); + break; + } + case 6: { + message.inlineRawDocument = reader.bytes(); + break; + } + case 7: { + if (!(message.properties && message.properties.length)) + message.properties = []; + message.properties.push($root.google.cloud.contentwarehouse.v1.Property.decode(reader, reader.uint32())); + break; + } + case 8: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.rawDocumentFileType = reader.int32(); + break; + } + case 12: { + message.asyncEnabled = reader.bool(); + break; + } + case 20: { + message.contentCategory = reader.int32(); + break; + } + case 19: { + message.textExtractionDisabled = reader.bool(); + break; + } + case 21: { + message.textExtractionEnabled = reader.bool(); + break; + } + case 13: { + message.creator = reader.string(); + break; + } + case 14: { + message.updater = reader.string(); + break; + } + case 22: { + message.dispositionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 23: { + message.legalHold = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Document message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.Document + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.Document} Document + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Document.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Document message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.Document + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Document.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.referenceId != null && message.hasOwnProperty("referenceId")) + if (!$util.isString(message.referenceId)) + return "referenceId: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.displayUri != null && message.hasOwnProperty("displayUri")) + if (!$util.isString(message.displayUri)) + return "displayUri: string expected"; + if (message.documentSchemaName != null && message.hasOwnProperty("documentSchemaName")) + if (!$util.isString(message.documentSchemaName)) + return "documentSchemaName: string expected"; + if (message.plainText != null && message.hasOwnProperty("plainText")) { + properties.structuredContent = 1; + if (!$util.isString(message.plainText)) + return "plainText: string expected"; + } + if (message.cloudAiDocument != null && message.hasOwnProperty("cloudAiDocument")) { + if (properties.structuredContent === 1) + return "structuredContent: multiple values"; + properties.structuredContent = 1; + { + var error = $root.google.cloud.documentai.v1.Document.verify(message.cloudAiDocument); + if (error) + return "cloudAiDocument." + error; + } + } + if (message.structuredContentUri != null && message.hasOwnProperty("structuredContentUri")) + if (!$util.isString(message.structuredContentUri)) + return "structuredContentUri: string expected"; + if (message.rawDocumentPath != null && message.hasOwnProperty("rawDocumentPath")) { + properties.rawDocument = 1; + if (!$util.isString(message.rawDocumentPath)) + return "rawDocumentPath: string expected"; + } + if (message.inlineRawDocument != null && message.hasOwnProperty("inlineRawDocument")) { + if (properties.rawDocument === 1) + return "rawDocument: multiple values"; + properties.rawDocument = 1; + if (!(message.inlineRawDocument && typeof message.inlineRawDocument.length === "number" || $util.isString(message.inlineRawDocument))) + return "inlineRawDocument: buffer expected"; + } + if (message.properties != null && message.hasOwnProperty("properties")) { + if (!Array.isArray(message.properties)) + return "properties: array expected"; + for (var i = 0; i < message.properties.length; ++i) { + var error = $root.google.cloud.contentwarehouse.v1.Property.verify(message.properties[i]); + if (error) + return "properties." + error; + } + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.rawDocumentFileType != null && message.hasOwnProperty("rawDocumentFileType")) + switch (message.rawDocumentFileType) { + default: + return "rawDocumentFileType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.asyncEnabled != null && message.hasOwnProperty("asyncEnabled")) + if (typeof message.asyncEnabled !== "boolean") + return "asyncEnabled: boolean expected"; + if (message.contentCategory != null && message.hasOwnProperty("contentCategory")) + switch (message.contentCategory) { + default: + return "contentCategory: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.textExtractionDisabled != null && message.hasOwnProperty("textExtractionDisabled")) + if (typeof message.textExtractionDisabled !== "boolean") + return "textExtractionDisabled: boolean expected"; + if (message.textExtractionEnabled != null && message.hasOwnProperty("textExtractionEnabled")) + if (typeof message.textExtractionEnabled !== "boolean") + return "textExtractionEnabled: boolean expected"; + if (message.creator != null && message.hasOwnProperty("creator")) + if (!$util.isString(message.creator)) + return "creator: string expected"; + if (message.updater != null && message.hasOwnProperty("updater")) + if (!$util.isString(message.updater)) + return "updater: string expected"; + if (message.dispositionTime != null && message.hasOwnProperty("dispositionTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.dispositionTime); + if (error) + return "dispositionTime." + error; + } + if (message.legalHold != null && message.hasOwnProperty("legalHold")) + if (typeof message.legalHold !== "boolean") + return "legalHold: boolean expected"; + return null; + }; + + /** + * Creates a Document message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.Document + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.Document} Document + */ + Document.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.Document) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.Document(); + if (object.name != null) + message.name = String(object.name); + if (object.referenceId != null) + message.referenceId = String(object.referenceId); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.title != null) + message.title = String(object.title); + if (object.displayUri != null) + message.displayUri = String(object.displayUri); + if (object.documentSchemaName != null) + message.documentSchemaName = String(object.documentSchemaName); + if (object.plainText != null) + message.plainText = String(object.plainText); + if (object.cloudAiDocument != null) { + if (typeof object.cloudAiDocument !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.Document.cloudAiDocument: object expected"); + message.cloudAiDocument = $root.google.cloud.documentai.v1.Document.fromObject(object.cloudAiDocument); + } + if (object.structuredContentUri != null) + message.structuredContentUri = String(object.structuredContentUri); + if (object.rawDocumentPath != null) + message.rawDocumentPath = String(object.rawDocumentPath); + if (object.inlineRawDocument != null) + if (typeof object.inlineRawDocument === "string") + $util.base64.decode(object.inlineRawDocument, message.inlineRawDocument = $util.newBuffer($util.base64.length(object.inlineRawDocument)), 0); + else if (object.inlineRawDocument.length >= 0) + message.inlineRawDocument = object.inlineRawDocument; + if (object.properties) { + if (!Array.isArray(object.properties)) + throw TypeError(".google.cloud.contentwarehouse.v1.Document.properties: array expected"); + message.properties = []; + for (var i = 0; i < object.properties.length; ++i) { + if (typeof object.properties[i] !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.Document.properties: object expected"); + message.properties[i] = $root.google.cloud.contentwarehouse.v1.Property.fromObject(object.properties[i]); + } + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.Document.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.Document.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + switch (object.rawDocumentFileType) { + default: + if (typeof object.rawDocumentFileType === "number") { + message.rawDocumentFileType = object.rawDocumentFileType; + break; + } + break; + case "RAW_DOCUMENT_FILE_TYPE_UNSPECIFIED": + case 0: + message.rawDocumentFileType = 0; + break; + case "RAW_DOCUMENT_FILE_TYPE_PDF": + case 1: + message.rawDocumentFileType = 1; + break; + case "RAW_DOCUMENT_FILE_TYPE_DOCX": + case 2: + message.rawDocumentFileType = 2; + break; + case "RAW_DOCUMENT_FILE_TYPE_XLSX": + case 3: + message.rawDocumentFileType = 3; + break; + case "RAW_DOCUMENT_FILE_TYPE_PPTX": + case 4: + message.rawDocumentFileType = 4; + break; + case "RAW_DOCUMENT_FILE_TYPE_TEXT": + case 5: + message.rawDocumentFileType = 5; + break; + case "RAW_DOCUMENT_FILE_TYPE_TIFF": + case 6: + message.rawDocumentFileType = 6; + break; + } + if (object.asyncEnabled != null) + message.asyncEnabled = Boolean(object.asyncEnabled); + switch (object.contentCategory) { + default: + if (typeof object.contentCategory === "number") { + message.contentCategory = object.contentCategory; + break; + } + break; + case "CONTENT_CATEGORY_UNSPECIFIED": + case 0: + message.contentCategory = 0; + break; + case "CONTENT_CATEGORY_IMAGE": + case 1: + message.contentCategory = 1; + break; + case "CONTENT_CATEGORY_AUDIO": + case 2: + message.contentCategory = 2; + break; + case "CONTENT_CATEGORY_VIDEO": + case 3: + message.contentCategory = 3; + break; + } + if (object.textExtractionDisabled != null) + message.textExtractionDisabled = Boolean(object.textExtractionDisabled); + if (object.textExtractionEnabled != null) + message.textExtractionEnabled = Boolean(object.textExtractionEnabled); + if (object.creator != null) + message.creator = String(object.creator); + if (object.updater != null) + message.updater = String(object.updater); + if (object.dispositionTime != null) { + if (typeof object.dispositionTime !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.Document.dispositionTime: object expected"); + message.dispositionTime = $root.google.protobuf.Timestamp.fromObject(object.dispositionTime); + } + if (object.legalHold != null) + message.legalHold = Boolean(object.legalHold); + return message; + }; + + /** + * Creates a plain object from a Document message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.Document + * @static + * @param {google.cloud.contentwarehouse.v1.Document} message Document + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Document.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.properties = []; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.documentSchemaName = ""; + object.updateTime = null; + object.createTime = null; + object.rawDocumentFileType = options.enums === String ? "RAW_DOCUMENT_FILE_TYPE_UNSPECIFIED" : 0; + object.referenceId = ""; + object.asyncEnabled = false; + object.creator = ""; + object.updater = ""; + object.structuredContentUri = ""; + object.displayUri = ""; + object.title = ""; + object.textExtractionDisabled = false; + object.contentCategory = options.enums === String ? "CONTENT_CATEGORY_UNSPECIFIED" : 0; + object.textExtractionEnabled = false; + object.dispositionTime = null; + object.legalHold = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.documentSchemaName != null && message.hasOwnProperty("documentSchemaName")) + object.documentSchemaName = message.documentSchemaName; + if (message.cloudAiDocument != null && message.hasOwnProperty("cloudAiDocument")) { + object.cloudAiDocument = $root.google.cloud.documentai.v1.Document.toObject(message.cloudAiDocument, options); + if (options.oneofs) + object.structuredContent = "cloudAiDocument"; + } + if (message.rawDocumentPath != null && message.hasOwnProperty("rawDocumentPath")) { + object.rawDocumentPath = message.rawDocumentPath; + if (options.oneofs) + object.rawDocument = "rawDocumentPath"; + } + if (message.inlineRawDocument != null && message.hasOwnProperty("inlineRawDocument")) { + object.inlineRawDocument = options.bytes === String ? $util.base64.encode(message.inlineRawDocument, 0, message.inlineRawDocument.length) : options.bytes === Array ? Array.prototype.slice.call(message.inlineRawDocument) : message.inlineRawDocument; + if (options.oneofs) + object.rawDocument = "inlineRawDocument"; + } + if (message.properties && message.properties.length) { + object.properties = []; + for (var j = 0; j < message.properties.length; ++j) + object.properties[j] = $root.google.cloud.contentwarehouse.v1.Property.toObject(message.properties[j], options); + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.rawDocumentFileType != null && message.hasOwnProperty("rawDocumentFileType")) + object.rawDocumentFileType = options.enums === String ? $root.google.cloud.contentwarehouse.v1.RawDocumentFileType[message.rawDocumentFileType] === undefined ? message.rawDocumentFileType : $root.google.cloud.contentwarehouse.v1.RawDocumentFileType[message.rawDocumentFileType] : message.rawDocumentFileType; + if (message.referenceId != null && message.hasOwnProperty("referenceId")) + object.referenceId = message.referenceId; + if (message.asyncEnabled != null && message.hasOwnProperty("asyncEnabled")) + object.asyncEnabled = message.asyncEnabled; + if (message.creator != null && message.hasOwnProperty("creator")) + object.creator = message.creator; + if (message.updater != null && message.hasOwnProperty("updater")) + object.updater = message.updater; + if (message.plainText != null && message.hasOwnProperty("plainText")) { + object.plainText = message.plainText; + if (options.oneofs) + object.structuredContent = "plainText"; + } + if (message.structuredContentUri != null && message.hasOwnProperty("structuredContentUri")) + object.structuredContentUri = message.structuredContentUri; + if (message.displayUri != null && message.hasOwnProperty("displayUri")) + object.displayUri = message.displayUri; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.textExtractionDisabled != null && message.hasOwnProperty("textExtractionDisabled")) + object.textExtractionDisabled = message.textExtractionDisabled; + if (message.contentCategory != null && message.hasOwnProperty("contentCategory")) + object.contentCategory = options.enums === String ? $root.google.cloud.contentwarehouse.v1.ContentCategory[message.contentCategory] === undefined ? message.contentCategory : $root.google.cloud.contentwarehouse.v1.ContentCategory[message.contentCategory] : message.contentCategory; + if (message.textExtractionEnabled != null && message.hasOwnProperty("textExtractionEnabled")) + object.textExtractionEnabled = message.textExtractionEnabled; + if (message.dispositionTime != null && message.hasOwnProperty("dispositionTime")) + object.dispositionTime = $root.google.protobuf.Timestamp.toObject(message.dispositionTime, options); + if (message.legalHold != null && message.hasOwnProperty("legalHold")) + object.legalHold = message.legalHold; + return object; + }; + + /** + * Converts this Document to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.Document + * @instance + * @returns {Object.} JSON object + */ + Document.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Document + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.Document + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Document.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.Document"; + }; + + return Document; + })(); + + v1.DocumentReference = (function() { + + /** + * Properties of a DocumentReference. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IDocumentReference + * @property {string|null} [documentName] DocumentReference documentName + * @property {string|null} [displayName] DocumentReference displayName + * @property {string|null} [snippet] DocumentReference snippet + * @property {boolean|null} [documentIsFolder] DocumentReference documentIsFolder + * @property {google.protobuf.ITimestamp|null} [updateTime] DocumentReference updateTime + * @property {google.protobuf.ITimestamp|null} [createTime] DocumentReference createTime + * @property {google.protobuf.ITimestamp|null} [deleteTime] DocumentReference deleteTime + * @property {boolean|null} [documentIsRetentionFolder] DocumentReference documentIsRetentionFolder + * @property {boolean|null} [documentIsLegalHoldFolder] DocumentReference documentIsLegalHoldFolder + */ + + /** + * Constructs a new DocumentReference. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a DocumentReference. + * @implements IDocumentReference + * @constructor + * @param {google.cloud.contentwarehouse.v1.IDocumentReference=} [properties] Properties to set + */ + function DocumentReference(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]]; + } + + /** + * DocumentReference documentName. + * @member {string} documentName + * @memberof google.cloud.contentwarehouse.v1.DocumentReference + * @instance + */ + DocumentReference.prototype.documentName = ""; + + /** + * DocumentReference displayName. + * @member {string} displayName + * @memberof google.cloud.contentwarehouse.v1.DocumentReference + * @instance + */ + DocumentReference.prototype.displayName = ""; + + /** + * DocumentReference snippet. + * @member {string} snippet + * @memberof google.cloud.contentwarehouse.v1.DocumentReference + * @instance + */ + DocumentReference.prototype.snippet = ""; + + /** + * DocumentReference documentIsFolder. + * @member {boolean} documentIsFolder + * @memberof google.cloud.contentwarehouse.v1.DocumentReference + * @instance + */ + DocumentReference.prototype.documentIsFolder = false; + + /** + * DocumentReference updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.contentwarehouse.v1.DocumentReference + * @instance + */ + DocumentReference.prototype.updateTime = null; + + /** + * DocumentReference createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.contentwarehouse.v1.DocumentReference + * @instance + */ + DocumentReference.prototype.createTime = null; + + /** + * DocumentReference deleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteTime + * @memberof google.cloud.contentwarehouse.v1.DocumentReference + * @instance + */ + DocumentReference.prototype.deleteTime = null; + + /** + * DocumentReference documentIsRetentionFolder. + * @member {boolean} documentIsRetentionFolder + * @memberof google.cloud.contentwarehouse.v1.DocumentReference + * @instance + */ + DocumentReference.prototype.documentIsRetentionFolder = false; + + /** + * DocumentReference documentIsLegalHoldFolder. + * @member {boolean} documentIsLegalHoldFolder + * @memberof google.cloud.contentwarehouse.v1.DocumentReference + * @instance + */ + DocumentReference.prototype.documentIsLegalHoldFolder = false; + + /** + * Creates a new DocumentReference instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.DocumentReference + * @static + * @param {google.cloud.contentwarehouse.v1.IDocumentReference=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.DocumentReference} DocumentReference instance + */ + DocumentReference.create = function create(properties) { + return new DocumentReference(properties); + }; + + /** + * Encodes the specified DocumentReference message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DocumentReference.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.DocumentReference + * @static + * @param {google.cloud.contentwarehouse.v1.IDocumentReference} message DocumentReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documentName != null && Object.hasOwnProperty.call(message, "documentName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.documentName); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.snippet != null && Object.hasOwnProperty.call(message, "snippet")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.snippet); + if (message.documentIsFolder != null && Object.hasOwnProperty.call(message, "documentIsFolder")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.documentIsFolder); + 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.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.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.documentIsRetentionFolder != null && Object.hasOwnProperty.call(message, "documentIsRetentionFolder")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.documentIsRetentionFolder); + if (message.documentIsLegalHoldFolder != null && Object.hasOwnProperty.call(message, "documentIsLegalHoldFolder")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.documentIsLegalHoldFolder); + return writer; + }; + + /** + * Encodes the specified DocumentReference message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DocumentReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.DocumentReference + * @static + * @param {google.cloud.contentwarehouse.v1.IDocumentReference} message DocumentReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DocumentReference message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.DocumentReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.DocumentReference} DocumentReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentReference.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.DocumentReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.documentName = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.snippet = reader.string(); + break; + } + case 4: { + message.documentIsFolder = reader.bool(); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.documentIsRetentionFolder = reader.bool(); + break; + } + case 9: { + message.documentIsLegalHoldFolder = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DocumentReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.DocumentReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.DocumentReference} DocumentReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DocumentReference message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.DocumentReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DocumentReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.documentName != null && message.hasOwnProperty("documentName")) + if (!$util.isString(message.documentName)) + return "documentName: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.snippet != null && message.hasOwnProperty("snippet")) + if (!$util.isString(message.snippet)) + return "snippet: string expected"; + if (message.documentIsFolder != null && message.hasOwnProperty("documentIsFolder")) + if (typeof message.documentIsFolder !== "boolean") + return "documentIsFolder: boolean expected"; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); + if (error) + return "deleteTime." + error; + } + if (message.documentIsRetentionFolder != null && message.hasOwnProperty("documentIsRetentionFolder")) + if (typeof message.documentIsRetentionFolder !== "boolean") + return "documentIsRetentionFolder: boolean expected"; + if (message.documentIsLegalHoldFolder != null && message.hasOwnProperty("documentIsLegalHoldFolder")) + if (typeof message.documentIsLegalHoldFolder !== "boolean") + return "documentIsLegalHoldFolder: boolean expected"; + return null; + }; + + /** + * Creates a DocumentReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.DocumentReference + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.DocumentReference} DocumentReference + */ + DocumentReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.DocumentReference) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.DocumentReference(); + if (object.documentName != null) + message.documentName = String(object.documentName); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.snippet != null) + message.snippet = String(object.snippet); + if (object.documentIsFolder != null) + message.documentIsFolder = Boolean(object.documentIsFolder); + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.DocumentReference.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.DocumentReference.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.deleteTime != null) { + if (typeof object.deleteTime !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.DocumentReference.deleteTime: object expected"); + message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); + } + if (object.documentIsRetentionFolder != null) + message.documentIsRetentionFolder = Boolean(object.documentIsRetentionFolder); + if (object.documentIsLegalHoldFolder != null) + message.documentIsLegalHoldFolder = Boolean(object.documentIsLegalHoldFolder); + return message; + }; + + /** + * Creates a plain object from a DocumentReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.DocumentReference + * @static + * @param {google.cloud.contentwarehouse.v1.DocumentReference} message DocumentReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DocumentReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.documentName = ""; + object.displayName = ""; + object.snippet = ""; + object.documentIsFolder = false; + object.updateTime = null; + object.createTime = null; + object.deleteTime = null; + object.documentIsRetentionFolder = false; + object.documentIsLegalHoldFolder = false; + } + if (message.documentName != null && message.hasOwnProperty("documentName")) + object.documentName = message.documentName; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.snippet != null && message.hasOwnProperty("snippet")) + object.snippet = message.snippet; + if (message.documentIsFolder != null && message.hasOwnProperty("documentIsFolder")) + object.documentIsFolder = message.documentIsFolder; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) + object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); + if (message.documentIsRetentionFolder != null && message.hasOwnProperty("documentIsRetentionFolder")) + object.documentIsRetentionFolder = message.documentIsRetentionFolder; + if (message.documentIsLegalHoldFolder != null && message.hasOwnProperty("documentIsLegalHoldFolder")) + object.documentIsLegalHoldFolder = message.documentIsLegalHoldFolder; + return object; + }; + + /** + * Converts this DocumentReference to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.DocumentReference + * @instance + * @returns {Object.} JSON object + */ + DocumentReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DocumentReference + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.DocumentReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DocumentReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.DocumentReference"; + }; + + return DocumentReference; + })(); + + v1.Property = (function() { + + /** + * Properties of a Property. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IProperty + * @property {string|null} [name] Property name + * @property {google.cloud.contentwarehouse.v1.IIntegerArray|null} [integerValues] Property integerValues + * @property {google.cloud.contentwarehouse.v1.IFloatArray|null} [floatValues] Property floatValues + * @property {google.cloud.contentwarehouse.v1.ITextArray|null} [textValues] Property textValues + * @property {google.cloud.contentwarehouse.v1.IEnumArray|null} [enumValues] Property enumValues + * @property {google.cloud.contentwarehouse.v1.IPropertyArray|null} [propertyValues] Property propertyValues + * @property {google.cloud.contentwarehouse.v1.IDateTimeArray|null} [dateTimeValues] Property dateTimeValues + * @property {google.cloud.contentwarehouse.v1.IMapProperty|null} [mapProperty] Property mapProperty + * @property {google.cloud.contentwarehouse.v1.ITimestampArray|null} [timestampValues] Property timestampValues + */ + + /** + * Constructs a new Property. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a Property. + * @implements IProperty + * @constructor + * @param {google.cloud.contentwarehouse.v1.IProperty=} [properties] Properties to set + */ + function Property(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]]; + } + + /** + * Property name. + * @member {string} name + * @memberof google.cloud.contentwarehouse.v1.Property + * @instance + */ + Property.prototype.name = ""; + + /** + * Property integerValues. + * @member {google.cloud.contentwarehouse.v1.IIntegerArray|null|undefined} integerValues + * @memberof google.cloud.contentwarehouse.v1.Property + * @instance + */ + Property.prototype.integerValues = null; + + /** + * Property floatValues. + * @member {google.cloud.contentwarehouse.v1.IFloatArray|null|undefined} floatValues + * @memberof google.cloud.contentwarehouse.v1.Property + * @instance + */ + Property.prototype.floatValues = null; + + /** + * Property textValues. + * @member {google.cloud.contentwarehouse.v1.ITextArray|null|undefined} textValues + * @memberof google.cloud.contentwarehouse.v1.Property + * @instance + */ + Property.prototype.textValues = null; + + /** + * Property enumValues. + * @member {google.cloud.contentwarehouse.v1.IEnumArray|null|undefined} enumValues + * @memberof google.cloud.contentwarehouse.v1.Property + * @instance + */ + Property.prototype.enumValues = null; + + /** + * Property propertyValues. + * @member {google.cloud.contentwarehouse.v1.IPropertyArray|null|undefined} propertyValues + * @memberof google.cloud.contentwarehouse.v1.Property + * @instance + */ + Property.prototype.propertyValues = null; + + /** + * Property dateTimeValues. + * @member {google.cloud.contentwarehouse.v1.IDateTimeArray|null|undefined} dateTimeValues + * @memberof google.cloud.contentwarehouse.v1.Property + * @instance + */ + Property.prototype.dateTimeValues = null; + + /** + * Property mapProperty. + * @member {google.cloud.contentwarehouse.v1.IMapProperty|null|undefined} mapProperty + * @memberof google.cloud.contentwarehouse.v1.Property + * @instance + */ + Property.prototype.mapProperty = null; + + /** + * Property timestampValues. + * @member {google.cloud.contentwarehouse.v1.ITimestampArray|null|undefined} timestampValues + * @memberof google.cloud.contentwarehouse.v1.Property + * @instance + */ + Property.prototype.timestampValues = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Property values. + * @member {"integerValues"|"floatValues"|"textValues"|"enumValues"|"propertyValues"|"dateTimeValues"|"mapProperty"|"timestampValues"|undefined} values + * @memberof google.cloud.contentwarehouse.v1.Property + * @instance + */ + Object.defineProperty(Property.prototype, "values", { + get: $util.oneOfGetter($oneOfFields = ["integerValues", "floatValues", "textValues", "enumValues", "propertyValues", "dateTimeValues", "mapProperty", "timestampValues"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Property instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.Property + * @static + * @param {google.cloud.contentwarehouse.v1.IProperty=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.Property} Property instance + */ + Property.create = function create(properties) { + return new Property(properties); + }; + + /** + * Encodes the specified Property message. Does not implicitly {@link google.cloud.contentwarehouse.v1.Property.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.Property + * @static + * @param {google.cloud.contentwarehouse.v1.IProperty} message Property message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Property.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.integerValues != null && Object.hasOwnProperty.call(message, "integerValues")) + $root.google.cloud.contentwarehouse.v1.IntegerArray.encode(message.integerValues, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.floatValues != null && Object.hasOwnProperty.call(message, "floatValues")) + $root.google.cloud.contentwarehouse.v1.FloatArray.encode(message.floatValues, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.textValues != null && Object.hasOwnProperty.call(message, "textValues")) + $root.google.cloud.contentwarehouse.v1.TextArray.encode(message.textValues, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumValues != null && Object.hasOwnProperty.call(message, "enumValues")) + $root.google.cloud.contentwarehouse.v1.EnumArray.encode(message.enumValues, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.propertyValues != null && Object.hasOwnProperty.call(message, "propertyValues")) + $root.google.cloud.contentwarehouse.v1.PropertyArray.encode(message.propertyValues, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.dateTimeValues != null && Object.hasOwnProperty.call(message, "dateTimeValues")) + $root.google.cloud.contentwarehouse.v1.DateTimeArray.encode(message.dateTimeValues, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.mapProperty != null && Object.hasOwnProperty.call(message, "mapProperty")) + $root.google.cloud.contentwarehouse.v1.MapProperty.encode(message.mapProperty, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.timestampValues != null && Object.hasOwnProperty.call(message, "timestampValues")) + $root.google.cloud.contentwarehouse.v1.TimestampArray.encode(message.timestampValues, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Property message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.Property.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.Property + * @static + * @param {google.cloud.contentwarehouse.v1.IProperty} message Property message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Property.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Property message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.Property + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.Property} Property + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Property.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.Property(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.integerValues = $root.google.cloud.contentwarehouse.v1.IntegerArray.decode(reader, reader.uint32()); + break; + } + case 3: { + message.floatValues = $root.google.cloud.contentwarehouse.v1.FloatArray.decode(reader, reader.uint32()); + break; + } + case 4: { + message.textValues = $root.google.cloud.contentwarehouse.v1.TextArray.decode(reader, reader.uint32()); + break; + } + case 5: { + message.enumValues = $root.google.cloud.contentwarehouse.v1.EnumArray.decode(reader, reader.uint32()); + break; + } + case 6: { + message.propertyValues = $root.google.cloud.contentwarehouse.v1.PropertyArray.decode(reader, reader.uint32()); + break; + } + case 7: { + message.dateTimeValues = $root.google.cloud.contentwarehouse.v1.DateTimeArray.decode(reader, reader.uint32()); + break; + } + case 8: { + message.mapProperty = $root.google.cloud.contentwarehouse.v1.MapProperty.decode(reader, reader.uint32()); + break; + } + case 9: { + message.timestampValues = $root.google.cloud.contentwarehouse.v1.TimestampArray.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Property message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.Property + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.Property} Property + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Property.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Property message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.Property + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Property.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.integerValues != null && message.hasOwnProperty("integerValues")) { + properties.values = 1; + { + var error = $root.google.cloud.contentwarehouse.v1.IntegerArray.verify(message.integerValues); + if (error) + return "integerValues." + error; + } + } + if (message.floatValues != null && message.hasOwnProperty("floatValues")) { + if (properties.values === 1) + return "values: multiple values"; + properties.values = 1; + { + var error = $root.google.cloud.contentwarehouse.v1.FloatArray.verify(message.floatValues); + if (error) + return "floatValues." + error; + } + } + if (message.textValues != null && message.hasOwnProperty("textValues")) { + if (properties.values === 1) + return "values: multiple values"; + properties.values = 1; + { + var error = $root.google.cloud.contentwarehouse.v1.TextArray.verify(message.textValues); + if (error) + return "textValues." + error; + } + } + if (message.enumValues != null && message.hasOwnProperty("enumValues")) { + if (properties.values === 1) + return "values: multiple values"; + properties.values = 1; + { + var error = $root.google.cloud.contentwarehouse.v1.EnumArray.verify(message.enumValues); + if (error) + return "enumValues." + error; + } + } + if (message.propertyValues != null && message.hasOwnProperty("propertyValues")) { + if (properties.values === 1) + return "values: multiple values"; + properties.values = 1; + { + var error = $root.google.cloud.contentwarehouse.v1.PropertyArray.verify(message.propertyValues); + if (error) + return "propertyValues." + error; + } + } + if (message.dateTimeValues != null && message.hasOwnProperty("dateTimeValues")) { + if (properties.values === 1) + return "values: multiple values"; + properties.values = 1; + { + var error = $root.google.cloud.contentwarehouse.v1.DateTimeArray.verify(message.dateTimeValues); + if (error) + return "dateTimeValues." + error; + } + } + if (message.mapProperty != null && message.hasOwnProperty("mapProperty")) { + if (properties.values === 1) + return "values: multiple values"; + properties.values = 1; + { + var error = $root.google.cloud.contentwarehouse.v1.MapProperty.verify(message.mapProperty); + if (error) + return "mapProperty." + error; + } + } + if (message.timestampValues != null && message.hasOwnProperty("timestampValues")) { + if (properties.values === 1) + return "values: multiple values"; + properties.values = 1; + { + var error = $root.google.cloud.contentwarehouse.v1.TimestampArray.verify(message.timestampValues); + if (error) + return "timestampValues." + error; + } + } + return null; + }; + + /** + * Creates a Property message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.Property + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.Property} Property + */ + Property.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.Property) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.Property(); + if (object.name != null) + message.name = String(object.name); + if (object.integerValues != null) { + if (typeof object.integerValues !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.Property.integerValues: object expected"); + message.integerValues = $root.google.cloud.contentwarehouse.v1.IntegerArray.fromObject(object.integerValues); + } + if (object.floatValues != null) { + if (typeof object.floatValues !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.Property.floatValues: object expected"); + message.floatValues = $root.google.cloud.contentwarehouse.v1.FloatArray.fromObject(object.floatValues); + } + if (object.textValues != null) { + if (typeof object.textValues !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.Property.textValues: object expected"); + message.textValues = $root.google.cloud.contentwarehouse.v1.TextArray.fromObject(object.textValues); + } + if (object.enumValues != null) { + if (typeof object.enumValues !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.Property.enumValues: object expected"); + message.enumValues = $root.google.cloud.contentwarehouse.v1.EnumArray.fromObject(object.enumValues); + } + if (object.propertyValues != null) { + if (typeof object.propertyValues !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.Property.propertyValues: object expected"); + message.propertyValues = $root.google.cloud.contentwarehouse.v1.PropertyArray.fromObject(object.propertyValues); + } + if (object.dateTimeValues != null) { + if (typeof object.dateTimeValues !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.Property.dateTimeValues: object expected"); + message.dateTimeValues = $root.google.cloud.contentwarehouse.v1.DateTimeArray.fromObject(object.dateTimeValues); + } + if (object.mapProperty != null) { + if (typeof object.mapProperty !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.Property.mapProperty: object expected"); + message.mapProperty = $root.google.cloud.contentwarehouse.v1.MapProperty.fromObject(object.mapProperty); + } + if (object.timestampValues != null) { + if (typeof object.timestampValues !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.Property.timestampValues: object expected"); + message.timestampValues = $root.google.cloud.contentwarehouse.v1.TimestampArray.fromObject(object.timestampValues); + } + return message; + }; + + /** + * Creates a plain object from a Property message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.Property + * @static + * @param {google.cloud.contentwarehouse.v1.Property} message Property + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Property.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; + if (message.integerValues != null && message.hasOwnProperty("integerValues")) { + object.integerValues = $root.google.cloud.contentwarehouse.v1.IntegerArray.toObject(message.integerValues, options); + if (options.oneofs) + object.values = "integerValues"; + } + if (message.floatValues != null && message.hasOwnProperty("floatValues")) { + object.floatValues = $root.google.cloud.contentwarehouse.v1.FloatArray.toObject(message.floatValues, options); + if (options.oneofs) + object.values = "floatValues"; + } + if (message.textValues != null && message.hasOwnProperty("textValues")) { + object.textValues = $root.google.cloud.contentwarehouse.v1.TextArray.toObject(message.textValues, options); + if (options.oneofs) + object.values = "textValues"; + } + if (message.enumValues != null && message.hasOwnProperty("enumValues")) { + object.enumValues = $root.google.cloud.contentwarehouse.v1.EnumArray.toObject(message.enumValues, options); + if (options.oneofs) + object.values = "enumValues"; + } + if (message.propertyValues != null && message.hasOwnProperty("propertyValues")) { + object.propertyValues = $root.google.cloud.contentwarehouse.v1.PropertyArray.toObject(message.propertyValues, options); + if (options.oneofs) + object.values = "propertyValues"; + } + if (message.dateTimeValues != null && message.hasOwnProperty("dateTimeValues")) { + object.dateTimeValues = $root.google.cloud.contentwarehouse.v1.DateTimeArray.toObject(message.dateTimeValues, options); + if (options.oneofs) + object.values = "dateTimeValues"; + } + if (message.mapProperty != null && message.hasOwnProperty("mapProperty")) { + object.mapProperty = $root.google.cloud.contentwarehouse.v1.MapProperty.toObject(message.mapProperty, options); + if (options.oneofs) + object.values = "mapProperty"; + } + if (message.timestampValues != null && message.hasOwnProperty("timestampValues")) { + object.timestampValues = $root.google.cloud.contentwarehouse.v1.TimestampArray.toObject(message.timestampValues, options); + if (options.oneofs) + object.values = "timestampValues"; + } + return object; + }; + + /** + * Converts this Property to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.Property + * @instance + * @returns {Object.} JSON object + */ + Property.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Property + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.Property + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Property.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.Property"; + }; + + return Property; + })(); + + v1.IntegerArray = (function() { + + /** + * Properties of an IntegerArray. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IIntegerArray + * @property {Array.|null} [values] IntegerArray values + */ + + /** + * Constructs a new IntegerArray. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents an IntegerArray. + * @implements IIntegerArray + * @constructor + * @param {google.cloud.contentwarehouse.v1.IIntegerArray=} [properties] Properties to set + */ + function IntegerArray(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]]; + } + + /** + * IntegerArray values. + * @member {Array.} values + * @memberof google.cloud.contentwarehouse.v1.IntegerArray + * @instance + */ + IntegerArray.prototype.values = $util.emptyArray; + + /** + * Creates a new IntegerArray instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.IntegerArray + * @static + * @param {google.cloud.contentwarehouse.v1.IIntegerArray=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.IntegerArray} IntegerArray instance + */ + IntegerArray.create = function create(properties) { + return new IntegerArray(properties); + }; + + /** + * Encodes the specified IntegerArray message. Does not implicitly {@link google.cloud.contentwarehouse.v1.IntegerArray.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.IntegerArray + * @static + * @param {google.cloud.contentwarehouse.v1.IIntegerArray} message IntegerArray message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntegerArray.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.values != null && message.values.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.values.length; ++i) + writer.int32(message.values[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified IntegerArray message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.IntegerArray.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.IntegerArray + * @static + * @param {google.cloud.contentwarehouse.v1.IIntegerArray} message IntegerArray message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntegerArray.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IntegerArray message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.IntegerArray + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.IntegerArray} IntegerArray + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntegerArray.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.IntegerArray(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.values.push(reader.int32()); + } else + message.values.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IntegerArray message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.IntegerArray + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.IntegerArray} IntegerArray + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntegerArray.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IntegerArray message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.IntegerArray + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IntegerArray.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) + if (!$util.isInteger(message.values[i])) + return "values: integer[] expected"; + } + return null; + }; + + /** + * Creates an IntegerArray message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.IntegerArray + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.IntegerArray} IntegerArray + */ + IntegerArray.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.IntegerArray) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.IntegerArray(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.cloud.contentwarehouse.v1.IntegerArray.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) + message.values[i] = object.values[i] | 0; + } + return message; + }; + + /** + * Creates a plain object from an IntegerArray message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.IntegerArray + * @static + * @param {google.cloud.contentwarehouse.v1.IntegerArray} message IntegerArray + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IntegerArray.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] = message.values[j]; + } + return object; + }; + + /** + * Converts this IntegerArray to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.IntegerArray + * @instance + * @returns {Object.} JSON object + */ + IntegerArray.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IntegerArray + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.IntegerArray + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IntegerArray.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.IntegerArray"; + }; + + return IntegerArray; + })(); + + v1.FloatArray = (function() { + + /** + * Properties of a FloatArray. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IFloatArray + * @property {Array.|null} [values] FloatArray values + */ + + /** + * Constructs a new FloatArray. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a FloatArray. + * @implements IFloatArray + * @constructor + * @param {google.cloud.contentwarehouse.v1.IFloatArray=} [properties] Properties to set + */ + function FloatArray(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]]; + } + + /** + * FloatArray values. + * @member {Array.} values + * @memberof google.cloud.contentwarehouse.v1.FloatArray + * @instance + */ + FloatArray.prototype.values = $util.emptyArray; + + /** + * Creates a new FloatArray instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.FloatArray + * @static + * @param {google.cloud.contentwarehouse.v1.IFloatArray=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.FloatArray} FloatArray instance + */ + FloatArray.create = function create(properties) { + return new FloatArray(properties); + }; + + /** + * Encodes the specified FloatArray message. Does not implicitly {@link google.cloud.contentwarehouse.v1.FloatArray.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.FloatArray + * @static + * @param {google.cloud.contentwarehouse.v1.IFloatArray} message FloatArray message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatArray.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.values != null && message.values.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.values.length; ++i) + writer.float(message.values[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified FloatArray message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.FloatArray.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.FloatArray + * @static + * @param {google.cloud.contentwarehouse.v1.IFloatArray} message FloatArray message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatArray.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FloatArray message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.FloatArray + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.FloatArray} FloatArray + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatArray.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.FloatArray(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.values.push(reader.float()); + } else + message.values.push(reader.float()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FloatArray message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.FloatArray + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.FloatArray} FloatArray + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatArray.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FloatArray message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.FloatArray + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FloatArray.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) + if (typeof message.values[i] !== "number") + return "values: number[] expected"; + } + return null; + }; + + /** + * Creates a FloatArray message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.FloatArray + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.FloatArray} FloatArray + */ + FloatArray.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.FloatArray) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.FloatArray(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.cloud.contentwarehouse.v1.FloatArray.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) + message.values[i] = Number(object.values[i]); + } + return message; + }; + + /** + * Creates a plain object from a FloatArray message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.FloatArray + * @static + * @param {google.cloud.contentwarehouse.v1.FloatArray} message FloatArray + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FloatArray.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] = options.json && !isFinite(message.values[j]) ? String(message.values[j]) : message.values[j]; + } + return object; + }; + + /** + * Converts this FloatArray to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.FloatArray + * @instance + * @returns {Object.} JSON object + */ + FloatArray.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FloatArray + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.FloatArray + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatArray.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.FloatArray"; + }; + + return FloatArray; + })(); + + v1.TextArray = (function() { + + /** + * Properties of a TextArray. + * @memberof google.cloud.contentwarehouse.v1 + * @interface ITextArray + * @property {Array.|null} [values] TextArray values + */ + + /** + * Constructs a new TextArray. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a TextArray. + * @implements ITextArray + * @constructor + * @param {google.cloud.contentwarehouse.v1.ITextArray=} [properties] Properties to set + */ + function TextArray(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]]; + } + + /** + * TextArray values. + * @member {Array.} values + * @memberof google.cloud.contentwarehouse.v1.TextArray + * @instance + */ + TextArray.prototype.values = $util.emptyArray; + + /** + * Creates a new TextArray instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.TextArray + * @static + * @param {google.cloud.contentwarehouse.v1.ITextArray=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.TextArray} TextArray instance + */ + TextArray.create = function create(properties) { + return new TextArray(properties); + }; + + /** + * Encodes the specified TextArray message. Does not implicitly {@link google.cloud.contentwarehouse.v1.TextArray.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.TextArray + * @static + * @param {google.cloud.contentwarehouse.v1.ITextArray} message TextArray message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextArray.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) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.values[i]); + return writer; + }; + + /** + * Encodes the specified TextArray message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.TextArray.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.TextArray + * @static + * @param {google.cloud.contentwarehouse.v1.ITextArray} message TextArray message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextArray.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextArray message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.TextArray + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.TextArray} TextArray + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextArray.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.TextArray(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextArray message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.TextArray + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.TextArray} TextArray + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextArray.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextArray message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.TextArray + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextArray.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) + if (!$util.isString(message.values[i])) + return "values: string[] expected"; + } + return null; + }; + + /** + * Creates a TextArray message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.TextArray + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.TextArray} TextArray + */ + TextArray.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.TextArray) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.TextArray(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.cloud.contentwarehouse.v1.TextArray.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) + message.values[i] = String(object.values[i]); + } + return message; + }; + + /** + * Creates a plain object from a TextArray message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.TextArray + * @static + * @param {google.cloud.contentwarehouse.v1.TextArray} message TextArray + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextArray.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] = message.values[j]; + } + return object; + }; + + /** + * Converts this TextArray to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.TextArray + * @instance + * @returns {Object.} JSON object + */ + TextArray.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextArray + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.TextArray + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextArray.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.TextArray"; + }; + + return TextArray; + })(); + + v1.EnumArray = (function() { + + /** + * Properties of an EnumArray. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IEnumArray + * @property {Array.|null} [values] EnumArray values + */ + + /** + * Constructs a new EnumArray. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents an EnumArray. + * @implements IEnumArray + * @constructor + * @param {google.cloud.contentwarehouse.v1.IEnumArray=} [properties] Properties to set + */ + function EnumArray(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]]; + } + + /** + * EnumArray values. + * @member {Array.} values + * @memberof google.cloud.contentwarehouse.v1.EnumArray + * @instance + */ + EnumArray.prototype.values = $util.emptyArray; + + /** + * Creates a new EnumArray instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.EnumArray + * @static + * @param {google.cloud.contentwarehouse.v1.IEnumArray=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.EnumArray} EnumArray instance + */ + EnumArray.create = function create(properties) { + return new EnumArray(properties); + }; + + /** + * Encodes the specified EnumArray message. Does not implicitly {@link google.cloud.contentwarehouse.v1.EnumArray.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.EnumArray + * @static + * @param {google.cloud.contentwarehouse.v1.IEnumArray} message EnumArray message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumArray.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) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.values[i]); + return writer; + }; + + /** + * Encodes the specified EnumArray message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.EnumArray.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.EnumArray + * @static + * @param {google.cloud.contentwarehouse.v1.IEnumArray} message EnumArray message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumArray.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumArray message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.EnumArray + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.EnumArray} EnumArray + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumArray.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.EnumArray(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumArray message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.EnumArray + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.EnumArray} EnumArray + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumArray.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumArray message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.EnumArray + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumArray.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) + if (!$util.isString(message.values[i])) + return "values: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumArray message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.EnumArray + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.EnumArray} EnumArray + */ + EnumArray.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.EnumArray) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.EnumArray(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.cloud.contentwarehouse.v1.EnumArray.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) + message.values[i] = String(object.values[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumArray message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.EnumArray + * @static + * @param {google.cloud.contentwarehouse.v1.EnumArray} message EnumArray + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumArray.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] = message.values[j]; + } + return object; + }; + + /** + * Converts this EnumArray to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.EnumArray + * @instance + * @returns {Object.} JSON object + */ + EnumArray.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumArray + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.EnumArray + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumArray.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.EnumArray"; + }; + + return EnumArray; + })(); + + v1.DateTimeArray = (function() { + + /** + * Properties of a DateTimeArray. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IDateTimeArray + * @property {Array.|null} [values] DateTimeArray values + */ + + /** + * Constructs a new DateTimeArray. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a DateTimeArray. + * @implements IDateTimeArray + * @constructor + * @param {google.cloud.contentwarehouse.v1.IDateTimeArray=} [properties] Properties to set + */ + function DateTimeArray(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]]; + } + + /** + * DateTimeArray values. + * @member {Array.} values + * @memberof google.cloud.contentwarehouse.v1.DateTimeArray + * @instance + */ + DateTimeArray.prototype.values = $util.emptyArray; + + /** + * Creates a new DateTimeArray instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.DateTimeArray + * @static + * @param {google.cloud.contentwarehouse.v1.IDateTimeArray=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.DateTimeArray} DateTimeArray instance + */ + DateTimeArray.create = function create(properties) { + return new DateTimeArray(properties); + }; + + /** + * Encodes the specified DateTimeArray message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DateTimeArray.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.DateTimeArray + * @static + * @param {google.cloud.contentwarehouse.v1.IDateTimeArray} message DateTimeArray message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DateTimeArray.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.type.DateTime.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DateTimeArray message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DateTimeArray.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.DateTimeArray + * @static + * @param {google.cloud.contentwarehouse.v1.IDateTimeArray} message DateTimeArray message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DateTimeArray.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DateTimeArray message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.DateTimeArray + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.DateTimeArray} DateTimeArray + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DateTimeArray.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.DateTimeArray(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.type.DateTime.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DateTimeArray message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.DateTimeArray + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.DateTimeArray} DateTimeArray + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DateTimeArray.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DateTimeArray message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.DateTimeArray + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DateTimeArray.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.type.DateTime.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates a DateTimeArray message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.DateTimeArray + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.DateTimeArray} DateTimeArray + */ + DateTimeArray.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.DateTimeArray) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.DateTimeArray(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.cloud.contentwarehouse.v1.DateTimeArray.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.DateTimeArray.values: object expected"); + message.values[i] = $root.google.type.DateTime.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a DateTimeArray message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.DateTimeArray + * @static + * @param {google.cloud.contentwarehouse.v1.DateTimeArray} message DateTimeArray + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DateTimeArray.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.type.DateTime.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this DateTimeArray to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.DateTimeArray + * @instance + * @returns {Object.} JSON object + */ + DateTimeArray.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DateTimeArray + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.DateTimeArray + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DateTimeArray.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.DateTimeArray"; + }; + + return DateTimeArray; + })(); + + v1.TimestampArray = (function() { + + /** + * Properties of a TimestampArray. + * @memberof google.cloud.contentwarehouse.v1 + * @interface ITimestampArray + * @property {Array.|null} [values] TimestampArray values + */ + + /** + * Constructs a new TimestampArray. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a TimestampArray. + * @implements ITimestampArray + * @constructor + * @param {google.cloud.contentwarehouse.v1.ITimestampArray=} [properties] Properties to set + */ + function TimestampArray(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]]; + } + + /** + * TimestampArray values. + * @member {Array.} values + * @memberof google.cloud.contentwarehouse.v1.TimestampArray + * @instance + */ + TimestampArray.prototype.values = $util.emptyArray; + + /** + * Creates a new TimestampArray instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.TimestampArray + * @static + * @param {google.cloud.contentwarehouse.v1.ITimestampArray=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.TimestampArray} TimestampArray instance + */ + TimestampArray.create = function create(properties) { + return new TimestampArray(properties); + }; + + /** + * Encodes the specified TimestampArray message. Does not implicitly {@link google.cloud.contentwarehouse.v1.TimestampArray.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.TimestampArray + * @static + * @param {google.cloud.contentwarehouse.v1.ITimestampArray} message TimestampArray message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampArray.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.cloud.contentwarehouse.v1.TimestampValue.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TimestampArray message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.TimestampArray.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.TimestampArray + * @static + * @param {google.cloud.contentwarehouse.v1.ITimestampArray} message TimestampArray message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampArray.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimestampArray message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.TimestampArray + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.TimestampArray} TimestampArray + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampArray.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.TimestampArray(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.cloud.contentwarehouse.v1.TimestampValue.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimestampArray message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.TimestampArray + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.TimestampArray} TimestampArray + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampArray.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimestampArray message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.TimestampArray + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimestampArray.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.cloud.contentwarehouse.v1.TimestampValue.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates a TimestampArray message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.TimestampArray + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.TimestampArray} TimestampArray + */ + TimestampArray.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.TimestampArray) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.TimestampArray(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.cloud.contentwarehouse.v1.TimestampArray.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.TimestampArray.values: object expected"); + message.values[i] = $root.google.cloud.contentwarehouse.v1.TimestampValue.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TimestampArray message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.TimestampArray + * @static + * @param {google.cloud.contentwarehouse.v1.TimestampArray} message TimestampArray + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimestampArray.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.cloud.contentwarehouse.v1.TimestampValue.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this TimestampArray to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.TimestampArray + * @instance + * @returns {Object.} JSON object + */ + TimestampArray.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimestampArray + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.TimestampArray + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampArray.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.TimestampArray"; + }; + + return TimestampArray; + })(); + + v1.TimestampValue = (function() { + + /** + * Properties of a TimestampValue. + * @memberof google.cloud.contentwarehouse.v1 + * @interface ITimestampValue + * @property {google.protobuf.ITimestamp|null} [timestampValue] TimestampValue timestampValue + * @property {string|null} [textValue] TimestampValue textValue + */ + + /** + * Constructs a new TimestampValue. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a TimestampValue. + * @implements ITimestampValue + * @constructor + * @param {google.cloud.contentwarehouse.v1.ITimestampValue=} [properties] Properties to set + */ + function TimestampValue(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]]; + } + + /** + * TimestampValue timestampValue. + * @member {google.protobuf.ITimestamp|null|undefined} timestampValue + * @memberof google.cloud.contentwarehouse.v1.TimestampValue + * @instance + */ + TimestampValue.prototype.timestampValue = null; + + /** + * TimestampValue textValue. + * @member {string|null|undefined} textValue + * @memberof google.cloud.contentwarehouse.v1.TimestampValue + * @instance + */ + TimestampValue.prototype.textValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TimestampValue value. + * @member {"timestampValue"|"textValue"|undefined} value + * @memberof google.cloud.contentwarehouse.v1.TimestampValue + * @instance + */ + Object.defineProperty(TimestampValue.prototype, "value", { + get: $util.oneOfGetter($oneOfFields = ["timestampValue", "textValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TimestampValue instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.TimestampValue + * @static + * @param {google.cloud.contentwarehouse.v1.ITimestampValue=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.TimestampValue} TimestampValue instance + */ + TimestampValue.create = function create(properties) { + return new TimestampValue(properties); + }; + + /** + * Encodes the specified TimestampValue message. Does not implicitly {@link google.cloud.contentwarehouse.v1.TimestampValue.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.TimestampValue + * @static + * @param {google.cloud.contentwarehouse.v1.ITimestampValue} message TimestampValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.timestampValue != null && Object.hasOwnProperty.call(message, "timestampValue")) + $root.google.protobuf.Timestamp.encode(message.timestampValue, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.textValue != null && Object.hasOwnProperty.call(message, "textValue")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.textValue); + return writer; + }; + + /** + * Encodes the specified TimestampValue message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.TimestampValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.TimestampValue + * @static + * @param {google.cloud.contentwarehouse.v1.ITimestampValue} message TimestampValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimestampValue message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.TimestampValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.TimestampValue} TimestampValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.TimestampValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.timestampValue = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.textValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimestampValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.TimestampValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.TimestampValue} TimestampValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimestampValue message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.TimestampValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimestampValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.timestampValue != null && message.hasOwnProperty("timestampValue")) { + properties.value = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.timestampValue); + if (error) + return "timestampValue." + error; + } + } + if (message.textValue != null && message.hasOwnProperty("textValue")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + if (!$util.isString(message.textValue)) + return "textValue: string expected"; + } + return null; + }; + + /** + * Creates a TimestampValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.TimestampValue + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.TimestampValue} TimestampValue + */ + TimestampValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.TimestampValue) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.TimestampValue(); + if (object.timestampValue != null) { + if (typeof object.timestampValue !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.TimestampValue.timestampValue: object expected"); + message.timestampValue = $root.google.protobuf.Timestamp.fromObject(object.timestampValue); + } + if (object.textValue != null) + message.textValue = String(object.textValue); + return message; + }; + + /** + * Creates a plain object from a TimestampValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.TimestampValue + * @static + * @param {google.cloud.contentwarehouse.v1.TimestampValue} message TimestampValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimestampValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.timestampValue != null && message.hasOwnProperty("timestampValue")) { + object.timestampValue = $root.google.protobuf.Timestamp.toObject(message.timestampValue, options); + if (options.oneofs) + object.value = "timestampValue"; + } + if (message.textValue != null && message.hasOwnProperty("textValue")) { + object.textValue = message.textValue; + if (options.oneofs) + object.value = "textValue"; + } + return object; + }; + + /** + * Converts this TimestampValue to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.TimestampValue + * @instance + * @returns {Object.} JSON object + */ + TimestampValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimestampValue + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.TimestampValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.TimestampValue"; + }; + + return TimestampValue; + })(); + + v1.PropertyArray = (function() { + + /** + * Properties of a PropertyArray. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IPropertyArray + * @property {Array.|null} [properties] PropertyArray properties + */ + + /** + * Constructs a new PropertyArray. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a PropertyArray. + * @implements IPropertyArray + * @constructor + * @param {google.cloud.contentwarehouse.v1.IPropertyArray=} [properties] Properties to set + */ + function PropertyArray(properties) { + this.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]]; + } + + /** + * PropertyArray properties. + * @member {Array.} properties + * @memberof google.cloud.contentwarehouse.v1.PropertyArray + * @instance + */ + PropertyArray.prototype.properties = $util.emptyArray; + + /** + * Creates a new PropertyArray instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.PropertyArray + * @static + * @param {google.cloud.contentwarehouse.v1.IPropertyArray=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.PropertyArray} PropertyArray instance + */ + PropertyArray.create = function create(properties) { + return new PropertyArray(properties); + }; + + /** + * Encodes the specified PropertyArray message. Does not implicitly {@link google.cloud.contentwarehouse.v1.PropertyArray.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.PropertyArray + * @static + * @param {google.cloud.contentwarehouse.v1.IPropertyArray} message PropertyArray message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PropertyArray.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.properties != null && message.properties.length) + for (var i = 0; i < message.properties.length; ++i) + $root.google.cloud.contentwarehouse.v1.Property.encode(message.properties[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PropertyArray message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.PropertyArray.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.PropertyArray + * @static + * @param {google.cloud.contentwarehouse.v1.IPropertyArray} message PropertyArray message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PropertyArray.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PropertyArray message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.PropertyArray + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.PropertyArray} PropertyArray + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PropertyArray.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.PropertyArray(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.properties && message.properties.length)) + message.properties = []; + message.properties.push($root.google.cloud.contentwarehouse.v1.Property.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PropertyArray message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.PropertyArray + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.PropertyArray} PropertyArray + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PropertyArray.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PropertyArray message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.PropertyArray + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PropertyArray.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.properties != null && message.hasOwnProperty("properties")) { + if (!Array.isArray(message.properties)) + return "properties: array expected"; + for (var i = 0; i < message.properties.length; ++i) { + var error = $root.google.cloud.contentwarehouse.v1.Property.verify(message.properties[i]); + if (error) + return "properties." + error; + } + } + return null; + }; + + /** + * Creates a PropertyArray message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.PropertyArray + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.PropertyArray} PropertyArray + */ + PropertyArray.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.PropertyArray) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.PropertyArray(); + if (object.properties) { + if (!Array.isArray(object.properties)) + throw TypeError(".google.cloud.contentwarehouse.v1.PropertyArray.properties: array expected"); + message.properties = []; + for (var i = 0; i < object.properties.length; ++i) { + if (typeof object.properties[i] !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.PropertyArray.properties: object expected"); + message.properties[i] = $root.google.cloud.contentwarehouse.v1.Property.fromObject(object.properties[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PropertyArray message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.PropertyArray + * @static + * @param {google.cloud.contentwarehouse.v1.PropertyArray} message PropertyArray + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PropertyArray.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.properties = []; + if (message.properties && message.properties.length) { + object.properties = []; + for (var j = 0; j < message.properties.length; ++j) + object.properties[j] = $root.google.cloud.contentwarehouse.v1.Property.toObject(message.properties[j], options); + } + return object; + }; + + /** + * Converts this PropertyArray to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.PropertyArray + * @instance + * @returns {Object.} JSON object + */ + PropertyArray.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PropertyArray + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.PropertyArray + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PropertyArray.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.PropertyArray"; + }; + + return PropertyArray; + })(); + + v1.MapProperty = (function() { + + /** + * Properties of a MapProperty. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IMapProperty + * @property {Object.|null} [fields] MapProperty fields + */ + + /** + * Constructs a new MapProperty. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a MapProperty. + * @implements IMapProperty + * @constructor + * @param {google.cloud.contentwarehouse.v1.IMapProperty=} [properties] Properties to set + */ + function MapProperty(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]]; + } + + /** + * MapProperty fields. + * @member {Object.} fields + * @memberof google.cloud.contentwarehouse.v1.MapProperty + * @instance + */ + MapProperty.prototype.fields = $util.emptyObject; + + /** + * Creates a new MapProperty instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.MapProperty + * @static + * @param {google.cloud.contentwarehouse.v1.IMapProperty=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.MapProperty} MapProperty instance + */ + MapProperty.create = function create(properties) { + return new MapProperty(properties); + }; + + /** + * Encodes the specified MapProperty message. Does not implicitly {@link google.cloud.contentwarehouse.v1.MapProperty.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.MapProperty + * @static + * @param {google.cloud.contentwarehouse.v1.IMapProperty} message MapProperty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MapProperty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) + for (var keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.contentwarehouse.v1.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified MapProperty message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.MapProperty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.MapProperty + * @static + * @param {google.cloud.contentwarehouse.v1.IMapProperty} message MapProperty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MapProperty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MapProperty message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.MapProperty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.MapProperty} MapProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MapProperty.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.MapProperty(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (message.fields === $util.emptyObject) + message.fields = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.contentwarehouse.v1.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.fields[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MapProperty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.MapProperty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.MapProperty} MapProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MapProperty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MapProperty message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.MapProperty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MapProperty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!$util.isObject(message.fields)) + return "fields: object expected"; + var key = Object.keys(message.fields); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.contentwarehouse.v1.Value.verify(message.fields[key[i]]); + if (error) + return "fields." + error; + } + } + return null; + }; + + /** + * Creates a MapProperty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.MapProperty + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.MapProperty} MapProperty + */ + MapProperty.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.MapProperty) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.MapProperty(); + if (object.fields) { + if (typeof object.fields !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.MapProperty.fields: object expected"); + message.fields = {}; + for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { + if (typeof object.fields[keys[i]] !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.MapProperty.fields: object expected"); + message.fields[keys[i]] = $root.google.cloud.contentwarehouse.v1.Value.fromObject(object.fields[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a MapProperty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.MapProperty + * @static + * @param {google.cloud.contentwarehouse.v1.MapProperty} message MapProperty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MapProperty.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.fields = {}; + var keys2; + if (message.fields && (keys2 = Object.keys(message.fields)).length) { + object.fields = {}; + for (var j = 0; j < keys2.length; ++j) + object.fields[keys2[j]] = $root.google.cloud.contentwarehouse.v1.Value.toObject(message.fields[keys2[j]], options); + } + return object; + }; + + /** + * Converts this MapProperty to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.MapProperty + * @instance + * @returns {Object.} JSON object + */ + MapProperty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MapProperty + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.MapProperty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MapProperty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.MapProperty"; + }; + + return MapProperty; + })(); + + v1.Value = (function() { + + /** + * Properties of a Value. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IValue + * @property {number|null} [floatValue] Value floatValue + * @property {number|null} [intValue] Value intValue + * @property {string|null} [stringValue] Value stringValue + * @property {google.cloud.contentwarehouse.v1.IEnumValue|null} [enumValue] Value enumValue + * @property {google.type.IDateTime|null} [datetimeValue] Value datetimeValue + * @property {google.cloud.contentwarehouse.v1.ITimestampValue|null} [timestampValue] Value timestampValue + * @property {boolean|null} [booleanValue] Value booleanValue + */ + + /** + * Constructs a new Value. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a Value. + * @implements IValue + * @constructor + * @param {google.cloud.contentwarehouse.v1.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 floatValue. + * @member {number|null|undefined} floatValue + * @memberof google.cloud.contentwarehouse.v1.Value + * @instance + */ + Value.prototype.floatValue = null; + + /** + * Value intValue. + * @member {number|null|undefined} intValue + * @memberof google.cloud.contentwarehouse.v1.Value + * @instance + */ + Value.prototype.intValue = null; + + /** + * Value stringValue. + * @member {string|null|undefined} stringValue + * @memberof google.cloud.contentwarehouse.v1.Value + * @instance + */ + Value.prototype.stringValue = null; + + /** + * Value enumValue. + * @member {google.cloud.contentwarehouse.v1.IEnumValue|null|undefined} enumValue + * @memberof google.cloud.contentwarehouse.v1.Value + * @instance + */ + Value.prototype.enumValue = null; + + /** + * Value datetimeValue. + * @member {google.type.IDateTime|null|undefined} datetimeValue + * @memberof google.cloud.contentwarehouse.v1.Value + * @instance + */ + Value.prototype.datetimeValue = null; + + /** + * Value timestampValue. + * @member {google.cloud.contentwarehouse.v1.ITimestampValue|null|undefined} timestampValue + * @memberof google.cloud.contentwarehouse.v1.Value + * @instance + */ + Value.prototype.timestampValue = null; + + /** + * Value booleanValue. + * @member {boolean|null|undefined} booleanValue + * @memberof google.cloud.contentwarehouse.v1.Value + * @instance + */ + Value.prototype.booleanValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Value kind. + * @member {"floatValue"|"intValue"|"stringValue"|"enumValue"|"datetimeValue"|"timestampValue"|"booleanValue"|undefined} kind + * @memberof google.cloud.contentwarehouse.v1.Value + * @instance + */ + Object.defineProperty(Value.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["floatValue", "intValue", "stringValue", "enumValue", "datetimeValue", "timestampValue", "booleanValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Value instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.Value + * @static + * @param {google.cloud.contentwarehouse.v1.IValue=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.Value} Value instance + */ + Value.create = function create(properties) { + return new Value(properties); + }; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.cloud.contentwarehouse.v1.Value.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.Value + * @static + * @param {google.cloud.contentwarehouse.v1.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.floatValue != null && Object.hasOwnProperty.call(message, "floatValue")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.floatValue); + if (message.intValue != null && Object.hasOwnProperty.call(message, "intValue")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.intValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); + if (message.enumValue != null && Object.hasOwnProperty.call(message, "enumValue")) + $root.google.cloud.contentwarehouse.v1.EnumValue.encode(message.enumValue, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.datetimeValue != null && Object.hasOwnProperty.call(message, "datetimeValue")) + $root.google.type.DateTime.encode(message.datetimeValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.timestampValue != null && Object.hasOwnProperty.call(message, "timestampValue")) + $root.google.cloud.contentwarehouse.v1.TimestampValue.encode(message.timestampValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.booleanValue != null && Object.hasOwnProperty.call(message, "booleanValue")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.booleanValue); + return writer; + }; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.Value + * @static + * @param {google.cloud.contentwarehouse.v1.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.cloud.contentwarehouse.v1.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.floatValue = reader.float(); + break; + } + case 2: { + message.intValue = reader.int32(); + break; + } + case 3: { + message.stringValue = reader.string(); + break; + } + case 4: { + message.enumValue = $root.google.cloud.contentwarehouse.v1.EnumValue.decode(reader, reader.uint32()); + break; + } + case 5: { + message.datetimeValue = $root.google.type.DateTime.decode(reader, reader.uint32()); + break; + } + case 6: { + message.timestampValue = $root.google.cloud.contentwarehouse.v1.TimestampValue.decode(reader, reader.uint32()); + break; + } + case 7: { + message.booleanValue = reader.bool(); + 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.cloud.contentwarehouse.v1.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.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.cloud.contentwarehouse.v1.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.floatValue != null && message.hasOwnProperty("floatValue")) { + properties.kind = 1; + if (typeof message.floatValue !== "number") + return "floatValue: number expected"; + } + if (message.intValue != null && message.hasOwnProperty("intValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (!$util.isInteger(message.intValue)) + return "intValue: integer expected"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + if (message.enumValue != null && message.hasOwnProperty("enumValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.cloud.contentwarehouse.v1.EnumValue.verify(message.enumValue); + if (error) + return "enumValue." + error; + } + } + if (message.datetimeValue != null && message.hasOwnProperty("datetimeValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.type.DateTime.verify(message.datetimeValue); + if (error) + return "datetimeValue." + error; + } + } + if (message.timestampValue != null && message.hasOwnProperty("timestampValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.cloud.contentwarehouse.v1.TimestampValue.verify(message.timestampValue); + if (error) + return "timestampValue." + error; + } + } + if (message.booleanValue != null && message.hasOwnProperty("booleanValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.booleanValue !== "boolean") + return "booleanValue: boolean expected"; + } + return null; + }; + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.Value + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.Value} Value + */ + Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.Value) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.Value(); + if (object.floatValue != null) + message.floatValue = Number(object.floatValue); + if (object.intValue != null) + message.intValue = object.intValue | 0; + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + if (object.enumValue != null) { + if (typeof object.enumValue !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.Value.enumValue: object expected"); + message.enumValue = $root.google.cloud.contentwarehouse.v1.EnumValue.fromObject(object.enumValue); + } + if (object.datetimeValue != null) { + if (typeof object.datetimeValue !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.Value.datetimeValue: object expected"); + message.datetimeValue = $root.google.type.DateTime.fromObject(object.datetimeValue); + } + if (object.timestampValue != null) { + if (typeof object.timestampValue !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.Value.timestampValue: object expected"); + message.timestampValue = $root.google.cloud.contentwarehouse.v1.TimestampValue.fromObject(object.timestampValue); + } + if (object.booleanValue != null) + message.booleanValue = Boolean(object.booleanValue); + return message; + }; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.Value + * @static + * @param {google.cloud.contentwarehouse.v1.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.floatValue != null && message.hasOwnProperty("floatValue")) { + object.floatValue = options.json && !isFinite(message.floatValue) ? String(message.floatValue) : message.floatValue; + if (options.oneofs) + object.kind = "floatValue"; + } + if (message.intValue != null && message.hasOwnProperty("intValue")) { + object.intValue = message.intValue; + if (options.oneofs) + object.kind = "intValue"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.kind = "stringValue"; + } + if (message.enumValue != null && message.hasOwnProperty("enumValue")) { + object.enumValue = $root.google.cloud.contentwarehouse.v1.EnumValue.toObject(message.enumValue, options); + if (options.oneofs) + object.kind = "enumValue"; + } + if (message.datetimeValue != null && message.hasOwnProperty("datetimeValue")) { + object.datetimeValue = $root.google.type.DateTime.toObject(message.datetimeValue, options); + if (options.oneofs) + object.kind = "datetimeValue"; + } + if (message.timestampValue != null && message.hasOwnProperty("timestampValue")) { + object.timestampValue = $root.google.cloud.contentwarehouse.v1.TimestampValue.toObject(message.timestampValue, options); + if (options.oneofs) + object.kind = "timestampValue"; + } + if (message.booleanValue != null && message.hasOwnProperty("booleanValue")) { + object.booleanValue = message.booleanValue; + if (options.oneofs) + object.kind = "booleanValue"; + } + return object; + }; + + /** + * Converts this Value to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.Value + * @instance + * @returns {Object.} JSON object + */ + Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Value + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.Value"; + }; + + return Value; + })(); + + v1.EnumValue = (function() { + + /** + * Properties of an EnumValue. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IEnumValue + * @property {string|null} [value] EnumValue value + */ + + /** + * Constructs a new EnumValue. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents an EnumValue. + * @implements IEnumValue + * @constructor + * @param {google.cloud.contentwarehouse.v1.IEnumValue=} [properties] Properties to set + */ + function EnumValue(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]]; + } + + /** + * EnumValue value. + * @member {string} value + * @memberof google.cloud.contentwarehouse.v1.EnumValue + * @instance + */ + EnumValue.prototype.value = ""; + + /** + * Creates a new EnumValue instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.EnumValue + * @static + * @param {google.cloud.contentwarehouse.v1.IEnumValue=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.EnumValue} EnumValue instance + */ + EnumValue.create = function create(properties) { + return new EnumValue(properties); + }; + + /** + * Encodes the specified EnumValue message. Does not implicitly {@link google.cloud.contentwarehouse.v1.EnumValue.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.EnumValue + * @static + * @param {google.cloud.contentwarehouse.v1.IEnumValue} message EnumValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + return writer; + }; + + /** + * Encodes the specified EnumValue message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.EnumValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.EnumValue + * @static + * @param {google.cloud.contentwarehouse.v1.IEnumValue} message EnumValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValue message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.EnumValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.EnumValue} EnumValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.EnumValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.EnumValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.EnumValue} EnumValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValue message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.EnumValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates an EnumValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.EnumValue + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.EnumValue} EnumValue + */ + EnumValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.EnumValue) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.EnumValue(); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an EnumValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.EnumValue + * @static + * @param {google.cloud.contentwarehouse.v1.EnumValue} message EnumValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = ""; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this EnumValue to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.EnumValue + * @instance + * @returns {Object.} JSON object + */ + EnumValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValue + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.EnumValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.EnumValue"; + }; + + return EnumValue; + })(); + + /** + * RawDocumentFileType enum. + * @name google.cloud.contentwarehouse.v1.RawDocumentFileType + * @enum {number} + * @property {number} RAW_DOCUMENT_FILE_TYPE_UNSPECIFIED=0 RAW_DOCUMENT_FILE_TYPE_UNSPECIFIED value + * @property {number} RAW_DOCUMENT_FILE_TYPE_PDF=1 RAW_DOCUMENT_FILE_TYPE_PDF value + * @property {number} RAW_DOCUMENT_FILE_TYPE_DOCX=2 RAW_DOCUMENT_FILE_TYPE_DOCX value + * @property {number} RAW_DOCUMENT_FILE_TYPE_XLSX=3 RAW_DOCUMENT_FILE_TYPE_XLSX value + * @property {number} RAW_DOCUMENT_FILE_TYPE_PPTX=4 RAW_DOCUMENT_FILE_TYPE_PPTX value + * @property {number} RAW_DOCUMENT_FILE_TYPE_TEXT=5 RAW_DOCUMENT_FILE_TYPE_TEXT value + * @property {number} RAW_DOCUMENT_FILE_TYPE_TIFF=6 RAW_DOCUMENT_FILE_TYPE_TIFF value + */ + v1.RawDocumentFileType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RAW_DOCUMENT_FILE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RAW_DOCUMENT_FILE_TYPE_PDF"] = 1; + values[valuesById[2] = "RAW_DOCUMENT_FILE_TYPE_DOCX"] = 2; + values[valuesById[3] = "RAW_DOCUMENT_FILE_TYPE_XLSX"] = 3; + values[valuesById[4] = "RAW_DOCUMENT_FILE_TYPE_PPTX"] = 4; + values[valuesById[5] = "RAW_DOCUMENT_FILE_TYPE_TEXT"] = 5; + values[valuesById[6] = "RAW_DOCUMENT_FILE_TYPE_TIFF"] = 6; + return values; + })(); + + /** + * ContentCategory enum. + * @name google.cloud.contentwarehouse.v1.ContentCategory + * @enum {number} + * @property {number} CONTENT_CATEGORY_UNSPECIFIED=0 CONTENT_CATEGORY_UNSPECIFIED value + * @property {number} CONTENT_CATEGORY_IMAGE=1 CONTENT_CATEGORY_IMAGE value + * @property {number} CONTENT_CATEGORY_AUDIO=2 CONTENT_CATEGORY_AUDIO value + * @property {number} CONTENT_CATEGORY_VIDEO=3 CONTENT_CATEGORY_VIDEO value + */ + v1.ContentCategory = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONTENT_CATEGORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "CONTENT_CATEGORY_IMAGE"] = 1; + values[valuesById[2] = "CONTENT_CATEGORY_AUDIO"] = 2; + values[valuesById[3] = "CONTENT_CATEGORY_VIDEO"] = 3; + return values; + })(); + + v1.DocumentLinkService = (function() { + + /** + * Constructs a new DocumentLinkService service. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a DocumentLinkService + * @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 DocumentLinkService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (DocumentLinkService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = DocumentLinkService; + + /** + * Creates new DocumentLinkService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.contentwarehouse.v1.DocumentLinkService + * @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 {DocumentLinkService} RPC service. Useful where requests and/or responses are streamed. + */ + DocumentLinkService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentLinkService|listLinkedTargets}. + * @memberof google.cloud.contentwarehouse.v1.DocumentLinkService + * @typedef ListLinkedTargetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse} [response] ListLinkedTargetsResponse + */ + + /** + * Calls ListLinkedTargets. + * @function listLinkedTargets + * @memberof google.cloud.contentwarehouse.v1.DocumentLinkService + * @instance + * @param {google.cloud.contentwarehouse.v1.IListLinkedTargetsRequest} request ListLinkedTargetsRequest message or plain object + * @param {google.cloud.contentwarehouse.v1.DocumentLinkService.ListLinkedTargetsCallback} callback Node-style callback called with the error, if any, and ListLinkedTargetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentLinkService.prototype.listLinkedTargets = function listLinkedTargets(request, callback) { + return this.rpcCall(listLinkedTargets, $root.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest, $root.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse, request, callback); + }, "name", { value: "ListLinkedTargets" }); + + /** + * Calls ListLinkedTargets. + * @function listLinkedTargets + * @memberof google.cloud.contentwarehouse.v1.DocumentLinkService + * @instance + * @param {google.cloud.contentwarehouse.v1.IListLinkedTargetsRequest} request ListLinkedTargetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentLinkService|listLinkedSources}. + * @memberof google.cloud.contentwarehouse.v1.DocumentLinkService + * @typedef ListLinkedSourcesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse} [response] ListLinkedSourcesResponse + */ + + /** + * Calls ListLinkedSources. + * @function listLinkedSources + * @memberof google.cloud.contentwarehouse.v1.DocumentLinkService + * @instance + * @param {google.cloud.contentwarehouse.v1.IListLinkedSourcesRequest} request ListLinkedSourcesRequest message or plain object + * @param {google.cloud.contentwarehouse.v1.DocumentLinkService.ListLinkedSourcesCallback} callback Node-style callback called with the error, if any, and ListLinkedSourcesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentLinkService.prototype.listLinkedSources = function listLinkedSources(request, callback) { + return this.rpcCall(listLinkedSources, $root.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest, $root.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse, request, callback); + }, "name", { value: "ListLinkedSources" }); + + /** + * Calls ListLinkedSources. + * @function listLinkedSources + * @memberof google.cloud.contentwarehouse.v1.DocumentLinkService + * @instance + * @param {google.cloud.contentwarehouse.v1.IListLinkedSourcesRequest} request ListLinkedSourcesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentLinkService|createDocumentLink}. + * @memberof google.cloud.contentwarehouse.v1.DocumentLinkService + * @typedef CreateDocumentLinkCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.contentwarehouse.v1.DocumentLink} [response] DocumentLink + */ + + /** + * Calls CreateDocumentLink. + * @function createDocumentLink + * @memberof google.cloud.contentwarehouse.v1.DocumentLinkService + * @instance + * @param {google.cloud.contentwarehouse.v1.ICreateDocumentLinkRequest} request CreateDocumentLinkRequest message or plain object + * @param {google.cloud.contentwarehouse.v1.DocumentLinkService.CreateDocumentLinkCallback} callback Node-style callback called with the error, if any, and DocumentLink + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentLinkService.prototype.createDocumentLink = function createDocumentLink(request, callback) { + return this.rpcCall(createDocumentLink, $root.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest, $root.google.cloud.contentwarehouse.v1.DocumentLink, request, callback); + }, "name", { value: "CreateDocumentLink" }); + + /** + * Calls CreateDocumentLink. + * @function createDocumentLink + * @memberof google.cloud.contentwarehouse.v1.DocumentLinkService + * @instance + * @param {google.cloud.contentwarehouse.v1.ICreateDocumentLinkRequest} request CreateDocumentLinkRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentLinkService|deleteDocumentLink}. + * @memberof google.cloud.contentwarehouse.v1.DocumentLinkService + * @typedef DeleteDocumentLinkCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteDocumentLink. + * @function deleteDocumentLink + * @memberof google.cloud.contentwarehouse.v1.DocumentLinkService + * @instance + * @param {google.cloud.contentwarehouse.v1.IDeleteDocumentLinkRequest} request DeleteDocumentLinkRequest message or plain object + * @param {google.cloud.contentwarehouse.v1.DocumentLinkService.DeleteDocumentLinkCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentLinkService.prototype.deleteDocumentLink = function deleteDocumentLink(request, callback) { + return this.rpcCall(deleteDocumentLink, $root.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteDocumentLink" }); + + /** + * Calls DeleteDocumentLink. + * @function deleteDocumentLink + * @memberof google.cloud.contentwarehouse.v1.DocumentLinkService + * @instance + * @param {google.cloud.contentwarehouse.v1.IDeleteDocumentLinkRequest} request DeleteDocumentLinkRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return DocumentLinkService; + })(); + + v1.ListLinkedTargetsResponse = (function() { + + /** + * Properties of a ListLinkedTargetsResponse. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IListLinkedTargetsResponse + * @property {Array.|null} [documentLinks] ListLinkedTargetsResponse documentLinks + * @property {string|null} [nextPageToken] ListLinkedTargetsResponse nextPageToken + */ + + /** + * Constructs a new ListLinkedTargetsResponse. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a ListLinkedTargetsResponse. + * @implements IListLinkedTargetsResponse + * @constructor + * @param {google.cloud.contentwarehouse.v1.IListLinkedTargetsResponse=} [properties] Properties to set + */ + function ListLinkedTargetsResponse(properties) { + this.documentLinks = []; + 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]]; + } + + /** + * ListLinkedTargetsResponse documentLinks. + * @member {Array.} documentLinks + * @memberof google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse + * @instance + */ + ListLinkedTargetsResponse.prototype.documentLinks = $util.emptyArray; + + /** + * ListLinkedTargetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse + * @instance + */ + ListLinkedTargetsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListLinkedTargetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse + * @static + * @param {google.cloud.contentwarehouse.v1.IListLinkedTargetsResponse=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse} ListLinkedTargetsResponse instance + */ + ListLinkedTargetsResponse.create = function create(properties) { + return new ListLinkedTargetsResponse(properties); + }; + + /** + * Encodes the specified ListLinkedTargetsResponse message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse + * @static + * @param {google.cloud.contentwarehouse.v1.IListLinkedTargetsResponse} message ListLinkedTargetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListLinkedTargetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documentLinks != null && message.documentLinks.length) + for (var i = 0; i < message.documentLinks.length; ++i) + $root.google.cloud.contentwarehouse.v1.DocumentLink.encode(message.documentLinks[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 ListLinkedTargetsResponse message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse + * @static + * @param {google.cloud.contentwarehouse.v1.IListLinkedTargetsResponse} message ListLinkedTargetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListLinkedTargetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListLinkedTargetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse} ListLinkedTargetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListLinkedTargetsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.documentLinks && message.documentLinks.length)) + message.documentLinks = []; + message.documentLinks.push($root.google.cloud.contentwarehouse.v1.DocumentLink.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListLinkedTargetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse} ListLinkedTargetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListLinkedTargetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListLinkedTargetsResponse message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListLinkedTargetsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.documentLinks != null && message.hasOwnProperty("documentLinks")) { + if (!Array.isArray(message.documentLinks)) + return "documentLinks: array expected"; + for (var i = 0; i < message.documentLinks.length; ++i) { + var error = $root.google.cloud.contentwarehouse.v1.DocumentLink.verify(message.documentLinks[i]); + if (error) + return "documentLinks." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListLinkedTargetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse} ListLinkedTargetsResponse + */ + ListLinkedTargetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse(); + if (object.documentLinks) { + if (!Array.isArray(object.documentLinks)) + throw TypeError(".google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse.documentLinks: array expected"); + message.documentLinks = []; + for (var i = 0; i < object.documentLinks.length; ++i) { + if (typeof object.documentLinks[i] !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse.documentLinks: object expected"); + message.documentLinks[i] = $root.google.cloud.contentwarehouse.v1.DocumentLink.fromObject(object.documentLinks[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListLinkedTargetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse + * @static + * @param {google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse} message ListLinkedTargetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListLinkedTargetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.documentLinks = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.documentLinks && message.documentLinks.length) { + object.documentLinks = []; + for (var j = 0; j < message.documentLinks.length; ++j) + object.documentLinks[j] = $root.google.cloud.contentwarehouse.v1.DocumentLink.toObject(message.documentLinks[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListLinkedTargetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse + * @instance + * @returns {Object.} JSON object + */ + ListLinkedTargetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListLinkedTargetsResponse + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListLinkedTargetsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse"; + }; + + return ListLinkedTargetsResponse; + })(); + + v1.ListLinkedTargetsRequest = (function() { + + /** + * Properties of a ListLinkedTargetsRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IListLinkedTargetsRequest + * @property {string|null} [parent] ListLinkedTargetsRequest parent + * @property {google.cloud.contentwarehouse.v1.IRequestMetadata|null} [requestMetadata] ListLinkedTargetsRequest requestMetadata + */ + + /** + * Constructs a new ListLinkedTargetsRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a ListLinkedTargetsRequest. + * @implements IListLinkedTargetsRequest + * @constructor + * @param {google.cloud.contentwarehouse.v1.IListLinkedTargetsRequest=} [properties] Properties to set + */ + function ListLinkedTargetsRequest(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]]; + } + + /** + * ListLinkedTargetsRequest parent. + * @member {string} parent + * @memberof google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest + * @instance + */ + ListLinkedTargetsRequest.prototype.parent = ""; + + /** + * ListLinkedTargetsRequest requestMetadata. + * @member {google.cloud.contentwarehouse.v1.IRequestMetadata|null|undefined} requestMetadata + * @memberof google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest + * @instance + */ + ListLinkedTargetsRequest.prototype.requestMetadata = null; + + /** + * Creates a new ListLinkedTargetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IListLinkedTargetsRequest=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest} ListLinkedTargetsRequest instance + */ + ListLinkedTargetsRequest.create = function create(properties) { + return new ListLinkedTargetsRequest(properties); + }; + + /** + * Encodes the specified ListLinkedTargetsRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IListLinkedTargetsRequest} message ListLinkedTargetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListLinkedTargetsRequest.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.requestMetadata != null && Object.hasOwnProperty.call(message, "requestMetadata")) + $root.google.cloud.contentwarehouse.v1.RequestMetadata.encode(message.requestMetadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListLinkedTargetsRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IListLinkedTargetsRequest} message ListLinkedTargetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListLinkedTargetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListLinkedTargetsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest} ListLinkedTargetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListLinkedTargetsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListLinkedTargetsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest} ListLinkedTargetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListLinkedTargetsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListLinkedTargetsRequest message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListLinkedTargetsRequest.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.requestMetadata != null && message.hasOwnProperty("requestMetadata")) { + var error = $root.google.cloud.contentwarehouse.v1.RequestMetadata.verify(message.requestMetadata); + if (error) + return "requestMetadata." + error; + } + return null; + }; + + /** + * Creates a ListLinkedTargetsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest} ListLinkedTargetsRequest + */ + ListLinkedTargetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.requestMetadata != null) { + if (typeof object.requestMetadata !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest.requestMetadata: object expected"); + message.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.fromObject(object.requestMetadata); + } + return message; + }; + + /** + * Creates a plain object from a ListLinkedTargetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest + * @static + * @param {google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest} message ListLinkedTargetsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListLinkedTargetsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.requestMetadata = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.requestMetadata != null && message.hasOwnProperty("requestMetadata")) + object.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.toObject(message.requestMetadata, options); + return object; + }; + + /** + * Converts this ListLinkedTargetsRequest to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest + * @instance + * @returns {Object.} JSON object + */ + ListLinkedTargetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListLinkedTargetsRequest + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListLinkedTargetsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest"; + }; + + return ListLinkedTargetsRequest; + })(); + + v1.ListLinkedSourcesResponse = (function() { + + /** + * Properties of a ListLinkedSourcesResponse. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IListLinkedSourcesResponse + * @property {Array.|null} [documentLinks] ListLinkedSourcesResponse documentLinks + * @property {string|null} [nextPageToken] ListLinkedSourcesResponse nextPageToken + */ + + /** + * Constructs a new ListLinkedSourcesResponse. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a ListLinkedSourcesResponse. + * @implements IListLinkedSourcesResponse + * @constructor + * @param {google.cloud.contentwarehouse.v1.IListLinkedSourcesResponse=} [properties] Properties to set + */ + function ListLinkedSourcesResponse(properties) { + this.documentLinks = []; + 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]]; + } + + /** + * ListLinkedSourcesResponse documentLinks. + * @member {Array.} documentLinks + * @memberof google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse + * @instance + */ + ListLinkedSourcesResponse.prototype.documentLinks = $util.emptyArray; + + /** + * ListLinkedSourcesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse + * @instance + */ + ListLinkedSourcesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListLinkedSourcesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse + * @static + * @param {google.cloud.contentwarehouse.v1.IListLinkedSourcesResponse=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse} ListLinkedSourcesResponse instance + */ + ListLinkedSourcesResponse.create = function create(properties) { + return new ListLinkedSourcesResponse(properties); + }; + + /** + * Encodes the specified ListLinkedSourcesResponse message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse + * @static + * @param {google.cloud.contentwarehouse.v1.IListLinkedSourcesResponse} message ListLinkedSourcesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListLinkedSourcesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documentLinks != null && message.documentLinks.length) + for (var i = 0; i < message.documentLinks.length; ++i) + $root.google.cloud.contentwarehouse.v1.DocumentLink.encode(message.documentLinks[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 ListLinkedSourcesResponse message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse + * @static + * @param {google.cloud.contentwarehouse.v1.IListLinkedSourcesResponse} message ListLinkedSourcesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListLinkedSourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListLinkedSourcesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse} ListLinkedSourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListLinkedSourcesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.documentLinks && message.documentLinks.length)) + message.documentLinks = []; + message.documentLinks.push($root.google.cloud.contentwarehouse.v1.DocumentLink.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListLinkedSourcesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse} ListLinkedSourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListLinkedSourcesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListLinkedSourcesResponse message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListLinkedSourcesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.documentLinks != null && message.hasOwnProperty("documentLinks")) { + if (!Array.isArray(message.documentLinks)) + return "documentLinks: array expected"; + for (var i = 0; i < message.documentLinks.length; ++i) { + var error = $root.google.cloud.contentwarehouse.v1.DocumentLink.verify(message.documentLinks[i]); + if (error) + return "documentLinks." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListLinkedSourcesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse} ListLinkedSourcesResponse + */ + ListLinkedSourcesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse(); + if (object.documentLinks) { + if (!Array.isArray(object.documentLinks)) + throw TypeError(".google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse.documentLinks: array expected"); + message.documentLinks = []; + for (var i = 0; i < object.documentLinks.length; ++i) { + if (typeof object.documentLinks[i] !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse.documentLinks: object expected"); + message.documentLinks[i] = $root.google.cloud.contentwarehouse.v1.DocumentLink.fromObject(object.documentLinks[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListLinkedSourcesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse + * @static + * @param {google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse} message ListLinkedSourcesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListLinkedSourcesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.documentLinks = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.documentLinks && message.documentLinks.length) { + object.documentLinks = []; + for (var j = 0; j < message.documentLinks.length; ++j) + object.documentLinks[j] = $root.google.cloud.contentwarehouse.v1.DocumentLink.toObject(message.documentLinks[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListLinkedSourcesResponse to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse + * @instance + * @returns {Object.} JSON object + */ + ListLinkedSourcesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListLinkedSourcesResponse + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListLinkedSourcesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse"; + }; + + return ListLinkedSourcesResponse; + })(); + + v1.ListLinkedSourcesRequest = (function() { + + /** + * Properties of a ListLinkedSourcesRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IListLinkedSourcesRequest + * @property {string|null} [parent] ListLinkedSourcesRequest parent + * @property {number|null} [pageSize] ListLinkedSourcesRequest pageSize + * @property {string|null} [pageToken] ListLinkedSourcesRequest pageToken + * @property {google.cloud.contentwarehouse.v1.IRequestMetadata|null} [requestMetadata] ListLinkedSourcesRequest requestMetadata + */ + + /** + * Constructs a new ListLinkedSourcesRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a ListLinkedSourcesRequest. + * @implements IListLinkedSourcesRequest + * @constructor + * @param {google.cloud.contentwarehouse.v1.IListLinkedSourcesRequest=} [properties] Properties to set + */ + function ListLinkedSourcesRequest(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]]; + } + + /** + * ListLinkedSourcesRequest parent. + * @member {string} parent + * @memberof google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest + * @instance + */ + ListLinkedSourcesRequest.prototype.parent = ""; + + /** + * ListLinkedSourcesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest + * @instance + */ + ListLinkedSourcesRequest.prototype.pageSize = 0; + + /** + * ListLinkedSourcesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest + * @instance + */ + ListLinkedSourcesRequest.prototype.pageToken = ""; + + /** + * ListLinkedSourcesRequest requestMetadata. + * @member {google.cloud.contentwarehouse.v1.IRequestMetadata|null|undefined} requestMetadata + * @memberof google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest + * @instance + */ + ListLinkedSourcesRequest.prototype.requestMetadata = null; + + /** + * Creates a new ListLinkedSourcesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IListLinkedSourcesRequest=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest} ListLinkedSourcesRequest instance + */ + ListLinkedSourcesRequest.create = function create(properties) { + return new ListLinkedSourcesRequest(properties); + }; + + /** + * Encodes the specified ListLinkedSourcesRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IListLinkedSourcesRequest} message ListLinkedSourcesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListLinkedSourcesRequest.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.requestMetadata != null && Object.hasOwnProperty.call(message, "requestMetadata")) + $root.google.cloud.contentwarehouse.v1.RequestMetadata.encode(message.requestMetadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListLinkedSourcesRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IListLinkedSourcesRequest} message ListLinkedSourcesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListLinkedSourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListLinkedSourcesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest} ListLinkedSourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListLinkedSourcesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + case 2: { + message.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListLinkedSourcesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest} ListLinkedSourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListLinkedSourcesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListLinkedSourcesRequest message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListLinkedSourcesRequest.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.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.requestMetadata != null && message.hasOwnProperty("requestMetadata")) { + var error = $root.google.cloud.contentwarehouse.v1.RequestMetadata.verify(message.requestMetadata); + if (error) + return "requestMetadata." + error; + } + return null; + }; + + /** + * Creates a ListLinkedSourcesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest} ListLinkedSourcesRequest + */ + ListLinkedSourcesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.requestMetadata != null) { + if (typeof object.requestMetadata !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest.requestMetadata: object expected"); + message.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.fromObject(object.requestMetadata); + } + return message; + }; + + /** + * Creates a plain object from a ListLinkedSourcesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest + * @static + * @param {google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest} message ListLinkedSourcesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListLinkedSourcesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.requestMetadata = null; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.requestMetadata != null && message.hasOwnProperty("requestMetadata")) + object.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.toObject(message.requestMetadata, options); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListLinkedSourcesRequest to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest + * @instance + * @returns {Object.} JSON object + */ + ListLinkedSourcesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListLinkedSourcesRequest + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListLinkedSourcesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest"; + }; + + return ListLinkedSourcesRequest; + })(); + + v1.DocumentLink = (function() { + + /** + * Properties of a DocumentLink. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IDocumentLink + * @property {string|null} [name] DocumentLink name + * @property {google.cloud.contentwarehouse.v1.IDocumentReference|null} [sourceDocumentReference] DocumentLink sourceDocumentReference + * @property {google.cloud.contentwarehouse.v1.IDocumentReference|null} [targetDocumentReference] DocumentLink targetDocumentReference + * @property {string|null} [description] DocumentLink description + * @property {google.protobuf.ITimestamp|null} [updateTime] DocumentLink updateTime + * @property {google.protobuf.ITimestamp|null} [createTime] DocumentLink createTime + * @property {google.cloud.contentwarehouse.v1.DocumentLink.State|null} [state] DocumentLink state + */ + + /** + * Constructs a new DocumentLink. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a DocumentLink. + * @implements IDocumentLink + * @constructor + * @param {google.cloud.contentwarehouse.v1.IDocumentLink=} [properties] Properties to set + */ + function DocumentLink(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]]; + } + + /** + * DocumentLink name. + * @member {string} name + * @memberof google.cloud.contentwarehouse.v1.DocumentLink + * @instance + */ + DocumentLink.prototype.name = ""; + + /** + * DocumentLink sourceDocumentReference. + * @member {google.cloud.contentwarehouse.v1.IDocumentReference|null|undefined} sourceDocumentReference + * @memberof google.cloud.contentwarehouse.v1.DocumentLink + * @instance + */ + DocumentLink.prototype.sourceDocumentReference = null; + + /** + * DocumentLink targetDocumentReference. + * @member {google.cloud.contentwarehouse.v1.IDocumentReference|null|undefined} targetDocumentReference + * @memberof google.cloud.contentwarehouse.v1.DocumentLink + * @instance + */ + DocumentLink.prototype.targetDocumentReference = null; + + /** + * DocumentLink description. + * @member {string} description + * @memberof google.cloud.contentwarehouse.v1.DocumentLink + * @instance + */ + DocumentLink.prototype.description = ""; + + /** + * DocumentLink updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.contentwarehouse.v1.DocumentLink + * @instance + */ + DocumentLink.prototype.updateTime = null; + + /** + * DocumentLink createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.contentwarehouse.v1.DocumentLink + * @instance + */ + DocumentLink.prototype.createTime = null; + + /** + * DocumentLink state. + * @member {google.cloud.contentwarehouse.v1.DocumentLink.State} state + * @memberof google.cloud.contentwarehouse.v1.DocumentLink + * @instance + */ + DocumentLink.prototype.state = 0; + + /** + * Creates a new DocumentLink instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.DocumentLink + * @static + * @param {google.cloud.contentwarehouse.v1.IDocumentLink=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.DocumentLink} DocumentLink instance + */ + DocumentLink.create = function create(properties) { + return new DocumentLink(properties); + }; + + /** + * Encodes the specified DocumentLink message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DocumentLink.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.DocumentLink + * @static + * @param {google.cloud.contentwarehouse.v1.IDocumentLink} message DocumentLink message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentLink.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.sourceDocumentReference != null && Object.hasOwnProperty.call(message, "sourceDocumentReference")) + $root.google.cloud.contentwarehouse.v1.DocumentReference.encode(message.sourceDocumentReference, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.targetDocumentReference != null && Object.hasOwnProperty.call(message, "targetDocumentReference")) + $root.google.cloud.contentwarehouse.v1.DocumentReference.encode(message.targetDocumentReference, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.description); + 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.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.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); + return writer; + }; + + /** + * Encodes the specified DocumentLink message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DocumentLink.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.DocumentLink + * @static + * @param {google.cloud.contentwarehouse.v1.IDocumentLink} message DocumentLink message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentLink.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DocumentLink message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.DocumentLink + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.DocumentLink} DocumentLink + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentLink.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.DocumentLink(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.sourceDocumentReference = $root.google.cloud.contentwarehouse.v1.DocumentReference.decode(reader, reader.uint32()); + break; + } + case 3: { + message.targetDocumentReference = $root.google.cloud.contentwarehouse.v1.DocumentReference.decode(reader, reader.uint32()); + break; + } + case 4: { + message.description = reader.string(); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.state = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DocumentLink message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.DocumentLink + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.DocumentLink} DocumentLink + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentLink.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DocumentLink message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.DocumentLink + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DocumentLink.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.sourceDocumentReference != null && message.hasOwnProperty("sourceDocumentReference")) { + var error = $root.google.cloud.contentwarehouse.v1.DocumentReference.verify(message.sourceDocumentReference); + if (error) + return "sourceDocumentReference." + error; + } + if (message.targetDocumentReference != null && message.hasOwnProperty("targetDocumentReference")) { + var error = $root.google.cloud.contentwarehouse.v1.DocumentReference.verify(message.targetDocumentReference); + if (error) + return "targetDocumentReference." + error; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: 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.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: + break; + } + return null; + }; + + /** + * Creates a DocumentLink message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.DocumentLink + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.DocumentLink} DocumentLink + */ + DocumentLink.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.DocumentLink) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.DocumentLink(); + if (object.name != null) + message.name = String(object.name); + if (object.sourceDocumentReference != null) { + if (typeof object.sourceDocumentReference !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.DocumentLink.sourceDocumentReference: object expected"); + message.sourceDocumentReference = $root.google.cloud.contentwarehouse.v1.DocumentReference.fromObject(object.sourceDocumentReference); + } + if (object.targetDocumentReference != null) { + if (typeof object.targetDocumentReference !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.DocumentLink.targetDocumentReference: object expected"); + message.targetDocumentReference = $root.google.cloud.contentwarehouse.v1.DocumentReference.fromObject(object.targetDocumentReference); + } + if (object.description != null) + message.description = String(object.description); + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.DocumentLink.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.DocumentLink.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "SOFT_DELETED": + case 2: + message.state = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a DocumentLink message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.DocumentLink + * @static + * @param {google.cloud.contentwarehouse.v1.DocumentLink} message DocumentLink + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DocumentLink.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.sourceDocumentReference = null; + object.targetDocumentReference = null; + object.description = ""; + object.updateTime = null; + object.createTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.sourceDocumentReference != null && message.hasOwnProperty("sourceDocumentReference")) + object.sourceDocumentReference = $root.google.cloud.contentwarehouse.v1.DocumentReference.toObject(message.sourceDocumentReference, options); + if (message.targetDocumentReference != null && message.hasOwnProperty("targetDocumentReference")) + object.targetDocumentReference = $root.google.cloud.contentwarehouse.v1.DocumentReference.toObject(message.targetDocumentReference, options); + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, 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.cloud.contentwarehouse.v1.DocumentLink.State[message.state] === undefined ? message.state : $root.google.cloud.contentwarehouse.v1.DocumentLink.State[message.state] : message.state; + return object; + }; + + /** + * Converts this DocumentLink to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.DocumentLink + * @instance + * @returns {Object.} JSON object + */ + DocumentLink.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DocumentLink + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.DocumentLink + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DocumentLink.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.DocumentLink"; + }; + + /** + * State enum. + * @name google.cloud.contentwarehouse.v1.DocumentLink.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} SOFT_DELETED=2 SOFT_DELETED value + */ + DocumentLink.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "SOFT_DELETED"] = 2; + return values; + })(); + + return DocumentLink; + })(); + + v1.CreateDocumentLinkRequest = (function() { + + /** + * Properties of a CreateDocumentLinkRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @interface ICreateDocumentLinkRequest + * @property {string|null} [parent] CreateDocumentLinkRequest parent + * @property {google.cloud.contentwarehouse.v1.IDocumentLink|null} [documentLink] CreateDocumentLinkRequest documentLink + * @property {google.cloud.contentwarehouse.v1.IRequestMetadata|null} [requestMetadata] CreateDocumentLinkRequest requestMetadata + */ + + /** + * Constructs a new CreateDocumentLinkRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a CreateDocumentLinkRequest. + * @implements ICreateDocumentLinkRequest + * @constructor + * @param {google.cloud.contentwarehouse.v1.ICreateDocumentLinkRequest=} [properties] Properties to set + */ + function CreateDocumentLinkRequest(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]]; + } + + /** + * CreateDocumentLinkRequest parent. + * @member {string} parent + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest + * @instance + */ + CreateDocumentLinkRequest.prototype.parent = ""; + + /** + * CreateDocumentLinkRequest documentLink. + * @member {google.cloud.contentwarehouse.v1.IDocumentLink|null|undefined} documentLink + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest + * @instance + */ + CreateDocumentLinkRequest.prototype.documentLink = null; + + /** + * CreateDocumentLinkRequest requestMetadata. + * @member {google.cloud.contentwarehouse.v1.IRequestMetadata|null|undefined} requestMetadata + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest + * @instance + */ + CreateDocumentLinkRequest.prototype.requestMetadata = null; + + /** + * Creates a new CreateDocumentLinkRequest instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest + * @static + * @param {google.cloud.contentwarehouse.v1.ICreateDocumentLinkRequest=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest} CreateDocumentLinkRequest instance + */ + CreateDocumentLinkRequest.create = function create(properties) { + return new CreateDocumentLinkRequest(properties); + }; + + /** + * Encodes the specified CreateDocumentLinkRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest + * @static + * @param {google.cloud.contentwarehouse.v1.ICreateDocumentLinkRequest} message CreateDocumentLinkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDocumentLinkRequest.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.documentLink != null && Object.hasOwnProperty.call(message, "documentLink")) + $root.google.cloud.contentwarehouse.v1.DocumentLink.encode(message.documentLink, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestMetadata != null && Object.hasOwnProperty.call(message, "requestMetadata")) + $root.google.cloud.contentwarehouse.v1.RequestMetadata.encode(message.requestMetadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateDocumentLinkRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest + * @static + * @param {google.cloud.contentwarehouse.v1.ICreateDocumentLinkRequest} message CreateDocumentLinkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDocumentLinkRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateDocumentLinkRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest} CreateDocumentLinkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDocumentLinkRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.documentLink = $root.google.cloud.contentwarehouse.v1.DocumentLink.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateDocumentLinkRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest} CreateDocumentLinkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDocumentLinkRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateDocumentLinkRequest message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateDocumentLinkRequest.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.documentLink != null && message.hasOwnProperty("documentLink")) { + var error = $root.google.cloud.contentwarehouse.v1.DocumentLink.verify(message.documentLink); + if (error) + return "documentLink." + error; + } + if (message.requestMetadata != null && message.hasOwnProperty("requestMetadata")) { + var error = $root.google.cloud.contentwarehouse.v1.RequestMetadata.verify(message.requestMetadata); + if (error) + return "requestMetadata." + error; + } + return null; + }; + + /** + * Creates a CreateDocumentLinkRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest} CreateDocumentLinkRequest + */ + CreateDocumentLinkRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.documentLink != null) { + if (typeof object.documentLink !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest.documentLink: object expected"); + message.documentLink = $root.google.cloud.contentwarehouse.v1.DocumentLink.fromObject(object.documentLink); + } + if (object.requestMetadata != null) { + if (typeof object.requestMetadata !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest.requestMetadata: object expected"); + message.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.fromObject(object.requestMetadata); + } + return message; + }; + + /** + * Creates a plain object from a CreateDocumentLinkRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest + * @static + * @param {google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest} message CreateDocumentLinkRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateDocumentLinkRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.documentLink = null; + object.requestMetadata = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.documentLink != null && message.hasOwnProperty("documentLink")) + object.documentLink = $root.google.cloud.contentwarehouse.v1.DocumentLink.toObject(message.documentLink, options); + if (message.requestMetadata != null && message.hasOwnProperty("requestMetadata")) + object.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.toObject(message.requestMetadata, options); + return object; + }; + + /** + * Converts this CreateDocumentLinkRequest to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest + * @instance + * @returns {Object.} JSON object + */ + CreateDocumentLinkRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateDocumentLinkRequest + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateDocumentLinkRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest"; + }; + + return CreateDocumentLinkRequest; + })(); + + v1.DeleteDocumentLinkRequest = (function() { + + /** + * Properties of a DeleteDocumentLinkRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IDeleteDocumentLinkRequest + * @property {string|null} [name] DeleteDocumentLinkRequest name + * @property {google.cloud.contentwarehouse.v1.IRequestMetadata|null} [requestMetadata] DeleteDocumentLinkRequest requestMetadata + */ + + /** + * Constructs a new DeleteDocumentLinkRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a DeleteDocumentLinkRequest. + * @implements IDeleteDocumentLinkRequest + * @constructor + * @param {google.cloud.contentwarehouse.v1.IDeleteDocumentLinkRequest=} [properties] Properties to set + */ + function DeleteDocumentLinkRequest(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]]; + } + + /** + * DeleteDocumentLinkRequest name. + * @member {string} name + * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest + * @instance + */ + DeleteDocumentLinkRequest.prototype.name = ""; + + /** + * DeleteDocumentLinkRequest requestMetadata. + * @member {google.cloud.contentwarehouse.v1.IRequestMetadata|null|undefined} requestMetadata + * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest + * @instance + */ + DeleteDocumentLinkRequest.prototype.requestMetadata = null; + + /** + * Creates a new DeleteDocumentLinkRequest instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IDeleteDocumentLinkRequest=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest} DeleteDocumentLinkRequest instance + */ + DeleteDocumentLinkRequest.create = function create(properties) { + return new DeleteDocumentLinkRequest(properties); + }; + + /** + * Encodes the specified DeleteDocumentLinkRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IDeleteDocumentLinkRequest} message DeleteDocumentLinkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDocumentLinkRequest.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.requestMetadata != null && Object.hasOwnProperty.call(message, "requestMetadata")) + $root.google.cloud.contentwarehouse.v1.RequestMetadata.encode(message.requestMetadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeleteDocumentLinkRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IDeleteDocumentLinkRequest} message DeleteDocumentLinkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDocumentLinkRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteDocumentLinkRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest} DeleteDocumentLinkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDocumentLinkRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteDocumentLinkRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest} DeleteDocumentLinkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDocumentLinkRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteDocumentLinkRequest message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteDocumentLinkRequest.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.requestMetadata != null && message.hasOwnProperty("requestMetadata")) { + var error = $root.google.cloud.contentwarehouse.v1.RequestMetadata.verify(message.requestMetadata); + if (error) + return "requestMetadata." + error; + } + return null; + }; + + /** + * Creates a DeleteDocumentLinkRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest} DeleteDocumentLinkRequest + */ + DeleteDocumentLinkRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestMetadata != null) { + if (typeof object.requestMetadata !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest.requestMetadata: object expected"); + message.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.fromObject(object.requestMetadata); + } + return message; + }; + + /** + * Creates a plain object from a DeleteDocumentLinkRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest + * @static + * @param {google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest} message DeleteDocumentLinkRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteDocumentLinkRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestMetadata = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestMetadata != null && message.hasOwnProperty("requestMetadata")) + object.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.toObject(message.requestMetadata, options); + return object; + }; + + /** + * Converts this DeleteDocumentLinkRequest to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteDocumentLinkRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteDocumentLinkRequest + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteDocumentLinkRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest"; + }; + + return DeleteDocumentLinkRequest; + })(); + + v1.DocumentSchema = (function() { + + /** + * Properties of a DocumentSchema. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IDocumentSchema + * @property {string|null} [name] DocumentSchema name + * @property {string|null} [displayName] DocumentSchema displayName + * @property {Array.|null} [propertyDefinitions] DocumentSchema propertyDefinitions + * @property {boolean|null} [documentIsFolder] DocumentSchema documentIsFolder + * @property {google.protobuf.ITimestamp|null} [updateTime] DocumentSchema updateTime + * @property {google.protobuf.ITimestamp|null} [createTime] DocumentSchema createTime + * @property {string|null} [description] DocumentSchema description + */ + + /** + * Constructs a new DocumentSchema. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a DocumentSchema. + * @implements IDocumentSchema + * @constructor + * @param {google.cloud.contentwarehouse.v1.IDocumentSchema=} [properties] Properties to set + */ + function DocumentSchema(properties) { + this.propertyDefinitions = []; + 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]]; + } + + /** + * DocumentSchema name. + * @member {string} name + * @memberof google.cloud.contentwarehouse.v1.DocumentSchema + * @instance + */ + DocumentSchema.prototype.name = ""; + + /** + * DocumentSchema displayName. + * @member {string} displayName + * @memberof google.cloud.contentwarehouse.v1.DocumentSchema + * @instance + */ + DocumentSchema.prototype.displayName = ""; + + /** + * DocumentSchema propertyDefinitions. + * @member {Array.} propertyDefinitions + * @memberof google.cloud.contentwarehouse.v1.DocumentSchema + * @instance + */ + DocumentSchema.prototype.propertyDefinitions = $util.emptyArray; + + /** + * DocumentSchema documentIsFolder. + * @member {boolean} documentIsFolder + * @memberof google.cloud.contentwarehouse.v1.DocumentSchema + * @instance + */ + DocumentSchema.prototype.documentIsFolder = false; + + /** + * DocumentSchema updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.contentwarehouse.v1.DocumentSchema + * @instance + */ + DocumentSchema.prototype.updateTime = null; + + /** + * DocumentSchema createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.contentwarehouse.v1.DocumentSchema + * @instance + */ + DocumentSchema.prototype.createTime = null; + + /** + * DocumentSchema description. + * @member {string} description + * @memberof google.cloud.contentwarehouse.v1.DocumentSchema + * @instance + */ + DocumentSchema.prototype.description = ""; + + /** + * Creates a new DocumentSchema instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.DocumentSchema + * @static + * @param {google.cloud.contentwarehouse.v1.IDocumentSchema=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.DocumentSchema} DocumentSchema instance + */ + DocumentSchema.create = function create(properties) { + return new DocumentSchema(properties); + }; + + /** + * Encodes the specified DocumentSchema message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DocumentSchema.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.DocumentSchema + * @static + * @param {google.cloud.contentwarehouse.v1.IDocumentSchema} message DocumentSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentSchema.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.propertyDefinitions != null && message.propertyDefinitions.length) + for (var i = 0; i < message.propertyDefinitions.length; ++i) + $root.google.cloud.contentwarehouse.v1.PropertyDefinition.encode(message.propertyDefinitions[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.documentIsFolder != null && Object.hasOwnProperty.call(message, "documentIsFolder")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.documentIsFolder); + 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.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.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.description); + return writer; + }; + + /** + * Encodes the specified DocumentSchema message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DocumentSchema.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.DocumentSchema + * @static + * @param {google.cloud.contentwarehouse.v1.IDocumentSchema} message DocumentSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentSchema.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DocumentSchema message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.DocumentSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.DocumentSchema} DocumentSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentSchema.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.DocumentSchema(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + if (!(message.propertyDefinitions && message.propertyDefinitions.length)) + message.propertyDefinitions = []; + message.propertyDefinitions.push($root.google.cloud.contentwarehouse.v1.PropertyDefinition.decode(reader, reader.uint32())); + break; + } + case 4: { + message.documentIsFolder = reader.bool(); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DocumentSchema message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.DocumentSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.DocumentSchema} DocumentSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentSchema.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DocumentSchema message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.DocumentSchema + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DocumentSchema.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.propertyDefinitions != null && message.hasOwnProperty("propertyDefinitions")) { + if (!Array.isArray(message.propertyDefinitions)) + return "propertyDefinitions: array expected"; + for (var i = 0; i < message.propertyDefinitions.length; ++i) { + var error = $root.google.cloud.contentwarehouse.v1.PropertyDefinition.verify(message.propertyDefinitions[i]); + if (error) + return "propertyDefinitions." + error; + } + } + if (message.documentIsFolder != null && message.hasOwnProperty("documentIsFolder")) + if (typeof message.documentIsFolder !== "boolean") + return "documentIsFolder: boolean expected"; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a DocumentSchema message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.DocumentSchema + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.DocumentSchema} DocumentSchema + */ + DocumentSchema.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.DocumentSchema) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.DocumentSchema(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.propertyDefinitions) { + if (!Array.isArray(object.propertyDefinitions)) + throw TypeError(".google.cloud.contentwarehouse.v1.DocumentSchema.propertyDefinitions: array expected"); + message.propertyDefinitions = []; + for (var i = 0; i < object.propertyDefinitions.length; ++i) { + if (typeof object.propertyDefinitions[i] !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.DocumentSchema.propertyDefinitions: object expected"); + message.propertyDefinitions[i] = $root.google.cloud.contentwarehouse.v1.PropertyDefinition.fromObject(object.propertyDefinitions[i]); + } + } + if (object.documentIsFolder != null) + message.documentIsFolder = Boolean(object.documentIsFolder); + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.DocumentSchema.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.DocumentSchema.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a DocumentSchema message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.DocumentSchema + * @static + * @param {google.cloud.contentwarehouse.v1.DocumentSchema} message DocumentSchema + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DocumentSchema.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.propertyDefinitions = []; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.documentIsFolder = false; + object.updateTime = null; + object.createTime = null; + 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.propertyDefinitions && message.propertyDefinitions.length) { + object.propertyDefinitions = []; + for (var j = 0; j < message.propertyDefinitions.length; ++j) + object.propertyDefinitions[j] = $root.google.cloud.contentwarehouse.v1.PropertyDefinition.toObject(message.propertyDefinitions[j], options); + } + if (message.documentIsFolder != null && message.hasOwnProperty("documentIsFolder")) + object.documentIsFolder = message.documentIsFolder; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this DocumentSchema to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.DocumentSchema + * @instance + * @returns {Object.} JSON object + */ + DocumentSchema.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DocumentSchema + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.DocumentSchema + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DocumentSchema.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.DocumentSchema"; + }; + + return DocumentSchema; + })(); + + v1.PropertyDefinition = (function() { + + /** + * Properties of a PropertyDefinition. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IPropertyDefinition + * @property {string|null} [name] PropertyDefinition name + * @property {string|null} [displayName] PropertyDefinition displayName + * @property {boolean|null} [isRepeatable] PropertyDefinition isRepeatable + * @property {boolean|null} [isFilterable] PropertyDefinition isFilterable + * @property {boolean|null} [isSearchable] PropertyDefinition isSearchable + * @property {boolean|null} [isMetadata] PropertyDefinition isMetadata + * @property {boolean|null} [isRequired] PropertyDefinition isRequired + * @property {google.cloud.contentwarehouse.v1.PropertyDefinition.RetrievalImportance|null} [retrievalImportance] PropertyDefinition retrievalImportance + * @property {google.cloud.contentwarehouse.v1.IIntegerTypeOptions|null} [integerTypeOptions] PropertyDefinition integerTypeOptions + * @property {google.cloud.contentwarehouse.v1.IFloatTypeOptions|null} [floatTypeOptions] PropertyDefinition floatTypeOptions + * @property {google.cloud.contentwarehouse.v1.ITextTypeOptions|null} [textTypeOptions] PropertyDefinition textTypeOptions + * @property {google.cloud.contentwarehouse.v1.IPropertyTypeOptions|null} [propertyTypeOptions] PropertyDefinition propertyTypeOptions + * @property {google.cloud.contentwarehouse.v1.IEnumTypeOptions|null} [enumTypeOptions] PropertyDefinition enumTypeOptions + * @property {google.cloud.contentwarehouse.v1.IDateTimeTypeOptions|null} [dateTimeTypeOptions] PropertyDefinition dateTimeTypeOptions + * @property {google.cloud.contentwarehouse.v1.IMapTypeOptions|null} [mapTypeOptions] PropertyDefinition mapTypeOptions + * @property {google.cloud.contentwarehouse.v1.ITimestampTypeOptions|null} [timestampTypeOptions] PropertyDefinition timestampTypeOptions + * @property {Array.|null} [schemaSources] PropertyDefinition schemaSources + */ + + /** + * Constructs a new PropertyDefinition. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a PropertyDefinition. + * @implements IPropertyDefinition + * @constructor + * @param {google.cloud.contentwarehouse.v1.IPropertyDefinition=} [properties] Properties to set + */ + function PropertyDefinition(properties) { + this.schemaSources = []; + 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]]; + } + + /** + * PropertyDefinition name. + * @member {string} name + * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition + * @instance + */ + PropertyDefinition.prototype.name = ""; + + /** + * PropertyDefinition displayName. + * @member {string} displayName + * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition + * @instance + */ + PropertyDefinition.prototype.displayName = ""; + + /** + * PropertyDefinition isRepeatable. + * @member {boolean} isRepeatable + * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition + * @instance + */ + PropertyDefinition.prototype.isRepeatable = false; + + /** + * PropertyDefinition isFilterable. + * @member {boolean} isFilterable + * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition + * @instance + */ + PropertyDefinition.prototype.isFilterable = false; + + /** + * PropertyDefinition isSearchable. + * @member {boolean} isSearchable + * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition + * @instance + */ + PropertyDefinition.prototype.isSearchable = false; + + /** + * PropertyDefinition isMetadata. + * @member {boolean} isMetadata + * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition + * @instance + */ + PropertyDefinition.prototype.isMetadata = false; + + /** + * PropertyDefinition isRequired. + * @member {boolean} isRequired + * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition + * @instance + */ + PropertyDefinition.prototype.isRequired = false; + + /** + * PropertyDefinition retrievalImportance. + * @member {google.cloud.contentwarehouse.v1.PropertyDefinition.RetrievalImportance} retrievalImportance + * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition + * @instance + */ + PropertyDefinition.prototype.retrievalImportance = 0; + + /** + * PropertyDefinition integerTypeOptions. + * @member {google.cloud.contentwarehouse.v1.IIntegerTypeOptions|null|undefined} integerTypeOptions + * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition + * @instance + */ + PropertyDefinition.prototype.integerTypeOptions = null; + + /** + * PropertyDefinition floatTypeOptions. + * @member {google.cloud.contentwarehouse.v1.IFloatTypeOptions|null|undefined} floatTypeOptions + * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition + * @instance + */ + PropertyDefinition.prototype.floatTypeOptions = null; + + /** + * PropertyDefinition textTypeOptions. + * @member {google.cloud.contentwarehouse.v1.ITextTypeOptions|null|undefined} textTypeOptions + * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition + * @instance + */ + PropertyDefinition.prototype.textTypeOptions = null; + + /** + * PropertyDefinition propertyTypeOptions. + * @member {google.cloud.contentwarehouse.v1.IPropertyTypeOptions|null|undefined} propertyTypeOptions + * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition + * @instance + */ + PropertyDefinition.prototype.propertyTypeOptions = null; + + /** + * PropertyDefinition enumTypeOptions. + * @member {google.cloud.contentwarehouse.v1.IEnumTypeOptions|null|undefined} enumTypeOptions + * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition + * @instance + */ + PropertyDefinition.prototype.enumTypeOptions = null; + + /** + * PropertyDefinition dateTimeTypeOptions. + * @member {google.cloud.contentwarehouse.v1.IDateTimeTypeOptions|null|undefined} dateTimeTypeOptions + * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition + * @instance + */ + PropertyDefinition.prototype.dateTimeTypeOptions = null; + + /** + * PropertyDefinition mapTypeOptions. + * @member {google.cloud.contentwarehouse.v1.IMapTypeOptions|null|undefined} mapTypeOptions + * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition + * @instance + */ + PropertyDefinition.prototype.mapTypeOptions = null; + + /** + * PropertyDefinition timestampTypeOptions. + * @member {google.cloud.contentwarehouse.v1.ITimestampTypeOptions|null|undefined} timestampTypeOptions + * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition + * @instance + */ + PropertyDefinition.prototype.timestampTypeOptions = null; + + /** + * PropertyDefinition schemaSources. + * @member {Array.} schemaSources + * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition + * @instance + */ + PropertyDefinition.prototype.schemaSources = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PropertyDefinition valueTypeOptions. + * @member {"integerTypeOptions"|"floatTypeOptions"|"textTypeOptions"|"propertyTypeOptions"|"enumTypeOptions"|"dateTimeTypeOptions"|"mapTypeOptions"|"timestampTypeOptions"|undefined} valueTypeOptions + * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition + * @instance + */ + Object.defineProperty(PropertyDefinition.prototype, "valueTypeOptions", { + get: $util.oneOfGetter($oneOfFields = ["integerTypeOptions", "floatTypeOptions", "textTypeOptions", "propertyTypeOptions", "enumTypeOptions", "dateTimeTypeOptions", "mapTypeOptions", "timestampTypeOptions"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PropertyDefinition instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition + * @static + * @param {google.cloud.contentwarehouse.v1.IPropertyDefinition=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.PropertyDefinition} PropertyDefinition instance + */ + PropertyDefinition.create = function create(properties) { + return new PropertyDefinition(properties); + }; + + /** + * Encodes the specified PropertyDefinition message. Does not implicitly {@link google.cloud.contentwarehouse.v1.PropertyDefinition.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition + * @static + * @param {google.cloud.contentwarehouse.v1.IPropertyDefinition} message PropertyDefinition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PropertyDefinition.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.isRepeatable != null && Object.hasOwnProperty.call(message, "isRepeatable")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isRepeatable); + if (message.isFilterable != null && Object.hasOwnProperty.call(message, "isFilterable")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.isFilterable); + if (message.isSearchable != null && Object.hasOwnProperty.call(message, "isSearchable")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.isSearchable); + if (message.isMetadata != null && Object.hasOwnProperty.call(message, "isMetadata")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.isMetadata); + if (message.integerTypeOptions != null && Object.hasOwnProperty.call(message, "integerTypeOptions")) + $root.google.cloud.contentwarehouse.v1.IntegerTypeOptions.encode(message.integerTypeOptions, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.floatTypeOptions != null && Object.hasOwnProperty.call(message, "floatTypeOptions")) + $root.google.cloud.contentwarehouse.v1.FloatTypeOptions.encode(message.floatTypeOptions, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.textTypeOptions != null && Object.hasOwnProperty.call(message, "textTypeOptions")) + $root.google.cloud.contentwarehouse.v1.TextTypeOptions.encode(message.textTypeOptions, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.propertyTypeOptions != null && Object.hasOwnProperty.call(message, "propertyTypeOptions")) + $root.google.cloud.contentwarehouse.v1.PropertyTypeOptions.encode(message.propertyTypeOptions, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.enumTypeOptions != null && Object.hasOwnProperty.call(message, "enumTypeOptions")) + $root.google.cloud.contentwarehouse.v1.EnumTypeOptions.encode(message.enumTypeOptions, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.displayName); + if (message.dateTimeTypeOptions != null && Object.hasOwnProperty.call(message, "dateTimeTypeOptions")) + $root.google.cloud.contentwarehouse.v1.DateTimeTypeOptions.encode(message.dateTimeTypeOptions, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.isRequired != null && Object.hasOwnProperty.call(message, "isRequired")) + writer.uint32(/* id 14, wireType 0 =*/112).bool(message.isRequired); + if (message.mapTypeOptions != null && Object.hasOwnProperty.call(message, "mapTypeOptions")) + $root.google.cloud.contentwarehouse.v1.MapTypeOptions.encode(message.mapTypeOptions, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.timestampTypeOptions != null && Object.hasOwnProperty.call(message, "timestampTypeOptions")) + $root.google.cloud.contentwarehouse.v1.TimestampTypeOptions.encode(message.timestampTypeOptions, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.retrievalImportance != null && Object.hasOwnProperty.call(message, "retrievalImportance")) + writer.uint32(/* id 18, wireType 0 =*/144).int32(message.retrievalImportance); + if (message.schemaSources != null && message.schemaSources.length) + for (var i = 0; i < message.schemaSources.length; ++i) + $root.google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource.encode(message.schemaSources[i], writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PropertyDefinition message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.PropertyDefinition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition + * @static + * @param {google.cloud.contentwarehouse.v1.IPropertyDefinition} message PropertyDefinition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PropertyDefinition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PropertyDefinition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.PropertyDefinition} PropertyDefinition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PropertyDefinition.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.PropertyDefinition(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 12: { + message.displayName = reader.string(); + break; + } + case 2: { + message.isRepeatable = reader.bool(); + break; + } + case 3: { + message.isFilterable = reader.bool(); + break; + } + case 4: { + message.isSearchable = reader.bool(); + break; + } + case 5: { + message.isMetadata = reader.bool(); + break; + } + case 14: { + message.isRequired = reader.bool(); + break; + } + case 18: { + message.retrievalImportance = reader.int32(); + break; + } + case 7: { + message.integerTypeOptions = $root.google.cloud.contentwarehouse.v1.IntegerTypeOptions.decode(reader, reader.uint32()); + break; + } + case 8: { + message.floatTypeOptions = $root.google.cloud.contentwarehouse.v1.FloatTypeOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.textTypeOptions = $root.google.cloud.contentwarehouse.v1.TextTypeOptions.decode(reader, reader.uint32()); + break; + } + case 10: { + message.propertyTypeOptions = $root.google.cloud.contentwarehouse.v1.PropertyTypeOptions.decode(reader, reader.uint32()); + break; + } + case 11: { + message.enumTypeOptions = $root.google.cloud.contentwarehouse.v1.EnumTypeOptions.decode(reader, reader.uint32()); + break; + } + case 13: { + message.dateTimeTypeOptions = $root.google.cloud.contentwarehouse.v1.DateTimeTypeOptions.decode(reader, reader.uint32()); + break; + } + case 15: { + message.mapTypeOptions = $root.google.cloud.contentwarehouse.v1.MapTypeOptions.decode(reader, reader.uint32()); + break; + } + case 16: { + message.timestampTypeOptions = $root.google.cloud.contentwarehouse.v1.TimestampTypeOptions.decode(reader, reader.uint32()); + break; + } + case 19: { + if (!(message.schemaSources && message.schemaSources.length)) + message.schemaSources = []; + message.schemaSources.push($root.google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PropertyDefinition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.PropertyDefinition} PropertyDefinition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PropertyDefinition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PropertyDefinition message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PropertyDefinition.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.isRepeatable != null && message.hasOwnProperty("isRepeatable")) + if (typeof message.isRepeatable !== "boolean") + return "isRepeatable: boolean expected"; + if (message.isFilterable != null && message.hasOwnProperty("isFilterable")) + if (typeof message.isFilterable !== "boolean") + return "isFilterable: boolean expected"; + if (message.isSearchable != null && message.hasOwnProperty("isSearchable")) + if (typeof message.isSearchable !== "boolean") + return "isSearchable: boolean expected"; + if (message.isMetadata != null && message.hasOwnProperty("isMetadata")) + if (typeof message.isMetadata !== "boolean") + return "isMetadata: boolean expected"; + if (message.isRequired != null && message.hasOwnProperty("isRequired")) + if (typeof message.isRequired !== "boolean") + return "isRequired: boolean expected"; + if (message.retrievalImportance != null && message.hasOwnProperty("retrievalImportance")) + switch (message.retrievalImportance) { + default: + return "retrievalImportance: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.integerTypeOptions != null && message.hasOwnProperty("integerTypeOptions")) { + properties.valueTypeOptions = 1; + { + var error = $root.google.cloud.contentwarehouse.v1.IntegerTypeOptions.verify(message.integerTypeOptions); + if (error) + return "integerTypeOptions." + error; + } + } + if (message.floatTypeOptions != null && message.hasOwnProperty("floatTypeOptions")) { + if (properties.valueTypeOptions === 1) + return "valueTypeOptions: multiple values"; + properties.valueTypeOptions = 1; + { + var error = $root.google.cloud.contentwarehouse.v1.FloatTypeOptions.verify(message.floatTypeOptions); + if (error) + return "floatTypeOptions." + error; + } + } + if (message.textTypeOptions != null && message.hasOwnProperty("textTypeOptions")) { + if (properties.valueTypeOptions === 1) + return "valueTypeOptions: multiple values"; + properties.valueTypeOptions = 1; + { + var error = $root.google.cloud.contentwarehouse.v1.TextTypeOptions.verify(message.textTypeOptions); + if (error) + return "textTypeOptions." + error; + } + } + if (message.propertyTypeOptions != null && message.hasOwnProperty("propertyTypeOptions")) { + if (properties.valueTypeOptions === 1) + return "valueTypeOptions: multiple values"; + properties.valueTypeOptions = 1; + { + var error = $root.google.cloud.contentwarehouse.v1.PropertyTypeOptions.verify(message.propertyTypeOptions); + if (error) + return "propertyTypeOptions." + error; + } + } + if (message.enumTypeOptions != null && message.hasOwnProperty("enumTypeOptions")) { + if (properties.valueTypeOptions === 1) + return "valueTypeOptions: multiple values"; + properties.valueTypeOptions = 1; + { + var error = $root.google.cloud.contentwarehouse.v1.EnumTypeOptions.verify(message.enumTypeOptions); + if (error) + return "enumTypeOptions." + error; + } + } + if (message.dateTimeTypeOptions != null && message.hasOwnProperty("dateTimeTypeOptions")) { + if (properties.valueTypeOptions === 1) + return "valueTypeOptions: multiple values"; + properties.valueTypeOptions = 1; + { + var error = $root.google.cloud.contentwarehouse.v1.DateTimeTypeOptions.verify(message.dateTimeTypeOptions); + if (error) + return "dateTimeTypeOptions." + error; + } + } + if (message.mapTypeOptions != null && message.hasOwnProperty("mapTypeOptions")) { + if (properties.valueTypeOptions === 1) + return "valueTypeOptions: multiple values"; + properties.valueTypeOptions = 1; + { + var error = $root.google.cloud.contentwarehouse.v1.MapTypeOptions.verify(message.mapTypeOptions); + if (error) + return "mapTypeOptions." + error; + } + } + if (message.timestampTypeOptions != null && message.hasOwnProperty("timestampTypeOptions")) { + if (properties.valueTypeOptions === 1) + return "valueTypeOptions: multiple values"; + properties.valueTypeOptions = 1; + { + var error = $root.google.cloud.contentwarehouse.v1.TimestampTypeOptions.verify(message.timestampTypeOptions); + if (error) + return "timestampTypeOptions." + error; + } + } + if (message.schemaSources != null && message.hasOwnProperty("schemaSources")) { + if (!Array.isArray(message.schemaSources)) + return "schemaSources: array expected"; + for (var i = 0; i < message.schemaSources.length; ++i) { + var error = $root.google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource.verify(message.schemaSources[i]); + if (error) + return "schemaSources." + error; + } + } + return null; + }; + + /** + * Creates a PropertyDefinition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.PropertyDefinition} PropertyDefinition + */ + PropertyDefinition.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.PropertyDefinition) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.PropertyDefinition(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.isRepeatable != null) + message.isRepeatable = Boolean(object.isRepeatable); + if (object.isFilterable != null) + message.isFilterable = Boolean(object.isFilterable); + if (object.isSearchable != null) + message.isSearchable = Boolean(object.isSearchable); + if (object.isMetadata != null) + message.isMetadata = Boolean(object.isMetadata); + if (object.isRequired != null) + message.isRequired = Boolean(object.isRequired); + switch (object.retrievalImportance) { + default: + if (typeof object.retrievalImportance === "number") { + message.retrievalImportance = object.retrievalImportance; + break; + } + break; + case "RETRIEVAL_IMPORTANCE_UNSPECIFIED": + case 0: + message.retrievalImportance = 0; + break; + case "HIGHEST": + case 1: + message.retrievalImportance = 1; + break; + case "HIGHER": + case 2: + message.retrievalImportance = 2; + break; + case "HIGH": + case 3: + message.retrievalImportance = 3; + break; + case "MEDIUM": + case 4: + message.retrievalImportance = 4; + break; + case "LOW": + case 5: + message.retrievalImportance = 5; + break; + case "LOWEST": + case 6: + message.retrievalImportance = 6; + break; + } + if (object.integerTypeOptions != null) { + if (typeof object.integerTypeOptions !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.PropertyDefinition.integerTypeOptions: object expected"); + message.integerTypeOptions = $root.google.cloud.contentwarehouse.v1.IntegerTypeOptions.fromObject(object.integerTypeOptions); + } + if (object.floatTypeOptions != null) { + if (typeof object.floatTypeOptions !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.PropertyDefinition.floatTypeOptions: object expected"); + message.floatTypeOptions = $root.google.cloud.contentwarehouse.v1.FloatTypeOptions.fromObject(object.floatTypeOptions); + } + if (object.textTypeOptions != null) { + if (typeof object.textTypeOptions !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.PropertyDefinition.textTypeOptions: object expected"); + message.textTypeOptions = $root.google.cloud.contentwarehouse.v1.TextTypeOptions.fromObject(object.textTypeOptions); + } + if (object.propertyTypeOptions != null) { + if (typeof object.propertyTypeOptions !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.PropertyDefinition.propertyTypeOptions: object expected"); + message.propertyTypeOptions = $root.google.cloud.contentwarehouse.v1.PropertyTypeOptions.fromObject(object.propertyTypeOptions); + } + if (object.enumTypeOptions != null) { + if (typeof object.enumTypeOptions !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.PropertyDefinition.enumTypeOptions: object expected"); + message.enumTypeOptions = $root.google.cloud.contentwarehouse.v1.EnumTypeOptions.fromObject(object.enumTypeOptions); + } + if (object.dateTimeTypeOptions != null) { + if (typeof object.dateTimeTypeOptions !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.PropertyDefinition.dateTimeTypeOptions: object expected"); + message.dateTimeTypeOptions = $root.google.cloud.contentwarehouse.v1.DateTimeTypeOptions.fromObject(object.dateTimeTypeOptions); + } + if (object.mapTypeOptions != null) { + if (typeof object.mapTypeOptions !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.PropertyDefinition.mapTypeOptions: object expected"); + message.mapTypeOptions = $root.google.cloud.contentwarehouse.v1.MapTypeOptions.fromObject(object.mapTypeOptions); + } + if (object.timestampTypeOptions != null) { + if (typeof object.timestampTypeOptions !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.PropertyDefinition.timestampTypeOptions: object expected"); + message.timestampTypeOptions = $root.google.cloud.contentwarehouse.v1.TimestampTypeOptions.fromObject(object.timestampTypeOptions); + } + if (object.schemaSources) { + if (!Array.isArray(object.schemaSources)) + throw TypeError(".google.cloud.contentwarehouse.v1.PropertyDefinition.schemaSources: array expected"); + message.schemaSources = []; + for (var i = 0; i < object.schemaSources.length; ++i) { + if (typeof object.schemaSources[i] !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.PropertyDefinition.schemaSources: object expected"); + message.schemaSources[i] = $root.google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource.fromObject(object.schemaSources[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PropertyDefinition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition + * @static + * @param {google.cloud.contentwarehouse.v1.PropertyDefinition} message PropertyDefinition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PropertyDefinition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.schemaSources = []; + if (options.defaults) { + object.name = ""; + object.isRepeatable = false; + object.isFilterable = false; + object.isSearchable = false; + object.isMetadata = false; + object.displayName = ""; + object.isRequired = false; + object.retrievalImportance = options.enums === String ? "RETRIEVAL_IMPORTANCE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.isRepeatable != null && message.hasOwnProperty("isRepeatable")) + object.isRepeatable = message.isRepeatable; + if (message.isFilterable != null && message.hasOwnProperty("isFilterable")) + object.isFilterable = message.isFilterable; + if (message.isSearchable != null && message.hasOwnProperty("isSearchable")) + object.isSearchable = message.isSearchable; + if (message.isMetadata != null && message.hasOwnProperty("isMetadata")) + object.isMetadata = message.isMetadata; + if (message.integerTypeOptions != null && message.hasOwnProperty("integerTypeOptions")) { + object.integerTypeOptions = $root.google.cloud.contentwarehouse.v1.IntegerTypeOptions.toObject(message.integerTypeOptions, options); + if (options.oneofs) + object.valueTypeOptions = "integerTypeOptions"; + } + if (message.floatTypeOptions != null && message.hasOwnProperty("floatTypeOptions")) { + object.floatTypeOptions = $root.google.cloud.contentwarehouse.v1.FloatTypeOptions.toObject(message.floatTypeOptions, options); + if (options.oneofs) + object.valueTypeOptions = "floatTypeOptions"; + } + if (message.textTypeOptions != null && message.hasOwnProperty("textTypeOptions")) { + object.textTypeOptions = $root.google.cloud.contentwarehouse.v1.TextTypeOptions.toObject(message.textTypeOptions, options); + if (options.oneofs) + object.valueTypeOptions = "textTypeOptions"; + } + if (message.propertyTypeOptions != null && message.hasOwnProperty("propertyTypeOptions")) { + object.propertyTypeOptions = $root.google.cloud.contentwarehouse.v1.PropertyTypeOptions.toObject(message.propertyTypeOptions, options); + if (options.oneofs) + object.valueTypeOptions = "propertyTypeOptions"; + } + if (message.enumTypeOptions != null && message.hasOwnProperty("enumTypeOptions")) { + object.enumTypeOptions = $root.google.cloud.contentwarehouse.v1.EnumTypeOptions.toObject(message.enumTypeOptions, options); + if (options.oneofs) + object.valueTypeOptions = "enumTypeOptions"; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.dateTimeTypeOptions != null && message.hasOwnProperty("dateTimeTypeOptions")) { + object.dateTimeTypeOptions = $root.google.cloud.contentwarehouse.v1.DateTimeTypeOptions.toObject(message.dateTimeTypeOptions, options); + if (options.oneofs) + object.valueTypeOptions = "dateTimeTypeOptions"; + } + if (message.isRequired != null && message.hasOwnProperty("isRequired")) + object.isRequired = message.isRequired; + if (message.mapTypeOptions != null && message.hasOwnProperty("mapTypeOptions")) { + object.mapTypeOptions = $root.google.cloud.contentwarehouse.v1.MapTypeOptions.toObject(message.mapTypeOptions, options); + if (options.oneofs) + object.valueTypeOptions = "mapTypeOptions"; + } + if (message.timestampTypeOptions != null && message.hasOwnProperty("timestampTypeOptions")) { + object.timestampTypeOptions = $root.google.cloud.contentwarehouse.v1.TimestampTypeOptions.toObject(message.timestampTypeOptions, options); + if (options.oneofs) + object.valueTypeOptions = "timestampTypeOptions"; + } + if (message.retrievalImportance != null && message.hasOwnProperty("retrievalImportance")) + object.retrievalImportance = options.enums === String ? $root.google.cloud.contentwarehouse.v1.PropertyDefinition.RetrievalImportance[message.retrievalImportance] === undefined ? message.retrievalImportance : $root.google.cloud.contentwarehouse.v1.PropertyDefinition.RetrievalImportance[message.retrievalImportance] : message.retrievalImportance; + if (message.schemaSources && message.schemaSources.length) { + object.schemaSources = []; + for (var j = 0; j < message.schemaSources.length; ++j) + object.schemaSources[j] = $root.google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource.toObject(message.schemaSources[j], options); + } + return object; + }; + + /** + * Converts this PropertyDefinition to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition + * @instance + * @returns {Object.} JSON object + */ + PropertyDefinition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PropertyDefinition + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PropertyDefinition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.PropertyDefinition"; + }; + + /** + * RetrievalImportance enum. + * @name google.cloud.contentwarehouse.v1.PropertyDefinition.RetrievalImportance + * @enum {number} + * @property {number} RETRIEVAL_IMPORTANCE_UNSPECIFIED=0 RETRIEVAL_IMPORTANCE_UNSPECIFIED value + * @property {number} HIGHEST=1 HIGHEST value + * @property {number} HIGHER=2 HIGHER value + * @property {number} HIGH=3 HIGH value + * @property {number} MEDIUM=4 MEDIUM value + * @property {number} LOW=5 LOW value + * @property {number} LOWEST=6 LOWEST value + */ + PropertyDefinition.RetrievalImportance = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RETRIEVAL_IMPORTANCE_UNSPECIFIED"] = 0; + values[valuesById[1] = "HIGHEST"] = 1; + values[valuesById[2] = "HIGHER"] = 2; + values[valuesById[3] = "HIGH"] = 3; + values[valuesById[4] = "MEDIUM"] = 4; + values[valuesById[5] = "LOW"] = 5; + values[valuesById[6] = "LOWEST"] = 6; + return values; + })(); + + PropertyDefinition.SchemaSource = (function() { + + /** + * Properties of a SchemaSource. + * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition + * @interface ISchemaSource + * @property {string|null} [name] SchemaSource name + * @property {string|null} [processorType] SchemaSource processorType + */ + + /** + * Constructs a new SchemaSource. + * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition + * @classdesc Represents a SchemaSource. + * @implements ISchemaSource + * @constructor + * @param {google.cloud.contentwarehouse.v1.PropertyDefinition.ISchemaSource=} [properties] Properties to set + */ + function SchemaSource(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]]; + } + + /** + * SchemaSource name. + * @member {string} name + * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource + * @instance + */ + SchemaSource.prototype.name = ""; + + /** + * SchemaSource processorType. + * @member {string} processorType + * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource + * @instance + */ + SchemaSource.prototype.processorType = ""; + + /** + * Creates a new SchemaSource instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource + * @static + * @param {google.cloud.contentwarehouse.v1.PropertyDefinition.ISchemaSource=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource} SchemaSource instance + */ + SchemaSource.create = function create(properties) { + return new SchemaSource(properties); + }; + + /** + * Encodes the specified SchemaSource message. Does not implicitly {@link google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource + * @static + * @param {google.cloud.contentwarehouse.v1.PropertyDefinition.ISchemaSource} message SchemaSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SchemaSource.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.processorType != null && Object.hasOwnProperty.call(message, "processorType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.processorType); + return writer; + }; + + /** + * Encodes the specified SchemaSource message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource + * @static + * @param {google.cloud.contentwarehouse.v1.PropertyDefinition.ISchemaSource} message SchemaSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SchemaSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SchemaSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource} SchemaSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SchemaSource.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.processorType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SchemaSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource} SchemaSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SchemaSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SchemaSource message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SchemaSource.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.processorType != null && message.hasOwnProperty("processorType")) + if (!$util.isString(message.processorType)) + return "processorType: string expected"; + return null; + }; + + /** + * Creates a SchemaSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource} SchemaSource + */ + SchemaSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource(); + if (object.name != null) + message.name = String(object.name); + if (object.processorType != null) + message.processorType = String(object.processorType); + return message; + }; + + /** + * Creates a plain object from a SchemaSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource + * @static + * @param {google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource} message SchemaSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SchemaSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.processorType = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.processorType != null && message.hasOwnProperty("processorType")) + object.processorType = message.processorType; + return object; + }; + + /** + * Converts this SchemaSource to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource + * @instance + * @returns {Object.} JSON object + */ + SchemaSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SchemaSource + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SchemaSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource"; + }; + + return SchemaSource; + })(); + + return PropertyDefinition; + })(); + + v1.IntegerTypeOptions = (function() { + + /** + * Properties of an IntegerTypeOptions. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IIntegerTypeOptions + */ + + /** + * Constructs a new IntegerTypeOptions. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents an IntegerTypeOptions. + * @implements IIntegerTypeOptions + * @constructor + * @param {google.cloud.contentwarehouse.v1.IIntegerTypeOptions=} [properties] Properties to set + */ + function IntegerTypeOptions(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 IntegerTypeOptions instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.IntegerTypeOptions + * @static + * @param {google.cloud.contentwarehouse.v1.IIntegerTypeOptions=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.IntegerTypeOptions} IntegerTypeOptions instance + */ + IntegerTypeOptions.create = function create(properties) { + return new IntegerTypeOptions(properties); + }; + + /** + * Encodes the specified IntegerTypeOptions message. Does not implicitly {@link google.cloud.contentwarehouse.v1.IntegerTypeOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.IntegerTypeOptions + * @static + * @param {google.cloud.contentwarehouse.v1.IIntegerTypeOptions} message IntegerTypeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntegerTypeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified IntegerTypeOptions message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.IntegerTypeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.IntegerTypeOptions + * @static + * @param {google.cloud.contentwarehouse.v1.IIntegerTypeOptions} message IntegerTypeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntegerTypeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IntegerTypeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.IntegerTypeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.IntegerTypeOptions} IntegerTypeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntegerTypeOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.IntegerTypeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IntegerTypeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.IntegerTypeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.IntegerTypeOptions} IntegerTypeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntegerTypeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IntegerTypeOptions message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.IntegerTypeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IntegerTypeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an IntegerTypeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.IntegerTypeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.IntegerTypeOptions} IntegerTypeOptions + */ + IntegerTypeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.IntegerTypeOptions) + return object; + return new $root.google.cloud.contentwarehouse.v1.IntegerTypeOptions(); + }; + + /** + * Creates a plain object from an IntegerTypeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.IntegerTypeOptions + * @static + * @param {google.cloud.contentwarehouse.v1.IntegerTypeOptions} message IntegerTypeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IntegerTypeOptions.toObject = function toObject() { + return {}; + }; + + /** + * Converts this IntegerTypeOptions to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.IntegerTypeOptions + * @instance + * @returns {Object.} JSON object + */ + IntegerTypeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IntegerTypeOptions + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.IntegerTypeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IntegerTypeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.IntegerTypeOptions"; + }; + + return IntegerTypeOptions; + })(); + + v1.FloatTypeOptions = (function() { + + /** + * Properties of a FloatTypeOptions. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IFloatTypeOptions + */ + + /** + * Constructs a new FloatTypeOptions. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a FloatTypeOptions. + * @implements IFloatTypeOptions + * @constructor + * @param {google.cloud.contentwarehouse.v1.IFloatTypeOptions=} [properties] Properties to set + */ + function FloatTypeOptions(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 FloatTypeOptions instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.FloatTypeOptions + * @static + * @param {google.cloud.contentwarehouse.v1.IFloatTypeOptions=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.FloatTypeOptions} FloatTypeOptions instance + */ + FloatTypeOptions.create = function create(properties) { + return new FloatTypeOptions(properties); + }; + + /** + * Encodes the specified FloatTypeOptions message. Does not implicitly {@link google.cloud.contentwarehouse.v1.FloatTypeOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.FloatTypeOptions + * @static + * @param {google.cloud.contentwarehouse.v1.IFloatTypeOptions} message FloatTypeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatTypeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified FloatTypeOptions message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.FloatTypeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.FloatTypeOptions + * @static + * @param {google.cloud.contentwarehouse.v1.IFloatTypeOptions} message FloatTypeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatTypeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FloatTypeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.FloatTypeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.FloatTypeOptions} FloatTypeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatTypeOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.FloatTypeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FloatTypeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.FloatTypeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.FloatTypeOptions} FloatTypeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatTypeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FloatTypeOptions message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.FloatTypeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FloatTypeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a FloatTypeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.FloatTypeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.FloatTypeOptions} FloatTypeOptions + */ + FloatTypeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.FloatTypeOptions) + return object; + return new $root.google.cloud.contentwarehouse.v1.FloatTypeOptions(); + }; + + /** + * Creates a plain object from a FloatTypeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.FloatTypeOptions + * @static + * @param {google.cloud.contentwarehouse.v1.FloatTypeOptions} message FloatTypeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FloatTypeOptions.toObject = function toObject() { + return {}; + }; + + /** + * Converts this FloatTypeOptions to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.FloatTypeOptions + * @instance + * @returns {Object.} JSON object + */ + FloatTypeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FloatTypeOptions + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.FloatTypeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatTypeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.FloatTypeOptions"; + }; + + return FloatTypeOptions; + })(); + + v1.TextTypeOptions = (function() { + + /** + * Properties of a TextTypeOptions. + * @memberof google.cloud.contentwarehouse.v1 + * @interface ITextTypeOptions + */ + + /** + * Constructs a new TextTypeOptions. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a TextTypeOptions. + * @implements ITextTypeOptions + * @constructor + * @param {google.cloud.contentwarehouse.v1.ITextTypeOptions=} [properties] Properties to set + */ + function TextTypeOptions(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 TextTypeOptions instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.TextTypeOptions + * @static + * @param {google.cloud.contentwarehouse.v1.ITextTypeOptions=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.TextTypeOptions} TextTypeOptions instance + */ + TextTypeOptions.create = function create(properties) { + return new TextTypeOptions(properties); + }; + + /** + * Encodes the specified TextTypeOptions message. Does not implicitly {@link google.cloud.contentwarehouse.v1.TextTypeOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.TextTypeOptions + * @static + * @param {google.cloud.contentwarehouse.v1.ITextTypeOptions} message TextTypeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextTypeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified TextTypeOptions message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.TextTypeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.TextTypeOptions + * @static + * @param {google.cloud.contentwarehouse.v1.ITextTypeOptions} message TextTypeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextTypeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextTypeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.TextTypeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.TextTypeOptions} TextTypeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextTypeOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.TextTypeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextTypeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.TextTypeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.TextTypeOptions} TextTypeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextTypeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextTypeOptions message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.TextTypeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextTypeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a TextTypeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.TextTypeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.TextTypeOptions} TextTypeOptions + */ + TextTypeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.TextTypeOptions) + return object; + return new $root.google.cloud.contentwarehouse.v1.TextTypeOptions(); + }; + + /** + * Creates a plain object from a TextTypeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.TextTypeOptions + * @static + * @param {google.cloud.contentwarehouse.v1.TextTypeOptions} message TextTypeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextTypeOptions.toObject = function toObject() { + return {}; + }; + + /** + * Converts this TextTypeOptions to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.TextTypeOptions + * @instance + * @returns {Object.} JSON object + */ + TextTypeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextTypeOptions + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.TextTypeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextTypeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.TextTypeOptions"; + }; + + return TextTypeOptions; + })(); + + v1.DateTimeTypeOptions = (function() { + + /** + * Properties of a DateTimeTypeOptions. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IDateTimeTypeOptions + */ + + /** + * Constructs a new DateTimeTypeOptions. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a DateTimeTypeOptions. + * @implements IDateTimeTypeOptions + * @constructor + * @param {google.cloud.contentwarehouse.v1.IDateTimeTypeOptions=} [properties] Properties to set + */ + function DateTimeTypeOptions(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 DateTimeTypeOptions instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.DateTimeTypeOptions + * @static + * @param {google.cloud.contentwarehouse.v1.IDateTimeTypeOptions=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.DateTimeTypeOptions} DateTimeTypeOptions instance + */ + DateTimeTypeOptions.create = function create(properties) { + return new DateTimeTypeOptions(properties); + }; + + /** + * Encodes the specified DateTimeTypeOptions message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DateTimeTypeOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.DateTimeTypeOptions + * @static + * @param {google.cloud.contentwarehouse.v1.IDateTimeTypeOptions} message DateTimeTypeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DateTimeTypeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified DateTimeTypeOptions message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DateTimeTypeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.DateTimeTypeOptions + * @static + * @param {google.cloud.contentwarehouse.v1.IDateTimeTypeOptions} message DateTimeTypeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DateTimeTypeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DateTimeTypeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.DateTimeTypeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.DateTimeTypeOptions} DateTimeTypeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DateTimeTypeOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.DateTimeTypeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DateTimeTypeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.DateTimeTypeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.DateTimeTypeOptions} DateTimeTypeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DateTimeTypeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DateTimeTypeOptions message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.DateTimeTypeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DateTimeTypeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a DateTimeTypeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.DateTimeTypeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.DateTimeTypeOptions} DateTimeTypeOptions + */ + DateTimeTypeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.DateTimeTypeOptions) + return object; + return new $root.google.cloud.contentwarehouse.v1.DateTimeTypeOptions(); + }; + + /** + * Creates a plain object from a DateTimeTypeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.DateTimeTypeOptions + * @static + * @param {google.cloud.contentwarehouse.v1.DateTimeTypeOptions} message DateTimeTypeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DateTimeTypeOptions.toObject = function toObject() { + return {}; + }; + + /** + * Converts this DateTimeTypeOptions to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.DateTimeTypeOptions + * @instance + * @returns {Object.} JSON object + */ + DateTimeTypeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DateTimeTypeOptions + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.DateTimeTypeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DateTimeTypeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.DateTimeTypeOptions"; + }; + + return DateTimeTypeOptions; + })(); + + v1.MapTypeOptions = (function() { + + /** + * Properties of a MapTypeOptions. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IMapTypeOptions + */ + + /** + * Constructs a new MapTypeOptions. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a MapTypeOptions. + * @implements IMapTypeOptions + * @constructor + * @param {google.cloud.contentwarehouse.v1.IMapTypeOptions=} [properties] Properties to set + */ + function MapTypeOptions(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 MapTypeOptions instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.MapTypeOptions + * @static + * @param {google.cloud.contentwarehouse.v1.IMapTypeOptions=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.MapTypeOptions} MapTypeOptions instance + */ + MapTypeOptions.create = function create(properties) { + return new MapTypeOptions(properties); + }; + + /** + * Encodes the specified MapTypeOptions message. Does not implicitly {@link google.cloud.contentwarehouse.v1.MapTypeOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.MapTypeOptions + * @static + * @param {google.cloud.contentwarehouse.v1.IMapTypeOptions} message MapTypeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MapTypeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MapTypeOptions message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.MapTypeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.MapTypeOptions + * @static + * @param {google.cloud.contentwarehouse.v1.IMapTypeOptions} message MapTypeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MapTypeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MapTypeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.MapTypeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.MapTypeOptions} MapTypeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MapTypeOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.MapTypeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MapTypeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.MapTypeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.MapTypeOptions} MapTypeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MapTypeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MapTypeOptions message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.MapTypeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MapTypeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MapTypeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.MapTypeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.MapTypeOptions} MapTypeOptions + */ + MapTypeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.MapTypeOptions) + return object; + return new $root.google.cloud.contentwarehouse.v1.MapTypeOptions(); + }; + + /** + * Creates a plain object from a MapTypeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.MapTypeOptions + * @static + * @param {google.cloud.contentwarehouse.v1.MapTypeOptions} message MapTypeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MapTypeOptions.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MapTypeOptions to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.MapTypeOptions + * @instance + * @returns {Object.} JSON object + */ + MapTypeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MapTypeOptions + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.MapTypeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MapTypeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.MapTypeOptions"; + }; + + return MapTypeOptions; + })(); + + v1.TimestampTypeOptions = (function() { + + /** + * Properties of a TimestampTypeOptions. + * @memberof google.cloud.contentwarehouse.v1 + * @interface ITimestampTypeOptions + */ + + /** + * Constructs a new TimestampTypeOptions. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a TimestampTypeOptions. + * @implements ITimestampTypeOptions + * @constructor + * @param {google.cloud.contentwarehouse.v1.ITimestampTypeOptions=} [properties] Properties to set + */ + function TimestampTypeOptions(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 TimestampTypeOptions instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.TimestampTypeOptions + * @static + * @param {google.cloud.contentwarehouse.v1.ITimestampTypeOptions=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.TimestampTypeOptions} TimestampTypeOptions instance + */ + TimestampTypeOptions.create = function create(properties) { + return new TimestampTypeOptions(properties); + }; + + /** + * Encodes the specified TimestampTypeOptions message. Does not implicitly {@link google.cloud.contentwarehouse.v1.TimestampTypeOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.TimestampTypeOptions + * @static + * @param {google.cloud.contentwarehouse.v1.ITimestampTypeOptions} message TimestampTypeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampTypeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified TimestampTypeOptions message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.TimestampTypeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.TimestampTypeOptions + * @static + * @param {google.cloud.contentwarehouse.v1.ITimestampTypeOptions} message TimestampTypeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampTypeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimestampTypeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.TimestampTypeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.TimestampTypeOptions} TimestampTypeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampTypeOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.TimestampTypeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimestampTypeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.TimestampTypeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.TimestampTypeOptions} TimestampTypeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampTypeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimestampTypeOptions message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.TimestampTypeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimestampTypeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a TimestampTypeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.TimestampTypeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.TimestampTypeOptions} TimestampTypeOptions + */ + TimestampTypeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.TimestampTypeOptions) + return object; + return new $root.google.cloud.contentwarehouse.v1.TimestampTypeOptions(); + }; + + /** + * Creates a plain object from a TimestampTypeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.TimestampTypeOptions + * @static + * @param {google.cloud.contentwarehouse.v1.TimestampTypeOptions} message TimestampTypeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimestampTypeOptions.toObject = function toObject() { + return {}; + }; + + /** + * Converts this TimestampTypeOptions to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.TimestampTypeOptions + * @instance + * @returns {Object.} JSON object + */ + TimestampTypeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimestampTypeOptions + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.TimestampTypeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampTypeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.TimestampTypeOptions"; + }; + + return TimestampTypeOptions; + })(); + + v1.PropertyTypeOptions = (function() { + + /** + * Properties of a PropertyTypeOptions. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IPropertyTypeOptions + * @property {Array.|null} [propertyDefinitions] PropertyTypeOptions propertyDefinitions + */ + + /** + * Constructs a new PropertyTypeOptions. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a PropertyTypeOptions. + * @implements IPropertyTypeOptions + * @constructor + * @param {google.cloud.contentwarehouse.v1.IPropertyTypeOptions=} [properties] Properties to set + */ + function PropertyTypeOptions(properties) { + this.propertyDefinitions = []; + 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]]; + } + + /** + * PropertyTypeOptions propertyDefinitions. + * @member {Array.} propertyDefinitions + * @memberof google.cloud.contentwarehouse.v1.PropertyTypeOptions + * @instance + */ + PropertyTypeOptions.prototype.propertyDefinitions = $util.emptyArray; + + /** + * Creates a new PropertyTypeOptions instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.PropertyTypeOptions + * @static + * @param {google.cloud.contentwarehouse.v1.IPropertyTypeOptions=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.PropertyTypeOptions} PropertyTypeOptions instance + */ + PropertyTypeOptions.create = function create(properties) { + return new PropertyTypeOptions(properties); + }; + + /** + * Encodes the specified PropertyTypeOptions message. Does not implicitly {@link google.cloud.contentwarehouse.v1.PropertyTypeOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.PropertyTypeOptions + * @static + * @param {google.cloud.contentwarehouse.v1.IPropertyTypeOptions} message PropertyTypeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PropertyTypeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.propertyDefinitions != null && message.propertyDefinitions.length) + for (var i = 0; i < message.propertyDefinitions.length; ++i) + $root.google.cloud.contentwarehouse.v1.PropertyDefinition.encode(message.propertyDefinitions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PropertyTypeOptions message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.PropertyTypeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.PropertyTypeOptions + * @static + * @param {google.cloud.contentwarehouse.v1.IPropertyTypeOptions} message PropertyTypeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PropertyTypeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PropertyTypeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.PropertyTypeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.PropertyTypeOptions} PropertyTypeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PropertyTypeOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.PropertyTypeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.propertyDefinitions && message.propertyDefinitions.length)) + message.propertyDefinitions = []; + message.propertyDefinitions.push($root.google.cloud.contentwarehouse.v1.PropertyDefinition.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PropertyTypeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.PropertyTypeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.PropertyTypeOptions} PropertyTypeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PropertyTypeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PropertyTypeOptions message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.PropertyTypeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PropertyTypeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.propertyDefinitions != null && message.hasOwnProperty("propertyDefinitions")) { + if (!Array.isArray(message.propertyDefinitions)) + return "propertyDefinitions: array expected"; + for (var i = 0; i < message.propertyDefinitions.length; ++i) { + var error = $root.google.cloud.contentwarehouse.v1.PropertyDefinition.verify(message.propertyDefinitions[i]); + if (error) + return "propertyDefinitions." + error; + } + } + return null; + }; + + /** + * Creates a PropertyTypeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.PropertyTypeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.PropertyTypeOptions} PropertyTypeOptions + */ + PropertyTypeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.PropertyTypeOptions) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.PropertyTypeOptions(); + if (object.propertyDefinitions) { + if (!Array.isArray(object.propertyDefinitions)) + throw TypeError(".google.cloud.contentwarehouse.v1.PropertyTypeOptions.propertyDefinitions: array expected"); + message.propertyDefinitions = []; + for (var i = 0; i < object.propertyDefinitions.length; ++i) { + if (typeof object.propertyDefinitions[i] !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.PropertyTypeOptions.propertyDefinitions: object expected"); + message.propertyDefinitions[i] = $root.google.cloud.contentwarehouse.v1.PropertyDefinition.fromObject(object.propertyDefinitions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PropertyTypeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.PropertyTypeOptions + * @static + * @param {google.cloud.contentwarehouse.v1.PropertyTypeOptions} message PropertyTypeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PropertyTypeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.propertyDefinitions = []; + if (message.propertyDefinitions && message.propertyDefinitions.length) { + object.propertyDefinitions = []; + for (var j = 0; j < message.propertyDefinitions.length; ++j) + object.propertyDefinitions[j] = $root.google.cloud.contentwarehouse.v1.PropertyDefinition.toObject(message.propertyDefinitions[j], options); + } + return object; + }; + + /** + * Converts this PropertyTypeOptions to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.PropertyTypeOptions + * @instance + * @returns {Object.} JSON object + */ + PropertyTypeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PropertyTypeOptions + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.PropertyTypeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PropertyTypeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.PropertyTypeOptions"; + }; + + return PropertyTypeOptions; + })(); + + v1.EnumTypeOptions = (function() { + + /** + * Properties of an EnumTypeOptions. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IEnumTypeOptions + * @property {Array.|null} [possibleValues] EnumTypeOptions possibleValues + * @property {boolean|null} [validationCheckDisabled] EnumTypeOptions validationCheckDisabled + */ + + /** + * Constructs a new EnumTypeOptions. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents an EnumTypeOptions. + * @implements IEnumTypeOptions + * @constructor + * @param {google.cloud.contentwarehouse.v1.IEnumTypeOptions=} [properties] Properties to set + */ + function EnumTypeOptions(properties) { + this.possibleValues = []; + 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]]; + } + + /** + * EnumTypeOptions possibleValues. + * @member {Array.} possibleValues + * @memberof google.cloud.contentwarehouse.v1.EnumTypeOptions + * @instance + */ + EnumTypeOptions.prototype.possibleValues = $util.emptyArray; + + /** + * EnumTypeOptions validationCheckDisabled. + * @member {boolean} validationCheckDisabled + * @memberof google.cloud.contentwarehouse.v1.EnumTypeOptions + * @instance + */ + EnumTypeOptions.prototype.validationCheckDisabled = false; + + /** + * Creates a new EnumTypeOptions instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.EnumTypeOptions + * @static + * @param {google.cloud.contentwarehouse.v1.IEnumTypeOptions=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.EnumTypeOptions} EnumTypeOptions instance + */ + EnumTypeOptions.create = function create(properties) { + return new EnumTypeOptions(properties); + }; + + /** + * Encodes the specified EnumTypeOptions message. Does not implicitly {@link google.cloud.contentwarehouse.v1.EnumTypeOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.EnumTypeOptions + * @static + * @param {google.cloud.contentwarehouse.v1.IEnumTypeOptions} message EnumTypeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumTypeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.possibleValues != null && message.possibleValues.length) + for (var i = 0; i < message.possibleValues.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.possibleValues[i]); + if (message.validationCheckDisabled != null && Object.hasOwnProperty.call(message, "validationCheckDisabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validationCheckDisabled); + return writer; + }; + + /** + * Encodes the specified EnumTypeOptions message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.EnumTypeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.EnumTypeOptions + * @static + * @param {google.cloud.contentwarehouse.v1.IEnumTypeOptions} message EnumTypeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumTypeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumTypeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.EnumTypeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.EnumTypeOptions} EnumTypeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumTypeOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.EnumTypeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.possibleValues && message.possibleValues.length)) + message.possibleValues = []; + message.possibleValues.push(reader.string()); + break; + } + case 2: { + message.validationCheckDisabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumTypeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.EnumTypeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.EnumTypeOptions} EnumTypeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumTypeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumTypeOptions message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.EnumTypeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumTypeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.possibleValues != null && message.hasOwnProperty("possibleValues")) { + if (!Array.isArray(message.possibleValues)) + return "possibleValues: array expected"; + for (var i = 0; i < message.possibleValues.length; ++i) + if (!$util.isString(message.possibleValues[i])) + return "possibleValues: string[] expected"; + } + if (message.validationCheckDisabled != null && message.hasOwnProperty("validationCheckDisabled")) + if (typeof message.validationCheckDisabled !== "boolean") + return "validationCheckDisabled: boolean expected"; + return null; + }; + + /** + * Creates an EnumTypeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.EnumTypeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.EnumTypeOptions} EnumTypeOptions + */ + EnumTypeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.EnumTypeOptions) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.EnumTypeOptions(); + if (object.possibleValues) { + if (!Array.isArray(object.possibleValues)) + throw TypeError(".google.cloud.contentwarehouse.v1.EnumTypeOptions.possibleValues: array expected"); + message.possibleValues = []; + for (var i = 0; i < object.possibleValues.length; ++i) + message.possibleValues[i] = String(object.possibleValues[i]); + } + if (object.validationCheckDisabled != null) + message.validationCheckDisabled = Boolean(object.validationCheckDisabled); + return message; + }; + + /** + * Creates a plain object from an EnumTypeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.EnumTypeOptions + * @static + * @param {google.cloud.contentwarehouse.v1.EnumTypeOptions} message EnumTypeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumTypeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.possibleValues = []; + if (options.defaults) + object.validationCheckDisabled = false; + if (message.possibleValues && message.possibleValues.length) { + object.possibleValues = []; + for (var j = 0; j < message.possibleValues.length; ++j) + object.possibleValues[j] = message.possibleValues[j]; + } + if (message.validationCheckDisabled != null && message.hasOwnProperty("validationCheckDisabled")) + object.validationCheckDisabled = message.validationCheckDisabled; + return object; + }; + + /** + * Converts this EnumTypeOptions to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.EnumTypeOptions + * @instance + * @returns {Object.} JSON object + */ + EnumTypeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumTypeOptions + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.EnumTypeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumTypeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.EnumTypeOptions"; + }; + + return EnumTypeOptions; + })(); + + v1.DocumentSchemaService = (function() { + + /** + * Constructs a new DocumentSchemaService service. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a DocumentSchemaService + * @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 DocumentSchemaService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (DocumentSchemaService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = DocumentSchemaService; + + /** + * Creates new DocumentSchemaService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.contentwarehouse.v1.DocumentSchemaService + * @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 {DocumentSchemaService} RPC service. Useful where requests and/or responses are streamed. + */ + DocumentSchemaService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentSchemaService|createDocumentSchema}. + * @memberof google.cloud.contentwarehouse.v1.DocumentSchemaService + * @typedef CreateDocumentSchemaCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.contentwarehouse.v1.DocumentSchema} [response] DocumentSchema + */ + + /** + * Calls CreateDocumentSchema. + * @function createDocumentSchema + * @memberof google.cloud.contentwarehouse.v1.DocumentSchemaService + * @instance + * @param {google.cloud.contentwarehouse.v1.ICreateDocumentSchemaRequest} request CreateDocumentSchemaRequest message or plain object + * @param {google.cloud.contentwarehouse.v1.DocumentSchemaService.CreateDocumentSchemaCallback} callback Node-style callback called with the error, if any, and DocumentSchema + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentSchemaService.prototype.createDocumentSchema = function createDocumentSchema(request, callback) { + return this.rpcCall(createDocumentSchema, $root.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest, $root.google.cloud.contentwarehouse.v1.DocumentSchema, request, callback); + }, "name", { value: "CreateDocumentSchema" }); + + /** + * Calls CreateDocumentSchema. + * @function createDocumentSchema + * @memberof google.cloud.contentwarehouse.v1.DocumentSchemaService + * @instance + * @param {google.cloud.contentwarehouse.v1.ICreateDocumentSchemaRequest} request CreateDocumentSchemaRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentSchemaService|updateDocumentSchema}. + * @memberof google.cloud.contentwarehouse.v1.DocumentSchemaService + * @typedef UpdateDocumentSchemaCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.contentwarehouse.v1.DocumentSchema} [response] DocumentSchema + */ + + /** + * Calls UpdateDocumentSchema. + * @function updateDocumentSchema + * @memberof google.cloud.contentwarehouse.v1.DocumentSchemaService + * @instance + * @param {google.cloud.contentwarehouse.v1.IUpdateDocumentSchemaRequest} request UpdateDocumentSchemaRequest message or plain object + * @param {google.cloud.contentwarehouse.v1.DocumentSchemaService.UpdateDocumentSchemaCallback} callback Node-style callback called with the error, if any, and DocumentSchema + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentSchemaService.prototype.updateDocumentSchema = function updateDocumentSchema(request, callback) { + return this.rpcCall(updateDocumentSchema, $root.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest, $root.google.cloud.contentwarehouse.v1.DocumentSchema, request, callback); + }, "name", { value: "UpdateDocumentSchema" }); + + /** + * Calls UpdateDocumentSchema. + * @function updateDocumentSchema + * @memberof google.cloud.contentwarehouse.v1.DocumentSchemaService + * @instance + * @param {google.cloud.contentwarehouse.v1.IUpdateDocumentSchemaRequest} request UpdateDocumentSchemaRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentSchemaService|getDocumentSchema}. + * @memberof google.cloud.contentwarehouse.v1.DocumentSchemaService + * @typedef GetDocumentSchemaCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.contentwarehouse.v1.DocumentSchema} [response] DocumentSchema + */ + + /** + * Calls GetDocumentSchema. + * @function getDocumentSchema + * @memberof google.cloud.contentwarehouse.v1.DocumentSchemaService + * @instance + * @param {google.cloud.contentwarehouse.v1.IGetDocumentSchemaRequest} request GetDocumentSchemaRequest message or plain object + * @param {google.cloud.contentwarehouse.v1.DocumentSchemaService.GetDocumentSchemaCallback} callback Node-style callback called with the error, if any, and DocumentSchema + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentSchemaService.prototype.getDocumentSchema = function getDocumentSchema(request, callback) { + return this.rpcCall(getDocumentSchema, $root.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest, $root.google.cloud.contentwarehouse.v1.DocumentSchema, request, callback); + }, "name", { value: "GetDocumentSchema" }); + + /** + * Calls GetDocumentSchema. + * @function getDocumentSchema + * @memberof google.cloud.contentwarehouse.v1.DocumentSchemaService + * @instance + * @param {google.cloud.contentwarehouse.v1.IGetDocumentSchemaRequest} request GetDocumentSchemaRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentSchemaService|deleteDocumentSchema}. + * @memberof google.cloud.contentwarehouse.v1.DocumentSchemaService + * @typedef DeleteDocumentSchemaCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteDocumentSchema. + * @function deleteDocumentSchema + * @memberof google.cloud.contentwarehouse.v1.DocumentSchemaService + * @instance + * @param {google.cloud.contentwarehouse.v1.IDeleteDocumentSchemaRequest} request DeleteDocumentSchemaRequest message or plain object + * @param {google.cloud.contentwarehouse.v1.DocumentSchemaService.DeleteDocumentSchemaCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentSchemaService.prototype.deleteDocumentSchema = function deleteDocumentSchema(request, callback) { + return this.rpcCall(deleteDocumentSchema, $root.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteDocumentSchema" }); + + /** + * Calls DeleteDocumentSchema. + * @function deleteDocumentSchema + * @memberof google.cloud.contentwarehouse.v1.DocumentSchemaService + * @instance + * @param {google.cloud.contentwarehouse.v1.IDeleteDocumentSchemaRequest} request DeleteDocumentSchemaRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentSchemaService|listDocumentSchemas}. + * @memberof google.cloud.contentwarehouse.v1.DocumentSchemaService + * @typedef ListDocumentSchemasCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse} [response] ListDocumentSchemasResponse + */ + + /** + * Calls ListDocumentSchemas. + * @function listDocumentSchemas + * @memberof google.cloud.contentwarehouse.v1.DocumentSchemaService + * @instance + * @param {google.cloud.contentwarehouse.v1.IListDocumentSchemasRequest} request ListDocumentSchemasRequest message or plain object + * @param {google.cloud.contentwarehouse.v1.DocumentSchemaService.ListDocumentSchemasCallback} callback Node-style callback called with the error, if any, and ListDocumentSchemasResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentSchemaService.prototype.listDocumentSchemas = function listDocumentSchemas(request, callback) { + return this.rpcCall(listDocumentSchemas, $root.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest, $root.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse, request, callback); + }, "name", { value: "ListDocumentSchemas" }); + + /** + * Calls ListDocumentSchemas. + * @function listDocumentSchemas + * @memberof google.cloud.contentwarehouse.v1.DocumentSchemaService + * @instance + * @param {google.cloud.contentwarehouse.v1.IListDocumentSchemasRequest} request ListDocumentSchemasRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return DocumentSchemaService; + })(); + + v1.CreateDocumentSchemaRequest = (function() { + + /** + * Properties of a CreateDocumentSchemaRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @interface ICreateDocumentSchemaRequest + * @property {string|null} [parent] CreateDocumentSchemaRequest parent + * @property {google.cloud.contentwarehouse.v1.IDocumentSchema|null} [documentSchema] CreateDocumentSchemaRequest documentSchema + */ + + /** + * Constructs a new CreateDocumentSchemaRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a CreateDocumentSchemaRequest. + * @implements ICreateDocumentSchemaRequest + * @constructor + * @param {google.cloud.contentwarehouse.v1.ICreateDocumentSchemaRequest=} [properties] Properties to set + */ + function CreateDocumentSchemaRequest(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]]; + } + + /** + * CreateDocumentSchemaRequest parent. + * @member {string} parent + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest + * @instance + */ + CreateDocumentSchemaRequest.prototype.parent = ""; + + /** + * CreateDocumentSchemaRequest documentSchema. + * @member {google.cloud.contentwarehouse.v1.IDocumentSchema|null|undefined} documentSchema + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest + * @instance + */ + CreateDocumentSchemaRequest.prototype.documentSchema = null; + + /** + * Creates a new CreateDocumentSchemaRequest instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest + * @static + * @param {google.cloud.contentwarehouse.v1.ICreateDocumentSchemaRequest=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest} CreateDocumentSchemaRequest instance + */ + CreateDocumentSchemaRequest.create = function create(properties) { + return new CreateDocumentSchemaRequest(properties); + }; + + /** + * Encodes the specified CreateDocumentSchemaRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest + * @static + * @param {google.cloud.contentwarehouse.v1.ICreateDocumentSchemaRequest} message CreateDocumentSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDocumentSchemaRequest.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.documentSchema != null && Object.hasOwnProperty.call(message, "documentSchema")) + $root.google.cloud.contentwarehouse.v1.DocumentSchema.encode(message.documentSchema, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateDocumentSchemaRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest + * @static + * @param {google.cloud.contentwarehouse.v1.ICreateDocumentSchemaRequest} message CreateDocumentSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDocumentSchemaRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateDocumentSchemaRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest} CreateDocumentSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDocumentSchemaRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.documentSchema = $root.google.cloud.contentwarehouse.v1.DocumentSchema.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateDocumentSchemaRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest} CreateDocumentSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDocumentSchemaRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateDocumentSchemaRequest message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateDocumentSchemaRequest.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.documentSchema != null && message.hasOwnProperty("documentSchema")) { + var error = $root.google.cloud.contentwarehouse.v1.DocumentSchema.verify(message.documentSchema); + if (error) + return "documentSchema." + error; + } + return null; + }; + + /** + * Creates a CreateDocumentSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest} CreateDocumentSchemaRequest + */ + CreateDocumentSchemaRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.documentSchema != null) { + if (typeof object.documentSchema !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest.documentSchema: object expected"); + message.documentSchema = $root.google.cloud.contentwarehouse.v1.DocumentSchema.fromObject(object.documentSchema); + } + return message; + }; + + /** + * Creates a plain object from a CreateDocumentSchemaRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest + * @static + * @param {google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest} message CreateDocumentSchemaRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateDocumentSchemaRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.documentSchema = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.documentSchema != null && message.hasOwnProperty("documentSchema")) + object.documentSchema = $root.google.cloud.contentwarehouse.v1.DocumentSchema.toObject(message.documentSchema, options); + return object; + }; + + /** + * Converts this CreateDocumentSchemaRequest to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest + * @instance + * @returns {Object.} JSON object + */ + CreateDocumentSchemaRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateDocumentSchemaRequest + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateDocumentSchemaRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest"; + }; + + return CreateDocumentSchemaRequest; + })(); + + v1.GetDocumentSchemaRequest = (function() { + + /** + * Properties of a GetDocumentSchemaRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IGetDocumentSchemaRequest + * @property {string|null} [name] GetDocumentSchemaRequest name + */ + + /** + * Constructs a new GetDocumentSchemaRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a GetDocumentSchemaRequest. + * @implements IGetDocumentSchemaRequest + * @constructor + * @param {google.cloud.contentwarehouse.v1.IGetDocumentSchemaRequest=} [properties] Properties to set + */ + function GetDocumentSchemaRequest(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]]; + } + + /** + * GetDocumentSchemaRequest name. + * @member {string} name + * @memberof google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest + * @instance + */ + GetDocumentSchemaRequest.prototype.name = ""; + + /** + * Creates a new GetDocumentSchemaRequest instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IGetDocumentSchemaRequest=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest} GetDocumentSchemaRequest instance + */ + GetDocumentSchemaRequest.create = function create(properties) { + return new GetDocumentSchemaRequest(properties); + }; + + /** + * Encodes the specified GetDocumentSchemaRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IGetDocumentSchemaRequest} message GetDocumentSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDocumentSchemaRequest.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 GetDocumentSchemaRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IGetDocumentSchemaRequest} message GetDocumentSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDocumentSchemaRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDocumentSchemaRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest} GetDocumentSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDocumentSchemaRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDocumentSchemaRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest} GetDocumentSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDocumentSchemaRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDocumentSchemaRequest message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDocumentSchemaRequest.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 GetDocumentSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest} GetDocumentSchemaRequest + */ + GetDocumentSchemaRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetDocumentSchemaRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest + * @static + * @param {google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest} message GetDocumentSchemaRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDocumentSchemaRequest.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 GetDocumentSchemaRequest to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest + * @instance + * @returns {Object.} JSON object + */ + GetDocumentSchemaRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetDocumentSchemaRequest + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetDocumentSchemaRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest"; + }; + + return GetDocumentSchemaRequest; + })(); + + v1.UpdateDocumentSchemaRequest = (function() { + + /** + * Properties of an UpdateDocumentSchemaRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IUpdateDocumentSchemaRequest + * @property {string|null} [name] UpdateDocumentSchemaRequest name + * @property {google.cloud.contentwarehouse.v1.IDocumentSchema|null} [documentSchema] UpdateDocumentSchemaRequest documentSchema + */ + + /** + * Constructs a new UpdateDocumentSchemaRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents an UpdateDocumentSchemaRequest. + * @implements IUpdateDocumentSchemaRequest + * @constructor + * @param {google.cloud.contentwarehouse.v1.IUpdateDocumentSchemaRequest=} [properties] Properties to set + */ + function UpdateDocumentSchemaRequest(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]]; + } + + /** + * UpdateDocumentSchemaRequest name. + * @member {string} name + * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest + * @instance + */ + UpdateDocumentSchemaRequest.prototype.name = ""; + + /** + * UpdateDocumentSchemaRequest documentSchema. + * @member {google.cloud.contentwarehouse.v1.IDocumentSchema|null|undefined} documentSchema + * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest + * @instance + */ + UpdateDocumentSchemaRequest.prototype.documentSchema = null; + + /** + * Creates a new UpdateDocumentSchemaRequest instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IUpdateDocumentSchemaRequest=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest} UpdateDocumentSchemaRequest instance + */ + UpdateDocumentSchemaRequest.create = function create(properties) { + return new UpdateDocumentSchemaRequest(properties); + }; + + /** + * Encodes the specified UpdateDocumentSchemaRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IUpdateDocumentSchemaRequest} message UpdateDocumentSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDocumentSchemaRequest.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.documentSchema != null && Object.hasOwnProperty.call(message, "documentSchema")) + $root.google.cloud.contentwarehouse.v1.DocumentSchema.encode(message.documentSchema, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateDocumentSchemaRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IUpdateDocumentSchemaRequest} message UpdateDocumentSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDocumentSchemaRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDocumentSchemaRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest} UpdateDocumentSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDocumentSchemaRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.documentSchema = $root.google.cloud.contentwarehouse.v1.DocumentSchema.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateDocumentSchemaRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest} UpdateDocumentSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDocumentSchemaRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDocumentSchemaRequest message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDocumentSchemaRequest.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.documentSchema != null && message.hasOwnProperty("documentSchema")) { + var error = $root.google.cloud.contentwarehouse.v1.DocumentSchema.verify(message.documentSchema); + if (error) + return "documentSchema." + error; + } + return null; + }; + + /** + * Creates an UpdateDocumentSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest} UpdateDocumentSchemaRequest + */ + UpdateDocumentSchemaRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.documentSchema != null) { + if (typeof object.documentSchema !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest.documentSchema: object expected"); + message.documentSchema = $root.google.cloud.contentwarehouse.v1.DocumentSchema.fromObject(object.documentSchema); + } + return message; + }; + + /** + * Creates a plain object from an UpdateDocumentSchemaRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest + * @static + * @param {google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest} message UpdateDocumentSchemaRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDocumentSchemaRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.documentSchema = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.documentSchema != null && message.hasOwnProperty("documentSchema")) + object.documentSchema = $root.google.cloud.contentwarehouse.v1.DocumentSchema.toObject(message.documentSchema, options); + return object; + }; + + /** + * Converts this UpdateDocumentSchemaRequest to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateDocumentSchemaRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateDocumentSchemaRequest + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateDocumentSchemaRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest"; + }; + + return UpdateDocumentSchemaRequest; + })(); + + v1.DeleteDocumentSchemaRequest = (function() { + + /** + * Properties of a DeleteDocumentSchemaRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IDeleteDocumentSchemaRequest + * @property {string|null} [name] DeleteDocumentSchemaRequest name + */ + + /** + * Constructs a new DeleteDocumentSchemaRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a DeleteDocumentSchemaRequest. + * @implements IDeleteDocumentSchemaRequest + * @constructor + * @param {google.cloud.contentwarehouse.v1.IDeleteDocumentSchemaRequest=} [properties] Properties to set + */ + function DeleteDocumentSchemaRequest(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]]; + } + + /** + * DeleteDocumentSchemaRequest name. + * @member {string} name + * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest + * @instance + */ + DeleteDocumentSchemaRequest.prototype.name = ""; + + /** + * Creates a new DeleteDocumentSchemaRequest instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IDeleteDocumentSchemaRequest=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest} DeleteDocumentSchemaRequest instance + */ + DeleteDocumentSchemaRequest.create = function create(properties) { + return new DeleteDocumentSchemaRequest(properties); + }; + + /** + * Encodes the specified DeleteDocumentSchemaRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IDeleteDocumentSchemaRequest} message DeleteDocumentSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDocumentSchemaRequest.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 DeleteDocumentSchemaRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IDeleteDocumentSchemaRequest} message DeleteDocumentSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDocumentSchemaRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteDocumentSchemaRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest} DeleteDocumentSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDocumentSchemaRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteDocumentSchemaRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest} DeleteDocumentSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDocumentSchemaRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteDocumentSchemaRequest message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteDocumentSchemaRequest.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 DeleteDocumentSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest} DeleteDocumentSchemaRequest + */ + DeleteDocumentSchemaRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteDocumentSchemaRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest + * @static + * @param {google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest} message DeleteDocumentSchemaRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteDocumentSchemaRequest.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 DeleteDocumentSchemaRequest to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteDocumentSchemaRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteDocumentSchemaRequest + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteDocumentSchemaRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest"; + }; + + return DeleteDocumentSchemaRequest; + })(); + + v1.ListDocumentSchemasRequest = (function() { + + /** + * Properties of a ListDocumentSchemasRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IListDocumentSchemasRequest + * @property {string|null} [parent] ListDocumentSchemasRequest parent + * @property {number|null} [pageSize] ListDocumentSchemasRequest pageSize + * @property {string|null} [pageToken] ListDocumentSchemasRequest pageToken + */ + + /** + * Constructs a new ListDocumentSchemasRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a ListDocumentSchemasRequest. + * @implements IListDocumentSchemasRequest + * @constructor + * @param {google.cloud.contentwarehouse.v1.IListDocumentSchemasRequest=} [properties] Properties to set + */ + function ListDocumentSchemasRequest(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]]; + } + + /** + * ListDocumentSchemasRequest parent. + * @member {string} parent + * @memberof google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest + * @instance + */ + ListDocumentSchemasRequest.prototype.parent = ""; + + /** + * ListDocumentSchemasRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest + * @instance + */ + ListDocumentSchemasRequest.prototype.pageSize = 0; + + /** + * ListDocumentSchemasRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest + * @instance + */ + ListDocumentSchemasRequest.prototype.pageToken = ""; + + /** + * Creates a new ListDocumentSchemasRequest instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IListDocumentSchemasRequest=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest} ListDocumentSchemasRequest instance + */ + ListDocumentSchemasRequest.create = function create(properties) { + return new ListDocumentSchemasRequest(properties); + }; + + /** + * Encodes the specified ListDocumentSchemasRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IListDocumentSchemasRequest} message ListDocumentSchemasRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDocumentSchemasRequest.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.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); + return writer; + }; + + /** + * Encodes the specified ListDocumentSchemasRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IListDocumentSchemasRequest} message ListDocumentSchemasRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDocumentSchemasRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDocumentSchemasRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest} ListDocumentSchemasRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDocumentSchemasRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDocumentSchemasRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest} ListDocumentSchemasRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDocumentSchemasRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDocumentSchemasRequest message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDocumentSchemasRequest.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.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"; + return null; + }; + + /** + * Creates a ListDocumentSchemasRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest} ListDocumentSchemasRequest + */ + ListDocumentSchemasRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListDocumentSchemasRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest + * @static + * @param {google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest} message ListDocumentSchemasRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDocumentSchemasRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListDocumentSchemasRequest to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest + * @instance + * @returns {Object.} JSON object + */ + ListDocumentSchemasRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDocumentSchemasRequest + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDocumentSchemasRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest"; + }; + + return ListDocumentSchemasRequest; + })(); + + v1.ListDocumentSchemasResponse = (function() { + + /** + * Properties of a ListDocumentSchemasResponse. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IListDocumentSchemasResponse + * @property {Array.|null} [documentSchemas] ListDocumentSchemasResponse documentSchemas + * @property {string|null} [nextPageToken] ListDocumentSchemasResponse nextPageToken + */ + + /** + * Constructs a new ListDocumentSchemasResponse. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a ListDocumentSchemasResponse. + * @implements IListDocumentSchemasResponse + * @constructor + * @param {google.cloud.contentwarehouse.v1.IListDocumentSchemasResponse=} [properties] Properties to set + */ + function ListDocumentSchemasResponse(properties) { + this.documentSchemas = []; + 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]]; + } + + /** + * ListDocumentSchemasResponse documentSchemas. + * @member {Array.} documentSchemas + * @memberof google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse + * @instance + */ + ListDocumentSchemasResponse.prototype.documentSchemas = $util.emptyArray; + + /** + * ListDocumentSchemasResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse + * @instance + */ + ListDocumentSchemasResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListDocumentSchemasResponse instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse + * @static + * @param {google.cloud.contentwarehouse.v1.IListDocumentSchemasResponse=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse} ListDocumentSchemasResponse instance + */ + ListDocumentSchemasResponse.create = function create(properties) { + return new ListDocumentSchemasResponse(properties); + }; + + /** + * Encodes the specified ListDocumentSchemasResponse message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse + * @static + * @param {google.cloud.contentwarehouse.v1.IListDocumentSchemasResponse} message ListDocumentSchemasResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDocumentSchemasResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documentSchemas != null && message.documentSchemas.length) + for (var i = 0; i < message.documentSchemas.length; ++i) + $root.google.cloud.contentwarehouse.v1.DocumentSchema.encode(message.documentSchemas[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 ListDocumentSchemasResponse message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse + * @static + * @param {google.cloud.contentwarehouse.v1.IListDocumentSchemasResponse} message ListDocumentSchemasResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDocumentSchemasResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDocumentSchemasResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse} ListDocumentSchemasResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDocumentSchemasResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.documentSchemas && message.documentSchemas.length)) + message.documentSchemas = []; + message.documentSchemas.push($root.google.cloud.contentwarehouse.v1.DocumentSchema.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDocumentSchemasResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse} ListDocumentSchemasResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDocumentSchemasResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDocumentSchemasResponse message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDocumentSchemasResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.documentSchemas != null && message.hasOwnProperty("documentSchemas")) { + if (!Array.isArray(message.documentSchemas)) + return "documentSchemas: array expected"; + for (var i = 0; i < message.documentSchemas.length; ++i) { + var error = $root.google.cloud.contentwarehouse.v1.DocumentSchema.verify(message.documentSchemas[i]); + if (error) + return "documentSchemas." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListDocumentSchemasResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse} ListDocumentSchemasResponse + */ + ListDocumentSchemasResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse(); + if (object.documentSchemas) { + if (!Array.isArray(object.documentSchemas)) + throw TypeError(".google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse.documentSchemas: array expected"); + message.documentSchemas = []; + for (var i = 0; i < object.documentSchemas.length; ++i) { + if (typeof object.documentSchemas[i] !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse.documentSchemas: object expected"); + message.documentSchemas[i] = $root.google.cloud.contentwarehouse.v1.DocumentSchema.fromObject(object.documentSchemas[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListDocumentSchemasResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse + * @static + * @param {google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse} message ListDocumentSchemasResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDocumentSchemasResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.documentSchemas = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.documentSchemas && message.documentSchemas.length) { + object.documentSchemas = []; + for (var j = 0; j < message.documentSchemas.length; ++j) + object.documentSchemas[j] = $root.google.cloud.contentwarehouse.v1.DocumentSchema.toObject(message.documentSchemas[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListDocumentSchemasResponse to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse + * @instance + * @returns {Object.} JSON object + */ + ListDocumentSchemasResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDocumentSchemasResponse + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDocumentSchemasResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse"; + }; + + return ListDocumentSchemasResponse; + })(); + + v1.DocumentService = (function() { + + /** + * Constructs a new DocumentService service. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a DocumentService + * @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 DocumentService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (DocumentService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = DocumentService; + + /** + * Creates new DocumentService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.contentwarehouse.v1.DocumentService + * @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 {DocumentService} RPC service. Useful where requests and/or responses are streamed. + */ + DocumentService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentService|createDocument}. + * @memberof google.cloud.contentwarehouse.v1.DocumentService + * @typedef CreateDocumentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.contentwarehouse.v1.CreateDocumentResponse} [response] CreateDocumentResponse + */ + + /** + * Calls CreateDocument. + * @function createDocument + * @memberof google.cloud.contentwarehouse.v1.DocumentService + * @instance + * @param {google.cloud.contentwarehouse.v1.ICreateDocumentRequest} request CreateDocumentRequest message or plain object + * @param {google.cloud.contentwarehouse.v1.DocumentService.CreateDocumentCallback} callback Node-style callback called with the error, if any, and CreateDocumentResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentService.prototype.createDocument = function createDocument(request, callback) { + return this.rpcCall(createDocument, $root.google.cloud.contentwarehouse.v1.CreateDocumentRequest, $root.google.cloud.contentwarehouse.v1.CreateDocumentResponse, request, callback); + }, "name", { value: "CreateDocument" }); + + /** + * Calls CreateDocument. + * @function createDocument + * @memberof google.cloud.contentwarehouse.v1.DocumentService + * @instance + * @param {google.cloud.contentwarehouse.v1.ICreateDocumentRequest} request CreateDocumentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentService|getDocument}. + * @memberof google.cloud.contentwarehouse.v1.DocumentService + * @typedef GetDocumentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.contentwarehouse.v1.Document} [response] Document + */ + + /** + * Calls GetDocument. + * @function getDocument + * @memberof google.cloud.contentwarehouse.v1.DocumentService + * @instance + * @param {google.cloud.contentwarehouse.v1.IGetDocumentRequest} request GetDocumentRequest message or plain object + * @param {google.cloud.contentwarehouse.v1.DocumentService.GetDocumentCallback} callback Node-style callback called with the error, if any, and Document + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentService.prototype.getDocument = function getDocument(request, callback) { + return this.rpcCall(getDocument, $root.google.cloud.contentwarehouse.v1.GetDocumentRequest, $root.google.cloud.contentwarehouse.v1.Document, request, callback); + }, "name", { value: "GetDocument" }); + + /** + * Calls GetDocument. + * @function getDocument + * @memberof google.cloud.contentwarehouse.v1.DocumentService + * @instance + * @param {google.cloud.contentwarehouse.v1.IGetDocumentRequest} request GetDocumentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentService|updateDocument}. + * @memberof google.cloud.contentwarehouse.v1.DocumentService + * @typedef UpdateDocumentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.contentwarehouse.v1.UpdateDocumentResponse} [response] UpdateDocumentResponse + */ + + /** + * Calls UpdateDocument. + * @function updateDocument + * @memberof google.cloud.contentwarehouse.v1.DocumentService + * @instance + * @param {google.cloud.contentwarehouse.v1.IUpdateDocumentRequest} request UpdateDocumentRequest message or plain object + * @param {google.cloud.contentwarehouse.v1.DocumentService.UpdateDocumentCallback} callback Node-style callback called with the error, if any, and UpdateDocumentResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentService.prototype.updateDocument = function updateDocument(request, callback) { + return this.rpcCall(updateDocument, $root.google.cloud.contentwarehouse.v1.UpdateDocumentRequest, $root.google.cloud.contentwarehouse.v1.UpdateDocumentResponse, request, callback); + }, "name", { value: "UpdateDocument" }); + + /** + * Calls UpdateDocument. + * @function updateDocument + * @memberof google.cloud.contentwarehouse.v1.DocumentService + * @instance + * @param {google.cloud.contentwarehouse.v1.IUpdateDocumentRequest} request UpdateDocumentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentService|deleteDocument}. + * @memberof google.cloud.contentwarehouse.v1.DocumentService + * @typedef DeleteDocumentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteDocument. + * @function deleteDocument + * @memberof google.cloud.contentwarehouse.v1.DocumentService + * @instance + * @param {google.cloud.contentwarehouse.v1.IDeleteDocumentRequest} request DeleteDocumentRequest message or plain object + * @param {google.cloud.contentwarehouse.v1.DocumentService.DeleteDocumentCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentService.prototype.deleteDocument = function deleteDocument(request, callback) { + return this.rpcCall(deleteDocument, $root.google.cloud.contentwarehouse.v1.DeleteDocumentRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteDocument" }); + + /** + * Calls DeleteDocument. + * @function deleteDocument + * @memberof google.cloud.contentwarehouse.v1.DocumentService + * @instance + * @param {google.cloud.contentwarehouse.v1.IDeleteDocumentRequest} request DeleteDocumentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentService|searchDocuments}. + * @memberof google.cloud.contentwarehouse.v1.DocumentService + * @typedef SearchDocumentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.contentwarehouse.v1.SearchDocumentsResponse} [response] SearchDocumentsResponse + */ + + /** + * Calls SearchDocuments. + * @function searchDocuments + * @memberof google.cloud.contentwarehouse.v1.DocumentService + * @instance + * @param {google.cloud.contentwarehouse.v1.ISearchDocumentsRequest} request SearchDocumentsRequest message or plain object + * @param {google.cloud.contentwarehouse.v1.DocumentService.SearchDocumentsCallback} callback Node-style callback called with the error, if any, and SearchDocumentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentService.prototype.searchDocuments = function searchDocuments(request, callback) { + return this.rpcCall(searchDocuments, $root.google.cloud.contentwarehouse.v1.SearchDocumentsRequest, $root.google.cloud.contentwarehouse.v1.SearchDocumentsResponse, request, callback); + }, "name", { value: "SearchDocuments" }); + + /** + * Calls SearchDocuments. + * @function searchDocuments + * @memberof google.cloud.contentwarehouse.v1.DocumentService + * @instance + * @param {google.cloud.contentwarehouse.v1.ISearchDocumentsRequest} request SearchDocumentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentService|lockDocument}. + * @memberof google.cloud.contentwarehouse.v1.DocumentService + * @typedef LockDocumentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.contentwarehouse.v1.Document} [response] Document + */ + + /** + * Calls LockDocument. + * @function lockDocument + * @memberof google.cloud.contentwarehouse.v1.DocumentService + * @instance + * @param {google.cloud.contentwarehouse.v1.ILockDocumentRequest} request LockDocumentRequest message or plain object + * @param {google.cloud.contentwarehouse.v1.DocumentService.LockDocumentCallback} callback Node-style callback called with the error, if any, and Document + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentService.prototype.lockDocument = function lockDocument(request, callback) { + return this.rpcCall(lockDocument, $root.google.cloud.contentwarehouse.v1.LockDocumentRequest, $root.google.cloud.contentwarehouse.v1.Document, request, callback); + }, "name", { value: "LockDocument" }); + + /** + * Calls LockDocument. + * @function lockDocument + * @memberof google.cloud.contentwarehouse.v1.DocumentService + * @instance + * @param {google.cloud.contentwarehouse.v1.ILockDocumentRequest} request LockDocumentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentService|fetchAcl}. + * @memberof google.cloud.contentwarehouse.v1.DocumentService + * @typedef FetchAclCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.contentwarehouse.v1.FetchAclResponse} [response] FetchAclResponse + */ + + /** + * Calls FetchAcl. + * @function fetchAcl + * @memberof google.cloud.contentwarehouse.v1.DocumentService + * @instance + * @param {google.cloud.contentwarehouse.v1.IFetchAclRequest} request FetchAclRequest message or plain object + * @param {google.cloud.contentwarehouse.v1.DocumentService.FetchAclCallback} callback Node-style callback called with the error, if any, and FetchAclResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentService.prototype.fetchAcl = function fetchAcl(request, callback) { + return this.rpcCall(fetchAcl, $root.google.cloud.contentwarehouse.v1.FetchAclRequest, $root.google.cloud.contentwarehouse.v1.FetchAclResponse, request, callback); + }, "name", { value: "FetchAcl" }); + + /** + * Calls FetchAcl. + * @function fetchAcl + * @memberof google.cloud.contentwarehouse.v1.DocumentService + * @instance + * @param {google.cloud.contentwarehouse.v1.IFetchAclRequest} request FetchAclRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentService|setAcl}. + * @memberof google.cloud.contentwarehouse.v1.DocumentService + * @typedef SetAclCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.contentwarehouse.v1.SetAclResponse} [response] SetAclResponse + */ + + /** + * Calls SetAcl. + * @function setAcl + * @memberof google.cloud.contentwarehouse.v1.DocumentService + * @instance + * @param {google.cloud.contentwarehouse.v1.ISetAclRequest} request SetAclRequest message or plain object + * @param {google.cloud.contentwarehouse.v1.DocumentService.SetAclCallback} callback Node-style callback called with the error, if any, and SetAclResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentService.prototype.setAcl = function setAcl(request, callback) { + return this.rpcCall(setAcl, $root.google.cloud.contentwarehouse.v1.SetAclRequest, $root.google.cloud.contentwarehouse.v1.SetAclResponse, request, callback); + }, "name", { value: "SetAcl" }); + + /** + * Calls SetAcl. + * @function setAcl + * @memberof google.cloud.contentwarehouse.v1.DocumentService + * @instance + * @param {google.cloud.contentwarehouse.v1.ISetAclRequest} request SetAclRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return DocumentService; + })(); + + v1.CreateDocumentResponse = (function() { + + /** + * Properties of a CreateDocumentResponse. + * @memberof google.cloud.contentwarehouse.v1 + * @interface ICreateDocumentResponse + * @property {google.cloud.contentwarehouse.v1.IDocument|null} [document] CreateDocumentResponse document + * @property {google.cloud.contentwarehouse.v1.IRuleEngineOutput|null} [ruleEngineOutput] CreateDocumentResponse ruleEngineOutput + * @property {google.cloud.contentwarehouse.v1.IResponseMetadata|null} [metadata] CreateDocumentResponse metadata + * @property {Array.|null} [longRunningOperations] CreateDocumentResponse longRunningOperations + */ + + /** + * Constructs a new CreateDocumentResponse. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a CreateDocumentResponse. + * @implements ICreateDocumentResponse + * @constructor + * @param {google.cloud.contentwarehouse.v1.ICreateDocumentResponse=} [properties] Properties to set + */ + function CreateDocumentResponse(properties) { + this.longRunningOperations = []; + 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]]; + } + + /** + * CreateDocumentResponse document. + * @member {google.cloud.contentwarehouse.v1.IDocument|null|undefined} document + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentResponse + * @instance + */ + CreateDocumentResponse.prototype.document = null; + + /** + * CreateDocumentResponse ruleEngineOutput. + * @member {google.cloud.contentwarehouse.v1.IRuleEngineOutput|null|undefined} ruleEngineOutput + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentResponse + * @instance + */ + CreateDocumentResponse.prototype.ruleEngineOutput = null; + + /** + * CreateDocumentResponse metadata. + * @member {google.cloud.contentwarehouse.v1.IResponseMetadata|null|undefined} metadata + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentResponse + * @instance + */ + CreateDocumentResponse.prototype.metadata = null; + + /** + * CreateDocumentResponse longRunningOperations. + * @member {Array.} longRunningOperations + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentResponse + * @instance + */ + CreateDocumentResponse.prototype.longRunningOperations = $util.emptyArray; + + /** + * Creates a new CreateDocumentResponse instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentResponse + * @static + * @param {google.cloud.contentwarehouse.v1.ICreateDocumentResponse=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.CreateDocumentResponse} CreateDocumentResponse instance + */ + CreateDocumentResponse.create = function create(properties) { + return new CreateDocumentResponse(properties); + }; + + /** + * Encodes the specified CreateDocumentResponse message. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateDocumentResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentResponse + * @static + * @param {google.cloud.contentwarehouse.v1.ICreateDocumentResponse} message CreateDocumentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDocumentResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.document != null && Object.hasOwnProperty.call(message, "document")) + $root.google.cloud.contentwarehouse.v1.Document.encode(message.document, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.ruleEngineOutput != null && Object.hasOwnProperty.call(message, "ruleEngineOutput")) + $root.google.cloud.contentwarehouse.v1.RuleEngineOutput.encode(message.ruleEngineOutput, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.cloud.contentwarehouse.v1.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.longRunningOperations != null && message.longRunningOperations.length) + for (var i = 0; i < message.longRunningOperations.length; ++i) + $root.google.longrunning.Operation.encode(message.longRunningOperations[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateDocumentResponse message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateDocumentResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentResponse + * @static + * @param {google.cloud.contentwarehouse.v1.ICreateDocumentResponse} message CreateDocumentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDocumentResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateDocumentResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.CreateDocumentResponse} CreateDocumentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDocumentResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.CreateDocumentResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.document = $root.google.cloud.contentwarehouse.v1.Document.decode(reader, reader.uint32()); + break; + } + case 2: { + message.ruleEngineOutput = $root.google.cloud.contentwarehouse.v1.RuleEngineOutput.decode(reader, reader.uint32()); + break; + } + case 3: { + message.metadata = $root.google.cloud.contentwarehouse.v1.ResponseMetadata.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.longRunningOperations && message.longRunningOperations.length)) + message.longRunningOperations = []; + message.longRunningOperations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateDocumentResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.CreateDocumentResponse} CreateDocumentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDocumentResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateDocumentResponse message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateDocumentResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.document != null && message.hasOwnProperty("document")) { + var error = $root.google.cloud.contentwarehouse.v1.Document.verify(message.document); + if (error) + return "document." + error; + } + if (message.ruleEngineOutput != null && message.hasOwnProperty("ruleEngineOutput")) { + var error = $root.google.cloud.contentwarehouse.v1.RuleEngineOutput.verify(message.ruleEngineOutput); + if (error) + return "ruleEngineOutput." + error; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.cloud.contentwarehouse.v1.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.longRunningOperations != null && message.hasOwnProperty("longRunningOperations")) { + if (!Array.isArray(message.longRunningOperations)) + return "longRunningOperations: array expected"; + for (var i = 0; i < message.longRunningOperations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.longRunningOperations[i]); + if (error) + return "longRunningOperations." + error; + } + } + return null; + }; + + /** + * Creates a CreateDocumentResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.CreateDocumentResponse} CreateDocumentResponse + */ + CreateDocumentResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.CreateDocumentResponse) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.CreateDocumentResponse(); + if (object.document != null) { + if (typeof object.document !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.CreateDocumentResponse.document: object expected"); + message.document = $root.google.cloud.contentwarehouse.v1.Document.fromObject(object.document); + } + if (object.ruleEngineOutput != null) { + if (typeof object.ruleEngineOutput !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.CreateDocumentResponse.ruleEngineOutput: object expected"); + message.ruleEngineOutput = $root.google.cloud.contentwarehouse.v1.RuleEngineOutput.fromObject(object.ruleEngineOutput); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.CreateDocumentResponse.metadata: object expected"); + message.metadata = $root.google.cloud.contentwarehouse.v1.ResponseMetadata.fromObject(object.metadata); + } + if (object.longRunningOperations) { + if (!Array.isArray(object.longRunningOperations)) + throw TypeError(".google.cloud.contentwarehouse.v1.CreateDocumentResponse.longRunningOperations: array expected"); + message.longRunningOperations = []; + for (var i = 0; i < object.longRunningOperations.length; ++i) { + if (typeof object.longRunningOperations[i] !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.CreateDocumentResponse.longRunningOperations: object expected"); + message.longRunningOperations[i] = $root.google.longrunning.Operation.fromObject(object.longRunningOperations[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CreateDocumentResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentResponse + * @static + * @param {google.cloud.contentwarehouse.v1.CreateDocumentResponse} message CreateDocumentResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateDocumentResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.longRunningOperations = []; + if (options.defaults) { + object.document = null; + object.ruleEngineOutput = null; + object.metadata = null; + } + if (message.document != null && message.hasOwnProperty("document")) + object.document = $root.google.cloud.contentwarehouse.v1.Document.toObject(message.document, options); + if (message.ruleEngineOutput != null && message.hasOwnProperty("ruleEngineOutput")) + object.ruleEngineOutput = $root.google.cloud.contentwarehouse.v1.RuleEngineOutput.toObject(message.ruleEngineOutput, options); + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.cloud.contentwarehouse.v1.ResponseMetadata.toObject(message.metadata, options); + if (message.longRunningOperations && message.longRunningOperations.length) { + object.longRunningOperations = []; + for (var j = 0; j < message.longRunningOperations.length; ++j) + object.longRunningOperations[j] = $root.google.longrunning.Operation.toObject(message.longRunningOperations[j], options); + } + return object; + }; + + /** + * Converts this CreateDocumentResponse to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentResponse + * @instance + * @returns {Object.} JSON object + */ + CreateDocumentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateDocumentResponse + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateDocumentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.CreateDocumentResponse"; + }; + + return CreateDocumentResponse; + })(); + + v1.UpdateDocumentResponse = (function() { + + /** + * Properties of an UpdateDocumentResponse. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IUpdateDocumentResponse + * @property {google.cloud.contentwarehouse.v1.IDocument|null} [document] UpdateDocumentResponse document + * @property {google.cloud.contentwarehouse.v1.IRuleEngineOutput|null} [ruleEngineOutput] UpdateDocumentResponse ruleEngineOutput + * @property {google.cloud.contentwarehouse.v1.IResponseMetadata|null} [metadata] UpdateDocumentResponse metadata + */ + + /** + * Constructs a new UpdateDocumentResponse. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents an UpdateDocumentResponse. + * @implements IUpdateDocumentResponse + * @constructor + * @param {google.cloud.contentwarehouse.v1.IUpdateDocumentResponse=} [properties] Properties to set + */ + function UpdateDocumentResponse(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]]; + } + + /** + * UpdateDocumentResponse document. + * @member {google.cloud.contentwarehouse.v1.IDocument|null|undefined} document + * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentResponse + * @instance + */ + UpdateDocumentResponse.prototype.document = null; + + /** + * UpdateDocumentResponse ruleEngineOutput. + * @member {google.cloud.contentwarehouse.v1.IRuleEngineOutput|null|undefined} ruleEngineOutput + * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentResponse + * @instance + */ + UpdateDocumentResponse.prototype.ruleEngineOutput = null; + + /** + * UpdateDocumentResponse metadata. + * @member {google.cloud.contentwarehouse.v1.IResponseMetadata|null|undefined} metadata + * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentResponse + * @instance + */ + UpdateDocumentResponse.prototype.metadata = null; + + /** + * Creates a new UpdateDocumentResponse instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentResponse + * @static + * @param {google.cloud.contentwarehouse.v1.IUpdateDocumentResponse=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.UpdateDocumentResponse} UpdateDocumentResponse instance + */ + UpdateDocumentResponse.create = function create(properties) { + return new UpdateDocumentResponse(properties); + }; + + /** + * Encodes the specified UpdateDocumentResponse message. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateDocumentResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentResponse + * @static + * @param {google.cloud.contentwarehouse.v1.IUpdateDocumentResponse} message UpdateDocumentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDocumentResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.document != null && Object.hasOwnProperty.call(message, "document")) + $root.google.cloud.contentwarehouse.v1.Document.encode(message.document, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.ruleEngineOutput != null && Object.hasOwnProperty.call(message, "ruleEngineOutput")) + $root.google.cloud.contentwarehouse.v1.RuleEngineOutput.encode(message.ruleEngineOutput, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.cloud.contentwarehouse.v1.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateDocumentResponse message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateDocumentResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentResponse + * @static + * @param {google.cloud.contentwarehouse.v1.IUpdateDocumentResponse} message UpdateDocumentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDocumentResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDocumentResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.UpdateDocumentResponse} UpdateDocumentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDocumentResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.UpdateDocumentResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.document = $root.google.cloud.contentwarehouse.v1.Document.decode(reader, reader.uint32()); + break; + } + case 2: { + message.ruleEngineOutput = $root.google.cloud.contentwarehouse.v1.RuleEngineOutput.decode(reader, reader.uint32()); + break; + } + case 3: { + message.metadata = $root.google.cloud.contentwarehouse.v1.ResponseMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateDocumentResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.UpdateDocumentResponse} UpdateDocumentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDocumentResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDocumentResponse message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDocumentResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.document != null && message.hasOwnProperty("document")) { + var error = $root.google.cloud.contentwarehouse.v1.Document.verify(message.document); + if (error) + return "document." + error; + } + if (message.ruleEngineOutput != null && message.hasOwnProperty("ruleEngineOutput")) { + var error = $root.google.cloud.contentwarehouse.v1.RuleEngineOutput.verify(message.ruleEngineOutput); + if (error) + return "ruleEngineOutput." + error; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.cloud.contentwarehouse.v1.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates an UpdateDocumentResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.UpdateDocumentResponse} UpdateDocumentResponse + */ + UpdateDocumentResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.UpdateDocumentResponse) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.UpdateDocumentResponse(); + if (object.document != null) { + if (typeof object.document !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.UpdateDocumentResponse.document: object expected"); + message.document = $root.google.cloud.contentwarehouse.v1.Document.fromObject(object.document); + } + if (object.ruleEngineOutput != null) { + if (typeof object.ruleEngineOutput !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.UpdateDocumentResponse.ruleEngineOutput: object expected"); + message.ruleEngineOutput = $root.google.cloud.contentwarehouse.v1.RuleEngineOutput.fromObject(object.ruleEngineOutput); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.UpdateDocumentResponse.metadata: object expected"); + message.metadata = $root.google.cloud.contentwarehouse.v1.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from an UpdateDocumentResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentResponse + * @static + * @param {google.cloud.contentwarehouse.v1.UpdateDocumentResponse} message UpdateDocumentResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDocumentResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.document = null; + object.ruleEngineOutput = null; + object.metadata = null; + } + if (message.document != null && message.hasOwnProperty("document")) + object.document = $root.google.cloud.contentwarehouse.v1.Document.toObject(message.document, options); + if (message.ruleEngineOutput != null && message.hasOwnProperty("ruleEngineOutput")) + object.ruleEngineOutput = $root.google.cloud.contentwarehouse.v1.RuleEngineOutput.toObject(message.ruleEngineOutput, options); + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.cloud.contentwarehouse.v1.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this UpdateDocumentResponse to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentResponse + * @instance + * @returns {Object.} JSON object + */ + UpdateDocumentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateDocumentResponse + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateDocumentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.UpdateDocumentResponse"; + }; + + return UpdateDocumentResponse; + })(); + + v1.QAResult = (function() { + + /** + * Properties of a QAResult. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IQAResult + * @property {Array.|null} [highlights] QAResult highlights + * @property {number|null} [confidenceScore] QAResult confidenceScore + */ + + /** + * Constructs a new QAResult. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a QAResult. + * @implements IQAResult + * @constructor + * @param {google.cloud.contentwarehouse.v1.IQAResult=} [properties] Properties to set + */ + function QAResult(properties) { + this.highlights = []; + 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]]; + } + + /** + * QAResult highlights. + * @member {Array.} highlights + * @memberof google.cloud.contentwarehouse.v1.QAResult + * @instance + */ + QAResult.prototype.highlights = $util.emptyArray; + + /** + * QAResult confidenceScore. + * @member {number} confidenceScore + * @memberof google.cloud.contentwarehouse.v1.QAResult + * @instance + */ + QAResult.prototype.confidenceScore = 0; + + /** + * Creates a new QAResult instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.QAResult + * @static + * @param {google.cloud.contentwarehouse.v1.IQAResult=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.QAResult} QAResult instance + */ + QAResult.create = function create(properties) { + return new QAResult(properties); + }; + + /** + * Encodes the specified QAResult message. Does not implicitly {@link google.cloud.contentwarehouse.v1.QAResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.QAResult + * @static + * @param {google.cloud.contentwarehouse.v1.IQAResult} message QAResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QAResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.highlights != null && message.highlights.length) + for (var i = 0; i < message.highlights.length; ++i) + $root.google.cloud.contentwarehouse.v1.QAResult.Highlight.encode(message.highlights[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.confidenceScore != null && Object.hasOwnProperty.call(message, "confidenceScore")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidenceScore); + return writer; + }; + + /** + * Encodes the specified QAResult message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.QAResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.QAResult + * @static + * @param {google.cloud.contentwarehouse.v1.IQAResult} message QAResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QAResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QAResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.QAResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.QAResult} QAResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QAResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.QAResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.highlights && message.highlights.length)) + message.highlights = []; + message.highlights.push($root.google.cloud.contentwarehouse.v1.QAResult.Highlight.decode(reader, reader.uint32())); + break; + } + case 2: { + message.confidenceScore = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QAResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.QAResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.QAResult} QAResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QAResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QAResult message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.QAResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QAResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.highlights != null && message.hasOwnProperty("highlights")) { + if (!Array.isArray(message.highlights)) + return "highlights: array expected"; + for (var i = 0; i < message.highlights.length; ++i) { + var error = $root.google.cloud.contentwarehouse.v1.QAResult.Highlight.verify(message.highlights[i]); + if (error) + return "highlights." + error; + } + } + if (message.confidenceScore != null && message.hasOwnProperty("confidenceScore")) + if (typeof message.confidenceScore !== "number") + return "confidenceScore: number expected"; + return null; + }; + + /** + * Creates a QAResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.QAResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.QAResult} QAResult + */ + QAResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.QAResult) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.QAResult(); + if (object.highlights) { + if (!Array.isArray(object.highlights)) + throw TypeError(".google.cloud.contentwarehouse.v1.QAResult.highlights: array expected"); + message.highlights = []; + for (var i = 0; i < object.highlights.length; ++i) { + if (typeof object.highlights[i] !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.QAResult.highlights: object expected"); + message.highlights[i] = $root.google.cloud.contentwarehouse.v1.QAResult.Highlight.fromObject(object.highlights[i]); + } + } + if (object.confidenceScore != null) + message.confidenceScore = Number(object.confidenceScore); + return message; + }; + + /** + * Creates a plain object from a QAResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.QAResult + * @static + * @param {google.cloud.contentwarehouse.v1.QAResult} message QAResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QAResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.highlights = []; + if (options.defaults) + object.confidenceScore = 0; + if (message.highlights && message.highlights.length) { + object.highlights = []; + for (var j = 0; j < message.highlights.length; ++j) + object.highlights[j] = $root.google.cloud.contentwarehouse.v1.QAResult.Highlight.toObject(message.highlights[j], options); + } + if (message.confidenceScore != null && message.hasOwnProperty("confidenceScore")) + object.confidenceScore = options.json && !isFinite(message.confidenceScore) ? String(message.confidenceScore) : message.confidenceScore; + return object; + }; + + /** + * Converts this QAResult to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.QAResult + * @instance + * @returns {Object.} JSON object + */ + QAResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QAResult + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.QAResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QAResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.QAResult"; + }; + + QAResult.Highlight = (function() { + + /** + * Properties of a Highlight. + * @memberof google.cloud.contentwarehouse.v1.QAResult + * @interface IHighlight + * @property {number|null} [startIndex] Highlight startIndex + * @property {number|null} [endIndex] Highlight endIndex + */ + + /** + * Constructs a new Highlight. + * @memberof google.cloud.contentwarehouse.v1.QAResult + * @classdesc Represents a Highlight. + * @implements IHighlight + * @constructor + * @param {google.cloud.contentwarehouse.v1.QAResult.IHighlight=} [properties] Properties to set + */ + function Highlight(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]]; + } + + /** + * Highlight startIndex. + * @member {number} startIndex + * @memberof google.cloud.contentwarehouse.v1.QAResult.Highlight + * @instance + */ + Highlight.prototype.startIndex = 0; + + /** + * Highlight endIndex. + * @member {number} endIndex + * @memberof google.cloud.contentwarehouse.v1.QAResult.Highlight + * @instance + */ + Highlight.prototype.endIndex = 0; + + /** + * Creates a new Highlight instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.QAResult.Highlight + * @static + * @param {google.cloud.contentwarehouse.v1.QAResult.IHighlight=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.QAResult.Highlight} Highlight instance + */ + Highlight.create = function create(properties) { + return new Highlight(properties); + }; + + /** + * Encodes the specified Highlight message. Does not implicitly {@link google.cloud.contentwarehouse.v1.QAResult.Highlight.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.QAResult.Highlight + * @static + * @param {google.cloud.contentwarehouse.v1.QAResult.IHighlight} message Highlight message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Highlight.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startIndex != null && Object.hasOwnProperty.call(message, "startIndex")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.startIndex); + if (message.endIndex != null && Object.hasOwnProperty.call(message, "endIndex")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.endIndex); + return writer; + }; + + /** + * Encodes the specified Highlight message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.QAResult.Highlight.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.QAResult.Highlight + * @static + * @param {google.cloud.contentwarehouse.v1.QAResult.IHighlight} message Highlight message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Highlight.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Highlight message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.QAResult.Highlight + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.QAResult.Highlight} Highlight + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Highlight.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.QAResult.Highlight(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.startIndex = reader.int32(); + break; + } + case 2: { + message.endIndex = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Highlight message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.QAResult.Highlight + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.QAResult.Highlight} Highlight + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Highlight.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Highlight message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.QAResult.Highlight + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Highlight.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startIndex != null && message.hasOwnProperty("startIndex")) + if (!$util.isInteger(message.startIndex)) + return "startIndex: integer expected"; + if (message.endIndex != null && message.hasOwnProperty("endIndex")) + if (!$util.isInteger(message.endIndex)) + return "endIndex: integer expected"; + return null; + }; + + /** + * Creates a Highlight message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.QAResult.Highlight + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.QAResult.Highlight} Highlight + */ + Highlight.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.QAResult.Highlight) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.QAResult.Highlight(); + if (object.startIndex != null) + message.startIndex = object.startIndex | 0; + if (object.endIndex != null) + message.endIndex = object.endIndex | 0; + return message; + }; + + /** + * Creates a plain object from a Highlight message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.QAResult.Highlight + * @static + * @param {google.cloud.contentwarehouse.v1.QAResult.Highlight} message Highlight + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Highlight.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startIndex = 0; + object.endIndex = 0; + } + if (message.startIndex != null && message.hasOwnProperty("startIndex")) + object.startIndex = message.startIndex; + if (message.endIndex != null && message.hasOwnProperty("endIndex")) + object.endIndex = message.endIndex; + return object; + }; + + /** + * Converts this Highlight to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.QAResult.Highlight + * @instance + * @returns {Object.} JSON object + */ + Highlight.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Highlight + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.QAResult.Highlight + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Highlight.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.QAResult.Highlight"; + }; + + return Highlight; + })(); + + return QAResult; + })(); + + v1.SearchDocumentsResponse = (function() { + + /** + * Properties of a SearchDocumentsResponse. + * @memberof google.cloud.contentwarehouse.v1 + * @interface ISearchDocumentsResponse + * @property {Array.|null} [matchingDocuments] SearchDocumentsResponse matchingDocuments + * @property {string|null} [nextPageToken] SearchDocumentsResponse nextPageToken + * @property {number|null} [totalSize] SearchDocumentsResponse totalSize + * @property {google.cloud.contentwarehouse.v1.IResponseMetadata|null} [metadata] SearchDocumentsResponse metadata + * @property {Array.|null} [histogramQueryResults] SearchDocumentsResponse histogramQueryResults + * @property {string|null} [questionAnswer] SearchDocumentsResponse questionAnswer + */ + + /** + * Constructs a new SearchDocumentsResponse. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a SearchDocumentsResponse. + * @implements ISearchDocumentsResponse + * @constructor + * @param {google.cloud.contentwarehouse.v1.ISearchDocumentsResponse=} [properties] Properties to set + */ + function SearchDocumentsResponse(properties) { + this.matchingDocuments = []; + this.histogramQueryResults = []; + 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]]; + } + + /** + * SearchDocumentsResponse matchingDocuments. + * @member {Array.} matchingDocuments + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse + * @instance + */ + SearchDocumentsResponse.prototype.matchingDocuments = $util.emptyArray; + + /** + * SearchDocumentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse + * @instance + */ + SearchDocumentsResponse.prototype.nextPageToken = ""; + + /** + * SearchDocumentsResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse + * @instance + */ + SearchDocumentsResponse.prototype.totalSize = 0; + + /** + * SearchDocumentsResponse metadata. + * @member {google.cloud.contentwarehouse.v1.IResponseMetadata|null|undefined} metadata + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse + * @instance + */ + SearchDocumentsResponse.prototype.metadata = null; + + /** + * SearchDocumentsResponse histogramQueryResults. + * @member {Array.} histogramQueryResults + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse + * @instance + */ + SearchDocumentsResponse.prototype.histogramQueryResults = $util.emptyArray; + + /** + * SearchDocumentsResponse questionAnswer. + * @member {string} questionAnswer + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse + * @instance + */ + SearchDocumentsResponse.prototype.questionAnswer = ""; + + /** + * Creates a new SearchDocumentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse + * @static + * @param {google.cloud.contentwarehouse.v1.ISearchDocumentsResponse=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.SearchDocumentsResponse} SearchDocumentsResponse instance + */ + SearchDocumentsResponse.create = function create(properties) { + return new SearchDocumentsResponse(properties); + }; + + /** + * Encodes the specified SearchDocumentsResponse message. Does not implicitly {@link google.cloud.contentwarehouse.v1.SearchDocumentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse + * @static + * @param {google.cloud.contentwarehouse.v1.ISearchDocumentsResponse} message SearchDocumentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchDocumentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.matchingDocuments != null && message.matchingDocuments.length) + for (var i = 0; i < message.matchingDocuments.length; ++i) + $root.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument.encode(message.matchingDocuments[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); + if (message.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalSize); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.cloud.contentwarehouse.v1.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.histogramQueryResults != null && message.histogramQueryResults.length) + for (var i = 0; i < message.histogramQueryResults.length; ++i) + $root.google.cloud.contentwarehouse.v1.HistogramQueryResult.encode(message.histogramQueryResults[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.questionAnswer != null && Object.hasOwnProperty.call(message, "questionAnswer")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.questionAnswer); + return writer; + }; + + /** + * Encodes the specified SearchDocumentsResponse message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.SearchDocumentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse + * @static + * @param {google.cloud.contentwarehouse.v1.ISearchDocumentsResponse} message SearchDocumentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchDocumentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchDocumentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.SearchDocumentsResponse} SearchDocumentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchDocumentsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.SearchDocumentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.matchingDocuments && message.matchingDocuments.length)) + message.matchingDocuments = []; + message.matchingDocuments.push($root.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + message.totalSize = reader.int32(); + break; + } + case 4: { + message.metadata = $root.google.cloud.contentwarehouse.v1.ResponseMetadata.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.histogramQueryResults && message.histogramQueryResults.length)) + message.histogramQueryResults = []; + message.histogramQueryResults.push($root.google.cloud.contentwarehouse.v1.HistogramQueryResult.decode(reader, reader.uint32())); + break; + } + case 7: { + message.questionAnswer = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchDocumentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.SearchDocumentsResponse} SearchDocumentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchDocumentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchDocumentsResponse message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchDocumentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.matchingDocuments != null && message.hasOwnProperty("matchingDocuments")) { + if (!Array.isArray(message.matchingDocuments)) + return "matchingDocuments: array expected"; + for (var i = 0; i < message.matchingDocuments.length; ++i) { + var error = $root.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument.verify(message.matchingDocuments[i]); + if (error) + return "matchingDocuments." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.cloud.contentwarehouse.v1.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.histogramQueryResults != null && message.hasOwnProperty("histogramQueryResults")) { + if (!Array.isArray(message.histogramQueryResults)) + return "histogramQueryResults: array expected"; + for (var i = 0; i < message.histogramQueryResults.length; ++i) { + var error = $root.google.cloud.contentwarehouse.v1.HistogramQueryResult.verify(message.histogramQueryResults[i]); + if (error) + return "histogramQueryResults." + error; + } + } + if (message.questionAnswer != null && message.hasOwnProperty("questionAnswer")) + if (!$util.isString(message.questionAnswer)) + return "questionAnswer: string expected"; + return null; + }; + + /** + * Creates a SearchDocumentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.SearchDocumentsResponse} SearchDocumentsResponse + */ + SearchDocumentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.SearchDocumentsResponse) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.SearchDocumentsResponse(); + if (object.matchingDocuments) { + if (!Array.isArray(object.matchingDocuments)) + throw TypeError(".google.cloud.contentwarehouse.v1.SearchDocumentsResponse.matchingDocuments: array expected"); + message.matchingDocuments = []; + for (var i = 0; i < object.matchingDocuments.length; ++i) { + if (typeof object.matchingDocuments[i] !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.SearchDocumentsResponse.matchingDocuments: object expected"); + message.matchingDocuments[i] = $root.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument.fromObject(object.matchingDocuments[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.SearchDocumentsResponse.metadata: object expected"); + message.metadata = $root.google.cloud.contentwarehouse.v1.ResponseMetadata.fromObject(object.metadata); + } + if (object.histogramQueryResults) { + if (!Array.isArray(object.histogramQueryResults)) + throw TypeError(".google.cloud.contentwarehouse.v1.SearchDocumentsResponse.histogramQueryResults: array expected"); + message.histogramQueryResults = []; + for (var i = 0; i < object.histogramQueryResults.length; ++i) { + if (typeof object.histogramQueryResults[i] !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.SearchDocumentsResponse.histogramQueryResults: object expected"); + message.histogramQueryResults[i] = $root.google.cloud.contentwarehouse.v1.HistogramQueryResult.fromObject(object.histogramQueryResults[i]); + } + } + if (object.questionAnswer != null) + message.questionAnswer = String(object.questionAnswer); + return message; + }; + + /** + * Creates a plain object from a SearchDocumentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse + * @static + * @param {google.cloud.contentwarehouse.v1.SearchDocumentsResponse} message SearchDocumentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchDocumentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.matchingDocuments = []; + object.histogramQueryResults = []; + } + if (options.defaults) { + object.nextPageToken = ""; + object.totalSize = 0; + object.metadata = null; + object.questionAnswer = ""; + } + if (message.matchingDocuments && message.matchingDocuments.length) { + object.matchingDocuments = []; + for (var j = 0; j < message.matchingDocuments.length; ++j) + object.matchingDocuments[j] = $root.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument.toObject(message.matchingDocuments[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.cloud.contentwarehouse.v1.ResponseMetadata.toObject(message.metadata, options); + if (message.histogramQueryResults && message.histogramQueryResults.length) { + object.histogramQueryResults = []; + for (var j = 0; j < message.histogramQueryResults.length; ++j) + object.histogramQueryResults[j] = $root.google.cloud.contentwarehouse.v1.HistogramQueryResult.toObject(message.histogramQueryResults[j], options); + } + if (message.questionAnswer != null && message.hasOwnProperty("questionAnswer")) + object.questionAnswer = message.questionAnswer; + return object; + }; + + /** + * Converts this SearchDocumentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse + * @instance + * @returns {Object.} JSON object + */ + SearchDocumentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchDocumentsResponse + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchDocumentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.SearchDocumentsResponse"; + }; + + SearchDocumentsResponse.MatchingDocument = (function() { + + /** + * Properties of a MatchingDocument. + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse + * @interface IMatchingDocument + * @property {google.cloud.contentwarehouse.v1.IDocument|null} [document] MatchingDocument document + * @property {string|null} [searchTextSnippet] MatchingDocument searchTextSnippet + * @property {google.cloud.contentwarehouse.v1.IQAResult|null} [qaResult] MatchingDocument qaResult + * @property {Array.|null} [matchedTokenPageIndices] MatchingDocument matchedTokenPageIndices + */ + + /** + * Constructs a new MatchingDocument. + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse + * @classdesc Represents a MatchingDocument. + * @implements IMatchingDocument + * @constructor + * @param {google.cloud.contentwarehouse.v1.SearchDocumentsResponse.IMatchingDocument=} [properties] Properties to set + */ + function MatchingDocument(properties) { + this.matchedTokenPageIndices = []; + 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]]; + } + + /** + * MatchingDocument document. + * @member {google.cloud.contentwarehouse.v1.IDocument|null|undefined} document + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument + * @instance + */ + MatchingDocument.prototype.document = null; + + /** + * MatchingDocument searchTextSnippet. + * @member {string} searchTextSnippet + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument + * @instance + */ + MatchingDocument.prototype.searchTextSnippet = ""; + + /** + * MatchingDocument qaResult. + * @member {google.cloud.contentwarehouse.v1.IQAResult|null|undefined} qaResult + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument + * @instance + */ + MatchingDocument.prototype.qaResult = null; + + /** + * MatchingDocument matchedTokenPageIndices. + * @member {Array.} matchedTokenPageIndices + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument + * @instance + */ + MatchingDocument.prototype.matchedTokenPageIndices = $util.emptyArray; + + /** + * Creates a new MatchingDocument instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument + * @static + * @param {google.cloud.contentwarehouse.v1.SearchDocumentsResponse.IMatchingDocument=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument} MatchingDocument instance + */ + MatchingDocument.create = function create(properties) { + return new MatchingDocument(properties); + }; + + /** + * Encodes the specified MatchingDocument message. Does not implicitly {@link google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument + * @static + * @param {google.cloud.contentwarehouse.v1.SearchDocumentsResponse.IMatchingDocument} message MatchingDocument message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MatchingDocument.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.document != null && Object.hasOwnProperty.call(message, "document")) + $root.google.cloud.contentwarehouse.v1.Document.encode(message.document, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.searchTextSnippet != null && Object.hasOwnProperty.call(message, "searchTextSnippet")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.searchTextSnippet); + if (message.qaResult != null && Object.hasOwnProperty.call(message, "qaResult")) + $root.google.cloud.contentwarehouse.v1.QAResult.encode(message.qaResult, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.matchedTokenPageIndices != null && message.matchedTokenPageIndices.length) { + writer.uint32(/* id 4, wireType 2 =*/34).fork(); + for (var i = 0; i < message.matchedTokenPageIndices.length; ++i) + writer.int64(message.matchedTokenPageIndices[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified MatchingDocument message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument + * @static + * @param {google.cloud.contentwarehouse.v1.SearchDocumentsResponse.IMatchingDocument} message MatchingDocument message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MatchingDocument.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MatchingDocument message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument} MatchingDocument + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MatchingDocument.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.document = $root.google.cloud.contentwarehouse.v1.Document.decode(reader, reader.uint32()); + break; + } + case 2: { + message.searchTextSnippet = reader.string(); + break; + } + case 3: { + message.qaResult = $root.google.cloud.contentwarehouse.v1.QAResult.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.matchedTokenPageIndices && message.matchedTokenPageIndices.length)) + message.matchedTokenPageIndices = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.matchedTokenPageIndices.push(reader.int64()); + } else + message.matchedTokenPageIndices.push(reader.int64()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MatchingDocument message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument} MatchingDocument + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MatchingDocument.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MatchingDocument message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MatchingDocument.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.document != null && message.hasOwnProperty("document")) { + var error = $root.google.cloud.contentwarehouse.v1.Document.verify(message.document); + if (error) + return "document." + error; + } + if (message.searchTextSnippet != null && message.hasOwnProperty("searchTextSnippet")) + if (!$util.isString(message.searchTextSnippet)) + return "searchTextSnippet: string expected"; + if (message.qaResult != null && message.hasOwnProperty("qaResult")) { + var error = $root.google.cloud.contentwarehouse.v1.QAResult.verify(message.qaResult); + if (error) + return "qaResult." + error; + } + if (message.matchedTokenPageIndices != null && message.hasOwnProperty("matchedTokenPageIndices")) { + if (!Array.isArray(message.matchedTokenPageIndices)) + return "matchedTokenPageIndices: array expected"; + for (var i = 0; i < message.matchedTokenPageIndices.length; ++i) + if (!$util.isInteger(message.matchedTokenPageIndices[i]) && !(message.matchedTokenPageIndices[i] && $util.isInteger(message.matchedTokenPageIndices[i].low) && $util.isInteger(message.matchedTokenPageIndices[i].high))) + return "matchedTokenPageIndices: integer|Long[] expected"; + } + return null; + }; + + /** + * Creates a MatchingDocument message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument} MatchingDocument + */ + MatchingDocument.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument(); + if (object.document != null) { + if (typeof object.document !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument.document: object expected"); + message.document = $root.google.cloud.contentwarehouse.v1.Document.fromObject(object.document); + } + if (object.searchTextSnippet != null) + message.searchTextSnippet = String(object.searchTextSnippet); + if (object.qaResult != null) { + if (typeof object.qaResult !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument.qaResult: object expected"); + message.qaResult = $root.google.cloud.contentwarehouse.v1.QAResult.fromObject(object.qaResult); + } + if (object.matchedTokenPageIndices) { + if (!Array.isArray(object.matchedTokenPageIndices)) + throw TypeError(".google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument.matchedTokenPageIndices: array expected"); + message.matchedTokenPageIndices = []; + for (var i = 0; i < object.matchedTokenPageIndices.length; ++i) + if ($util.Long) + (message.matchedTokenPageIndices[i] = $util.Long.fromValue(object.matchedTokenPageIndices[i])).unsigned = false; + else if (typeof object.matchedTokenPageIndices[i] === "string") + message.matchedTokenPageIndices[i] = parseInt(object.matchedTokenPageIndices[i], 10); + else if (typeof object.matchedTokenPageIndices[i] === "number") + message.matchedTokenPageIndices[i] = object.matchedTokenPageIndices[i]; + else if (typeof object.matchedTokenPageIndices[i] === "object") + message.matchedTokenPageIndices[i] = new $util.LongBits(object.matchedTokenPageIndices[i].low >>> 0, object.matchedTokenPageIndices[i].high >>> 0).toNumber(); + } + return message; + }; + + /** + * Creates a plain object from a MatchingDocument message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument + * @static + * @param {google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument} message MatchingDocument + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MatchingDocument.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.matchedTokenPageIndices = []; + if (options.defaults) { + object.document = null; + object.searchTextSnippet = ""; + object.qaResult = null; + } + if (message.document != null && message.hasOwnProperty("document")) + object.document = $root.google.cloud.contentwarehouse.v1.Document.toObject(message.document, options); + if (message.searchTextSnippet != null && message.hasOwnProperty("searchTextSnippet")) + object.searchTextSnippet = message.searchTextSnippet; + if (message.qaResult != null && message.hasOwnProperty("qaResult")) + object.qaResult = $root.google.cloud.contentwarehouse.v1.QAResult.toObject(message.qaResult, options); + if (message.matchedTokenPageIndices && message.matchedTokenPageIndices.length) { + object.matchedTokenPageIndices = []; + for (var j = 0; j < message.matchedTokenPageIndices.length; ++j) + if (typeof message.matchedTokenPageIndices[j] === "number") + object.matchedTokenPageIndices[j] = options.longs === String ? String(message.matchedTokenPageIndices[j]) : message.matchedTokenPageIndices[j]; + else + object.matchedTokenPageIndices[j] = options.longs === String ? $util.Long.prototype.toString.call(message.matchedTokenPageIndices[j]) : options.longs === Number ? new $util.LongBits(message.matchedTokenPageIndices[j].low >>> 0, message.matchedTokenPageIndices[j].high >>> 0).toNumber() : message.matchedTokenPageIndices[j]; + } + return object; + }; + + /** + * Converts this MatchingDocument to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument + * @instance + * @returns {Object.} JSON object + */ + MatchingDocument.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MatchingDocument + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MatchingDocument.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument"; + }; + + return MatchingDocument; + })(); + + return SearchDocumentsResponse; + })(); + + v1.FetchAclResponse = (function() { + + /** + * Properties of a FetchAclResponse. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IFetchAclResponse + * @property {google.iam.v1.IPolicy|null} [policy] FetchAclResponse policy + * @property {google.cloud.contentwarehouse.v1.IResponseMetadata|null} [metadata] FetchAclResponse metadata + */ + + /** + * Constructs a new FetchAclResponse. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a FetchAclResponse. + * @implements IFetchAclResponse + * @constructor + * @param {google.cloud.contentwarehouse.v1.IFetchAclResponse=} [properties] Properties to set + */ + function FetchAclResponse(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]]; + } + + /** + * FetchAclResponse policy. + * @member {google.iam.v1.IPolicy|null|undefined} policy + * @memberof google.cloud.contentwarehouse.v1.FetchAclResponse + * @instance + */ + FetchAclResponse.prototype.policy = null; + + /** + * FetchAclResponse metadata. + * @member {google.cloud.contentwarehouse.v1.IResponseMetadata|null|undefined} metadata + * @memberof google.cloud.contentwarehouse.v1.FetchAclResponse + * @instance + */ + FetchAclResponse.prototype.metadata = null; + + /** + * Creates a new FetchAclResponse instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.FetchAclResponse + * @static + * @param {google.cloud.contentwarehouse.v1.IFetchAclResponse=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.FetchAclResponse} FetchAclResponse instance + */ + FetchAclResponse.create = function create(properties) { + return new FetchAclResponse(properties); + }; + + /** + * Encodes the specified FetchAclResponse message. Does not implicitly {@link google.cloud.contentwarehouse.v1.FetchAclResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.FetchAclResponse + * @static + * @param {google.cloud.contentwarehouse.v1.IFetchAclResponse} message FetchAclResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchAclResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) + $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.cloud.contentwarehouse.v1.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FetchAclResponse message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.FetchAclResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.FetchAclResponse + * @static + * @param {google.cloud.contentwarehouse.v1.IFetchAclResponse} message FetchAclResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchAclResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FetchAclResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.FetchAclResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.FetchAclResponse} FetchAclResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchAclResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.FetchAclResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + } + case 2: { + message.metadata = $root.google.cloud.contentwarehouse.v1.ResponseMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FetchAclResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.FetchAclResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.FetchAclResponse} FetchAclResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchAclResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FetchAclResponse message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.FetchAclResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FetchAclResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.policy != null && message.hasOwnProperty("policy")) { + var error = $root.google.iam.v1.Policy.verify(message.policy); + if (error) + return "policy." + error; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.cloud.contentwarehouse.v1.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a FetchAclResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.FetchAclResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.FetchAclResponse} FetchAclResponse + */ + FetchAclResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.FetchAclResponse) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.FetchAclResponse(); + if (object.policy != null) { + if (typeof object.policy !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.FetchAclResponse.policy: object expected"); + message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.FetchAclResponse.metadata: object expected"); + message.metadata = $root.google.cloud.contentwarehouse.v1.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a FetchAclResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.FetchAclResponse + * @static + * @param {google.cloud.contentwarehouse.v1.FetchAclResponse} message FetchAclResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FetchAclResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.policy = null; + object.metadata = null; + } + if (message.policy != null && message.hasOwnProperty("policy")) + object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.cloud.contentwarehouse.v1.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this FetchAclResponse to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.FetchAclResponse + * @instance + * @returns {Object.} JSON object + */ + FetchAclResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FetchAclResponse + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.FetchAclResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FetchAclResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.FetchAclResponse"; + }; + + return FetchAclResponse; + })(); + + v1.SetAclResponse = (function() { + + /** + * Properties of a SetAclResponse. + * @memberof google.cloud.contentwarehouse.v1 + * @interface ISetAclResponse + * @property {google.iam.v1.IPolicy|null} [policy] SetAclResponse policy + * @property {google.cloud.contentwarehouse.v1.IResponseMetadata|null} [metadata] SetAclResponse metadata + */ + + /** + * Constructs a new SetAclResponse. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a SetAclResponse. + * @implements ISetAclResponse + * @constructor + * @param {google.cloud.contentwarehouse.v1.ISetAclResponse=} [properties] Properties to set + */ + function SetAclResponse(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]]; + } + + /** + * SetAclResponse policy. + * @member {google.iam.v1.IPolicy|null|undefined} policy + * @memberof google.cloud.contentwarehouse.v1.SetAclResponse + * @instance + */ + SetAclResponse.prototype.policy = null; + + /** + * SetAclResponse metadata. + * @member {google.cloud.contentwarehouse.v1.IResponseMetadata|null|undefined} metadata + * @memberof google.cloud.contentwarehouse.v1.SetAclResponse + * @instance + */ + SetAclResponse.prototype.metadata = null; + + /** + * Creates a new SetAclResponse instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.SetAclResponse + * @static + * @param {google.cloud.contentwarehouse.v1.ISetAclResponse=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.SetAclResponse} SetAclResponse instance + */ + SetAclResponse.create = function create(properties) { + return new SetAclResponse(properties); + }; + + /** + * Encodes the specified SetAclResponse message. Does not implicitly {@link google.cloud.contentwarehouse.v1.SetAclResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.SetAclResponse + * @static + * @param {google.cloud.contentwarehouse.v1.ISetAclResponse} message SetAclResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetAclResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) + $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.cloud.contentwarehouse.v1.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetAclResponse message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.SetAclResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.SetAclResponse + * @static + * @param {google.cloud.contentwarehouse.v1.ISetAclResponse} message SetAclResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetAclResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetAclResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.SetAclResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.SetAclResponse} SetAclResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetAclResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.SetAclResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + } + case 2: { + message.metadata = $root.google.cloud.contentwarehouse.v1.ResponseMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetAclResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.SetAclResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.SetAclResponse} SetAclResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetAclResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetAclResponse message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.SetAclResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetAclResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.policy != null && message.hasOwnProperty("policy")) { + var error = $root.google.iam.v1.Policy.verify(message.policy); + if (error) + return "policy." + error; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.cloud.contentwarehouse.v1.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a SetAclResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.SetAclResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.SetAclResponse} SetAclResponse + */ + SetAclResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.SetAclResponse) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.SetAclResponse(); + if (object.policy != null) { + if (typeof object.policy !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.SetAclResponse.policy: object expected"); + message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.SetAclResponse.metadata: object expected"); + message.metadata = $root.google.cloud.contentwarehouse.v1.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a SetAclResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.SetAclResponse + * @static + * @param {google.cloud.contentwarehouse.v1.SetAclResponse} message SetAclResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetAclResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.policy = null; + object.metadata = null; + } + if (message.policy != null && message.hasOwnProperty("policy")) + object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.cloud.contentwarehouse.v1.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this SetAclResponse to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.SetAclResponse + * @instance + * @returns {Object.} JSON object + */ + SetAclResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SetAclResponse + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.SetAclResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SetAclResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.SetAclResponse"; + }; + + return SetAclResponse; + })(); + + v1.CloudAIDocumentOption = (function() { + + /** + * Properties of a CloudAIDocumentOption. + * @memberof google.cloud.contentwarehouse.v1 + * @interface ICloudAIDocumentOption + * @property {boolean|null} [enableEntitiesConversions] CloudAIDocumentOption enableEntitiesConversions + * @property {Object.|null} [customizedEntitiesPropertiesConversions] CloudAIDocumentOption customizedEntitiesPropertiesConversions + */ + + /** + * Constructs a new CloudAIDocumentOption. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a CloudAIDocumentOption. + * @implements ICloudAIDocumentOption + * @constructor + * @param {google.cloud.contentwarehouse.v1.ICloudAIDocumentOption=} [properties] Properties to set + */ + function CloudAIDocumentOption(properties) { + this.customizedEntitiesPropertiesConversions = {}; + 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]]; + } + + /** + * CloudAIDocumentOption enableEntitiesConversions. + * @member {boolean} enableEntitiesConversions + * @memberof google.cloud.contentwarehouse.v1.CloudAIDocumentOption + * @instance + */ + CloudAIDocumentOption.prototype.enableEntitiesConversions = false; + + /** + * CloudAIDocumentOption customizedEntitiesPropertiesConversions. + * @member {Object.} customizedEntitiesPropertiesConversions + * @memberof google.cloud.contentwarehouse.v1.CloudAIDocumentOption + * @instance + */ + CloudAIDocumentOption.prototype.customizedEntitiesPropertiesConversions = $util.emptyObject; + + /** + * Creates a new CloudAIDocumentOption instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.CloudAIDocumentOption + * @static + * @param {google.cloud.contentwarehouse.v1.ICloudAIDocumentOption=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.CloudAIDocumentOption} CloudAIDocumentOption instance + */ + CloudAIDocumentOption.create = function create(properties) { + return new CloudAIDocumentOption(properties); + }; + + /** + * Encodes the specified CloudAIDocumentOption message. Does not implicitly {@link google.cloud.contentwarehouse.v1.CloudAIDocumentOption.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.CloudAIDocumentOption + * @static + * @param {google.cloud.contentwarehouse.v1.ICloudAIDocumentOption} message CloudAIDocumentOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudAIDocumentOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableEntitiesConversions != null && Object.hasOwnProperty.call(message, "enableEntitiesConversions")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableEntitiesConversions); + if (message.customizedEntitiesPropertiesConversions != null && Object.hasOwnProperty.call(message, "customizedEntitiesPropertiesConversions")) + for (var keys = Object.keys(message.customizedEntitiesPropertiesConversions), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.customizedEntitiesPropertiesConversions[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified CloudAIDocumentOption message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.CloudAIDocumentOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.CloudAIDocumentOption + * @static + * @param {google.cloud.contentwarehouse.v1.ICloudAIDocumentOption} message CloudAIDocumentOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudAIDocumentOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudAIDocumentOption message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.CloudAIDocumentOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.CloudAIDocumentOption} CloudAIDocumentOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudAIDocumentOption.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.CloudAIDocumentOption(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enableEntitiesConversions = reader.bool(); + break; + } + case 2: { + if (message.customizedEntitiesPropertiesConversions === $util.emptyObject) + message.customizedEntitiesPropertiesConversions = {}; + 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.customizedEntitiesPropertiesConversions[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudAIDocumentOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.CloudAIDocumentOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.CloudAIDocumentOption} CloudAIDocumentOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudAIDocumentOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudAIDocumentOption message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.CloudAIDocumentOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudAIDocumentOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enableEntitiesConversions != null && message.hasOwnProperty("enableEntitiesConversions")) + if (typeof message.enableEntitiesConversions !== "boolean") + return "enableEntitiesConversions: boolean expected"; + if (message.customizedEntitiesPropertiesConversions != null && message.hasOwnProperty("customizedEntitiesPropertiesConversions")) { + if (!$util.isObject(message.customizedEntitiesPropertiesConversions)) + return "customizedEntitiesPropertiesConversions: object expected"; + var key = Object.keys(message.customizedEntitiesPropertiesConversions); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.customizedEntitiesPropertiesConversions[key[i]])) + return "customizedEntitiesPropertiesConversions: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a CloudAIDocumentOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.CloudAIDocumentOption + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.CloudAIDocumentOption} CloudAIDocumentOption + */ + CloudAIDocumentOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.CloudAIDocumentOption) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.CloudAIDocumentOption(); + if (object.enableEntitiesConversions != null) + message.enableEntitiesConversions = Boolean(object.enableEntitiesConversions); + if (object.customizedEntitiesPropertiesConversions) { + if (typeof object.customizedEntitiesPropertiesConversions !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.CloudAIDocumentOption.customizedEntitiesPropertiesConversions: object expected"); + message.customizedEntitiesPropertiesConversions = {}; + for (var keys = Object.keys(object.customizedEntitiesPropertiesConversions), i = 0; i < keys.length; ++i) + message.customizedEntitiesPropertiesConversions[keys[i]] = String(object.customizedEntitiesPropertiesConversions[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a CloudAIDocumentOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.CloudAIDocumentOption + * @static + * @param {google.cloud.contentwarehouse.v1.CloudAIDocumentOption} message CloudAIDocumentOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudAIDocumentOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.customizedEntitiesPropertiesConversions = {}; + if (options.defaults) + object.enableEntitiesConversions = false; + if (message.enableEntitiesConversions != null && message.hasOwnProperty("enableEntitiesConversions")) + object.enableEntitiesConversions = message.enableEntitiesConversions; + var keys2; + if (message.customizedEntitiesPropertiesConversions && (keys2 = Object.keys(message.customizedEntitiesPropertiesConversions)).length) { + object.customizedEntitiesPropertiesConversions = {}; + for (var j = 0; j < keys2.length; ++j) + object.customizedEntitiesPropertiesConversions[keys2[j]] = message.customizedEntitiesPropertiesConversions[keys2[j]]; + } + return object; + }; + + /** + * Converts this CloudAIDocumentOption to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.CloudAIDocumentOption + * @instance + * @returns {Object.} JSON object + */ + CloudAIDocumentOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudAIDocumentOption + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.CloudAIDocumentOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudAIDocumentOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.CloudAIDocumentOption"; + }; + + return CloudAIDocumentOption; + })(); + + v1.CreateDocumentRequest = (function() { + + /** + * Properties of a CreateDocumentRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @interface ICreateDocumentRequest + * @property {string|null} [parent] CreateDocumentRequest parent + * @property {google.cloud.contentwarehouse.v1.IDocument|null} [document] CreateDocumentRequest document + * @property {google.cloud.contentwarehouse.v1.IRequestMetadata|null} [requestMetadata] CreateDocumentRequest requestMetadata + * @property {google.iam.v1.IPolicy|null} [policy] CreateDocumentRequest policy + * @property {google.cloud.contentwarehouse.v1.ICloudAIDocumentOption|null} [cloudAiDocumentOption] CreateDocumentRequest cloudAiDocumentOption + * @property {google.protobuf.IFieldMask|null} [createMask] CreateDocumentRequest createMask + */ + + /** + * Constructs a new CreateDocumentRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a CreateDocumentRequest. + * @implements ICreateDocumentRequest + * @constructor + * @param {google.cloud.contentwarehouse.v1.ICreateDocumentRequest=} [properties] Properties to set + */ + function CreateDocumentRequest(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]]; + } + + /** + * CreateDocumentRequest parent. + * @member {string} parent + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentRequest + * @instance + */ + CreateDocumentRequest.prototype.parent = ""; + + /** + * CreateDocumentRequest document. + * @member {google.cloud.contentwarehouse.v1.IDocument|null|undefined} document + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentRequest + * @instance + */ + CreateDocumentRequest.prototype.document = null; + + /** + * CreateDocumentRequest requestMetadata. + * @member {google.cloud.contentwarehouse.v1.IRequestMetadata|null|undefined} requestMetadata + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentRequest + * @instance + */ + CreateDocumentRequest.prototype.requestMetadata = null; + + /** + * CreateDocumentRequest policy. + * @member {google.iam.v1.IPolicy|null|undefined} policy + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentRequest + * @instance + */ + CreateDocumentRequest.prototype.policy = null; + + /** + * CreateDocumentRequest cloudAiDocumentOption. + * @member {google.cloud.contentwarehouse.v1.ICloudAIDocumentOption|null|undefined} cloudAiDocumentOption + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentRequest + * @instance + */ + CreateDocumentRequest.prototype.cloudAiDocumentOption = null; + + /** + * CreateDocumentRequest createMask. + * @member {google.protobuf.IFieldMask|null|undefined} createMask + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentRequest + * @instance + */ + CreateDocumentRequest.prototype.createMask = null; + + /** + * Creates a new CreateDocumentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentRequest + * @static + * @param {google.cloud.contentwarehouse.v1.ICreateDocumentRequest=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.CreateDocumentRequest} CreateDocumentRequest instance + */ + CreateDocumentRequest.create = function create(properties) { + return new CreateDocumentRequest(properties); + }; + + /** + * Encodes the specified CreateDocumentRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateDocumentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentRequest + * @static + * @param {google.cloud.contentwarehouse.v1.ICreateDocumentRequest} message CreateDocumentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDocumentRequest.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.document != null && Object.hasOwnProperty.call(message, "document")) + $root.google.cloud.contentwarehouse.v1.Document.encode(message.document, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestMetadata != null && Object.hasOwnProperty.call(message, "requestMetadata")) + $root.google.cloud.contentwarehouse.v1.RequestMetadata.encode(message.requestMetadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) + $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.cloudAiDocumentOption != null && Object.hasOwnProperty.call(message, "cloudAiDocumentOption")) + $root.google.cloud.contentwarehouse.v1.CloudAIDocumentOption.encode(message.cloudAiDocumentOption, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.createMask != null && Object.hasOwnProperty.call(message, "createMask")) + $root.google.protobuf.FieldMask.encode(message.createMask, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateDocumentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentRequest + * @static + * @param {google.cloud.contentwarehouse.v1.ICreateDocumentRequest} message CreateDocumentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateDocumentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.CreateDocumentRequest} CreateDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDocumentRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.CreateDocumentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.document = $root.google.cloud.contentwarehouse.v1.Document.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.decode(reader, reader.uint32()); + break; + } + case 4: { + message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + } + case 5: { + message.cloudAiDocumentOption = $root.google.cloud.contentwarehouse.v1.CloudAIDocumentOption.decode(reader, reader.uint32()); + break; + } + case 6: { + message.createMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateDocumentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.CreateDocumentRequest} CreateDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDocumentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateDocumentRequest message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateDocumentRequest.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.document != null && message.hasOwnProperty("document")) { + var error = $root.google.cloud.contentwarehouse.v1.Document.verify(message.document); + if (error) + return "document." + error; + } + if (message.requestMetadata != null && message.hasOwnProperty("requestMetadata")) { + var error = $root.google.cloud.contentwarehouse.v1.RequestMetadata.verify(message.requestMetadata); + if (error) + return "requestMetadata." + error; + } + if (message.policy != null && message.hasOwnProperty("policy")) { + var error = $root.google.iam.v1.Policy.verify(message.policy); + if (error) + return "policy." + error; + } + if (message.cloudAiDocumentOption != null && message.hasOwnProperty("cloudAiDocumentOption")) { + var error = $root.google.cloud.contentwarehouse.v1.CloudAIDocumentOption.verify(message.cloudAiDocumentOption); + if (error) + return "cloudAiDocumentOption." + error; + } + if (message.createMask != null && message.hasOwnProperty("createMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.createMask); + if (error) + return "createMask." + error; + } + return null; + }; + + /** + * Creates a CreateDocumentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.CreateDocumentRequest} CreateDocumentRequest + */ + CreateDocumentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.CreateDocumentRequest) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.CreateDocumentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.document != null) { + if (typeof object.document !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.CreateDocumentRequest.document: object expected"); + message.document = $root.google.cloud.contentwarehouse.v1.Document.fromObject(object.document); + } + if (object.requestMetadata != null) { + if (typeof object.requestMetadata !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.CreateDocumentRequest.requestMetadata: object expected"); + message.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.fromObject(object.requestMetadata); + } + if (object.policy != null) { + if (typeof object.policy !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.CreateDocumentRequest.policy: object expected"); + message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); + } + if (object.cloudAiDocumentOption != null) { + if (typeof object.cloudAiDocumentOption !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.CreateDocumentRequest.cloudAiDocumentOption: object expected"); + message.cloudAiDocumentOption = $root.google.cloud.contentwarehouse.v1.CloudAIDocumentOption.fromObject(object.cloudAiDocumentOption); + } + if (object.createMask != null) { + if (typeof object.createMask !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.CreateDocumentRequest.createMask: object expected"); + message.createMask = $root.google.protobuf.FieldMask.fromObject(object.createMask); + } + return message; + }; + + /** + * Creates a plain object from a CreateDocumentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentRequest + * @static + * @param {google.cloud.contentwarehouse.v1.CreateDocumentRequest} message CreateDocumentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateDocumentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.document = null; + object.requestMetadata = null; + object.policy = null; + object.cloudAiDocumentOption = null; + object.createMask = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.document != null && message.hasOwnProperty("document")) + object.document = $root.google.cloud.contentwarehouse.v1.Document.toObject(message.document, options); + if (message.requestMetadata != null && message.hasOwnProperty("requestMetadata")) + object.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.toObject(message.requestMetadata, options); + if (message.policy != null && message.hasOwnProperty("policy")) + object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); + if (message.cloudAiDocumentOption != null && message.hasOwnProperty("cloudAiDocumentOption")) + object.cloudAiDocumentOption = $root.google.cloud.contentwarehouse.v1.CloudAIDocumentOption.toObject(message.cloudAiDocumentOption, options); + if (message.createMask != null && message.hasOwnProperty("createMask")) + object.createMask = $root.google.protobuf.FieldMask.toObject(message.createMask, options); + return object; + }; + + /** + * Converts this CreateDocumentRequest to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentRequest + * @instance + * @returns {Object.} JSON object + */ + CreateDocumentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateDocumentRequest + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.CreateDocumentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateDocumentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.CreateDocumentRequest"; + }; + + return CreateDocumentRequest; + })(); + + v1.GetDocumentRequest = (function() { + + /** + * Properties of a GetDocumentRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IGetDocumentRequest + * @property {string|null} [name] GetDocumentRequest name + * @property {google.cloud.contentwarehouse.v1.IRequestMetadata|null} [requestMetadata] GetDocumentRequest requestMetadata + */ + + /** + * Constructs a new GetDocumentRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a GetDocumentRequest. + * @implements IGetDocumentRequest + * @constructor + * @param {google.cloud.contentwarehouse.v1.IGetDocumentRequest=} [properties] Properties to set + */ + function GetDocumentRequest(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]]; + } + + /** + * GetDocumentRequest name. + * @member {string} name + * @memberof google.cloud.contentwarehouse.v1.GetDocumentRequest + * @instance + */ + GetDocumentRequest.prototype.name = ""; + + /** + * GetDocumentRequest requestMetadata. + * @member {google.cloud.contentwarehouse.v1.IRequestMetadata|null|undefined} requestMetadata + * @memberof google.cloud.contentwarehouse.v1.GetDocumentRequest + * @instance + */ + GetDocumentRequest.prototype.requestMetadata = null; + + /** + * Creates a new GetDocumentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.GetDocumentRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IGetDocumentRequest=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.GetDocumentRequest} GetDocumentRequest instance + */ + GetDocumentRequest.create = function create(properties) { + return new GetDocumentRequest(properties); + }; + + /** + * Encodes the specified GetDocumentRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.GetDocumentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.GetDocumentRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IGetDocumentRequest} message GetDocumentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDocumentRequest.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.requestMetadata != null && Object.hasOwnProperty.call(message, "requestMetadata")) + $root.google.cloud.contentwarehouse.v1.RequestMetadata.encode(message.requestMetadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.GetDocumentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.GetDocumentRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IGetDocumentRequest} message GetDocumentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDocumentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.GetDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.GetDocumentRequest} GetDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDocumentRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.GetDocumentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDocumentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.GetDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.GetDocumentRequest} GetDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDocumentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDocumentRequest message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.GetDocumentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDocumentRequest.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.requestMetadata != null && message.hasOwnProperty("requestMetadata")) { + var error = $root.google.cloud.contentwarehouse.v1.RequestMetadata.verify(message.requestMetadata); + if (error) + return "requestMetadata." + error; + } + return null; + }; + + /** + * Creates a GetDocumentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.GetDocumentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.GetDocumentRequest} GetDocumentRequest + */ + GetDocumentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.GetDocumentRequest) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.GetDocumentRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestMetadata != null) { + if (typeof object.requestMetadata !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.GetDocumentRequest.requestMetadata: object expected"); + message.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.fromObject(object.requestMetadata); + } + return message; + }; + + /** + * Creates a plain object from a GetDocumentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.GetDocumentRequest + * @static + * @param {google.cloud.contentwarehouse.v1.GetDocumentRequest} message GetDocumentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDocumentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestMetadata = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestMetadata != null && message.hasOwnProperty("requestMetadata")) + object.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.toObject(message.requestMetadata, options); + return object; + }; + + /** + * Converts this GetDocumentRequest to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.GetDocumentRequest + * @instance + * @returns {Object.} JSON object + */ + GetDocumentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetDocumentRequest + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.GetDocumentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetDocumentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.GetDocumentRequest"; + }; + + return GetDocumentRequest; + })(); + + v1.UpdateDocumentRequest = (function() { + + /** + * Properties of an UpdateDocumentRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IUpdateDocumentRequest + * @property {string|null} [name] UpdateDocumentRequest name + * @property {google.cloud.contentwarehouse.v1.IDocument|null} [document] UpdateDocumentRequest document + * @property {google.cloud.contentwarehouse.v1.IRequestMetadata|null} [requestMetadata] UpdateDocumentRequest requestMetadata + * @property {google.cloud.contentwarehouse.v1.ICloudAIDocumentOption|null} [cloudAiDocumentOption] UpdateDocumentRequest cloudAiDocumentOption + * @property {google.cloud.contentwarehouse.v1.IUpdateOptions|null} [updateOptions] UpdateDocumentRequest updateOptions + */ + + /** + * Constructs a new UpdateDocumentRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents an UpdateDocumentRequest. + * @implements IUpdateDocumentRequest + * @constructor + * @param {google.cloud.contentwarehouse.v1.IUpdateDocumentRequest=} [properties] Properties to set + */ + function UpdateDocumentRequest(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]]; + } + + /** + * UpdateDocumentRequest name. + * @member {string} name + * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentRequest + * @instance + */ + UpdateDocumentRequest.prototype.name = ""; + + /** + * UpdateDocumentRequest document. + * @member {google.cloud.contentwarehouse.v1.IDocument|null|undefined} document + * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentRequest + * @instance + */ + UpdateDocumentRequest.prototype.document = null; + + /** + * UpdateDocumentRequest requestMetadata. + * @member {google.cloud.contentwarehouse.v1.IRequestMetadata|null|undefined} requestMetadata + * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentRequest + * @instance + */ + UpdateDocumentRequest.prototype.requestMetadata = null; + + /** + * UpdateDocumentRequest cloudAiDocumentOption. + * @member {google.cloud.contentwarehouse.v1.ICloudAIDocumentOption|null|undefined} cloudAiDocumentOption + * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentRequest + * @instance + */ + UpdateDocumentRequest.prototype.cloudAiDocumentOption = null; + + /** + * UpdateDocumentRequest updateOptions. + * @member {google.cloud.contentwarehouse.v1.IUpdateOptions|null|undefined} updateOptions + * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentRequest + * @instance + */ + UpdateDocumentRequest.prototype.updateOptions = null; + + /** + * Creates a new UpdateDocumentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IUpdateDocumentRequest=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.UpdateDocumentRequest} UpdateDocumentRequest instance + */ + UpdateDocumentRequest.create = function create(properties) { + return new UpdateDocumentRequest(properties); + }; + + /** + * Encodes the specified UpdateDocumentRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateDocumentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IUpdateDocumentRequest} message UpdateDocumentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDocumentRequest.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.document != null && Object.hasOwnProperty.call(message, "document")) + $root.google.cloud.contentwarehouse.v1.Document.encode(message.document, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestMetadata != null && Object.hasOwnProperty.call(message, "requestMetadata")) + $root.google.cloud.contentwarehouse.v1.RequestMetadata.encode(message.requestMetadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.cloudAiDocumentOption != null && Object.hasOwnProperty.call(message, "cloudAiDocumentOption")) + $root.google.cloud.contentwarehouse.v1.CloudAIDocumentOption.encode(message.cloudAiDocumentOption, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.updateOptions != null && Object.hasOwnProperty.call(message, "updateOptions")) + $root.google.cloud.contentwarehouse.v1.UpdateOptions.encode(message.updateOptions, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateDocumentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IUpdateDocumentRequest} message UpdateDocumentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDocumentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.UpdateDocumentRequest} UpdateDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDocumentRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.UpdateDocumentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.document = $root.google.cloud.contentwarehouse.v1.Document.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.decode(reader, reader.uint32()); + break; + } + case 5: { + message.cloudAiDocumentOption = $root.google.cloud.contentwarehouse.v1.CloudAIDocumentOption.decode(reader, reader.uint32()); + break; + } + case 6: { + message.updateOptions = $root.google.cloud.contentwarehouse.v1.UpdateOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateDocumentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.UpdateDocumentRequest} UpdateDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDocumentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDocumentRequest message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDocumentRequest.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.document != null && message.hasOwnProperty("document")) { + var error = $root.google.cloud.contentwarehouse.v1.Document.verify(message.document); + if (error) + return "document." + error; + } + if (message.requestMetadata != null && message.hasOwnProperty("requestMetadata")) { + var error = $root.google.cloud.contentwarehouse.v1.RequestMetadata.verify(message.requestMetadata); + if (error) + return "requestMetadata." + error; + } + if (message.cloudAiDocumentOption != null && message.hasOwnProperty("cloudAiDocumentOption")) { + var error = $root.google.cloud.contentwarehouse.v1.CloudAIDocumentOption.verify(message.cloudAiDocumentOption); + if (error) + return "cloudAiDocumentOption." + error; + } + if (message.updateOptions != null && message.hasOwnProperty("updateOptions")) { + var error = $root.google.cloud.contentwarehouse.v1.UpdateOptions.verify(message.updateOptions); + if (error) + return "updateOptions." + error; + } + return null; + }; + + /** + * Creates an UpdateDocumentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.UpdateDocumentRequest} UpdateDocumentRequest + */ + UpdateDocumentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.UpdateDocumentRequest) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.UpdateDocumentRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.document != null) { + if (typeof object.document !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.UpdateDocumentRequest.document: object expected"); + message.document = $root.google.cloud.contentwarehouse.v1.Document.fromObject(object.document); + } + if (object.requestMetadata != null) { + if (typeof object.requestMetadata !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.UpdateDocumentRequest.requestMetadata: object expected"); + message.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.fromObject(object.requestMetadata); + } + if (object.cloudAiDocumentOption != null) { + if (typeof object.cloudAiDocumentOption !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.UpdateDocumentRequest.cloudAiDocumentOption: object expected"); + message.cloudAiDocumentOption = $root.google.cloud.contentwarehouse.v1.CloudAIDocumentOption.fromObject(object.cloudAiDocumentOption); + } + if (object.updateOptions != null) { + if (typeof object.updateOptions !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.UpdateDocumentRequest.updateOptions: object expected"); + message.updateOptions = $root.google.cloud.contentwarehouse.v1.UpdateOptions.fromObject(object.updateOptions); + } + return message; + }; + + /** + * Creates a plain object from an UpdateDocumentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentRequest + * @static + * @param {google.cloud.contentwarehouse.v1.UpdateDocumentRequest} message UpdateDocumentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDocumentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.document = null; + object.requestMetadata = null; + object.cloudAiDocumentOption = null; + object.updateOptions = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.document != null && message.hasOwnProperty("document")) + object.document = $root.google.cloud.contentwarehouse.v1.Document.toObject(message.document, options); + if (message.requestMetadata != null && message.hasOwnProperty("requestMetadata")) + object.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.toObject(message.requestMetadata, options); + if (message.cloudAiDocumentOption != null && message.hasOwnProperty("cloudAiDocumentOption")) + object.cloudAiDocumentOption = $root.google.cloud.contentwarehouse.v1.CloudAIDocumentOption.toObject(message.cloudAiDocumentOption, options); + if (message.updateOptions != null && message.hasOwnProperty("updateOptions")) + object.updateOptions = $root.google.cloud.contentwarehouse.v1.UpdateOptions.toObject(message.updateOptions, options); + return object; + }; + + /** + * Converts this UpdateDocumentRequest to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateDocumentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateDocumentRequest + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateDocumentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.UpdateDocumentRequest"; + }; + + return UpdateDocumentRequest; + })(); + + v1.DeleteDocumentRequest = (function() { + + /** + * Properties of a DeleteDocumentRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IDeleteDocumentRequest + * @property {string|null} [name] DeleteDocumentRequest name + * @property {google.cloud.contentwarehouse.v1.IRequestMetadata|null} [requestMetadata] DeleteDocumentRequest requestMetadata + */ + + /** + * Constructs a new DeleteDocumentRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a DeleteDocumentRequest. + * @implements IDeleteDocumentRequest + * @constructor + * @param {google.cloud.contentwarehouse.v1.IDeleteDocumentRequest=} [properties] Properties to set + */ + function DeleteDocumentRequest(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]]; + } + + /** + * DeleteDocumentRequest name. + * @member {string} name + * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentRequest + * @instance + */ + DeleteDocumentRequest.prototype.name = ""; + + /** + * DeleteDocumentRequest requestMetadata. + * @member {google.cloud.contentwarehouse.v1.IRequestMetadata|null|undefined} requestMetadata + * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentRequest + * @instance + */ + DeleteDocumentRequest.prototype.requestMetadata = null; + + /** + * Creates a new DeleteDocumentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IDeleteDocumentRequest=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.DeleteDocumentRequest} DeleteDocumentRequest instance + */ + DeleteDocumentRequest.create = function create(properties) { + return new DeleteDocumentRequest(properties); + }; + + /** + * Encodes the specified DeleteDocumentRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DeleteDocumentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IDeleteDocumentRequest} message DeleteDocumentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDocumentRequest.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.requestMetadata != null && Object.hasOwnProperty.call(message, "requestMetadata")) + $root.google.cloud.contentwarehouse.v1.RequestMetadata.encode(message.requestMetadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeleteDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DeleteDocumentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IDeleteDocumentRequest} message DeleteDocumentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteDocumentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.DeleteDocumentRequest} DeleteDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDocumentRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.DeleteDocumentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteDocumentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.DeleteDocumentRequest} DeleteDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDocumentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteDocumentRequest message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteDocumentRequest.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.requestMetadata != null && message.hasOwnProperty("requestMetadata")) { + var error = $root.google.cloud.contentwarehouse.v1.RequestMetadata.verify(message.requestMetadata); + if (error) + return "requestMetadata." + error; + } + return null; + }; + + /** + * Creates a DeleteDocumentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.DeleteDocumentRequest} DeleteDocumentRequest + */ + DeleteDocumentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.DeleteDocumentRequest) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.DeleteDocumentRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestMetadata != null) { + if (typeof object.requestMetadata !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.DeleteDocumentRequest.requestMetadata: object expected"); + message.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.fromObject(object.requestMetadata); + } + return message; + }; + + /** + * Creates a plain object from a DeleteDocumentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentRequest + * @static + * @param {google.cloud.contentwarehouse.v1.DeleteDocumentRequest} message DeleteDocumentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteDocumentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestMetadata = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestMetadata != null && message.hasOwnProperty("requestMetadata")) + object.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.toObject(message.requestMetadata, options); + return object; + }; + + /** + * Converts this DeleteDocumentRequest to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteDocumentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteDocumentRequest + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteDocumentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.DeleteDocumentRequest"; + }; + + return DeleteDocumentRequest; + })(); + + v1.SearchDocumentsRequest = (function() { + + /** + * Properties of a SearchDocumentsRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @interface ISearchDocumentsRequest + * @property {string|null} [parent] SearchDocumentsRequest parent + * @property {google.cloud.contentwarehouse.v1.IRequestMetadata|null} [requestMetadata] SearchDocumentsRequest requestMetadata + * @property {google.cloud.contentwarehouse.v1.IDocumentQuery|null} [documentQuery] SearchDocumentsRequest documentQuery + * @property {number|null} [offset] SearchDocumentsRequest offset + * @property {number|null} [pageSize] SearchDocumentsRequest pageSize + * @property {string|null} [pageToken] SearchDocumentsRequest pageToken + * @property {string|null} [orderBy] SearchDocumentsRequest orderBy + * @property {Array.|null} [histogramQueries] SearchDocumentsRequest histogramQueries + * @property {boolean|null} [requireTotalSize] SearchDocumentsRequest requireTotalSize + * @property {google.cloud.contentwarehouse.v1.SearchDocumentsRequest.TotalResultSize|null} [totalResultSize] SearchDocumentsRequest totalResultSize + * @property {number|null} [qaSizeLimit] SearchDocumentsRequest qaSizeLimit + */ + + /** + * Constructs a new SearchDocumentsRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a SearchDocumentsRequest. + * @implements ISearchDocumentsRequest + * @constructor + * @param {google.cloud.contentwarehouse.v1.ISearchDocumentsRequest=} [properties] Properties to set + */ + function SearchDocumentsRequest(properties) { + this.histogramQueries = []; + 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]]; + } + + /** + * SearchDocumentsRequest parent. + * @member {string} parent + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsRequest + * @instance + */ + SearchDocumentsRequest.prototype.parent = ""; + + /** + * SearchDocumentsRequest requestMetadata. + * @member {google.cloud.contentwarehouse.v1.IRequestMetadata|null|undefined} requestMetadata + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsRequest + * @instance + */ + SearchDocumentsRequest.prototype.requestMetadata = null; + + /** + * SearchDocumentsRequest documentQuery. + * @member {google.cloud.contentwarehouse.v1.IDocumentQuery|null|undefined} documentQuery + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsRequest + * @instance + */ + SearchDocumentsRequest.prototype.documentQuery = null; + + /** + * SearchDocumentsRequest offset. + * @member {number} offset + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsRequest + * @instance + */ + SearchDocumentsRequest.prototype.offset = 0; + + /** + * SearchDocumentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsRequest + * @instance + */ + SearchDocumentsRequest.prototype.pageSize = 0; + + /** + * SearchDocumentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsRequest + * @instance + */ + SearchDocumentsRequest.prototype.pageToken = ""; + + /** + * SearchDocumentsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsRequest + * @instance + */ + SearchDocumentsRequest.prototype.orderBy = ""; + + /** + * SearchDocumentsRequest histogramQueries. + * @member {Array.} histogramQueries + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsRequest + * @instance + */ + SearchDocumentsRequest.prototype.histogramQueries = $util.emptyArray; + + /** + * SearchDocumentsRequest requireTotalSize. + * @member {boolean} requireTotalSize + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsRequest + * @instance + */ + SearchDocumentsRequest.prototype.requireTotalSize = false; + + /** + * SearchDocumentsRequest totalResultSize. + * @member {google.cloud.contentwarehouse.v1.SearchDocumentsRequest.TotalResultSize} totalResultSize + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsRequest + * @instance + */ + SearchDocumentsRequest.prototype.totalResultSize = 0; + + /** + * SearchDocumentsRequest qaSizeLimit. + * @member {number} qaSizeLimit + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsRequest + * @instance + */ + SearchDocumentsRequest.prototype.qaSizeLimit = 0; + + /** + * Creates a new SearchDocumentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsRequest + * @static + * @param {google.cloud.contentwarehouse.v1.ISearchDocumentsRequest=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.SearchDocumentsRequest} SearchDocumentsRequest instance + */ + SearchDocumentsRequest.create = function create(properties) { + return new SearchDocumentsRequest(properties); + }; + + /** + * Encodes the specified SearchDocumentsRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.SearchDocumentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsRequest + * @static + * @param {google.cloud.contentwarehouse.v1.ISearchDocumentsRequest} message SearchDocumentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchDocumentsRequest.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.requestMetadata != null && Object.hasOwnProperty.call(message, "requestMetadata")) + $root.google.cloud.contentwarehouse.v1.RequestMetadata.encode(message.requestMetadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.documentQuery != null && Object.hasOwnProperty.call(message, "documentQuery")) + $root.google.cloud.contentwarehouse.v1.DocumentQuery.encode(message.documentQuery, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.offset); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.pageToken); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.orderBy); + if (message.histogramQueries != null && message.histogramQueries.length) + for (var i = 0; i < message.histogramQueries.length; ++i) + $root.google.cloud.contentwarehouse.v1.HistogramQuery.encode(message.histogramQueries[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.requireTotalSize != null && Object.hasOwnProperty.call(message, "requireTotalSize")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.requireTotalSize); + if (message.qaSizeLimit != null && Object.hasOwnProperty.call(message, "qaSizeLimit")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.qaSizeLimit); + if (message.totalResultSize != null && Object.hasOwnProperty.call(message, "totalResultSize")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.totalResultSize); + return writer; + }; + + /** + * Encodes the specified SearchDocumentsRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.SearchDocumentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsRequest + * @static + * @param {google.cloud.contentwarehouse.v1.ISearchDocumentsRequest} message SearchDocumentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchDocumentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchDocumentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.SearchDocumentsRequest} SearchDocumentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchDocumentsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.SearchDocumentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 3: { + message.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.decode(reader, reader.uint32()); + break; + } + case 4: { + message.documentQuery = $root.google.cloud.contentwarehouse.v1.DocumentQuery.decode(reader, reader.uint32()); + break; + } + case 5: { + message.offset = reader.int32(); + break; + } + case 6: { + message.pageSize = reader.int32(); + break; + } + case 7: { + message.pageToken = reader.string(); + break; + } + case 8: { + message.orderBy = reader.string(); + break; + } + case 9: { + if (!(message.histogramQueries && message.histogramQueries.length)) + message.histogramQueries = []; + message.histogramQueries.push($root.google.cloud.contentwarehouse.v1.HistogramQuery.decode(reader, reader.uint32())); + break; + } + case 10: { + message.requireTotalSize = reader.bool(); + break; + } + case 12: { + message.totalResultSize = reader.int32(); + break; + } + case 11: { + message.qaSizeLimit = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchDocumentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.SearchDocumentsRequest} SearchDocumentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchDocumentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchDocumentsRequest message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchDocumentsRequest.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.requestMetadata != null && message.hasOwnProperty("requestMetadata")) { + var error = $root.google.cloud.contentwarehouse.v1.RequestMetadata.verify(message.requestMetadata); + if (error) + return "requestMetadata." + error; + } + if (message.documentQuery != null && message.hasOwnProperty("documentQuery")) { + var error = $root.google.cloud.contentwarehouse.v1.DocumentQuery.verify(message.documentQuery); + if (error) + return "documentQuery." + error; + } + if (message.offset != null && message.hasOwnProperty("offset")) + if (!$util.isInteger(message.offset)) + return "offset: integer 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.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.histogramQueries != null && message.hasOwnProperty("histogramQueries")) { + if (!Array.isArray(message.histogramQueries)) + return "histogramQueries: array expected"; + for (var i = 0; i < message.histogramQueries.length; ++i) { + var error = $root.google.cloud.contentwarehouse.v1.HistogramQuery.verify(message.histogramQueries[i]); + if (error) + return "histogramQueries." + error; + } + } + if (message.requireTotalSize != null && message.hasOwnProperty("requireTotalSize")) + if (typeof message.requireTotalSize !== "boolean") + return "requireTotalSize: boolean expected"; + if (message.totalResultSize != null && message.hasOwnProperty("totalResultSize")) + switch (message.totalResultSize) { + default: + return "totalResultSize: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.qaSizeLimit != null && message.hasOwnProperty("qaSizeLimit")) + if (!$util.isInteger(message.qaSizeLimit)) + return "qaSizeLimit: integer expected"; + return null; + }; + + /** + * Creates a SearchDocumentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.SearchDocumentsRequest} SearchDocumentsRequest + */ + SearchDocumentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.SearchDocumentsRequest) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.SearchDocumentsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.requestMetadata != null) { + if (typeof object.requestMetadata !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.SearchDocumentsRequest.requestMetadata: object expected"); + message.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.fromObject(object.requestMetadata); + } + if (object.documentQuery != null) { + if (typeof object.documentQuery !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.SearchDocumentsRequest.documentQuery: object expected"); + message.documentQuery = $root.google.cloud.contentwarehouse.v1.DocumentQuery.fromObject(object.documentQuery); + } + if (object.offset != null) + message.offset = object.offset | 0; + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.histogramQueries) { + if (!Array.isArray(object.histogramQueries)) + throw TypeError(".google.cloud.contentwarehouse.v1.SearchDocumentsRequest.histogramQueries: array expected"); + message.histogramQueries = []; + for (var i = 0; i < object.histogramQueries.length; ++i) { + if (typeof object.histogramQueries[i] !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.SearchDocumentsRequest.histogramQueries: object expected"); + message.histogramQueries[i] = $root.google.cloud.contentwarehouse.v1.HistogramQuery.fromObject(object.histogramQueries[i]); + } + } + if (object.requireTotalSize != null) + message.requireTotalSize = Boolean(object.requireTotalSize); + switch (object.totalResultSize) { + default: + if (typeof object.totalResultSize === "number") { + message.totalResultSize = object.totalResultSize; + break; + } + break; + case "TOTAL_RESULT_SIZE_UNSPECIFIED": + case 0: + message.totalResultSize = 0; + break; + case "ESTIMATED_SIZE": + case 1: + message.totalResultSize = 1; + break; + case "ACTUAL_SIZE": + case 2: + message.totalResultSize = 2; + break; + } + if (object.qaSizeLimit != null) + message.qaSizeLimit = object.qaSizeLimit | 0; + return message; + }; + + /** + * Creates a plain object from a SearchDocumentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsRequest + * @static + * @param {google.cloud.contentwarehouse.v1.SearchDocumentsRequest} message SearchDocumentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchDocumentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.histogramQueries = []; + if (options.defaults) { + object.parent = ""; + object.requestMetadata = null; + object.documentQuery = null; + object.offset = 0; + object.pageSize = 0; + object.pageToken = ""; + object.orderBy = ""; + object.requireTotalSize = false; + object.qaSizeLimit = 0; + object.totalResultSize = options.enums === String ? "TOTAL_RESULT_SIZE_UNSPECIFIED" : 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.requestMetadata != null && message.hasOwnProperty("requestMetadata")) + object.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.toObject(message.requestMetadata, options); + if (message.documentQuery != null && message.hasOwnProperty("documentQuery")) + object.documentQuery = $root.google.cloud.contentwarehouse.v1.DocumentQuery.toObject(message.documentQuery, options); + if (message.offset != null && message.hasOwnProperty("offset")) + object.offset = message.offset; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.histogramQueries && message.histogramQueries.length) { + object.histogramQueries = []; + for (var j = 0; j < message.histogramQueries.length; ++j) + object.histogramQueries[j] = $root.google.cloud.contentwarehouse.v1.HistogramQuery.toObject(message.histogramQueries[j], options); + } + if (message.requireTotalSize != null && message.hasOwnProperty("requireTotalSize")) + object.requireTotalSize = message.requireTotalSize; + if (message.qaSizeLimit != null && message.hasOwnProperty("qaSizeLimit")) + object.qaSizeLimit = message.qaSizeLimit; + if (message.totalResultSize != null && message.hasOwnProperty("totalResultSize")) + object.totalResultSize = options.enums === String ? $root.google.cloud.contentwarehouse.v1.SearchDocumentsRequest.TotalResultSize[message.totalResultSize] === undefined ? message.totalResultSize : $root.google.cloud.contentwarehouse.v1.SearchDocumentsRequest.TotalResultSize[message.totalResultSize] : message.totalResultSize; + return object; + }; + + /** + * Converts this SearchDocumentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsRequest + * @instance + * @returns {Object.} JSON object + */ + SearchDocumentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchDocumentsRequest + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchDocumentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.SearchDocumentsRequest"; + }; + + /** + * TotalResultSize enum. + * @name google.cloud.contentwarehouse.v1.SearchDocumentsRequest.TotalResultSize + * @enum {number} + * @property {number} TOTAL_RESULT_SIZE_UNSPECIFIED=0 TOTAL_RESULT_SIZE_UNSPECIFIED value + * @property {number} ESTIMATED_SIZE=1 ESTIMATED_SIZE value + * @property {number} ACTUAL_SIZE=2 ACTUAL_SIZE value + */ + SearchDocumentsRequest.TotalResultSize = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TOTAL_RESULT_SIZE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ESTIMATED_SIZE"] = 1; + values[valuesById[2] = "ACTUAL_SIZE"] = 2; + return values; + })(); + + return SearchDocumentsRequest; + })(); + + v1.LockDocumentRequest = (function() { + + /** + * Properties of a LockDocumentRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @interface ILockDocumentRequest + * @property {string|null} [name] LockDocumentRequest name + * @property {string|null} [collectionId] LockDocumentRequest collectionId + * @property {google.cloud.contentwarehouse.v1.IUserInfo|null} [lockingUser] LockDocumentRequest lockingUser + */ + + /** + * Constructs a new LockDocumentRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a LockDocumentRequest. + * @implements ILockDocumentRequest + * @constructor + * @param {google.cloud.contentwarehouse.v1.ILockDocumentRequest=} [properties] Properties to set + */ + function LockDocumentRequest(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]]; + } + + /** + * LockDocumentRequest name. + * @member {string} name + * @memberof google.cloud.contentwarehouse.v1.LockDocumentRequest + * @instance + */ + LockDocumentRequest.prototype.name = ""; + + /** + * LockDocumentRequest collectionId. + * @member {string} collectionId + * @memberof google.cloud.contentwarehouse.v1.LockDocumentRequest + * @instance + */ + LockDocumentRequest.prototype.collectionId = ""; + + /** + * LockDocumentRequest lockingUser. + * @member {google.cloud.contentwarehouse.v1.IUserInfo|null|undefined} lockingUser + * @memberof google.cloud.contentwarehouse.v1.LockDocumentRequest + * @instance + */ + LockDocumentRequest.prototype.lockingUser = null; + + /** + * Creates a new LockDocumentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.LockDocumentRequest + * @static + * @param {google.cloud.contentwarehouse.v1.ILockDocumentRequest=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.LockDocumentRequest} LockDocumentRequest instance + */ + LockDocumentRequest.create = function create(properties) { + return new LockDocumentRequest(properties); + }; + + /** + * Encodes the specified LockDocumentRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.LockDocumentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.LockDocumentRequest + * @static + * @param {google.cloud.contentwarehouse.v1.ILockDocumentRequest} message LockDocumentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LockDocumentRequest.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.collectionId != null && Object.hasOwnProperty.call(message, "collectionId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.collectionId); + if (message.lockingUser != null && Object.hasOwnProperty.call(message, "lockingUser")) + $root.google.cloud.contentwarehouse.v1.UserInfo.encode(message.lockingUser, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LockDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.LockDocumentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.LockDocumentRequest + * @static + * @param {google.cloud.contentwarehouse.v1.ILockDocumentRequest} message LockDocumentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LockDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LockDocumentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.LockDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.LockDocumentRequest} LockDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LockDocumentRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.LockDocumentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.collectionId = reader.string(); + break; + } + case 3: { + message.lockingUser = $root.google.cloud.contentwarehouse.v1.UserInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LockDocumentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.LockDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.LockDocumentRequest} LockDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LockDocumentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LockDocumentRequest message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.LockDocumentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LockDocumentRequest.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.collectionId != null && message.hasOwnProperty("collectionId")) + if (!$util.isString(message.collectionId)) + return "collectionId: string expected"; + if (message.lockingUser != null && message.hasOwnProperty("lockingUser")) { + var error = $root.google.cloud.contentwarehouse.v1.UserInfo.verify(message.lockingUser); + if (error) + return "lockingUser." + error; + } + return null; + }; + + /** + * Creates a LockDocumentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.LockDocumentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.LockDocumentRequest} LockDocumentRequest + */ + LockDocumentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.LockDocumentRequest) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.LockDocumentRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.collectionId != null) + message.collectionId = String(object.collectionId); + if (object.lockingUser != null) { + if (typeof object.lockingUser !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.LockDocumentRequest.lockingUser: object expected"); + message.lockingUser = $root.google.cloud.contentwarehouse.v1.UserInfo.fromObject(object.lockingUser); + } + return message; + }; + + /** + * Creates a plain object from a LockDocumentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.LockDocumentRequest + * @static + * @param {google.cloud.contentwarehouse.v1.LockDocumentRequest} message LockDocumentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LockDocumentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.collectionId = ""; + object.lockingUser = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.collectionId != null && message.hasOwnProperty("collectionId")) + object.collectionId = message.collectionId; + if (message.lockingUser != null && message.hasOwnProperty("lockingUser")) + object.lockingUser = $root.google.cloud.contentwarehouse.v1.UserInfo.toObject(message.lockingUser, options); + return object; + }; + + /** + * Converts this LockDocumentRequest to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.LockDocumentRequest + * @instance + * @returns {Object.} JSON object + */ + LockDocumentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LockDocumentRequest + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.LockDocumentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LockDocumentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.LockDocumentRequest"; + }; + + return LockDocumentRequest; + })(); + + v1.FetchAclRequest = (function() { + + /** + * Properties of a FetchAclRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IFetchAclRequest + * @property {string|null} [resource] FetchAclRequest resource + * @property {google.cloud.contentwarehouse.v1.IRequestMetadata|null} [requestMetadata] FetchAclRequest requestMetadata + * @property {boolean|null} [projectOwner] FetchAclRequest projectOwner + */ + + /** + * Constructs a new FetchAclRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a FetchAclRequest. + * @implements IFetchAclRequest + * @constructor + * @param {google.cloud.contentwarehouse.v1.IFetchAclRequest=} [properties] Properties to set + */ + function FetchAclRequest(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]]; + } + + /** + * FetchAclRequest resource. + * @member {string} resource + * @memberof google.cloud.contentwarehouse.v1.FetchAclRequest + * @instance + */ + FetchAclRequest.prototype.resource = ""; + + /** + * FetchAclRequest requestMetadata. + * @member {google.cloud.contentwarehouse.v1.IRequestMetadata|null|undefined} requestMetadata + * @memberof google.cloud.contentwarehouse.v1.FetchAclRequest + * @instance + */ + FetchAclRequest.prototype.requestMetadata = null; + + /** + * FetchAclRequest projectOwner. + * @member {boolean} projectOwner + * @memberof google.cloud.contentwarehouse.v1.FetchAclRequest + * @instance + */ + FetchAclRequest.prototype.projectOwner = false; + + /** + * Creates a new FetchAclRequest instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.FetchAclRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IFetchAclRequest=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.FetchAclRequest} FetchAclRequest instance + */ + FetchAclRequest.create = function create(properties) { + return new FetchAclRequest(properties); + }; + + /** + * Encodes the specified FetchAclRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.FetchAclRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.FetchAclRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IFetchAclRequest} message FetchAclRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchAclRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.requestMetadata != null && Object.hasOwnProperty.call(message, "requestMetadata")) + $root.google.cloud.contentwarehouse.v1.RequestMetadata.encode(message.requestMetadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.projectOwner != null && Object.hasOwnProperty.call(message, "projectOwner")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.projectOwner); + return writer; + }; + + /** + * Encodes the specified FetchAclRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.FetchAclRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.FetchAclRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IFetchAclRequest} message FetchAclRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchAclRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FetchAclRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.FetchAclRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.FetchAclRequest} FetchAclRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchAclRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.FetchAclRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.resource = reader.string(); + break; + } + case 2: { + message.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.decode(reader, reader.uint32()); + break; + } + case 3: { + message.projectOwner = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FetchAclRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.FetchAclRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.FetchAclRequest} FetchAclRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchAclRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FetchAclRequest message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.FetchAclRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FetchAclRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.requestMetadata != null && message.hasOwnProperty("requestMetadata")) { + var error = $root.google.cloud.contentwarehouse.v1.RequestMetadata.verify(message.requestMetadata); + if (error) + return "requestMetadata." + error; + } + if (message.projectOwner != null && message.hasOwnProperty("projectOwner")) + if (typeof message.projectOwner !== "boolean") + return "projectOwner: boolean expected"; + return null; + }; + + /** + * Creates a FetchAclRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.FetchAclRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.FetchAclRequest} FetchAclRequest + */ + FetchAclRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.FetchAclRequest) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.FetchAclRequest(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.requestMetadata != null) { + if (typeof object.requestMetadata !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.FetchAclRequest.requestMetadata: object expected"); + message.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.fromObject(object.requestMetadata); + } + if (object.projectOwner != null) + message.projectOwner = Boolean(object.projectOwner); + return message; + }; + + /** + * Creates a plain object from a FetchAclRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.FetchAclRequest + * @static + * @param {google.cloud.contentwarehouse.v1.FetchAclRequest} message FetchAclRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FetchAclRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.requestMetadata = null; + object.projectOwner = false; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.requestMetadata != null && message.hasOwnProperty("requestMetadata")) + object.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.toObject(message.requestMetadata, options); + if (message.projectOwner != null && message.hasOwnProperty("projectOwner")) + object.projectOwner = message.projectOwner; + return object; + }; + + /** + * Converts this FetchAclRequest to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.FetchAclRequest + * @instance + * @returns {Object.} JSON object + */ + FetchAclRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FetchAclRequest + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.FetchAclRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FetchAclRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.FetchAclRequest"; + }; + + return FetchAclRequest; + })(); + + v1.SetAclRequest = (function() { + + /** + * Properties of a SetAclRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @interface ISetAclRequest + * @property {string|null} [resource] SetAclRequest resource + * @property {google.iam.v1.IPolicy|null} [policy] SetAclRequest policy + * @property {google.cloud.contentwarehouse.v1.IRequestMetadata|null} [requestMetadata] SetAclRequest requestMetadata + * @property {boolean|null} [projectOwner] SetAclRequest projectOwner + */ + + /** + * Constructs a new SetAclRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a SetAclRequest. + * @implements ISetAclRequest + * @constructor + * @param {google.cloud.contentwarehouse.v1.ISetAclRequest=} [properties] Properties to set + */ + function SetAclRequest(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]]; + } + + /** + * SetAclRequest resource. + * @member {string} resource + * @memberof google.cloud.contentwarehouse.v1.SetAclRequest + * @instance + */ + SetAclRequest.prototype.resource = ""; + + /** + * SetAclRequest policy. + * @member {google.iam.v1.IPolicy|null|undefined} policy + * @memberof google.cloud.contentwarehouse.v1.SetAclRequest + * @instance + */ + SetAclRequest.prototype.policy = null; + + /** + * SetAclRequest requestMetadata. + * @member {google.cloud.contentwarehouse.v1.IRequestMetadata|null|undefined} requestMetadata + * @memberof google.cloud.contentwarehouse.v1.SetAclRequest + * @instance + */ + SetAclRequest.prototype.requestMetadata = null; + + /** + * SetAclRequest projectOwner. + * @member {boolean} projectOwner + * @memberof google.cloud.contentwarehouse.v1.SetAclRequest + * @instance + */ + SetAclRequest.prototype.projectOwner = false; + + /** + * Creates a new SetAclRequest instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.SetAclRequest + * @static + * @param {google.cloud.contentwarehouse.v1.ISetAclRequest=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.SetAclRequest} SetAclRequest instance + */ + SetAclRequest.create = function create(properties) { + return new SetAclRequest(properties); + }; + + /** + * Encodes the specified SetAclRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.SetAclRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.SetAclRequest + * @static + * @param {google.cloud.contentwarehouse.v1.ISetAclRequest} message SetAclRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetAclRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) + $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestMetadata != null && Object.hasOwnProperty.call(message, "requestMetadata")) + $root.google.cloud.contentwarehouse.v1.RequestMetadata.encode(message.requestMetadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.projectOwner != null && Object.hasOwnProperty.call(message, "projectOwner")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.projectOwner); + return writer; + }; + + /** + * Encodes the specified SetAclRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.SetAclRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.SetAclRequest + * @static + * @param {google.cloud.contentwarehouse.v1.ISetAclRequest} message SetAclRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetAclRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetAclRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.SetAclRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.SetAclRequest} SetAclRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetAclRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.SetAclRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.resource = reader.string(); + break; + } + case 2: { + message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.decode(reader, reader.uint32()); + break; + } + case 4: { + message.projectOwner = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetAclRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.SetAclRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.SetAclRequest} SetAclRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetAclRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetAclRequest message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.SetAclRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetAclRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.policy != null && message.hasOwnProperty("policy")) { + var error = $root.google.iam.v1.Policy.verify(message.policy); + if (error) + return "policy." + error; + } + if (message.requestMetadata != null && message.hasOwnProperty("requestMetadata")) { + var error = $root.google.cloud.contentwarehouse.v1.RequestMetadata.verify(message.requestMetadata); + if (error) + return "requestMetadata." + error; + } + if (message.projectOwner != null && message.hasOwnProperty("projectOwner")) + if (typeof message.projectOwner !== "boolean") + return "projectOwner: boolean expected"; + return null; + }; + + /** + * Creates a SetAclRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.SetAclRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.SetAclRequest} SetAclRequest + */ + SetAclRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.SetAclRequest) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.SetAclRequest(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.policy != null) { + if (typeof object.policy !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.SetAclRequest.policy: object expected"); + message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); + } + if (object.requestMetadata != null) { + if (typeof object.requestMetadata !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.SetAclRequest.requestMetadata: object expected"); + message.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.fromObject(object.requestMetadata); + } + if (object.projectOwner != null) + message.projectOwner = Boolean(object.projectOwner); + return message; + }; + + /** + * Creates a plain object from a SetAclRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.SetAclRequest + * @static + * @param {google.cloud.contentwarehouse.v1.SetAclRequest} message SetAclRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetAclRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.policy = null; + object.requestMetadata = null; + object.projectOwner = false; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.policy != null && message.hasOwnProperty("policy")) + object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); + if (message.requestMetadata != null && message.hasOwnProperty("requestMetadata")) + object.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.toObject(message.requestMetadata, options); + if (message.projectOwner != null && message.hasOwnProperty("projectOwner")) + object.projectOwner = message.projectOwner; + return object; + }; + + /** + * Converts this SetAclRequest to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.SetAclRequest + * @instance + * @returns {Object.} JSON object + */ + SetAclRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SetAclRequest + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.SetAclRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SetAclRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.SetAclRequest"; + }; + + return SetAclRequest; + })(); + + v1.DocumentQuery = (function() { + + /** + * Properties of a DocumentQuery. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IDocumentQuery + * @property {string|null} [query] DocumentQuery query + * @property {boolean|null} [isNlQuery] DocumentQuery isNlQuery + * @property {string|null} [customPropertyFilter] DocumentQuery customPropertyFilter + * @property {Array.|null} [timeFilters] DocumentQuery timeFilters + * @property {Array.|null} [documentSchemaNames] DocumentQuery documentSchemaNames + * @property {Array.|null} [propertyFilter] DocumentQuery propertyFilter + * @property {google.cloud.contentwarehouse.v1.IFileTypeFilter|null} [fileTypeFilter] DocumentQuery fileTypeFilter + * @property {string|null} [folderNameFilter] DocumentQuery folderNameFilter + * @property {Array.|null} [documentNameFilter] DocumentQuery documentNameFilter + * @property {Array.|null} [queryContext] DocumentQuery queryContext + * @property {Array.|null} [documentCreatorFilter] DocumentQuery documentCreatorFilter + * @property {google.cloud.contentwarehouse.v1.ICustomWeightsMetadata|null} [customWeightsMetadata] DocumentQuery customWeightsMetadata + */ + + /** + * Constructs a new DocumentQuery. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a DocumentQuery. + * @implements IDocumentQuery + * @constructor + * @param {google.cloud.contentwarehouse.v1.IDocumentQuery=} [properties] Properties to set + */ + function DocumentQuery(properties) { + this.timeFilters = []; + this.documentSchemaNames = []; + this.propertyFilter = []; + this.documentNameFilter = []; + this.queryContext = []; + this.documentCreatorFilter = []; + 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]]; + } + + /** + * DocumentQuery query. + * @member {string} query + * @memberof google.cloud.contentwarehouse.v1.DocumentQuery + * @instance + */ + DocumentQuery.prototype.query = ""; + + /** + * DocumentQuery isNlQuery. + * @member {boolean} isNlQuery + * @memberof google.cloud.contentwarehouse.v1.DocumentQuery + * @instance + */ + DocumentQuery.prototype.isNlQuery = false; + + /** + * DocumentQuery customPropertyFilter. + * @member {string} customPropertyFilter + * @memberof google.cloud.contentwarehouse.v1.DocumentQuery + * @instance + */ + DocumentQuery.prototype.customPropertyFilter = ""; + + /** + * DocumentQuery timeFilters. + * @member {Array.} timeFilters + * @memberof google.cloud.contentwarehouse.v1.DocumentQuery + * @instance + */ + DocumentQuery.prototype.timeFilters = $util.emptyArray; + + /** + * DocumentQuery documentSchemaNames. + * @member {Array.} documentSchemaNames + * @memberof google.cloud.contentwarehouse.v1.DocumentQuery + * @instance + */ + DocumentQuery.prototype.documentSchemaNames = $util.emptyArray; + + /** + * DocumentQuery propertyFilter. + * @member {Array.} propertyFilter + * @memberof google.cloud.contentwarehouse.v1.DocumentQuery + * @instance + */ + DocumentQuery.prototype.propertyFilter = $util.emptyArray; + + /** + * DocumentQuery fileTypeFilter. + * @member {google.cloud.contentwarehouse.v1.IFileTypeFilter|null|undefined} fileTypeFilter + * @memberof google.cloud.contentwarehouse.v1.DocumentQuery + * @instance + */ + DocumentQuery.prototype.fileTypeFilter = null; + + /** + * DocumentQuery folderNameFilter. + * @member {string} folderNameFilter + * @memberof google.cloud.contentwarehouse.v1.DocumentQuery + * @instance + */ + DocumentQuery.prototype.folderNameFilter = ""; + + /** + * DocumentQuery documentNameFilter. + * @member {Array.} documentNameFilter + * @memberof google.cloud.contentwarehouse.v1.DocumentQuery + * @instance + */ + DocumentQuery.prototype.documentNameFilter = $util.emptyArray; + + /** + * DocumentQuery queryContext. + * @member {Array.} queryContext + * @memberof google.cloud.contentwarehouse.v1.DocumentQuery + * @instance + */ + DocumentQuery.prototype.queryContext = $util.emptyArray; + + /** + * DocumentQuery documentCreatorFilter. + * @member {Array.} documentCreatorFilter + * @memberof google.cloud.contentwarehouse.v1.DocumentQuery + * @instance + */ + DocumentQuery.prototype.documentCreatorFilter = $util.emptyArray; + + /** + * DocumentQuery customWeightsMetadata. + * @member {google.cloud.contentwarehouse.v1.ICustomWeightsMetadata|null|undefined} customWeightsMetadata + * @memberof google.cloud.contentwarehouse.v1.DocumentQuery + * @instance + */ + DocumentQuery.prototype.customWeightsMetadata = null; + + /** + * Creates a new DocumentQuery instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.DocumentQuery + * @static + * @param {google.cloud.contentwarehouse.v1.IDocumentQuery=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.DocumentQuery} DocumentQuery instance + */ + DocumentQuery.create = function create(properties) { + return new DocumentQuery(properties); + }; + + /** + * Encodes the specified DocumentQuery message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DocumentQuery.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.DocumentQuery + * @static + * @param {google.cloud.contentwarehouse.v1.IDocumentQuery} message DocumentQuery message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentQuery.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.query); + if (message.customPropertyFilter != null && Object.hasOwnProperty.call(message, "customPropertyFilter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.customPropertyFilter); + if (message.timeFilters != null && message.timeFilters.length) + for (var i = 0; i < message.timeFilters.length; ++i) + $root.google.cloud.contentwarehouse.v1.TimeFilter.encode(message.timeFilters[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.documentSchemaNames != null && message.documentSchemaNames.length) + for (var i = 0; i < message.documentSchemaNames.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.documentSchemaNames[i]); + if (message.propertyFilter != null && message.propertyFilter.length) + for (var i = 0; i < message.propertyFilter.length; ++i) + $root.google.cloud.contentwarehouse.v1.PropertyFilter.encode(message.propertyFilter[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.fileTypeFilter != null && Object.hasOwnProperty.call(message, "fileTypeFilter")) + $root.google.cloud.contentwarehouse.v1.FileTypeFilter.encode(message.fileTypeFilter, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.folderNameFilter != null && Object.hasOwnProperty.call(message, "folderNameFilter")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.folderNameFilter); + if (message.queryContext != null && message.queryContext.length) + for (var i = 0; i < message.queryContext.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.queryContext[i]); + if (message.documentCreatorFilter != null && message.documentCreatorFilter.length) + for (var i = 0; i < message.documentCreatorFilter.length; ++i) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.documentCreatorFilter[i]); + if (message.isNlQuery != null && Object.hasOwnProperty.call(message, "isNlQuery")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.isNlQuery); + if (message.customWeightsMetadata != null && Object.hasOwnProperty.call(message, "customWeightsMetadata")) + $root.google.cloud.contentwarehouse.v1.CustomWeightsMetadata.encode(message.customWeightsMetadata, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.documentNameFilter != null && message.documentNameFilter.length) + for (var i = 0; i < message.documentNameFilter.length; ++i) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.documentNameFilter[i]); + return writer; + }; + + /** + * Encodes the specified DocumentQuery message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DocumentQuery.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.DocumentQuery + * @static + * @param {google.cloud.contentwarehouse.v1.IDocumentQuery} message DocumentQuery message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentQuery.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DocumentQuery message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.DocumentQuery + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.DocumentQuery} DocumentQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentQuery.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.DocumentQuery(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.query = reader.string(); + break; + } + case 12: { + message.isNlQuery = reader.bool(); + break; + } + case 4: { + message.customPropertyFilter = reader.string(); + break; + } + case 5: { + if (!(message.timeFilters && message.timeFilters.length)) + message.timeFilters = []; + message.timeFilters.push($root.google.cloud.contentwarehouse.v1.TimeFilter.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.documentSchemaNames && message.documentSchemaNames.length)) + message.documentSchemaNames = []; + message.documentSchemaNames.push(reader.string()); + break; + } + case 7: { + if (!(message.propertyFilter && message.propertyFilter.length)) + message.propertyFilter = []; + message.propertyFilter.push($root.google.cloud.contentwarehouse.v1.PropertyFilter.decode(reader, reader.uint32())); + break; + } + case 8: { + message.fileTypeFilter = $root.google.cloud.contentwarehouse.v1.FileTypeFilter.decode(reader, reader.uint32()); + break; + } + case 9: { + message.folderNameFilter = reader.string(); + break; + } + case 14: { + if (!(message.documentNameFilter && message.documentNameFilter.length)) + message.documentNameFilter = []; + message.documentNameFilter.push(reader.string()); + break; + } + case 10: { + if (!(message.queryContext && message.queryContext.length)) + message.queryContext = []; + message.queryContext.push(reader.string()); + break; + } + case 11: { + if (!(message.documentCreatorFilter && message.documentCreatorFilter.length)) + message.documentCreatorFilter = []; + message.documentCreatorFilter.push(reader.string()); + break; + } + case 13: { + message.customWeightsMetadata = $root.google.cloud.contentwarehouse.v1.CustomWeightsMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DocumentQuery message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.DocumentQuery + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.DocumentQuery} DocumentQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentQuery.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DocumentQuery message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.DocumentQuery + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DocumentQuery.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: string expected"; + if (message.isNlQuery != null && message.hasOwnProperty("isNlQuery")) + if (typeof message.isNlQuery !== "boolean") + return "isNlQuery: boolean expected"; + if (message.customPropertyFilter != null && message.hasOwnProperty("customPropertyFilter")) + if (!$util.isString(message.customPropertyFilter)) + return "customPropertyFilter: string expected"; + if (message.timeFilters != null && message.hasOwnProperty("timeFilters")) { + if (!Array.isArray(message.timeFilters)) + return "timeFilters: array expected"; + for (var i = 0; i < message.timeFilters.length; ++i) { + var error = $root.google.cloud.contentwarehouse.v1.TimeFilter.verify(message.timeFilters[i]); + if (error) + return "timeFilters." + error; + } + } + if (message.documentSchemaNames != null && message.hasOwnProperty("documentSchemaNames")) { + if (!Array.isArray(message.documentSchemaNames)) + return "documentSchemaNames: array expected"; + for (var i = 0; i < message.documentSchemaNames.length; ++i) + if (!$util.isString(message.documentSchemaNames[i])) + return "documentSchemaNames: string[] expected"; + } + if (message.propertyFilter != null && message.hasOwnProperty("propertyFilter")) { + if (!Array.isArray(message.propertyFilter)) + return "propertyFilter: array expected"; + for (var i = 0; i < message.propertyFilter.length; ++i) { + var error = $root.google.cloud.contentwarehouse.v1.PropertyFilter.verify(message.propertyFilter[i]); + if (error) + return "propertyFilter." + error; + } + } + if (message.fileTypeFilter != null && message.hasOwnProperty("fileTypeFilter")) { + var error = $root.google.cloud.contentwarehouse.v1.FileTypeFilter.verify(message.fileTypeFilter); + if (error) + return "fileTypeFilter." + error; + } + if (message.folderNameFilter != null && message.hasOwnProperty("folderNameFilter")) + if (!$util.isString(message.folderNameFilter)) + return "folderNameFilter: string expected"; + if (message.documentNameFilter != null && message.hasOwnProperty("documentNameFilter")) { + if (!Array.isArray(message.documentNameFilter)) + return "documentNameFilter: array expected"; + for (var i = 0; i < message.documentNameFilter.length; ++i) + if (!$util.isString(message.documentNameFilter[i])) + return "documentNameFilter: string[] expected"; + } + if (message.queryContext != null && message.hasOwnProperty("queryContext")) { + if (!Array.isArray(message.queryContext)) + return "queryContext: array expected"; + for (var i = 0; i < message.queryContext.length; ++i) + if (!$util.isString(message.queryContext[i])) + return "queryContext: string[] expected"; + } + if (message.documentCreatorFilter != null && message.hasOwnProperty("documentCreatorFilter")) { + if (!Array.isArray(message.documentCreatorFilter)) + return "documentCreatorFilter: array expected"; + for (var i = 0; i < message.documentCreatorFilter.length; ++i) + if (!$util.isString(message.documentCreatorFilter[i])) + return "documentCreatorFilter: string[] expected"; + } + if (message.customWeightsMetadata != null && message.hasOwnProperty("customWeightsMetadata")) { + var error = $root.google.cloud.contentwarehouse.v1.CustomWeightsMetadata.verify(message.customWeightsMetadata); + if (error) + return "customWeightsMetadata." + error; + } + return null; + }; + + /** + * Creates a DocumentQuery message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.DocumentQuery + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.DocumentQuery} DocumentQuery + */ + DocumentQuery.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.DocumentQuery) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.DocumentQuery(); + if (object.query != null) + message.query = String(object.query); + if (object.isNlQuery != null) + message.isNlQuery = Boolean(object.isNlQuery); + if (object.customPropertyFilter != null) + message.customPropertyFilter = String(object.customPropertyFilter); + if (object.timeFilters) { + if (!Array.isArray(object.timeFilters)) + throw TypeError(".google.cloud.contentwarehouse.v1.DocumentQuery.timeFilters: array expected"); + message.timeFilters = []; + for (var i = 0; i < object.timeFilters.length; ++i) { + if (typeof object.timeFilters[i] !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.DocumentQuery.timeFilters: object expected"); + message.timeFilters[i] = $root.google.cloud.contentwarehouse.v1.TimeFilter.fromObject(object.timeFilters[i]); + } + } + if (object.documentSchemaNames) { + if (!Array.isArray(object.documentSchemaNames)) + throw TypeError(".google.cloud.contentwarehouse.v1.DocumentQuery.documentSchemaNames: array expected"); + message.documentSchemaNames = []; + for (var i = 0; i < object.documentSchemaNames.length; ++i) + message.documentSchemaNames[i] = String(object.documentSchemaNames[i]); + } + if (object.propertyFilter) { + if (!Array.isArray(object.propertyFilter)) + throw TypeError(".google.cloud.contentwarehouse.v1.DocumentQuery.propertyFilter: array expected"); + message.propertyFilter = []; + for (var i = 0; i < object.propertyFilter.length; ++i) { + if (typeof object.propertyFilter[i] !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.DocumentQuery.propertyFilter: object expected"); + message.propertyFilter[i] = $root.google.cloud.contentwarehouse.v1.PropertyFilter.fromObject(object.propertyFilter[i]); + } + } + if (object.fileTypeFilter != null) { + if (typeof object.fileTypeFilter !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.DocumentQuery.fileTypeFilter: object expected"); + message.fileTypeFilter = $root.google.cloud.contentwarehouse.v1.FileTypeFilter.fromObject(object.fileTypeFilter); + } + if (object.folderNameFilter != null) + message.folderNameFilter = String(object.folderNameFilter); + if (object.documentNameFilter) { + if (!Array.isArray(object.documentNameFilter)) + throw TypeError(".google.cloud.contentwarehouse.v1.DocumentQuery.documentNameFilter: array expected"); + message.documentNameFilter = []; + for (var i = 0; i < object.documentNameFilter.length; ++i) + message.documentNameFilter[i] = String(object.documentNameFilter[i]); + } + if (object.queryContext) { + if (!Array.isArray(object.queryContext)) + throw TypeError(".google.cloud.contentwarehouse.v1.DocumentQuery.queryContext: array expected"); + message.queryContext = []; + for (var i = 0; i < object.queryContext.length; ++i) + message.queryContext[i] = String(object.queryContext[i]); + } + if (object.documentCreatorFilter) { + if (!Array.isArray(object.documentCreatorFilter)) + throw TypeError(".google.cloud.contentwarehouse.v1.DocumentQuery.documentCreatorFilter: array expected"); + message.documentCreatorFilter = []; + for (var i = 0; i < object.documentCreatorFilter.length; ++i) + message.documentCreatorFilter[i] = String(object.documentCreatorFilter[i]); + } + if (object.customWeightsMetadata != null) { + if (typeof object.customWeightsMetadata !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.DocumentQuery.customWeightsMetadata: object expected"); + message.customWeightsMetadata = $root.google.cloud.contentwarehouse.v1.CustomWeightsMetadata.fromObject(object.customWeightsMetadata); + } + return message; + }; + + /** + * Creates a plain object from a DocumentQuery message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.DocumentQuery + * @static + * @param {google.cloud.contentwarehouse.v1.DocumentQuery} message DocumentQuery + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DocumentQuery.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.timeFilters = []; + object.documentSchemaNames = []; + object.propertyFilter = []; + object.queryContext = []; + object.documentCreatorFilter = []; + object.documentNameFilter = []; + } + if (options.defaults) { + object.query = ""; + object.customPropertyFilter = ""; + object.fileTypeFilter = null; + object.folderNameFilter = ""; + object.isNlQuery = false; + object.customWeightsMetadata = null; + } + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.customPropertyFilter != null && message.hasOwnProperty("customPropertyFilter")) + object.customPropertyFilter = message.customPropertyFilter; + if (message.timeFilters && message.timeFilters.length) { + object.timeFilters = []; + for (var j = 0; j < message.timeFilters.length; ++j) + object.timeFilters[j] = $root.google.cloud.contentwarehouse.v1.TimeFilter.toObject(message.timeFilters[j], options); + } + if (message.documentSchemaNames && message.documentSchemaNames.length) { + object.documentSchemaNames = []; + for (var j = 0; j < message.documentSchemaNames.length; ++j) + object.documentSchemaNames[j] = message.documentSchemaNames[j]; + } + if (message.propertyFilter && message.propertyFilter.length) { + object.propertyFilter = []; + for (var j = 0; j < message.propertyFilter.length; ++j) + object.propertyFilter[j] = $root.google.cloud.contentwarehouse.v1.PropertyFilter.toObject(message.propertyFilter[j], options); + } + if (message.fileTypeFilter != null && message.hasOwnProperty("fileTypeFilter")) + object.fileTypeFilter = $root.google.cloud.contentwarehouse.v1.FileTypeFilter.toObject(message.fileTypeFilter, options); + if (message.folderNameFilter != null && message.hasOwnProperty("folderNameFilter")) + object.folderNameFilter = message.folderNameFilter; + if (message.queryContext && message.queryContext.length) { + object.queryContext = []; + for (var j = 0; j < message.queryContext.length; ++j) + object.queryContext[j] = message.queryContext[j]; + } + if (message.documentCreatorFilter && message.documentCreatorFilter.length) { + object.documentCreatorFilter = []; + for (var j = 0; j < message.documentCreatorFilter.length; ++j) + object.documentCreatorFilter[j] = message.documentCreatorFilter[j]; + } + if (message.isNlQuery != null && message.hasOwnProperty("isNlQuery")) + object.isNlQuery = message.isNlQuery; + if (message.customWeightsMetadata != null && message.hasOwnProperty("customWeightsMetadata")) + object.customWeightsMetadata = $root.google.cloud.contentwarehouse.v1.CustomWeightsMetadata.toObject(message.customWeightsMetadata, options); + if (message.documentNameFilter && message.documentNameFilter.length) { + object.documentNameFilter = []; + for (var j = 0; j < message.documentNameFilter.length; ++j) + object.documentNameFilter[j] = message.documentNameFilter[j]; + } + return object; + }; + + /** + * Converts this DocumentQuery to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.DocumentQuery + * @instance + * @returns {Object.} JSON object + */ + DocumentQuery.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DocumentQuery + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.DocumentQuery + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DocumentQuery.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.DocumentQuery"; + }; + + return DocumentQuery; + })(); + + v1.TimeFilter = (function() { + + /** + * Properties of a TimeFilter. + * @memberof google.cloud.contentwarehouse.v1 + * @interface ITimeFilter + * @property {google.type.IInterval|null} [timeRange] TimeFilter timeRange + * @property {google.cloud.contentwarehouse.v1.TimeFilter.TimeField|null} [timeField] TimeFilter timeField + */ + + /** + * Constructs a new TimeFilter. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a TimeFilter. + * @implements ITimeFilter + * @constructor + * @param {google.cloud.contentwarehouse.v1.ITimeFilter=} [properties] Properties to set + */ + function TimeFilter(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]]; + } + + /** + * TimeFilter timeRange. + * @member {google.type.IInterval|null|undefined} timeRange + * @memberof google.cloud.contentwarehouse.v1.TimeFilter + * @instance + */ + TimeFilter.prototype.timeRange = null; + + /** + * TimeFilter timeField. + * @member {google.cloud.contentwarehouse.v1.TimeFilter.TimeField} timeField + * @memberof google.cloud.contentwarehouse.v1.TimeFilter + * @instance + */ + TimeFilter.prototype.timeField = 0; + + /** + * Creates a new TimeFilter instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.TimeFilter + * @static + * @param {google.cloud.contentwarehouse.v1.ITimeFilter=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.TimeFilter} TimeFilter instance + */ + TimeFilter.create = function create(properties) { + return new TimeFilter(properties); + }; + + /** + * Encodes the specified TimeFilter message. Does not implicitly {@link google.cloud.contentwarehouse.v1.TimeFilter.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.TimeFilter + * @static + * @param {google.cloud.contentwarehouse.v1.ITimeFilter} message TimeFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.timeRange != null && Object.hasOwnProperty.call(message, "timeRange")) + $root.google.type.Interval.encode(message.timeRange, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.timeField != null && Object.hasOwnProperty.call(message, "timeField")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.timeField); + return writer; + }; + + /** + * Encodes the specified TimeFilter message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.TimeFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.TimeFilter + * @static + * @param {google.cloud.contentwarehouse.v1.ITimeFilter} message TimeFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimeFilter message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.TimeFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.TimeFilter} TimeFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeFilter.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.TimeFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.timeRange = $root.google.type.Interval.decode(reader, reader.uint32()); + break; + } + case 2: { + message.timeField = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimeFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.TimeFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.TimeFilter} TimeFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimeFilter message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.TimeFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimeFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.timeRange != null && message.hasOwnProperty("timeRange")) { + var error = $root.google.type.Interval.verify(message.timeRange); + if (error) + return "timeRange." + error; + } + if (message.timeField != null && message.hasOwnProperty("timeField")) + switch (message.timeField) { + default: + return "timeField: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a TimeFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.TimeFilter + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.TimeFilter} TimeFilter + */ + TimeFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.TimeFilter) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.TimeFilter(); + if (object.timeRange != null) { + if (typeof object.timeRange !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.TimeFilter.timeRange: object expected"); + message.timeRange = $root.google.type.Interval.fromObject(object.timeRange); + } + switch (object.timeField) { + default: + if (typeof object.timeField === "number") { + message.timeField = object.timeField; + break; + } + break; + case "TIME_FIELD_UNSPECIFIED": + case 0: + message.timeField = 0; + break; + case "CREATE_TIME": + case 1: + message.timeField = 1; + break; + case "UPDATE_TIME": + case 2: + message.timeField = 2; + break; + case "DISPOSITION_TIME": + case 3: + message.timeField = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a TimeFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.TimeFilter + * @static + * @param {google.cloud.contentwarehouse.v1.TimeFilter} message TimeFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimeFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.timeRange = null; + object.timeField = options.enums === String ? "TIME_FIELD_UNSPECIFIED" : 0; + } + if (message.timeRange != null && message.hasOwnProperty("timeRange")) + object.timeRange = $root.google.type.Interval.toObject(message.timeRange, options); + if (message.timeField != null && message.hasOwnProperty("timeField")) + object.timeField = options.enums === String ? $root.google.cloud.contentwarehouse.v1.TimeFilter.TimeField[message.timeField] === undefined ? message.timeField : $root.google.cloud.contentwarehouse.v1.TimeFilter.TimeField[message.timeField] : message.timeField; + return object; + }; + + /** + * Converts this TimeFilter to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.TimeFilter + * @instance + * @returns {Object.} JSON object + */ + TimeFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimeFilter + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.TimeFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimeFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.TimeFilter"; + }; + + /** + * TimeField enum. + * @name google.cloud.contentwarehouse.v1.TimeFilter.TimeField + * @enum {number} + * @property {number} TIME_FIELD_UNSPECIFIED=0 TIME_FIELD_UNSPECIFIED value + * @property {number} CREATE_TIME=1 CREATE_TIME value + * @property {number} UPDATE_TIME=2 UPDATE_TIME value + * @property {number} DISPOSITION_TIME=3 DISPOSITION_TIME value + */ + TimeFilter.TimeField = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TIME_FIELD_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATE_TIME"] = 1; + values[valuesById[2] = "UPDATE_TIME"] = 2; + values[valuesById[3] = "DISPOSITION_TIME"] = 3; + return values; + })(); + + return TimeFilter; + })(); + + v1.PropertyFilter = (function() { + + /** + * Properties of a PropertyFilter. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IPropertyFilter + * @property {string|null} [documentSchemaName] PropertyFilter documentSchemaName + * @property {string|null} [condition] PropertyFilter condition + */ + + /** + * Constructs a new PropertyFilter. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a PropertyFilter. + * @implements IPropertyFilter + * @constructor + * @param {google.cloud.contentwarehouse.v1.IPropertyFilter=} [properties] Properties to set + */ + function PropertyFilter(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]]; + } + + /** + * PropertyFilter documentSchemaName. + * @member {string} documentSchemaName + * @memberof google.cloud.contentwarehouse.v1.PropertyFilter + * @instance + */ + PropertyFilter.prototype.documentSchemaName = ""; + + /** + * PropertyFilter condition. + * @member {string} condition + * @memberof google.cloud.contentwarehouse.v1.PropertyFilter + * @instance + */ + PropertyFilter.prototype.condition = ""; + + /** + * Creates a new PropertyFilter instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.PropertyFilter + * @static + * @param {google.cloud.contentwarehouse.v1.IPropertyFilter=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.PropertyFilter} PropertyFilter instance + */ + PropertyFilter.create = function create(properties) { + return new PropertyFilter(properties); + }; + + /** + * Encodes the specified PropertyFilter message. Does not implicitly {@link google.cloud.contentwarehouse.v1.PropertyFilter.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.PropertyFilter + * @static + * @param {google.cloud.contentwarehouse.v1.IPropertyFilter} message PropertyFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PropertyFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documentSchemaName != null && Object.hasOwnProperty.call(message, "documentSchemaName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.documentSchemaName); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.condition); + return writer; + }; + + /** + * Encodes the specified PropertyFilter message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.PropertyFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.PropertyFilter + * @static + * @param {google.cloud.contentwarehouse.v1.IPropertyFilter} message PropertyFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PropertyFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PropertyFilter message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.PropertyFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.PropertyFilter} PropertyFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PropertyFilter.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.PropertyFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.documentSchemaName = reader.string(); + break; + } + case 2: { + message.condition = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PropertyFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.PropertyFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.PropertyFilter} PropertyFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PropertyFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PropertyFilter message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.PropertyFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PropertyFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.documentSchemaName != null && message.hasOwnProperty("documentSchemaName")) + if (!$util.isString(message.documentSchemaName)) + return "documentSchemaName: string expected"; + if (message.condition != null && message.hasOwnProperty("condition")) + if (!$util.isString(message.condition)) + return "condition: string expected"; + return null; + }; + + /** + * Creates a PropertyFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.PropertyFilter + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.PropertyFilter} PropertyFilter + */ + PropertyFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.PropertyFilter) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.PropertyFilter(); + if (object.documentSchemaName != null) + message.documentSchemaName = String(object.documentSchemaName); + if (object.condition != null) + message.condition = String(object.condition); + return message; + }; + + /** + * Creates a plain object from a PropertyFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.PropertyFilter + * @static + * @param {google.cloud.contentwarehouse.v1.PropertyFilter} message PropertyFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PropertyFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.documentSchemaName = ""; + object.condition = ""; + } + if (message.documentSchemaName != null && message.hasOwnProperty("documentSchemaName")) + object.documentSchemaName = message.documentSchemaName; + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = message.condition; + return object; + }; + + /** + * Converts this PropertyFilter to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.PropertyFilter + * @instance + * @returns {Object.} JSON object + */ + PropertyFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PropertyFilter + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.PropertyFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PropertyFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.PropertyFilter"; + }; + + return PropertyFilter; + })(); + + v1.FileTypeFilter = (function() { + + /** + * Properties of a FileTypeFilter. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IFileTypeFilter + * @property {google.cloud.contentwarehouse.v1.FileTypeFilter.FileType|null} [fileType] FileTypeFilter fileType + */ + + /** + * Constructs a new FileTypeFilter. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a FileTypeFilter. + * @implements IFileTypeFilter + * @constructor + * @param {google.cloud.contentwarehouse.v1.IFileTypeFilter=} [properties] Properties to set + */ + function FileTypeFilter(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]]; + } + + /** + * FileTypeFilter fileType. + * @member {google.cloud.contentwarehouse.v1.FileTypeFilter.FileType} fileType + * @memberof google.cloud.contentwarehouse.v1.FileTypeFilter + * @instance + */ + FileTypeFilter.prototype.fileType = 0; + + /** + * Creates a new FileTypeFilter instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.FileTypeFilter + * @static + * @param {google.cloud.contentwarehouse.v1.IFileTypeFilter=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.FileTypeFilter} FileTypeFilter instance + */ + FileTypeFilter.create = function create(properties) { + return new FileTypeFilter(properties); + }; + + /** + * Encodes the specified FileTypeFilter message. Does not implicitly {@link google.cloud.contentwarehouse.v1.FileTypeFilter.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.FileTypeFilter + * @static + * @param {google.cloud.contentwarehouse.v1.IFileTypeFilter} message FileTypeFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileTypeFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fileType != null && Object.hasOwnProperty.call(message, "fileType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fileType); + return writer; + }; + + /** + * Encodes the specified FileTypeFilter message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.FileTypeFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.FileTypeFilter + * @static + * @param {google.cloud.contentwarehouse.v1.IFileTypeFilter} message FileTypeFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileTypeFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileTypeFilter message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.FileTypeFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.FileTypeFilter} FileTypeFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileTypeFilter.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.FileTypeFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.fileType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileTypeFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.FileTypeFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.FileTypeFilter} FileTypeFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileTypeFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileTypeFilter message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.FileTypeFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileTypeFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fileType != null && message.hasOwnProperty("fileType")) + switch (message.fileType) { + default: + return "fileType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a FileTypeFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.FileTypeFilter + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.FileTypeFilter} FileTypeFilter + */ + FileTypeFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.FileTypeFilter) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.FileTypeFilter(); + switch (object.fileType) { + default: + if (typeof object.fileType === "number") { + message.fileType = object.fileType; + break; + } + break; + case "FILE_TYPE_UNSPECIFIED": + case 0: + message.fileType = 0; + break; + case "ALL": + case 1: + message.fileType = 1; + break; + case "FOLDER": + case 2: + message.fileType = 2; + break; + case "DOCUMENT": + case 3: + message.fileType = 3; + break; + case "ROOT_FOLDER": + case 4: + message.fileType = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a FileTypeFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.FileTypeFilter + * @static + * @param {google.cloud.contentwarehouse.v1.FileTypeFilter} message FileTypeFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileTypeFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.fileType = options.enums === String ? "FILE_TYPE_UNSPECIFIED" : 0; + if (message.fileType != null && message.hasOwnProperty("fileType")) + object.fileType = options.enums === String ? $root.google.cloud.contentwarehouse.v1.FileTypeFilter.FileType[message.fileType] === undefined ? message.fileType : $root.google.cloud.contentwarehouse.v1.FileTypeFilter.FileType[message.fileType] : message.fileType; + return object; + }; + + /** + * Converts this FileTypeFilter to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.FileTypeFilter + * @instance + * @returns {Object.} JSON object + */ + FileTypeFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileTypeFilter + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.FileTypeFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileTypeFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.FileTypeFilter"; + }; + + /** + * FileType enum. + * @name google.cloud.contentwarehouse.v1.FileTypeFilter.FileType + * @enum {number} + * @property {number} FILE_TYPE_UNSPECIFIED=0 FILE_TYPE_UNSPECIFIED value + * @property {number} ALL=1 ALL value + * @property {number} FOLDER=2 FOLDER value + * @property {number} DOCUMENT=3 DOCUMENT value + * @property {number} ROOT_FOLDER=4 ROOT_FOLDER value + */ + FileTypeFilter.FileType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FILE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ALL"] = 1; + values[valuesById[2] = "FOLDER"] = 2; + values[valuesById[3] = "DOCUMENT"] = 3; + values[valuesById[4] = "ROOT_FOLDER"] = 4; + return values; + })(); + + return FileTypeFilter; + })(); + + v1.CustomWeightsMetadata = (function() { + + /** + * Properties of a CustomWeightsMetadata. + * @memberof google.cloud.contentwarehouse.v1 + * @interface ICustomWeightsMetadata + * @property {Array.|null} [weightedSchemaProperties] CustomWeightsMetadata weightedSchemaProperties + */ + + /** + * Constructs a new CustomWeightsMetadata. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a CustomWeightsMetadata. + * @implements ICustomWeightsMetadata + * @constructor + * @param {google.cloud.contentwarehouse.v1.ICustomWeightsMetadata=} [properties] Properties to set + */ + function CustomWeightsMetadata(properties) { + this.weightedSchemaProperties = []; + 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]]; + } + + /** + * CustomWeightsMetadata weightedSchemaProperties. + * @member {Array.} weightedSchemaProperties + * @memberof google.cloud.contentwarehouse.v1.CustomWeightsMetadata + * @instance + */ + CustomWeightsMetadata.prototype.weightedSchemaProperties = $util.emptyArray; + + /** + * Creates a new CustomWeightsMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.CustomWeightsMetadata + * @static + * @param {google.cloud.contentwarehouse.v1.ICustomWeightsMetadata=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.CustomWeightsMetadata} CustomWeightsMetadata instance + */ + CustomWeightsMetadata.create = function create(properties) { + return new CustomWeightsMetadata(properties); + }; + + /** + * Encodes the specified CustomWeightsMetadata message. Does not implicitly {@link google.cloud.contentwarehouse.v1.CustomWeightsMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.CustomWeightsMetadata + * @static + * @param {google.cloud.contentwarehouse.v1.ICustomWeightsMetadata} message CustomWeightsMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomWeightsMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.weightedSchemaProperties != null && message.weightedSchemaProperties.length) + for (var i = 0; i < message.weightedSchemaProperties.length; ++i) + $root.google.cloud.contentwarehouse.v1.WeightedSchemaProperty.encode(message.weightedSchemaProperties[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CustomWeightsMetadata message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.CustomWeightsMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.CustomWeightsMetadata + * @static + * @param {google.cloud.contentwarehouse.v1.ICustomWeightsMetadata} message CustomWeightsMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomWeightsMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomWeightsMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.CustomWeightsMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.CustomWeightsMetadata} CustomWeightsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomWeightsMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.CustomWeightsMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.weightedSchemaProperties && message.weightedSchemaProperties.length)) + message.weightedSchemaProperties = []; + message.weightedSchemaProperties.push($root.google.cloud.contentwarehouse.v1.WeightedSchemaProperty.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomWeightsMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.CustomWeightsMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.CustomWeightsMetadata} CustomWeightsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomWeightsMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomWeightsMetadata message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.CustomWeightsMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomWeightsMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.weightedSchemaProperties != null && message.hasOwnProperty("weightedSchemaProperties")) { + if (!Array.isArray(message.weightedSchemaProperties)) + return "weightedSchemaProperties: array expected"; + for (var i = 0; i < message.weightedSchemaProperties.length; ++i) { + var error = $root.google.cloud.contentwarehouse.v1.WeightedSchemaProperty.verify(message.weightedSchemaProperties[i]); + if (error) + return "weightedSchemaProperties." + error; + } + } + return null; + }; + + /** + * Creates a CustomWeightsMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.CustomWeightsMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.CustomWeightsMetadata} CustomWeightsMetadata + */ + CustomWeightsMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.CustomWeightsMetadata) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.CustomWeightsMetadata(); + if (object.weightedSchemaProperties) { + if (!Array.isArray(object.weightedSchemaProperties)) + throw TypeError(".google.cloud.contentwarehouse.v1.CustomWeightsMetadata.weightedSchemaProperties: array expected"); + message.weightedSchemaProperties = []; + for (var i = 0; i < object.weightedSchemaProperties.length; ++i) { + if (typeof object.weightedSchemaProperties[i] !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.CustomWeightsMetadata.weightedSchemaProperties: object expected"); + message.weightedSchemaProperties[i] = $root.google.cloud.contentwarehouse.v1.WeightedSchemaProperty.fromObject(object.weightedSchemaProperties[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CustomWeightsMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.CustomWeightsMetadata + * @static + * @param {google.cloud.contentwarehouse.v1.CustomWeightsMetadata} message CustomWeightsMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomWeightsMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.weightedSchemaProperties = []; + if (message.weightedSchemaProperties && message.weightedSchemaProperties.length) { + object.weightedSchemaProperties = []; + for (var j = 0; j < message.weightedSchemaProperties.length; ++j) + object.weightedSchemaProperties[j] = $root.google.cloud.contentwarehouse.v1.WeightedSchemaProperty.toObject(message.weightedSchemaProperties[j], options); + } + return object; + }; + + /** + * Converts this CustomWeightsMetadata to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.CustomWeightsMetadata + * @instance + * @returns {Object.} JSON object + */ + CustomWeightsMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomWeightsMetadata + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.CustomWeightsMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomWeightsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.CustomWeightsMetadata"; + }; + + return CustomWeightsMetadata; + })(); + + v1.WeightedSchemaProperty = (function() { + + /** + * Properties of a WeightedSchemaProperty. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IWeightedSchemaProperty + * @property {string|null} [documentSchemaName] WeightedSchemaProperty documentSchemaName + * @property {Array.|null} [propertyNames] WeightedSchemaProperty propertyNames + */ + + /** + * Constructs a new WeightedSchemaProperty. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a WeightedSchemaProperty. + * @implements IWeightedSchemaProperty + * @constructor + * @param {google.cloud.contentwarehouse.v1.IWeightedSchemaProperty=} [properties] Properties to set + */ + function WeightedSchemaProperty(properties) { + this.propertyNames = []; + 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]]; + } + + /** + * WeightedSchemaProperty documentSchemaName. + * @member {string} documentSchemaName + * @memberof google.cloud.contentwarehouse.v1.WeightedSchemaProperty + * @instance + */ + WeightedSchemaProperty.prototype.documentSchemaName = ""; + + /** + * WeightedSchemaProperty propertyNames. + * @member {Array.} propertyNames + * @memberof google.cloud.contentwarehouse.v1.WeightedSchemaProperty + * @instance + */ + WeightedSchemaProperty.prototype.propertyNames = $util.emptyArray; + + /** + * Creates a new WeightedSchemaProperty instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.WeightedSchemaProperty + * @static + * @param {google.cloud.contentwarehouse.v1.IWeightedSchemaProperty=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.WeightedSchemaProperty} WeightedSchemaProperty instance + */ + WeightedSchemaProperty.create = function create(properties) { + return new WeightedSchemaProperty(properties); + }; + + /** + * Encodes the specified WeightedSchemaProperty message. Does not implicitly {@link google.cloud.contentwarehouse.v1.WeightedSchemaProperty.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.WeightedSchemaProperty + * @static + * @param {google.cloud.contentwarehouse.v1.IWeightedSchemaProperty} message WeightedSchemaProperty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WeightedSchemaProperty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documentSchemaName != null && Object.hasOwnProperty.call(message, "documentSchemaName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.documentSchemaName); + if (message.propertyNames != null && message.propertyNames.length) + for (var i = 0; i < message.propertyNames.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.propertyNames[i]); + return writer; + }; + + /** + * Encodes the specified WeightedSchemaProperty message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.WeightedSchemaProperty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.WeightedSchemaProperty + * @static + * @param {google.cloud.contentwarehouse.v1.IWeightedSchemaProperty} message WeightedSchemaProperty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WeightedSchemaProperty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WeightedSchemaProperty message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.WeightedSchemaProperty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.WeightedSchemaProperty} WeightedSchemaProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WeightedSchemaProperty.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.WeightedSchemaProperty(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.documentSchemaName = reader.string(); + break; + } + case 2: { + if (!(message.propertyNames && message.propertyNames.length)) + message.propertyNames = []; + message.propertyNames.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WeightedSchemaProperty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.WeightedSchemaProperty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.WeightedSchemaProperty} WeightedSchemaProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WeightedSchemaProperty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WeightedSchemaProperty message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.WeightedSchemaProperty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WeightedSchemaProperty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.documentSchemaName != null && message.hasOwnProperty("documentSchemaName")) + if (!$util.isString(message.documentSchemaName)) + return "documentSchemaName: string expected"; + if (message.propertyNames != null && message.hasOwnProperty("propertyNames")) { + if (!Array.isArray(message.propertyNames)) + return "propertyNames: array expected"; + for (var i = 0; i < message.propertyNames.length; ++i) + if (!$util.isString(message.propertyNames[i])) + return "propertyNames: string[] expected"; + } + return null; + }; + + /** + * Creates a WeightedSchemaProperty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.WeightedSchemaProperty + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.WeightedSchemaProperty} WeightedSchemaProperty + */ + WeightedSchemaProperty.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.WeightedSchemaProperty) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.WeightedSchemaProperty(); + if (object.documentSchemaName != null) + message.documentSchemaName = String(object.documentSchemaName); + if (object.propertyNames) { + if (!Array.isArray(object.propertyNames)) + throw TypeError(".google.cloud.contentwarehouse.v1.WeightedSchemaProperty.propertyNames: array expected"); + message.propertyNames = []; + for (var i = 0; i < object.propertyNames.length; ++i) + message.propertyNames[i] = String(object.propertyNames[i]); + } + return message; + }; + + /** + * Creates a plain object from a WeightedSchemaProperty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.WeightedSchemaProperty + * @static + * @param {google.cloud.contentwarehouse.v1.WeightedSchemaProperty} message WeightedSchemaProperty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WeightedSchemaProperty.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.propertyNames = []; + if (options.defaults) + object.documentSchemaName = ""; + if (message.documentSchemaName != null && message.hasOwnProperty("documentSchemaName")) + object.documentSchemaName = message.documentSchemaName; + if (message.propertyNames && message.propertyNames.length) { + object.propertyNames = []; + for (var j = 0; j < message.propertyNames.length; ++j) + object.propertyNames[j] = message.propertyNames[j]; + } + return object; + }; + + /** + * Converts this WeightedSchemaProperty to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.WeightedSchemaProperty + * @instance + * @returns {Object.} JSON object + */ + WeightedSchemaProperty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WeightedSchemaProperty + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.WeightedSchemaProperty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WeightedSchemaProperty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.WeightedSchemaProperty"; + }; + + return WeightedSchemaProperty; + })(); + + v1.HistogramQuery = (function() { + + /** + * Properties of a HistogramQuery. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IHistogramQuery + * @property {string|null} [histogramQuery] HistogramQuery histogramQuery + * @property {boolean|null} [requirePreciseResultSize] HistogramQuery requirePreciseResultSize + * @property {google.cloud.contentwarehouse.v1.IHistogramQueryPropertyNameFilter|null} [filters] HistogramQuery filters + */ + + /** + * Constructs a new HistogramQuery. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a HistogramQuery. + * @implements IHistogramQuery + * @constructor + * @param {google.cloud.contentwarehouse.v1.IHistogramQuery=} [properties] Properties to set + */ + function HistogramQuery(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]]; + } + + /** + * HistogramQuery histogramQuery. + * @member {string} histogramQuery + * @memberof google.cloud.contentwarehouse.v1.HistogramQuery + * @instance + */ + HistogramQuery.prototype.histogramQuery = ""; + + /** + * HistogramQuery requirePreciseResultSize. + * @member {boolean} requirePreciseResultSize + * @memberof google.cloud.contentwarehouse.v1.HistogramQuery + * @instance + */ + HistogramQuery.prototype.requirePreciseResultSize = false; + + /** + * HistogramQuery filters. + * @member {google.cloud.contentwarehouse.v1.IHistogramQueryPropertyNameFilter|null|undefined} filters + * @memberof google.cloud.contentwarehouse.v1.HistogramQuery + * @instance + */ + HistogramQuery.prototype.filters = null; + + /** + * Creates a new HistogramQuery instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.HistogramQuery + * @static + * @param {google.cloud.contentwarehouse.v1.IHistogramQuery=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.HistogramQuery} HistogramQuery instance + */ + HistogramQuery.create = function create(properties) { + return new HistogramQuery(properties); + }; + + /** + * Encodes the specified HistogramQuery message. Does not implicitly {@link google.cloud.contentwarehouse.v1.HistogramQuery.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.HistogramQuery + * @static + * @param {google.cloud.contentwarehouse.v1.IHistogramQuery} message HistogramQuery message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HistogramQuery.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.histogramQuery != null && Object.hasOwnProperty.call(message, "histogramQuery")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.histogramQuery); + if (message.requirePreciseResultSize != null && Object.hasOwnProperty.call(message, "requirePreciseResultSize")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.requirePreciseResultSize); + if (message.filters != null && Object.hasOwnProperty.call(message, "filters")) + $root.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.encode(message.filters, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified HistogramQuery message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.HistogramQuery.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.HistogramQuery + * @static + * @param {google.cloud.contentwarehouse.v1.IHistogramQuery} message HistogramQuery message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HistogramQuery.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HistogramQuery message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.HistogramQuery + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.HistogramQuery} HistogramQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HistogramQuery.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.HistogramQuery(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.histogramQuery = reader.string(); + break; + } + case 2: { + message.requirePreciseResultSize = reader.bool(); + break; + } + case 3: { + message.filters = $root.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HistogramQuery message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.HistogramQuery + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.HistogramQuery} HistogramQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HistogramQuery.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HistogramQuery message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.HistogramQuery + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HistogramQuery.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.histogramQuery != null && message.hasOwnProperty("histogramQuery")) + if (!$util.isString(message.histogramQuery)) + return "histogramQuery: string expected"; + if (message.requirePreciseResultSize != null && message.hasOwnProperty("requirePreciseResultSize")) + if (typeof message.requirePreciseResultSize !== "boolean") + return "requirePreciseResultSize: boolean expected"; + if (message.filters != null && message.hasOwnProperty("filters")) { + var error = $root.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.verify(message.filters); + if (error) + return "filters." + error; + } + return null; + }; + + /** + * Creates a HistogramQuery message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.HistogramQuery + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.HistogramQuery} HistogramQuery + */ + HistogramQuery.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.HistogramQuery) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.HistogramQuery(); + if (object.histogramQuery != null) + message.histogramQuery = String(object.histogramQuery); + if (object.requirePreciseResultSize != null) + message.requirePreciseResultSize = Boolean(object.requirePreciseResultSize); + if (object.filters != null) { + if (typeof object.filters !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.HistogramQuery.filters: object expected"); + message.filters = $root.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.fromObject(object.filters); + } + return message; + }; + + /** + * Creates a plain object from a HistogramQuery message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.HistogramQuery + * @static + * @param {google.cloud.contentwarehouse.v1.HistogramQuery} message HistogramQuery + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HistogramQuery.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.histogramQuery = ""; + object.requirePreciseResultSize = false; + object.filters = null; + } + if (message.histogramQuery != null && message.hasOwnProperty("histogramQuery")) + object.histogramQuery = message.histogramQuery; + if (message.requirePreciseResultSize != null && message.hasOwnProperty("requirePreciseResultSize")) + object.requirePreciseResultSize = message.requirePreciseResultSize; + if (message.filters != null && message.hasOwnProperty("filters")) + object.filters = $root.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.toObject(message.filters, options); + return object; + }; + + /** + * Converts this HistogramQuery to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.HistogramQuery + * @instance + * @returns {Object.} JSON object + */ + HistogramQuery.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HistogramQuery + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.HistogramQuery + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HistogramQuery.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.HistogramQuery"; + }; + + return HistogramQuery; + })(); + + v1.HistogramQueryPropertyNameFilter = (function() { + + /** + * Properties of a HistogramQueryPropertyNameFilter. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IHistogramQueryPropertyNameFilter + * @property {Array.|null} [documentSchemas] HistogramQueryPropertyNameFilter documentSchemas + * @property {Array.|null} [propertyNames] HistogramQueryPropertyNameFilter propertyNames + * @property {google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.HistogramYAxis|null} [yAxis] HistogramQueryPropertyNameFilter yAxis + */ + + /** + * Constructs a new HistogramQueryPropertyNameFilter. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a HistogramQueryPropertyNameFilter. + * @implements IHistogramQueryPropertyNameFilter + * @constructor + * @param {google.cloud.contentwarehouse.v1.IHistogramQueryPropertyNameFilter=} [properties] Properties to set + */ + function HistogramQueryPropertyNameFilter(properties) { + this.documentSchemas = []; + this.propertyNames = []; + 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]]; + } + + /** + * HistogramQueryPropertyNameFilter documentSchemas. + * @member {Array.} documentSchemas + * @memberof google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter + * @instance + */ + HistogramQueryPropertyNameFilter.prototype.documentSchemas = $util.emptyArray; + + /** + * HistogramQueryPropertyNameFilter propertyNames. + * @member {Array.} propertyNames + * @memberof google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter + * @instance + */ + HistogramQueryPropertyNameFilter.prototype.propertyNames = $util.emptyArray; + + /** + * HistogramQueryPropertyNameFilter yAxis. + * @member {google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.HistogramYAxis} yAxis + * @memberof google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter + * @instance + */ + HistogramQueryPropertyNameFilter.prototype.yAxis = 0; + + /** + * Creates a new HistogramQueryPropertyNameFilter instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter + * @static + * @param {google.cloud.contentwarehouse.v1.IHistogramQueryPropertyNameFilter=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter} HistogramQueryPropertyNameFilter instance + */ + HistogramQueryPropertyNameFilter.create = function create(properties) { + return new HistogramQueryPropertyNameFilter(properties); + }; + + /** + * Encodes the specified HistogramQueryPropertyNameFilter message. Does not implicitly {@link google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter + * @static + * @param {google.cloud.contentwarehouse.v1.IHistogramQueryPropertyNameFilter} message HistogramQueryPropertyNameFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HistogramQueryPropertyNameFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documentSchemas != null && message.documentSchemas.length) + for (var i = 0; i < message.documentSchemas.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.documentSchemas[i]); + if (message.propertyNames != null && message.propertyNames.length) + for (var i = 0; i < message.propertyNames.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.propertyNames[i]); + if (message.yAxis != null && Object.hasOwnProperty.call(message, "yAxis")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.yAxis); + return writer; + }; + + /** + * Encodes the specified HistogramQueryPropertyNameFilter message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter + * @static + * @param {google.cloud.contentwarehouse.v1.IHistogramQueryPropertyNameFilter} message HistogramQueryPropertyNameFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HistogramQueryPropertyNameFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HistogramQueryPropertyNameFilter message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter} HistogramQueryPropertyNameFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HistogramQueryPropertyNameFilter.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.documentSchemas && message.documentSchemas.length)) + message.documentSchemas = []; + message.documentSchemas.push(reader.string()); + break; + } + case 2: { + if (!(message.propertyNames && message.propertyNames.length)) + message.propertyNames = []; + message.propertyNames.push(reader.string()); + break; + } + case 3: { + message.yAxis = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HistogramQueryPropertyNameFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter} HistogramQueryPropertyNameFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HistogramQueryPropertyNameFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HistogramQueryPropertyNameFilter message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HistogramQueryPropertyNameFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.documentSchemas != null && message.hasOwnProperty("documentSchemas")) { + if (!Array.isArray(message.documentSchemas)) + return "documentSchemas: array expected"; + for (var i = 0; i < message.documentSchemas.length; ++i) + if (!$util.isString(message.documentSchemas[i])) + return "documentSchemas: string[] expected"; + } + if (message.propertyNames != null && message.hasOwnProperty("propertyNames")) { + if (!Array.isArray(message.propertyNames)) + return "propertyNames: array expected"; + for (var i = 0; i < message.propertyNames.length; ++i) + if (!$util.isString(message.propertyNames[i])) + return "propertyNames: string[] expected"; + } + if (message.yAxis != null && message.hasOwnProperty("yAxis")) + switch (message.yAxis) { + default: + return "yAxis: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a HistogramQueryPropertyNameFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter} HistogramQueryPropertyNameFilter + */ + HistogramQueryPropertyNameFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter(); + if (object.documentSchemas) { + if (!Array.isArray(object.documentSchemas)) + throw TypeError(".google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.documentSchemas: array expected"); + message.documentSchemas = []; + for (var i = 0; i < object.documentSchemas.length; ++i) + message.documentSchemas[i] = String(object.documentSchemas[i]); + } + if (object.propertyNames) { + if (!Array.isArray(object.propertyNames)) + throw TypeError(".google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.propertyNames: array expected"); + message.propertyNames = []; + for (var i = 0; i < object.propertyNames.length; ++i) + message.propertyNames[i] = String(object.propertyNames[i]); + } + switch (object.yAxis) { + default: + if (typeof object.yAxis === "number") { + message.yAxis = object.yAxis; + break; + } + break; + case "HISTOGRAM_YAXIS_DOCUMENT": + case 0: + message.yAxis = 0; + break; + case "HISTOGRAM_YAXIS_PROPERTY": + case 1: + message.yAxis = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a HistogramQueryPropertyNameFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter + * @static + * @param {google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter} message HistogramQueryPropertyNameFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HistogramQueryPropertyNameFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.documentSchemas = []; + object.propertyNames = []; + } + if (options.defaults) + object.yAxis = options.enums === String ? "HISTOGRAM_YAXIS_DOCUMENT" : 0; + if (message.documentSchemas && message.documentSchemas.length) { + object.documentSchemas = []; + for (var j = 0; j < message.documentSchemas.length; ++j) + object.documentSchemas[j] = message.documentSchemas[j]; + } + if (message.propertyNames && message.propertyNames.length) { + object.propertyNames = []; + for (var j = 0; j < message.propertyNames.length; ++j) + object.propertyNames[j] = message.propertyNames[j]; + } + if (message.yAxis != null && message.hasOwnProperty("yAxis")) + object.yAxis = options.enums === String ? $root.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.HistogramYAxis[message.yAxis] === undefined ? message.yAxis : $root.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.HistogramYAxis[message.yAxis] : message.yAxis; + return object; + }; + + /** + * Converts this HistogramQueryPropertyNameFilter to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter + * @instance + * @returns {Object.} JSON object + */ + HistogramQueryPropertyNameFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HistogramQueryPropertyNameFilter + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HistogramQueryPropertyNameFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter"; + }; + + /** + * HistogramYAxis enum. + * @name google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.HistogramYAxis + * @enum {number} + * @property {number} HISTOGRAM_YAXIS_DOCUMENT=0 HISTOGRAM_YAXIS_DOCUMENT value + * @property {number} HISTOGRAM_YAXIS_PROPERTY=1 HISTOGRAM_YAXIS_PROPERTY value + */ + HistogramQueryPropertyNameFilter.HistogramYAxis = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTOGRAM_YAXIS_DOCUMENT"] = 0; + values[valuesById[1] = "HISTOGRAM_YAXIS_PROPERTY"] = 1; + return values; + })(); + + return HistogramQueryPropertyNameFilter; + })(); + + v1.HistogramQueryResult = (function() { + + /** + * Properties of a HistogramQueryResult. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IHistogramQueryResult + * @property {string|null} [histogramQuery] HistogramQueryResult histogramQuery + * @property {Object.|null} [histogram] HistogramQueryResult histogram + */ + + /** + * Constructs a new HistogramQueryResult. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a HistogramQueryResult. + * @implements IHistogramQueryResult + * @constructor + * @param {google.cloud.contentwarehouse.v1.IHistogramQueryResult=} [properties] Properties to set + */ + function HistogramQueryResult(properties) { + this.histogram = {}; + 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]]; + } + + /** + * HistogramQueryResult histogramQuery. + * @member {string} histogramQuery + * @memberof google.cloud.contentwarehouse.v1.HistogramQueryResult + * @instance + */ + HistogramQueryResult.prototype.histogramQuery = ""; + + /** + * HistogramQueryResult histogram. + * @member {Object.} histogram + * @memberof google.cloud.contentwarehouse.v1.HistogramQueryResult + * @instance + */ + HistogramQueryResult.prototype.histogram = $util.emptyObject; + + /** + * Creates a new HistogramQueryResult instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.HistogramQueryResult + * @static + * @param {google.cloud.contentwarehouse.v1.IHistogramQueryResult=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.HistogramQueryResult} HistogramQueryResult instance + */ + HistogramQueryResult.create = function create(properties) { + return new HistogramQueryResult(properties); + }; + + /** + * Encodes the specified HistogramQueryResult message. Does not implicitly {@link google.cloud.contentwarehouse.v1.HistogramQueryResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.HistogramQueryResult + * @static + * @param {google.cloud.contentwarehouse.v1.IHistogramQueryResult} message HistogramQueryResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HistogramQueryResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.histogramQuery != null && Object.hasOwnProperty.call(message, "histogramQuery")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.histogramQuery); + if (message.histogram != null && Object.hasOwnProperty.call(message, "histogram")) + for (var keys = Object.keys(message.histogram), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).int64(message.histogram[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified HistogramQueryResult message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.HistogramQueryResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.HistogramQueryResult + * @static + * @param {google.cloud.contentwarehouse.v1.IHistogramQueryResult} message HistogramQueryResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HistogramQueryResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HistogramQueryResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.HistogramQueryResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.HistogramQueryResult} HistogramQueryResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HistogramQueryResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.HistogramQueryResult(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.histogramQuery = reader.string(); + break; + } + case 2: { + if (message.histogram === $util.emptyObject) + message.histogram = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = 0; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.int64(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.histogram[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HistogramQueryResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.HistogramQueryResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.HistogramQueryResult} HistogramQueryResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HistogramQueryResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HistogramQueryResult message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.HistogramQueryResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HistogramQueryResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.histogramQuery != null && message.hasOwnProperty("histogramQuery")) + if (!$util.isString(message.histogramQuery)) + return "histogramQuery: string expected"; + if (message.histogram != null && message.hasOwnProperty("histogram")) { + if (!$util.isObject(message.histogram)) + return "histogram: object expected"; + var key = Object.keys(message.histogram); + for (var i = 0; i < key.length; ++i) + if (!$util.isInteger(message.histogram[key[i]]) && !(message.histogram[key[i]] && $util.isInteger(message.histogram[key[i]].low) && $util.isInteger(message.histogram[key[i]].high))) + return "histogram: integer|Long{k:string} expected"; + } + return null; + }; + + /** + * Creates a HistogramQueryResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.HistogramQueryResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.HistogramQueryResult} HistogramQueryResult + */ + HistogramQueryResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.HistogramQueryResult) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.HistogramQueryResult(); + if (object.histogramQuery != null) + message.histogramQuery = String(object.histogramQuery); + if (object.histogram) { + if (typeof object.histogram !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.HistogramQueryResult.histogram: object expected"); + message.histogram = {}; + for (var keys = Object.keys(object.histogram), i = 0; i < keys.length; ++i) + if ($util.Long) + (message.histogram[keys[i]] = $util.Long.fromValue(object.histogram[keys[i]])).unsigned = false; + else if (typeof object.histogram[keys[i]] === "string") + message.histogram[keys[i]] = parseInt(object.histogram[keys[i]], 10); + else if (typeof object.histogram[keys[i]] === "number") + message.histogram[keys[i]] = object.histogram[keys[i]]; + else if (typeof object.histogram[keys[i]] === "object") + message.histogram[keys[i]] = new $util.LongBits(object.histogram[keys[i]].low >>> 0, object.histogram[keys[i]].high >>> 0).toNumber(); + } + return message; + }; + + /** + * Creates a plain object from a HistogramQueryResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.HistogramQueryResult + * @static + * @param {google.cloud.contentwarehouse.v1.HistogramQueryResult} message HistogramQueryResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HistogramQueryResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.histogram = {}; + if (options.defaults) + object.histogramQuery = ""; + if (message.histogramQuery != null && message.hasOwnProperty("histogramQuery")) + object.histogramQuery = message.histogramQuery; + var keys2; + if (message.histogram && (keys2 = Object.keys(message.histogram)).length) { + object.histogram = {}; + for (var j = 0; j < keys2.length; ++j) + if (typeof message.histogram[keys2[j]] === "number") + object.histogram[keys2[j]] = options.longs === String ? String(message.histogram[keys2[j]]) : message.histogram[keys2[j]]; + else + object.histogram[keys2[j]] = options.longs === String ? $util.Long.prototype.toString.call(message.histogram[keys2[j]]) : options.longs === Number ? new $util.LongBits(message.histogram[keys2[j]].low >>> 0, message.histogram[keys2[j]].high >>> 0).toNumber() : message.histogram[keys2[j]]; + } + return object; + }; + + /** + * Converts this HistogramQueryResult to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.HistogramQueryResult + * @instance + * @returns {Object.} JSON object + */ + HistogramQueryResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HistogramQueryResult + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.HistogramQueryResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HistogramQueryResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.HistogramQueryResult"; + }; + + return HistogramQueryResult; + })(); + + v1.RuleSet = (function() { + + /** + * Properties of a RuleSet. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IRuleSet + * @property {string|null} [name] RuleSet name + * @property {string|null} [description] RuleSet description + * @property {string|null} [source] RuleSet source + * @property {Array.|null} [rules] RuleSet rules + */ + + /** + * Constructs a new RuleSet. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a RuleSet. + * @implements IRuleSet + * @constructor + * @param {google.cloud.contentwarehouse.v1.IRuleSet=} [properties] Properties to set + */ + function RuleSet(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]]; + } + + /** + * RuleSet name. + * @member {string} name + * @memberof google.cloud.contentwarehouse.v1.RuleSet + * @instance + */ + RuleSet.prototype.name = ""; + + /** + * RuleSet description. + * @member {string} description + * @memberof google.cloud.contentwarehouse.v1.RuleSet + * @instance + */ + RuleSet.prototype.description = ""; + + /** + * RuleSet source. + * @member {string} source + * @memberof google.cloud.contentwarehouse.v1.RuleSet + * @instance + */ + RuleSet.prototype.source = ""; + + /** + * RuleSet rules. + * @member {Array.} rules + * @memberof google.cloud.contentwarehouse.v1.RuleSet + * @instance + */ + RuleSet.prototype.rules = $util.emptyArray; + + /** + * Creates a new RuleSet instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.RuleSet + * @static + * @param {google.cloud.contentwarehouse.v1.IRuleSet=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.RuleSet} RuleSet instance + */ + RuleSet.create = function create(properties) { + return new RuleSet(properties); + }; + + /** + * Encodes the specified RuleSet message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RuleSet.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.RuleSet + * @static + * @param {google.cloud.contentwarehouse.v1.IRuleSet} message RuleSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RuleSet.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.source != null && Object.hasOwnProperty.call(message, "source")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.source); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.cloud.contentwarehouse.v1.Rule.encode(message.rules[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.name); + return writer; + }; + + /** + * Encodes the specified RuleSet message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RuleSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.RuleSet + * @static + * @param {google.cloud.contentwarehouse.v1.IRuleSet} message RuleSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RuleSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RuleSet message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.RuleSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.RuleSet} RuleSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RuleSet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.RuleSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 6: { + message.name = reader.string(); + break; + } + case 1: { + message.description = reader.string(); + break; + } + case 2: { + message.source = reader.string(); + break; + } + case 3: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.cloud.contentwarehouse.v1.Rule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RuleSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.RuleSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.RuleSet} RuleSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RuleSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RuleSet message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.RuleSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RuleSet.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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.source != null && message.hasOwnProperty("source")) + if (!$util.isString(message.source)) + return "source: string 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.cloud.contentwarehouse.v1.Rule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + return null; + }; + + /** + * Creates a RuleSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.RuleSet + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.RuleSet} RuleSet + */ + RuleSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.RuleSet) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.RuleSet(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.source != null) + message.source = String(object.source); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.cloud.contentwarehouse.v1.RuleSet.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.RuleSet.rules: object expected"); + message.rules[i] = $root.google.cloud.contentwarehouse.v1.Rule.fromObject(object.rules[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RuleSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.RuleSet + * @static + * @param {google.cloud.contentwarehouse.v1.RuleSet} message RuleSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RuleSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) { + object.description = ""; + object.source = ""; + object.name = ""; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.source != null && message.hasOwnProperty("source")) + object.source = message.source; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.cloud.contentwarehouse.v1.Rule.toObject(message.rules[j], options); + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this RuleSet to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.RuleSet + * @instance + * @returns {Object.} JSON object + */ + RuleSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RuleSet + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.RuleSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RuleSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.RuleSet"; + }; + + return RuleSet; + })(); + + v1.Rule = (function() { + + /** + * Properties of a Rule. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IRule + * @property {string|null} [description] Rule description + * @property {string|null} [ruleId] Rule ruleId + * @property {google.cloud.contentwarehouse.v1.Rule.TriggerType|null} [triggerType] Rule triggerType + * @property {string|null} [condition] Rule condition + * @property {Array.|null} [actions] Rule actions + */ + + /** + * Constructs a new Rule. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a Rule. + * @implements IRule + * @constructor + * @param {google.cloud.contentwarehouse.v1.IRule=} [properties] Properties to set + */ + function Rule(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]]; + } + + /** + * Rule description. + * @member {string} description + * @memberof google.cloud.contentwarehouse.v1.Rule + * @instance + */ + Rule.prototype.description = ""; + + /** + * Rule ruleId. + * @member {string} ruleId + * @memberof google.cloud.contentwarehouse.v1.Rule + * @instance + */ + Rule.prototype.ruleId = ""; + + /** + * Rule triggerType. + * @member {google.cloud.contentwarehouse.v1.Rule.TriggerType} triggerType + * @memberof google.cloud.contentwarehouse.v1.Rule + * @instance + */ + Rule.prototype.triggerType = 0; + + /** + * Rule condition. + * @member {string} condition + * @memberof google.cloud.contentwarehouse.v1.Rule + * @instance + */ + Rule.prototype.condition = ""; + + /** + * Rule actions. + * @member {Array.} actions + * @memberof google.cloud.contentwarehouse.v1.Rule + * @instance + */ + Rule.prototype.actions = $util.emptyArray; + + /** + * Creates a new Rule instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.Rule + * @static + * @param {google.cloud.contentwarehouse.v1.IRule=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.Rule} Rule instance + */ + Rule.create = function create(properties) { + return new Rule(properties); + }; + + /** + * Encodes the specified Rule message. Does not implicitly {@link google.cloud.contentwarehouse.v1.Rule.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.Rule + * @static + * @param {google.cloud.contentwarehouse.v1.IRule} message Rule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Rule.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.ruleId != null && Object.hasOwnProperty.call(message, "ruleId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.ruleId); + if (message.triggerType != null && Object.hasOwnProperty.call(message, "triggerType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.triggerType); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.condition); + if (message.actions != null && message.actions.length) + for (var i = 0; i < message.actions.length; ++i) + $root.google.cloud.contentwarehouse.v1.Action.encode(message.actions[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Rule message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.Rule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.Rule + * @static + * @param {google.cloud.contentwarehouse.v1.IRule} message Rule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Rule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Rule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.Rule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.Rule} Rule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Rule.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.Rule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.description = reader.string(); + break; + } + case 2: { + message.ruleId = reader.string(); + break; + } + case 3: { + message.triggerType = reader.int32(); + break; + } + case 4: { + message.condition = reader.string(); + break; + } + case 5: { + if (!(message.actions && message.actions.length)) + message.actions = []; + message.actions.push($root.google.cloud.contentwarehouse.v1.Action.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Rule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.Rule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.Rule} Rule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Rule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Rule message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.Rule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Rule.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.ruleId != null && message.hasOwnProperty("ruleId")) + if (!$util.isString(message.ruleId)) + return "ruleId: string expected"; + if (message.triggerType != null && message.hasOwnProperty("triggerType")) + switch (message.triggerType) { + default: + return "triggerType: enum value expected"; + case 0: + case 1: + case 4: + case 7: + case 8: + break; + } + if (message.condition != null && message.hasOwnProperty("condition")) + if (!$util.isString(message.condition)) + return "condition: 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.cloud.contentwarehouse.v1.Action.verify(message.actions[i]); + if (error) + return "actions." + error; + } + } + return null; + }; + + /** + * Creates a Rule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.Rule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.Rule} Rule + */ + Rule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.Rule) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.Rule(); + if (object.description != null) + message.description = String(object.description); + if (object.ruleId != null) + message.ruleId = String(object.ruleId); + switch (object.triggerType) { + default: + if (typeof object.triggerType === "number") { + message.triggerType = object.triggerType; + break; + } + break; + case "UNKNOWN": + case 0: + message.triggerType = 0; + break; + case "ON_CREATE": + case 1: + message.triggerType = 1; + break; + case "ON_UPDATE": + case 4: + message.triggerType = 4; + break; + case "ON_CREATE_LINK": + case 7: + message.triggerType = 7; + break; + case "ON_DELETE_LINK": + case 8: + message.triggerType = 8; + break; + } + if (object.condition != null) + message.condition = String(object.condition); + if (object.actions) { + if (!Array.isArray(object.actions)) + throw TypeError(".google.cloud.contentwarehouse.v1.Rule.actions: array expected"); + message.actions = []; + for (var i = 0; i < object.actions.length; ++i) { + if (typeof object.actions[i] !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.Rule.actions: object expected"); + message.actions[i] = $root.google.cloud.contentwarehouse.v1.Action.fromObject(object.actions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Rule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.Rule + * @static + * @param {google.cloud.contentwarehouse.v1.Rule} message Rule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Rule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.actions = []; + if (options.defaults) { + object.description = ""; + object.ruleId = ""; + object.triggerType = options.enums === String ? "UNKNOWN" : 0; + object.condition = ""; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.ruleId != null && message.hasOwnProperty("ruleId")) + object.ruleId = message.ruleId; + if (message.triggerType != null && message.hasOwnProperty("triggerType")) + object.triggerType = options.enums === String ? $root.google.cloud.contentwarehouse.v1.Rule.TriggerType[message.triggerType] === undefined ? message.triggerType : $root.google.cloud.contentwarehouse.v1.Rule.TriggerType[message.triggerType] : message.triggerType; + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = message.condition; + if (message.actions && message.actions.length) { + object.actions = []; + for (var j = 0; j < message.actions.length; ++j) + object.actions[j] = $root.google.cloud.contentwarehouse.v1.Action.toObject(message.actions[j], options); + } + return object; + }; + + /** + * Converts this Rule to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.Rule + * @instance + * @returns {Object.} JSON object + */ + Rule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Rule + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.Rule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Rule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.Rule"; + }; + + /** + * TriggerType enum. + * @name google.cloud.contentwarehouse.v1.Rule.TriggerType + * @enum {number} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} ON_CREATE=1 ON_CREATE value + * @property {number} ON_UPDATE=4 ON_UPDATE value + * @property {number} ON_CREATE_LINK=7 ON_CREATE_LINK value + * @property {number} ON_DELETE_LINK=8 ON_DELETE_LINK value + */ + Rule.TriggerType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "ON_CREATE"] = 1; + values[valuesById[4] = "ON_UPDATE"] = 4; + values[valuesById[7] = "ON_CREATE_LINK"] = 7; + values[valuesById[8] = "ON_DELETE_LINK"] = 8; + return values; + })(); + + return Rule; + })(); + + v1.Action = (function() { + + /** + * Properties of an Action. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IAction + * @property {string|null} [actionId] Action actionId + * @property {google.cloud.contentwarehouse.v1.IAccessControlAction|null} [accessControl] Action accessControl + * @property {google.cloud.contentwarehouse.v1.IDataValidationAction|null} [dataValidation] Action dataValidation + * @property {google.cloud.contentwarehouse.v1.IDataUpdateAction|null} [dataUpdate] Action dataUpdate + * @property {google.cloud.contentwarehouse.v1.IAddToFolderAction|null} [addToFolder] Action addToFolder + * @property {google.cloud.contentwarehouse.v1.IPublishAction|null} [publishToPubSub] Action publishToPubSub + * @property {google.cloud.contentwarehouse.v1.IRemoveFromFolderAction|null} [removeFromFolderAction] Action removeFromFolderAction + * @property {google.cloud.contentwarehouse.v1.IDeleteDocumentAction|null} [deleteDocumentAction] Action deleteDocumentAction + */ + + /** + * Constructs a new Action. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents an Action. + * @implements IAction + * @constructor + * @param {google.cloud.contentwarehouse.v1.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 actionId. + * @member {string} actionId + * @memberof google.cloud.contentwarehouse.v1.Action + * @instance + */ + Action.prototype.actionId = ""; + + /** + * Action accessControl. + * @member {google.cloud.contentwarehouse.v1.IAccessControlAction|null|undefined} accessControl + * @memberof google.cloud.contentwarehouse.v1.Action + * @instance + */ + Action.prototype.accessControl = null; + + /** + * Action dataValidation. + * @member {google.cloud.contentwarehouse.v1.IDataValidationAction|null|undefined} dataValidation + * @memberof google.cloud.contentwarehouse.v1.Action + * @instance + */ + Action.prototype.dataValidation = null; + + /** + * Action dataUpdate. + * @member {google.cloud.contentwarehouse.v1.IDataUpdateAction|null|undefined} dataUpdate + * @memberof google.cloud.contentwarehouse.v1.Action + * @instance + */ + Action.prototype.dataUpdate = null; + + /** + * Action addToFolder. + * @member {google.cloud.contentwarehouse.v1.IAddToFolderAction|null|undefined} addToFolder + * @memberof google.cloud.contentwarehouse.v1.Action + * @instance + */ + Action.prototype.addToFolder = null; + + /** + * Action publishToPubSub. + * @member {google.cloud.contentwarehouse.v1.IPublishAction|null|undefined} publishToPubSub + * @memberof google.cloud.contentwarehouse.v1.Action + * @instance + */ + Action.prototype.publishToPubSub = null; + + /** + * Action removeFromFolderAction. + * @member {google.cloud.contentwarehouse.v1.IRemoveFromFolderAction|null|undefined} removeFromFolderAction + * @memberof google.cloud.contentwarehouse.v1.Action + * @instance + */ + Action.prototype.removeFromFolderAction = null; + + /** + * Action deleteDocumentAction. + * @member {google.cloud.contentwarehouse.v1.IDeleteDocumentAction|null|undefined} deleteDocumentAction + * @memberof google.cloud.contentwarehouse.v1.Action + * @instance + */ + Action.prototype.deleteDocumentAction = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Action action. + * @member {"accessControl"|"dataValidation"|"dataUpdate"|"addToFolder"|"publishToPubSub"|"removeFromFolderAction"|"deleteDocumentAction"|undefined} action + * @memberof google.cloud.contentwarehouse.v1.Action + * @instance + */ + Object.defineProperty(Action.prototype, "action", { + get: $util.oneOfGetter($oneOfFields = ["accessControl", "dataValidation", "dataUpdate", "addToFolder", "publishToPubSub", "removeFromFolderAction", "deleteDocumentAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Action instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.Action + * @static + * @param {google.cloud.contentwarehouse.v1.IAction=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.Action} Action instance + */ + Action.create = function create(properties) { + return new Action(properties); + }; + + /** + * Encodes the specified Action message. Does not implicitly {@link google.cloud.contentwarehouse.v1.Action.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.Action + * @static + * @param {google.cloud.contentwarehouse.v1.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.actionId != null && Object.hasOwnProperty.call(message, "actionId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.actionId); + if (message.accessControl != null && Object.hasOwnProperty.call(message, "accessControl")) + $root.google.cloud.contentwarehouse.v1.AccessControlAction.encode(message.accessControl, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.dataValidation != null && Object.hasOwnProperty.call(message, "dataValidation")) + $root.google.cloud.contentwarehouse.v1.DataValidationAction.encode(message.dataValidation, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.dataUpdate != null && Object.hasOwnProperty.call(message, "dataUpdate")) + $root.google.cloud.contentwarehouse.v1.DataUpdateAction.encode(message.dataUpdate, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.addToFolder != null && Object.hasOwnProperty.call(message, "addToFolder")) + $root.google.cloud.contentwarehouse.v1.AddToFolderAction.encode(message.addToFolder, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.publishToPubSub != null && Object.hasOwnProperty.call(message, "publishToPubSub")) + $root.google.cloud.contentwarehouse.v1.PublishAction.encode(message.publishToPubSub, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.removeFromFolderAction != null && Object.hasOwnProperty.call(message, "removeFromFolderAction")) + $root.google.cloud.contentwarehouse.v1.RemoveFromFolderAction.encode(message.removeFromFolderAction, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.deleteDocumentAction != null && Object.hasOwnProperty.call(message, "deleteDocumentAction")) + $root.google.cloud.contentwarehouse.v1.DeleteDocumentAction.encode(message.deleteDocumentAction, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Action message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.Action.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.Action + * @static + * @param {google.cloud.contentwarehouse.v1.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.cloud.contentwarehouse.v1.Action + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.Action(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.actionId = reader.string(); + break; + } + case 2: { + message.accessControl = $root.google.cloud.contentwarehouse.v1.AccessControlAction.decode(reader, reader.uint32()); + break; + } + case 3: { + message.dataValidation = $root.google.cloud.contentwarehouse.v1.DataValidationAction.decode(reader, reader.uint32()); + break; + } + case 4: { + message.dataUpdate = $root.google.cloud.contentwarehouse.v1.DataUpdateAction.decode(reader, reader.uint32()); + break; + } + case 5: { + message.addToFolder = $root.google.cloud.contentwarehouse.v1.AddToFolderAction.decode(reader, reader.uint32()); + break; + } + case 6: { + message.publishToPubSub = $root.google.cloud.contentwarehouse.v1.PublishAction.decode(reader, reader.uint32()); + break; + } + case 9: { + message.removeFromFolderAction = $root.google.cloud.contentwarehouse.v1.RemoveFromFolderAction.decode(reader, reader.uint32()); + break; + } + case 10: { + message.deleteDocumentAction = $root.google.cloud.contentwarehouse.v1.DeleteDocumentAction.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.cloud.contentwarehouse.v1.Action + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.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.cloud.contentwarehouse.v1.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.actionId != null && message.hasOwnProperty("actionId")) + if (!$util.isString(message.actionId)) + return "actionId: string expected"; + if (message.accessControl != null && message.hasOwnProperty("accessControl")) { + properties.action = 1; + { + var error = $root.google.cloud.contentwarehouse.v1.AccessControlAction.verify(message.accessControl); + if (error) + return "accessControl." + error; + } + } + if (message.dataValidation != null && message.hasOwnProperty("dataValidation")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.contentwarehouse.v1.DataValidationAction.verify(message.dataValidation); + if (error) + return "dataValidation." + error; + } + } + if (message.dataUpdate != null && message.hasOwnProperty("dataUpdate")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.contentwarehouse.v1.DataUpdateAction.verify(message.dataUpdate); + if (error) + return "dataUpdate." + error; + } + } + if (message.addToFolder != null && message.hasOwnProperty("addToFolder")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.contentwarehouse.v1.AddToFolderAction.verify(message.addToFolder); + if (error) + return "addToFolder." + error; + } + } + if (message.publishToPubSub != null && message.hasOwnProperty("publishToPubSub")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.contentwarehouse.v1.PublishAction.verify(message.publishToPubSub); + if (error) + return "publishToPubSub." + error; + } + } + if (message.removeFromFolderAction != null && message.hasOwnProperty("removeFromFolderAction")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.contentwarehouse.v1.RemoveFromFolderAction.verify(message.removeFromFolderAction); + if (error) + return "removeFromFolderAction." + error; + } + } + if (message.deleteDocumentAction != null && message.hasOwnProperty("deleteDocumentAction")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.contentwarehouse.v1.DeleteDocumentAction.verify(message.deleteDocumentAction); + if (error) + return "deleteDocumentAction." + error; + } + } + return null; + }; + + /** + * Creates an Action message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.Action + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.Action} Action + */ + Action.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.Action) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.Action(); + if (object.actionId != null) + message.actionId = String(object.actionId); + if (object.accessControl != null) { + if (typeof object.accessControl !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.Action.accessControl: object expected"); + message.accessControl = $root.google.cloud.contentwarehouse.v1.AccessControlAction.fromObject(object.accessControl); + } + if (object.dataValidation != null) { + if (typeof object.dataValidation !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.Action.dataValidation: object expected"); + message.dataValidation = $root.google.cloud.contentwarehouse.v1.DataValidationAction.fromObject(object.dataValidation); + } + if (object.dataUpdate != null) { + if (typeof object.dataUpdate !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.Action.dataUpdate: object expected"); + message.dataUpdate = $root.google.cloud.contentwarehouse.v1.DataUpdateAction.fromObject(object.dataUpdate); + } + if (object.addToFolder != null) { + if (typeof object.addToFolder !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.Action.addToFolder: object expected"); + message.addToFolder = $root.google.cloud.contentwarehouse.v1.AddToFolderAction.fromObject(object.addToFolder); + } + if (object.publishToPubSub != null) { + if (typeof object.publishToPubSub !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.Action.publishToPubSub: object expected"); + message.publishToPubSub = $root.google.cloud.contentwarehouse.v1.PublishAction.fromObject(object.publishToPubSub); + } + if (object.removeFromFolderAction != null) { + if (typeof object.removeFromFolderAction !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.Action.removeFromFolderAction: object expected"); + message.removeFromFolderAction = $root.google.cloud.contentwarehouse.v1.RemoveFromFolderAction.fromObject(object.removeFromFolderAction); + } + if (object.deleteDocumentAction != null) { + if (typeof object.deleteDocumentAction !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.Action.deleteDocumentAction: object expected"); + message.deleteDocumentAction = $root.google.cloud.contentwarehouse.v1.DeleteDocumentAction.fromObject(object.deleteDocumentAction); + } + return message; + }; + + /** + * Creates a plain object from an Action message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.Action + * @static + * @param {google.cloud.contentwarehouse.v1.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 (options.defaults) + object.actionId = ""; + if (message.actionId != null && message.hasOwnProperty("actionId")) + object.actionId = message.actionId; + if (message.accessControl != null && message.hasOwnProperty("accessControl")) { + object.accessControl = $root.google.cloud.contentwarehouse.v1.AccessControlAction.toObject(message.accessControl, options); + if (options.oneofs) + object.action = "accessControl"; + } + if (message.dataValidation != null && message.hasOwnProperty("dataValidation")) { + object.dataValidation = $root.google.cloud.contentwarehouse.v1.DataValidationAction.toObject(message.dataValidation, options); + if (options.oneofs) + object.action = "dataValidation"; + } + if (message.dataUpdate != null && message.hasOwnProperty("dataUpdate")) { + object.dataUpdate = $root.google.cloud.contentwarehouse.v1.DataUpdateAction.toObject(message.dataUpdate, options); + if (options.oneofs) + object.action = "dataUpdate"; + } + if (message.addToFolder != null && message.hasOwnProperty("addToFolder")) { + object.addToFolder = $root.google.cloud.contentwarehouse.v1.AddToFolderAction.toObject(message.addToFolder, options); + if (options.oneofs) + object.action = "addToFolder"; + } + if (message.publishToPubSub != null && message.hasOwnProperty("publishToPubSub")) { + object.publishToPubSub = $root.google.cloud.contentwarehouse.v1.PublishAction.toObject(message.publishToPubSub, options); + if (options.oneofs) + object.action = "publishToPubSub"; + } + if (message.removeFromFolderAction != null && message.hasOwnProperty("removeFromFolderAction")) { + object.removeFromFolderAction = $root.google.cloud.contentwarehouse.v1.RemoveFromFolderAction.toObject(message.removeFromFolderAction, options); + if (options.oneofs) + object.action = "removeFromFolderAction"; + } + if (message.deleteDocumentAction != null && message.hasOwnProperty("deleteDocumentAction")) { + object.deleteDocumentAction = $root.google.cloud.contentwarehouse.v1.DeleteDocumentAction.toObject(message.deleteDocumentAction, options); + if (options.oneofs) + object.action = "deleteDocumentAction"; + } + return object; + }; + + /** + * Converts this Action to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.Action + * @instance + * @returns {Object.} JSON object + */ + Action.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Action + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.Action + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Action.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.Action"; + }; + + return Action; + })(); + + v1.AccessControlAction = (function() { + + /** + * Properties of an AccessControlAction. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IAccessControlAction + * @property {google.cloud.contentwarehouse.v1.AccessControlAction.OperationType|null} [operationType] AccessControlAction operationType + * @property {google.iam.v1.IPolicy|null} [policy] AccessControlAction policy + */ + + /** + * Constructs a new AccessControlAction. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents an AccessControlAction. + * @implements IAccessControlAction + * @constructor + * @param {google.cloud.contentwarehouse.v1.IAccessControlAction=} [properties] Properties to set + */ + function AccessControlAction(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]]; + } + + /** + * AccessControlAction operationType. + * @member {google.cloud.contentwarehouse.v1.AccessControlAction.OperationType} operationType + * @memberof google.cloud.contentwarehouse.v1.AccessControlAction + * @instance + */ + AccessControlAction.prototype.operationType = 0; + + /** + * AccessControlAction policy. + * @member {google.iam.v1.IPolicy|null|undefined} policy + * @memberof google.cloud.contentwarehouse.v1.AccessControlAction + * @instance + */ + AccessControlAction.prototype.policy = null; + + /** + * Creates a new AccessControlAction instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.AccessControlAction + * @static + * @param {google.cloud.contentwarehouse.v1.IAccessControlAction=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.AccessControlAction} AccessControlAction instance + */ + AccessControlAction.create = function create(properties) { + return new AccessControlAction(properties); + }; + + /** + * Encodes the specified AccessControlAction message. Does not implicitly {@link google.cloud.contentwarehouse.v1.AccessControlAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.AccessControlAction + * @static + * @param {google.cloud.contentwarehouse.v1.IAccessControlAction} message AccessControlAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessControlAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operationType != null && Object.hasOwnProperty.call(message, "operationType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.operationType); + if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) + $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AccessControlAction message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.AccessControlAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.AccessControlAction + * @static + * @param {google.cloud.contentwarehouse.v1.IAccessControlAction} message AccessControlAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessControlAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AccessControlAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.AccessControlAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.AccessControlAction} AccessControlAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessControlAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.AccessControlAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.operationType = reader.int32(); + break; + } + case 2: { + message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AccessControlAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.AccessControlAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.AccessControlAction} AccessControlAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessControlAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AccessControlAction message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.AccessControlAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccessControlAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operationType != null && message.hasOwnProperty("operationType")) + switch (message.operationType) { + default: + return "operationType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.policy != null && message.hasOwnProperty("policy")) { + var error = $root.google.iam.v1.Policy.verify(message.policy); + if (error) + return "policy." + error; + } + return null; + }; + + /** + * Creates an AccessControlAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.AccessControlAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.AccessControlAction} AccessControlAction + */ + AccessControlAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.AccessControlAction) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.AccessControlAction(); + switch (object.operationType) { + default: + if (typeof object.operationType === "number") { + message.operationType = object.operationType; + break; + } + break; + case "UNKNOWN": + case 0: + message.operationType = 0; + break; + case "ADD_POLICY_BINDING": + case 1: + message.operationType = 1; + break; + case "REMOVE_POLICY_BINDING": + case 2: + message.operationType = 2; + break; + case "REPLACE_POLICY_BINDING": + case 3: + message.operationType = 3; + break; + } + if (object.policy != null) { + if (typeof object.policy !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.AccessControlAction.policy: object expected"); + message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); + } + return message; + }; + + /** + * Creates a plain object from an AccessControlAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.AccessControlAction + * @static + * @param {google.cloud.contentwarehouse.v1.AccessControlAction} message AccessControlAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccessControlAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.operationType = options.enums === String ? "UNKNOWN" : 0; + object.policy = null; + } + if (message.operationType != null && message.hasOwnProperty("operationType")) + object.operationType = options.enums === String ? $root.google.cloud.contentwarehouse.v1.AccessControlAction.OperationType[message.operationType] === undefined ? message.operationType : $root.google.cloud.contentwarehouse.v1.AccessControlAction.OperationType[message.operationType] : message.operationType; + if (message.policy != null && message.hasOwnProperty("policy")) + object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); + return object; + }; + + /** + * Converts this AccessControlAction to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.AccessControlAction + * @instance + * @returns {Object.} JSON object + */ + AccessControlAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AccessControlAction + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.AccessControlAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccessControlAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.AccessControlAction"; + }; + + /** + * OperationType enum. + * @name google.cloud.contentwarehouse.v1.AccessControlAction.OperationType + * @enum {number} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} ADD_POLICY_BINDING=1 ADD_POLICY_BINDING value + * @property {number} REMOVE_POLICY_BINDING=2 REMOVE_POLICY_BINDING value + * @property {number} REPLACE_POLICY_BINDING=3 REPLACE_POLICY_BINDING value + */ + AccessControlAction.OperationType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "ADD_POLICY_BINDING"] = 1; + values[valuesById[2] = "REMOVE_POLICY_BINDING"] = 2; + values[valuesById[3] = "REPLACE_POLICY_BINDING"] = 3; + return values; + })(); + + return AccessControlAction; + })(); + + v1.DataValidationAction = (function() { + + /** + * Properties of a DataValidationAction. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IDataValidationAction + * @property {Object.|null} [conditions] DataValidationAction conditions + */ + + /** + * Constructs a new DataValidationAction. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a DataValidationAction. + * @implements IDataValidationAction + * @constructor + * @param {google.cloud.contentwarehouse.v1.IDataValidationAction=} [properties] Properties to set + */ + function DataValidationAction(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]]; + } + + /** + * DataValidationAction conditions. + * @member {Object.} conditions + * @memberof google.cloud.contentwarehouse.v1.DataValidationAction + * @instance + */ + DataValidationAction.prototype.conditions = $util.emptyObject; + + /** + * Creates a new DataValidationAction instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.DataValidationAction + * @static + * @param {google.cloud.contentwarehouse.v1.IDataValidationAction=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.DataValidationAction} DataValidationAction instance + */ + DataValidationAction.create = function create(properties) { + return new DataValidationAction(properties); + }; + + /** + * Encodes the specified DataValidationAction message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DataValidationAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.DataValidationAction + * @static + * @param {google.cloud.contentwarehouse.v1.IDataValidationAction} message DataValidationAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataValidationAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.conditions != null && Object.hasOwnProperty.call(message, "conditions")) + for (var keys = Object.keys(message.conditions), i = 0; i < keys.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.conditions[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified DataValidationAction message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DataValidationAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.DataValidationAction + * @static + * @param {google.cloud.contentwarehouse.v1.IDataValidationAction} message DataValidationAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataValidationAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataValidationAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.DataValidationAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.DataValidationAction} DataValidationAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataValidationAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.DataValidationAction(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (message.conditions === $util.emptyObject) + message.conditions = {}; + 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.conditions[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataValidationAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.DataValidationAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.DataValidationAction} DataValidationAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataValidationAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataValidationAction message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.DataValidationAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataValidationAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.conditions != null && message.hasOwnProperty("conditions")) { + if (!$util.isObject(message.conditions)) + return "conditions: object expected"; + var key = Object.keys(message.conditions); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.conditions[key[i]])) + return "conditions: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a DataValidationAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.DataValidationAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.DataValidationAction} DataValidationAction + */ + DataValidationAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.DataValidationAction) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.DataValidationAction(); + if (object.conditions) { + if (typeof object.conditions !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.DataValidationAction.conditions: object expected"); + message.conditions = {}; + for (var keys = Object.keys(object.conditions), i = 0; i < keys.length; ++i) + message.conditions[keys[i]] = String(object.conditions[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a DataValidationAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.DataValidationAction + * @static + * @param {google.cloud.contentwarehouse.v1.DataValidationAction} message DataValidationAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataValidationAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.conditions = {}; + var keys2; + if (message.conditions && (keys2 = Object.keys(message.conditions)).length) { + object.conditions = {}; + for (var j = 0; j < keys2.length; ++j) + object.conditions[keys2[j]] = message.conditions[keys2[j]]; + } + return object; + }; + + /** + * Converts this DataValidationAction to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.DataValidationAction + * @instance + * @returns {Object.} JSON object + */ + DataValidationAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataValidationAction + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.DataValidationAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataValidationAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.DataValidationAction"; + }; + + return DataValidationAction; + })(); + + v1.DataUpdateAction = (function() { + + /** + * Properties of a DataUpdateAction. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IDataUpdateAction + * @property {Object.|null} [entries] DataUpdateAction entries + */ + + /** + * Constructs a new DataUpdateAction. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a DataUpdateAction. + * @implements IDataUpdateAction + * @constructor + * @param {google.cloud.contentwarehouse.v1.IDataUpdateAction=} [properties] Properties to set + */ + function DataUpdateAction(properties) { + this.entries = {}; + 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]]; + } + + /** + * DataUpdateAction entries. + * @member {Object.} entries + * @memberof google.cloud.contentwarehouse.v1.DataUpdateAction + * @instance + */ + DataUpdateAction.prototype.entries = $util.emptyObject; + + /** + * Creates a new DataUpdateAction instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.DataUpdateAction + * @static + * @param {google.cloud.contentwarehouse.v1.IDataUpdateAction=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.DataUpdateAction} DataUpdateAction instance + */ + DataUpdateAction.create = function create(properties) { + return new DataUpdateAction(properties); + }; + + /** + * Encodes the specified DataUpdateAction message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DataUpdateAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.DataUpdateAction + * @static + * @param {google.cloud.contentwarehouse.v1.IDataUpdateAction} message DataUpdateAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataUpdateAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entries != null && Object.hasOwnProperty.call(message, "entries")) + for (var keys = Object.keys(message.entries), i = 0; i < keys.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.entries[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified DataUpdateAction message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DataUpdateAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.DataUpdateAction + * @static + * @param {google.cloud.contentwarehouse.v1.IDataUpdateAction} message DataUpdateAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataUpdateAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataUpdateAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.DataUpdateAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.DataUpdateAction} DataUpdateAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataUpdateAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.DataUpdateAction(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (message.entries === $util.emptyObject) + message.entries = {}; + 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.entries[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataUpdateAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.DataUpdateAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.DataUpdateAction} DataUpdateAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataUpdateAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataUpdateAction message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.DataUpdateAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataUpdateAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entries != null && message.hasOwnProperty("entries")) { + if (!$util.isObject(message.entries)) + return "entries: object expected"; + var key = Object.keys(message.entries); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.entries[key[i]])) + return "entries: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a DataUpdateAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.DataUpdateAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.DataUpdateAction} DataUpdateAction + */ + DataUpdateAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.DataUpdateAction) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.DataUpdateAction(); + if (object.entries) { + if (typeof object.entries !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.DataUpdateAction.entries: object expected"); + message.entries = {}; + for (var keys = Object.keys(object.entries), i = 0; i < keys.length; ++i) + message.entries[keys[i]] = String(object.entries[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a DataUpdateAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.DataUpdateAction + * @static + * @param {google.cloud.contentwarehouse.v1.DataUpdateAction} message DataUpdateAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataUpdateAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.entries = {}; + var keys2; + if (message.entries && (keys2 = Object.keys(message.entries)).length) { + object.entries = {}; + for (var j = 0; j < keys2.length; ++j) + object.entries[keys2[j]] = message.entries[keys2[j]]; + } + return object; + }; + + /** + * Converts this DataUpdateAction to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.DataUpdateAction + * @instance + * @returns {Object.} JSON object + */ + DataUpdateAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataUpdateAction + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.DataUpdateAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataUpdateAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.DataUpdateAction"; + }; + + return DataUpdateAction; + })(); + + v1.AddToFolderAction = (function() { + + /** + * Properties of an AddToFolderAction. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IAddToFolderAction + * @property {Array.|null} [folders] AddToFolderAction folders + */ + + /** + * Constructs a new AddToFolderAction. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents an AddToFolderAction. + * @implements IAddToFolderAction + * @constructor + * @param {google.cloud.contentwarehouse.v1.IAddToFolderAction=} [properties] Properties to set + */ + function AddToFolderAction(properties) { + this.folders = []; + 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]]; + } + + /** + * AddToFolderAction folders. + * @member {Array.} folders + * @memberof google.cloud.contentwarehouse.v1.AddToFolderAction + * @instance + */ + AddToFolderAction.prototype.folders = $util.emptyArray; + + /** + * Creates a new AddToFolderAction instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.AddToFolderAction + * @static + * @param {google.cloud.contentwarehouse.v1.IAddToFolderAction=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.AddToFolderAction} AddToFolderAction instance + */ + AddToFolderAction.create = function create(properties) { + return new AddToFolderAction(properties); + }; + + /** + * Encodes the specified AddToFolderAction message. Does not implicitly {@link google.cloud.contentwarehouse.v1.AddToFolderAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.AddToFolderAction + * @static + * @param {google.cloud.contentwarehouse.v1.IAddToFolderAction} message AddToFolderAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddToFolderAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.folders != null && message.folders.length) + for (var i = 0; i < message.folders.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.folders[i]); + return writer; + }; + + /** + * Encodes the specified AddToFolderAction message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.AddToFolderAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.AddToFolderAction + * @static + * @param {google.cloud.contentwarehouse.v1.IAddToFolderAction} message AddToFolderAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddToFolderAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AddToFolderAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.AddToFolderAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.AddToFolderAction} AddToFolderAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddToFolderAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.AddToFolderAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.folders && message.folders.length)) + message.folders = []; + message.folders.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AddToFolderAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.AddToFolderAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.AddToFolderAction} AddToFolderAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddToFolderAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AddToFolderAction message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.AddToFolderAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AddToFolderAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.folders != null && message.hasOwnProperty("folders")) { + if (!Array.isArray(message.folders)) + return "folders: array expected"; + for (var i = 0; i < message.folders.length; ++i) + if (!$util.isString(message.folders[i])) + return "folders: string[] expected"; + } + return null; + }; + + /** + * Creates an AddToFolderAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.AddToFolderAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.AddToFolderAction} AddToFolderAction + */ + AddToFolderAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.AddToFolderAction) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.AddToFolderAction(); + if (object.folders) { + if (!Array.isArray(object.folders)) + throw TypeError(".google.cloud.contentwarehouse.v1.AddToFolderAction.folders: array expected"); + message.folders = []; + for (var i = 0; i < object.folders.length; ++i) + message.folders[i] = String(object.folders[i]); + } + return message; + }; + + /** + * Creates a plain object from an AddToFolderAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.AddToFolderAction + * @static + * @param {google.cloud.contentwarehouse.v1.AddToFolderAction} message AddToFolderAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AddToFolderAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.folders = []; + if (message.folders && message.folders.length) { + object.folders = []; + for (var j = 0; j < message.folders.length; ++j) + object.folders[j] = message.folders[j]; + } + return object; + }; + + /** + * Converts this AddToFolderAction to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.AddToFolderAction + * @instance + * @returns {Object.} JSON object + */ + AddToFolderAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AddToFolderAction + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.AddToFolderAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AddToFolderAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.AddToFolderAction"; + }; + + return AddToFolderAction; + })(); + + v1.RemoveFromFolderAction = (function() { + + /** + * Properties of a RemoveFromFolderAction. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IRemoveFromFolderAction + * @property {string|null} [condition] RemoveFromFolderAction condition + * @property {string|null} [folder] RemoveFromFolderAction folder + */ + + /** + * Constructs a new RemoveFromFolderAction. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a RemoveFromFolderAction. + * @implements IRemoveFromFolderAction + * @constructor + * @param {google.cloud.contentwarehouse.v1.IRemoveFromFolderAction=} [properties] Properties to set + */ + function RemoveFromFolderAction(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]]; + } + + /** + * RemoveFromFolderAction condition. + * @member {string} condition + * @memberof google.cloud.contentwarehouse.v1.RemoveFromFolderAction + * @instance + */ + RemoveFromFolderAction.prototype.condition = ""; + + /** + * RemoveFromFolderAction folder. + * @member {string} folder + * @memberof google.cloud.contentwarehouse.v1.RemoveFromFolderAction + * @instance + */ + RemoveFromFolderAction.prototype.folder = ""; + + /** + * Creates a new RemoveFromFolderAction instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.RemoveFromFolderAction + * @static + * @param {google.cloud.contentwarehouse.v1.IRemoveFromFolderAction=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.RemoveFromFolderAction} RemoveFromFolderAction instance + */ + RemoveFromFolderAction.create = function create(properties) { + return new RemoveFromFolderAction(properties); + }; + + /** + * Encodes the specified RemoveFromFolderAction message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RemoveFromFolderAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.RemoveFromFolderAction + * @static + * @param {google.cloud.contentwarehouse.v1.IRemoveFromFolderAction} message RemoveFromFolderAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveFromFolderAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.condition); + if (message.folder != null && Object.hasOwnProperty.call(message, "folder")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.folder); + return writer; + }; + + /** + * Encodes the specified RemoveFromFolderAction message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RemoveFromFolderAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.RemoveFromFolderAction + * @static + * @param {google.cloud.contentwarehouse.v1.IRemoveFromFolderAction} message RemoveFromFolderAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveFromFolderAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RemoveFromFolderAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.RemoveFromFolderAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.RemoveFromFolderAction} RemoveFromFolderAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveFromFolderAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.RemoveFromFolderAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.condition = reader.string(); + break; + } + case 2: { + message.folder = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RemoveFromFolderAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.RemoveFromFolderAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.RemoveFromFolderAction} RemoveFromFolderAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveFromFolderAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RemoveFromFolderAction message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.RemoveFromFolderAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RemoveFromFolderAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.condition != null && message.hasOwnProperty("condition")) + if (!$util.isString(message.condition)) + return "condition: string expected"; + if (message.folder != null && message.hasOwnProperty("folder")) + if (!$util.isString(message.folder)) + return "folder: string expected"; + return null; + }; + + /** + * Creates a RemoveFromFolderAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.RemoveFromFolderAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.RemoveFromFolderAction} RemoveFromFolderAction + */ + RemoveFromFolderAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.RemoveFromFolderAction) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.RemoveFromFolderAction(); + if (object.condition != null) + message.condition = String(object.condition); + if (object.folder != null) + message.folder = String(object.folder); + return message; + }; + + /** + * Creates a plain object from a RemoveFromFolderAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.RemoveFromFolderAction + * @static + * @param {google.cloud.contentwarehouse.v1.RemoveFromFolderAction} message RemoveFromFolderAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RemoveFromFolderAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.condition = ""; + object.folder = ""; + } + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = message.condition; + if (message.folder != null && message.hasOwnProperty("folder")) + object.folder = message.folder; + return object; + }; + + /** + * Converts this RemoveFromFolderAction to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.RemoveFromFolderAction + * @instance + * @returns {Object.} JSON object + */ + RemoveFromFolderAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RemoveFromFolderAction + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.RemoveFromFolderAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RemoveFromFolderAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.RemoveFromFolderAction"; + }; + + return RemoveFromFolderAction; + })(); + + v1.PublishAction = (function() { + + /** + * Properties of a PublishAction. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IPublishAction + * @property {string|null} [topicId] PublishAction topicId + * @property {Array.|null} [messages] PublishAction messages + */ + + /** + * Constructs a new PublishAction. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a PublishAction. + * @implements IPublishAction + * @constructor + * @param {google.cloud.contentwarehouse.v1.IPublishAction=} [properties] Properties to set + */ + function PublishAction(properties) { + this.messages = []; + 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]]; + } + + /** + * PublishAction topicId. + * @member {string} topicId + * @memberof google.cloud.contentwarehouse.v1.PublishAction + * @instance + */ + PublishAction.prototype.topicId = ""; + + /** + * PublishAction messages. + * @member {Array.} messages + * @memberof google.cloud.contentwarehouse.v1.PublishAction + * @instance + */ + PublishAction.prototype.messages = $util.emptyArray; + + /** + * Creates a new PublishAction instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.PublishAction + * @static + * @param {google.cloud.contentwarehouse.v1.IPublishAction=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.PublishAction} PublishAction instance + */ + PublishAction.create = function create(properties) { + return new PublishAction(properties); + }; + + /** + * Encodes the specified PublishAction message. Does not implicitly {@link google.cloud.contentwarehouse.v1.PublishAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.PublishAction + * @static + * @param {google.cloud.contentwarehouse.v1.IPublishAction} message PublishAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublishAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.topicId != null && Object.hasOwnProperty.call(message, "topicId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.topicId); + if (message.messages != null && message.messages.length) + for (var i = 0; i < message.messages.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.messages[i]); + return writer; + }; + + /** + * Encodes the specified PublishAction message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.PublishAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.PublishAction + * @static + * @param {google.cloud.contentwarehouse.v1.IPublishAction} message PublishAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublishAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PublishAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.PublishAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.PublishAction} PublishAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublishAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.PublishAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.topicId = reader.string(); + break; + } + case 2: { + if (!(message.messages && message.messages.length)) + message.messages = []; + message.messages.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PublishAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.PublishAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.PublishAction} PublishAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublishAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PublishAction message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.PublishAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PublishAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.topicId != null && message.hasOwnProperty("topicId")) + if (!$util.isString(message.topicId)) + return "topicId: string expected"; + if (message.messages != null && message.hasOwnProperty("messages")) { + if (!Array.isArray(message.messages)) + return "messages: array expected"; + for (var i = 0; i < message.messages.length; ++i) + if (!$util.isString(message.messages[i])) + return "messages: string[] expected"; + } + return null; + }; + + /** + * Creates a PublishAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.PublishAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.PublishAction} PublishAction + */ + PublishAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.PublishAction) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.PublishAction(); + if (object.topicId != null) + message.topicId = String(object.topicId); + if (object.messages) { + if (!Array.isArray(object.messages)) + throw TypeError(".google.cloud.contentwarehouse.v1.PublishAction.messages: array expected"); + message.messages = []; + for (var i = 0; i < object.messages.length; ++i) + message.messages[i] = String(object.messages[i]); + } + return message; + }; + + /** + * Creates a plain object from a PublishAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.PublishAction + * @static + * @param {google.cloud.contentwarehouse.v1.PublishAction} message PublishAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PublishAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.messages = []; + if (options.defaults) + object.topicId = ""; + if (message.topicId != null && message.hasOwnProperty("topicId")) + object.topicId = message.topicId; + if (message.messages && message.messages.length) { + object.messages = []; + for (var j = 0; j < message.messages.length; ++j) + object.messages[j] = message.messages[j]; + } + return object; + }; + + /** + * Converts this PublishAction to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.PublishAction + * @instance + * @returns {Object.} JSON object + */ + PublishAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PublishAction + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.PublishAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PublishAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.PublishAction"; + }; + + return PublishAction; + })(); + + v1.DeleteDocumentAction = (function() { + + /** + * Properties of a DeleteDocumentAction. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IDeleteDocumentAction + * @property {boolean|null} [enableHardDelete] DeleteDocumentAction enableHardDelete + */ + + /** + * Constructs a new DeleteDocumentAction. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a DeleteDocumentAction. + * @implements IDeleteDocumentAction + * @constructor + * @param {google.cloud.contentwarehouse.v1.IDeleteDocumentAction=} [properties] Properties to set + */ + function DeleteDocumentAction(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]]; + } + + /** + * DeleteDocumentAction enableHardDelete. + * @member {boolean} enableHardDelete + * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentAction + * @instance + */ + DeleteDocumentAction.prototype.enableHardDelete = false; + + /** + * Creates a new DeleteDocumentAction instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentAction + * @static + * @param {google.cloud.contentwarehouse.v1.IDeleteDocumentAction=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.DeleteDocumentAction} DeleteDocumentAction instance + */ + DeleteDocumentAction.create = function create(properties) { + return new DeleteDocumentAction(properties); + }; + + /** + * Encodes the specified DeleteDocumentAction message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DeleteDocumentAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentAction + * @static + * @param {google.cloud.contentwarehouse.v1.IDeleteDocumentAction} message DeleteDocumentAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDocumentAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableHardDelete != null && Object.hasOwnProperty.call(message, "enableHardDelete")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableHardDelete); + return writer; + }; + + /** + * Encodes the specified DeleteDocumentAction message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DeleteDocumentAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentAction + * @static + * @param {google.cloud.contentwarehouse.v1.IDeleteDocumentAction} message DeleteDocumentAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDocumentAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteDocumentAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.DeleteDocumentAction} DeleteDocumentAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDocumentAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.DeleteDocumentAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enableHardDelete = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteDocumentAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.DeleteDocumentAction} DeleteDocumentAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDocumentAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteDocumentAction message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteDocumentAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enableHardDelete != null && message.hasOwnProperty("enableHardDelete")) + if (typeof message.enableHardDelete !== "boolean") + return "enableHardDelete: boolean expected"; + return null; + }; + + /** + * Creates a DeleteDocumentAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.DeleteDocumentAction} DeleteDocumentAction + */ + DeleteDocumentAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.DeleteDocumentAction) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.DeleteDocumentAction(); + if (object.enableHardDelete != null) + message.enableHardDelete = Boolean(object.enableHardDelete); + return message; + }; + + /** + * Creates a plain object from a DeleteDocumentAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentAction + * @static + * @param {google.cloud.contentwarehouse.v1.DeleteDocumentAction} message DeleteDocumentAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteDocumentAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.enableHardDelete = false; + if (message.enableHardDelete != null && message.hasOwnProperty("enableHardDelete")) + object.enableHardDelete = message.enableHardDelete; + return object; + }; + + /** + * Converts this DeleteDocumentAction to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentAction + * @instance + * @returns {Object.} JSON object + */ + DeleteDocumentAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteDocumentAction + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteDocumentAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.DeleteDocumentAction"; + }; + + return DeleteDocumentAction; + })(); + + v1.RuleEngineOutput = (function() { + + /** + * Properties of a RuleEngineOutput. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IRuleEngineOutput + * @property {string|null} [documentName] RuleEngineOutput documentName + * @property {google.cloud.contentwarehouse.v1.IRuleEvaluatorOutput|null} [ruleEvaluatorOutput] RuleEngineOutput ruleEvaluatorOutput + * @property {google.cloud.contentwarehouse.v1.IActionExecutorOutput|null} [actionExecutorOutput] RuleEngineOutput actionExecutorOutput + */ + + /** + * Constructs a new RuleEngineOutput. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a RuleEngineOutput. + * @implements IRuleEngineOutput + * @constructor + * @param {google.cloud.contentwarehouse.v1.IRuleEngineOutput=} [properties] Properties to set + */ + function RuleEngineOutput(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]]; + } + + /** + * RuleEngineOutput documentName. + * @member {string} documentName + * @memberof google.cloud.contentwarehouse.v1.RuleEngineOutput + * @instance + */ + RuleEngineOutput.prototype.documentName = ""; + + /** + * RuleEngineOutput ruleEvaluatorOutput. + * @member {google.cloud.contentwarehouse.v1.IRuleEvaluatorOutput|null|undefined} ruleEvaluatorOutput + * @memberof google.cloud.contentwarehouse.v1.RuleEngineOutput + * @instance + */ + RuleEngineOutput.prototype.ruleEvaluatorOutput = null; + + /** + * RuleEngineOutput actionExecutorOutput. + * @member {google.cloud.contentwarehouse.v1.IActionExecutorOutput|null|undefined} actionExecutorOutput + * @memberof google.cloud.contentwarehouse.v1.RuleEngineOutput + * @instance + */ + RuleEngineOutput.prototype.actionExecutorOutput = null; + + /** + * Creates a new RuleEngineOutput instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.RuleEngineOutput + * @static + * @param {google.cloud.contentwarehouse.v1.IRuleEngineOutput=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.RuleEngineOutput} RuleEngineOutput instance + */ + RuleEngineOutput.create = function create(properties) { + return new RuleEngineOutput(properties); + }; + + /** + * Encodes the specified RuleEngineOutput message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RuleEngineOutput.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.RuleEngineOutput + * @static + * @param {google.cloud.contentwarehouse.v1.IRuleEngineOutput} message RuleEngineOutput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RuleEngineOutput.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ruleEvaluatorOutput != null && Object.hasOwnProperty.call(message, "ruleEvaluatorOutput")) + $root.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput.encode(message.ruleEvaluatorOutput, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.actionExecutorOutput != null && Object.hasOwnProperty.call(message, "actionExecutorOutput")) + $root.google.cloud.contentwarehouse.v1.ActionExecutorOutput.encode(message.actionExecutorOutput, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.documentName != null && Object.hasOwnProperty.call(message, "documentName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.documentName); + return writer; + }; + + /** + * Encodes the specified RuleEngineOutput message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RuleEngineOutput.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.RuleEngineOutput + * @static + * @param {google.cloud.contentwarehouse.v1.IRuleEngineOutput} message RuleEngineOutput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RuleEngineOutput.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RuleEngineOutput message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.RuleEngineOutput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.RuleEngineOutput} RuleEngineOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RuleEngineOutput.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.RuleEngineOutput(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.documentName = reader.string(); + break; + } + case 1: { + message.ruleEvaluatorOutput = $root.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput.decode(reader, reader.uint32()); + break; + } + case 2: { + message.actionExecutorOutput = $root.google.cloud.contentwarehouse.v1.ActionExecutorOutput.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RuleEngineOutput message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.RuleEngineOutput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.RuleEngineOutput} RuleEngineOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RuleEngineOutput.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RuleEngineOutput message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.RuleEngineOutput + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RuleEngineOutput.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.documentName != null && message.hasOwnProperty("documentName")) + if (!$util.isString(message.documentName)) + return "documentName: string expected"; + if (message.ruleEvaluatorOutput != null && message.hasOwnProperty("ruleEvaluatorOutput")) { + var error = $root.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput.verify(message.ruleEvaluatorOutput); + if (error) + return "ruleEvaluatorOutput." + error; + } + if (message.actionExecutorOutput != null && message.hasOwnProperty("actionExecutorOutput")) { + var error = $root.google.cloud.contentwarehouse.v1.ActionExecutorOutput.verify(message.actionExecutorOutput); + if (error) + return "actionExecutorOutput." + error; + } + return null; + }; + + /** + * Creates a RuleEngineOutput message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.RuleEngineOutput + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.RuleEngineOutput} RuleEngineOutput + */ + RuleEngineOutput.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.RuleEngineOutput) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.RuleEngineOutput(); + if (object.documentName != null) + message.documentName = String(object.documentName); + if (object.ruleEvaluatorOutput != null) { + if (typeof object.ruleEvaluatorOutput !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.RuleEngineOutput.ruleEvaluatorOutput: object expected"); + message.ruleEvaluatorOutput = $root.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput.fromObject(object.ruleEvaluatorOutput); + } + if (object.actionExecutorOutput != null) { + if (typeof object.actionExecutorOutput !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.RuleEngineOutput.actionExecutorOutput: object expected"); + message.actionExecutorOutput = $root.google.cloud.contentwarehouse.v1.ActionExecutorOutput.fromObject(object.actionExecutorOutput); + } + return message; + }; + + /** + * Creates a plain object from a RuleEngineOutput message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.RuleEngineOutput + * @static + * @param {google.cloud.contentwarehouse.v1.RuleEngineOutput} message RuleEngineOutput + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RuleEngineOutput.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.ruleEvaluatorOutput = null; + object.actionExecutorOutput = null; + object.documentName = ""; + } + if (message.ruleEvaluatorOutput != null && message.hasOwnProperty("ruleEvaluatorOutput")) + object.ruleEvaluatorOutput = $root.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput.toObject(message.ruleEvaluatorOutput, options); + if (message.actionExecutorOutput != null && message.hasOwnProperty("actionExecutorOutput")) + object.actionExecutorOutput = $root.google.cloud.contentwarehouse.v1.ActionExecutorOutput.toObject(message.actionExecutorOutput, options); + if (message.documentName != null && message.hasOwnProperty("documentName")) + object.documentName = message.documentName; + return object; + }; + + /** + * Converts this RuleEngineOutput to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.RuleEngineOutput + * @instance + * @returns {Object.} JSON object + */ + RuleEngineOutput.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RuleEngineOutput + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.RuleEngineOutput + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RuleEngineOutput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.RuleEngineOutput"; + }; + + return RuleEngineOutput; + })(); + + v1.RuleEvaluatorOutput = (function() { + + /** + * Properties of a RuleEvaluatorOutput. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IRuleEvaluatorOutput + * @property {Array.|null} [triggeredRules] RuleEvaluatorOutput triggeredRules + * @property {Array.|null} [matchedRules] RuleEvaluatorOutput matchedRules + * @property {Array.|null} [invalidRules] RuleEvaluatorOutput invalidRules + */ + + /** + * Constructs a new RuleEvaluatorOutput. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a RuleEvaluatorOutput. + * @implements IRuleEvaluatorOutput + * @constructor + * @param {google.cloud.contentwarehouse.v1.IRuleEvaluatorOutput=} [properties] Properties to set + */ + function RuleEvaluatorOutput(properties) { + this.triggeredRules = []; + this.matchedRules = []; + this.invalidRules = []; + 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]]; + } + + /** + * RuleEvaluatorOutput triggeredRules. + * @member {Array.} triggeredRules + * @memberof google.cloud.contentwarehouse.v1.RuleEvaluatorOutput + * @instance + */ + RuleEvaluatorOutput.prototype.triggeredRules = $util.emptyArray; + + /** + * RuleEvaluatorOutput matchedRules. + * @member {Array.} matchedRules + * @memberof google.cloud.contentwarehouse.v1.RuleEvaluatorOutput + * @instance + */ + RuleEvaluatorOutput.prototype.matchedRules = $util.emptyArray; + + /** + * RuleEvaluatorOutput invalidRules. + * @member {Array.} invalidRules + * @memberof google.cloud.contentwarehouse.v1.RuleEvaluatorOutput + * @instance + */ + RuleEvaluatorOutput.prototype.invalidRules = $util.emptyArray; + + /** + * Creates a new RuleEvaluatorOutput instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.RuleEvaluatorOutput + * @static + * @param {google.cloud.contentwarehouse.v1.IRuleEvaluatorOutput=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.RuleEvaluatorOutput} RuleEvaluatorOutput instance + */ + RuleEvaluatorOutput.create = function create(properties) { + return new RuleEvaluatorOutput(properties); + }; + + /** + * Encodes the specified RuleEvaluatorOutput message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RuleEvaluatorOutput.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.RuleEvaluatorOutput + * @static + * @param {google.cloud.contentwarehouse.v1.IRuleEvaluatorOutput} message RuleEvaluatorOutput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RuleEvaluatorOutput.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.triggeredRules != null && message.triggeredRules.length) + for (var i = 0; i < message.triggeredRules.length; ++i) + $root.google.cloud.contentwarehouse.v1.Rule.encode(message.triggeredRules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.matchedRules != null && message.matchedRules.length) + for (var i = 0; i < message.matchedRules.length; ++i) + $root.google.cloud.contentwarehouse.v1.Rule.encode(message.matchedRules[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.invalidRules != null && message.invalidRules.length) + for (var i = 0; i < message.invalidRules.length; ++i) + $root.google.cloud.contentwarehouse.v1.InvalidRule.encode(message.invalidRules[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RuleEvaluatorOutput message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RuleEvaluatorOutput.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.RuleEvaluatorOutput + * @static + * @param {google.cloud.contentwarehouse.v1.IRuleEvaluatorOutput} message RuleEvaluatorOutput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RuleEvaluatorOutput.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RuleEvaluatorOutput message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.RuleEvaluatorOutput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.RuleEvaluatorOutput} RuleEvaluatorOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RuleEvaluatorOutput.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.triggeredRules && message.triggeredRules.length)) + message.triggeredRules = []; + message.triggeredRules.push($root.google.cloud.contentwarehouse.v1.Rule.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.matchedRules && message.matchedRules.length)) + message.matchedRules = []; + message.matchedRules.push($root.google.cloud.contentwarehouse.v1.Rule.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.invalidRules && message.invalidRules.length)) + message.invalidRules = []; + message.invalidRules.push($root.google.cloud.contentwarehouse.v1.InvalidRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RuleEvaluatorOutput message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.RuleEvaluatorOutput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.RuleEvaluatorOutput} RuleEvaluatorOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RuleEvaluatorOutput.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RuleEvaluatorOutput message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.RuleEvaluatorOutput + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RuleEvaluatorOutput.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.triggeredRules != null && message.hasOwnProperty("triggeredRules")) { + if (!Array.isArray(message.triggeredRules)) + return "triggeredRules: array expected"; + for (var i = 0; i < message.triggeredRules.length; ++i) { + var error = $root.google.cloud.contentwarehouse.v1.Rule.verify(message.triggeredRules[i]); + if (error) + return "triggeredRules." + error; + } + } + if (message.matchedRules != null && message.hasOwnProperty("matchedRules")) { + if (!Array.isArray(message.matchedRules)) + return "matchedRules: array expected"; + for (var i = 0; i < message.matchedRules.length; ++i) { + var error = $root.google.cloud.contentwarehouse.v1.Rule.verify(message.matchedRules[i]); + if (error) + return "matchedRules." + error; + } + } + if (message.invalidRules != null && message.hasOwnProperty("invalidRules")) { + if (!Array.isArray(message.invalidRules)) + return "invalidRules: array expected"; + for (var i = 0; i < message.invalidRules.length; ++i) { + var error = $root.google.cloud.contentwarehouse.v1.InvalidRule.verify(message.invalidRules[i]); + if (error) + return "invalidRules." + error; + } + } + return null; + }; + + /** + * Creates a RuleEvaluatorOutput message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.RuleEvaluatorOutput + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.RuleEvaluatorOutput} RuleEvaluatorOutput + */ + RuleEvaluatorOutput.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput(); + if (object.triggeredRules) { + if (!Array.isArray(object.triggeredRules)) + throw TypeError(".google.cloud.contentwarehouse.v1.RuleEvaluatorOutput.triggeredRules: array expected"); + message.triggeredRules = []; + for (var i = 0; i < object.triggeredRules.length; ++i) { + if (typeof object.triggeredRules[i] !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.RuleEvaluatorOutput.triggeredRules: object expected"); + message.triggeredRules[i] = $root.google.cloud.contentwarehouse.v1.Rule.fromObject(object.triggeredRules[i]); + } + } + if (object.matchedRules) { + if (!Array.isArray(object.matchedRules)) + throw TypeError(".google.cloud.contentwarehouse.v1.RuleEvaluatorOutput.matchedRules: array expected"); + message.matchedRules = []; + for (var i = 0; i < object.matchedRules.length; ++i) { + if (typeof object.matchedRules[i] !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.RuleEvaluatorOutput.matchedRules: object expected"); + message.matchedRules[i] = $root.google.cloud.contentwarehouse.v1.Rule.fromObject(object.matchedRules[i]); + } + } + if (object.invalidRules) { + if (!Array.isArray(object.invalidRules)) + throw TypeError(".google.cloud.contentwarehouse.v1.RuleEvaluatorOutput.invalidRules: array expected"); + message.invalidRules = []; + for (var i = 0; i < object.invalidRules.length; ++i) { + if (typeof object.invalidRules[i] !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.RuleEvaluatorOutput.invalidRules: object expected"); + message.invalidRules[i] = $root.google.cloud.contentwarehouse.v1.InvalidRule.fromObject(object.invalidRules[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RuleEvaluatorOutput message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.RuleEvaluatorOutput + * @static + * @param {google.cloud.contentwarehouse.v1.RuleEvaluatorOutput} message RuleEvaluatorOutput + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RuleEvaluatorOutput.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.triggeredRules = []; + object.matchedRules = []; + object.invalidRules = []; + } + if (message.triggeredRules && message.triggeredRules.length) { + object.triggeredRules = []; + for (var j = 0; j < message.triggeredRules.length; ++j) + object.triggeredRules[j] = $root.google.cloud.contentwarehouse.v1.Rule.toObject(message.triggeredRules[j], options); + } + if (message.matchedRules && message.matchedRules.length) { + object.matchedRules = []; + for (var j = 0; j < message.matchedRules.length; ++j) + object.matchedRules[j] = $root.google.cloud.contentwarehouse.v1.Rule.toObject(message.matchedRules[j], options); + } + if (message.invalidRules && message.invalidRules.length) { + object.invalidRules = []; + for (var j = 0; j < message.invalidRules.length; ++j) + object.invalidRules[j] = $root.google.cloud.contentwarehouse.v1.InvalidRule.toObject(message.invalidRules[j], options); + } + return object; + }; + + /** + * Converts this RuleEvaluatorOutput to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.RuleEvaluatorOutput + * @instance + * @returns {Object.} JSON object + */ + RuleEvaluatorOutput.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RuleEvaluatorOutput + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.RuleEvaluatorOutput + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RuleEvaluatorOutput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.RuleEvaluatorOutput"; + }; + + return RuleEvaluatorOutput; + })(); + + v1.InvalidRule = (function() { + + /** + * Properties of an InvalidRule. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IInvalidRule + * @property {google.cloud.contentwarehouse.v1.IRule|null} [rule] InvalidRule rule + * @property {string|null} [error] InvalidRule error + */ + + /** + * Constructs a new InvalidRule. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents an InvalidRule. + * @implements IInvalidRule + * @constructor + * @param {google.cloud.contentwarehouse.v1.IInvalidRule=} [properties] Properties to set + */ + function InvalidRule(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]]; + } + + /** + * InvalidRule rule. + * @member {google.cloud.contentwarehouse.v1.IRule|null|undefined} rule + * @memberof google.cloud.contentwarehouse.v1.InvalidRule + * @instance + */ + InvalidRule.prototype.rule = null; + + /** + * InvalidRule error. + * @member {string} error + * @memberof google.cloud.contentwarehouse.v1.InvalidRule + * @instance + */ + InvalidRule.prototype.error = ""; + + /** + * Creates a new InvalidRule instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.InvalidRule + * @static + * @param {google.cloud.contentwarehouse.v1.IInvalidRule=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.InvalidRule} InvalidRule instance + */ + InvalidRule.create = function create(properties) { + return new InvalidRule(properties); + }; + + /** + * Encodes the specified InvalidRule message. Does not implicitly {@link google.cloud.contentwarehouse.v1.InvalidRule.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.InvalidRule + * @static + * @param {google.cloud.contentwarehouse.v1.IInvalidRule} message InvalidRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InvalidRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rule != null && Object.hasOwnProperty.call(message, "rule")) + $root.google.cloud.contentwarehouse.v1.Rule.encode(message.rule, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.error); + return writer; + }; + + /** + * Encodes the specified InvalidRule message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.InvalidRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.InvalidRule + * @static + * @param {google.cloud.contentwarehouse.v1.IInvalidRule} message InvalidRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InvalidRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InvalidRule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.InvalidRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.InvalidRule} InvalidRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InvalidRule.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.InvalidRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.rule = $root.google.cloud.contentwarehouse.v1.Rule.decode(reader, reader.uint32()); + break; + } + case 2: { + message.error = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InvalidRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.InvalidRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.InvalidRule} InvalidRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InvalidRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InvalidRule message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.InvalidRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InvalidRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rule != null && message.hasOwnProperty("rule")) { + var error = $root.google.cloud.contentwarehouse.v1.Rule.verify(message.rule); + if (error) + return "rule." + error; + } + if (message.error != null && message.hasOwnProperty("error")) + if (!$util.isString(message.error)) + return "error: string expected"; + return null; + }; + + /** + * Creates an InvalidRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.InvalidRule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.InvalidRule} InvalidRule + */ + InvalidRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.InvalidRule) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.InvalidRule(); + if (object.rule != null) { + if (typeof object.rule !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.InvalidRule.rule: object expected"); + message.rule = $root.google.cloud.contentwarehouse.v1.Rule.fromObject(object.rule); + } + if (object.error != null) + message.error = String(object.error); + return message; + }; + + /** + * Creates a plain object from an InvalidRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.InvalidRule + * @static + * @param {google.cloud.contentwarehouse.v1.InvalidRule} message InvalidRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InvalidRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.rule = null; + object.error = ""; + } + if (message.rule != null && message.hasOwnProperty("rule")) + object.rule = $root.google.cloud.contentwarehouse.v1.Rule.toObject(message.rule, options); + if (message.error != null && message.hasOwnProperty("error")) + object.error = message.error; + return object; + }; + + /** + * Converts this InvalidRule to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.InvalidRule + * @instance + * @returns {Object.} JSON object + */ + InvalidRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InvalidRule + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.InvalidRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InvalidRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.InvalidRule"; + }; + + return InvalidRule; + })(); + + v1.ActionExecutorOutput = (function() { + + /** + * Properties of an ActionExecutorOutput. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IActionExecutorOutput + * @property {Array.|null} [ruleActionsPairs] ActionExecutorOutput ruleActionsPairs + */ + + /** + * Constructs a new ActionExecutorOutput. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents an ActionExecutorOutput. + * @implements IActionExecutorOutput + * @constructor + * @param {google.cloud.contentwarehouse.v1.IActionExecutorOutput=} [properties] Properties to set + */ + function ActionExecutorOutput(properties) { + this.ruleActionsPairs = []; + 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]]; + } + + /** + * ActionExecutorOutput ruleActionsPairs. + * @member {Array.} ruleActionsPairs + * @memberof google.cloud.contentwarehouse.v1.ActionExecutorOutput + * @instance + */ + ActionExecutorOutput.prototype.ruleActionsPairs = $util.emptyArray; + + /** + * Creates a new ActionExecutorOutput instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.ActionExecutorOutput + * @static + * @param {google.cloud.contentwarehouse.v1.IActionExecutorOutput=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.ActionExecutorOutput} ActionExecutorOutput instance + */ + ActionExecutorOutput.create = function create(properties) { + return new ActionExecutorOutput(properties); + }; + + /** + * Encodes the specified ActionExecutorOutput message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ActionExecutorOutput.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.ActionExecutorOutput + * @static + * @param {google.cloud.contentwarehouse.v1.IActionExecutorOutput} message ActionExecutorOutput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ActionExecutorOutput.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ruleActionsPairs != null && message.ruleActionsPairs.length) + for (var i = 0; i < message.ruleActionsPairs.length; ++i) + $root.google.cloud.contentwarehouse.v1.RuleActionsPair.encode(message.ruleActionsPairs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ActionExecutorOutput message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ActionExecutorOutput.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.ActionExecutorOutput + * @static + * @param {google.cloud.contentwarehouse.v1.IActionExecutorOutput} message ActionExecutorOutput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ActionExecutorOutput.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ActionExecutorOutput message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.ActionExecutorOutput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.ActionExecutorOutput} ActionExecutorOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ActionExecutorOutput.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.ActionExecutorOutput(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.ruleActionsPairs && message.ruleActionsPairs.length)) + message.ruleActionsPairs = []; + message.ruleActionsPairs.push($root.google.cloud.contentwarehouse.v1.RuleActionsPair.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ActionExecutorOutput message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.ActionExecutorOutput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.ActionExecutorOutput} ActionExecutorOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ActionExecutorOutput.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ActionExecutorOutput message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.ActionExecutorOutput + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ActionExecutorOutput.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ruleActionsPairs != null && message.hasOwnProperty("ruleActionsPairs")) { + if (!Array.isArray(message.ruleActionsPairs)) + return "ruleActionsPairs: array expected"; + for (var i = 0; i < message.ruleActionsPairs.length; ++i) { + var error = $root.google.cloud.contentwarehouse.v1.RuleActionsPair.verify(message.ruleActionsPairs[i]); + if (error) + return "ruleActionsPairs." + error; + } + } + return null; + }; + + /** + * Creates an ActionExecutorOutput message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.ActionExecutorOutput + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.ActionExecutorOutput} ActionExecutorOutput + */ + ActionExecutorOutput.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.ActionExecutorOutput) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.ActionExecutorOutput(); + if (object.ruleActionsPairs) { + if (!Array.isArray(object.ruleActionsPairs)) + throw TypeError(".google.cloud.contentwarehouse.v1.ActionExecutorOutput.ruleActionsPairs: array expected"); + message.ruleActionsPairs = []; + for (var i = 0; i < object.ruleActionsPairs.length; ++i) { + if (typeof object.ruleActionsPairs[i] !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.ActionExecutorOutput.ruleActionsPairs: object expected"); + message.ruleActionsPairs[i] = $root.google.cloud.contentwarehouse.v1.RuleActionsPair.fromObject(object.ruleActionsPairs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ActionExecutorOutput message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.ActionExecutorOutput + * @static + * @param {google.cloud.contentwarehouse.v1.ActionExecutorOutput} message ActionExecutorOutput + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ActionExecutorOutput.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ruleActionsPairs = []; + if (message.ruleActionsPairs && message.ruleActionsPairs.length) { + object.ruleActionsPairs = []; + for (var j = 0; j < message.ruleActionsPairs.length; ++j) + object.ruleActionsPairs[j] = $root.google.cloud.contentwarehouse.v1.RuleActionsPair.toObject(message.ruleActionsPairs[j], options); + } + return object; + }; + + /** + * Converts this ActionExecutorOutput to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.ActionExecutorOutput + * @instance + * @returns {Object.} JSON object + */ + ActionExecutorOutput.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ActionExecutorOutput + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.ActionExecutorOutput + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ActionExecutorOutput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.ActionExecutorOutput"; + }; + + return ActionExecutorOutput; + })(); + + v1.RuleActionsPair = (function() { + + /** + * Properties of a RuleActionsPair. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IRuleActionsPair + * @property {google.cloud.contentwarehouse.v1.IRule|null} [rule] RuleActionsPair rule + * @property {Array.|null} [actionOutputs] RuleActionsPair actionOutputs + */ + + /** + * Constructs a new RuleActionsPair. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a RuleActionsPair. + * @implements IRuleActionsPair + * @constructor + * @param {google.cloud.contentwarehouse.v1.IRuleActionsPair=} [properties] Properties to set + */ + function RuleActionsPair(properties) { + this.actionOutputs = []; + 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]]; + } + + /** + * RuleActionsPair rule. + * @member {google.cloud.contentwarehouse.v1.IRule|null|undefined} rule + * @memberof google.cloud.contentwarehouse.v1.RuleActionsPair + * @instance + */ + RuleActionsPair.prototype.rule = null; + + /** + * RuleActionsPair actionOutputs. + * @member {Array.} actionOutputs + * @memberof google.cloud.contentwarehouse.v1.RuleActionsPair + * @instance + */ + RuleActionsPair.prototype.actionOutputs = $util.emptyArray; + + /** + * Creates a new RuleActionsPair instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.RuleActionsPair + * @static + * @param {google.cloud.contentwarehouse.v1.IRuleActionsPair=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.RuleActionsPair} RuleActionsPair instance + */ + RuleActionsPair.create = function create(properties) { + return new RuleActionsPair(properties); + }; + + /** + * Encodes the specified RuleActionsPair message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RuleActionsPair.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.RuleActionsPair + * @static + * @param {google.cloud.contentwarehouse.v1.IRuleActionsPair} message RuleActionsPair message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RuleActionsPair.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rule != null && Object.hasOwnProperty.call(message, "rule")) + $root.google.cloud.contentwarehouse.v1.Rule.encode(message.rule, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.actionOutputs != null && message.actionOutputs.length) + for (var i = 0; i < message.actionOutputs.length; ++i) + $root.google.cloud.contentwarehouse.v1.ActionOutput.encode(message.actionOutputs[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RuleActionsPair message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RuleActionsPair.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.RuleActionsPair + * @static + * @param {google.cloud.contentwarehouse.v1.IRuleActionsPair} message RuleActionsPair message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RuleActionsPair.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RuleActionsPair message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.RuleActionsPair + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.RuleActionsPair} RuleActionsPair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RuleActionsPair.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.RuleActionsPair(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.rule = $root.google.cloud.contentwarehouse.v1.Rule.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.actionOutputs && message.actionOutputs.length)) + message.actionOutputs = []; + message.actionOutputs.push($root.google.cloud.contentwarehouse.v1.ActionOutput.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RuleActionsPair message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.RuleActionsPair + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.RuleActionsPair} RuleActionsPair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RuleActionsPair.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RuleActionsPair message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.RuleActionsPair + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RuleActionsPair.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rule != null && message.hasOwnProperty("rule")) { + var error = $root.google.cloud.contentwarehouse.v1.Rule.verify(message.rule); + if (error) + return "rule." + error; + } + if (message.actionOutputs != null && message.hasOwnProperty("actionOutputs")) { + if (!Array.isArray(message.actionOutputs)) + return "actionOutputs: array expected"; + for (var i = 0; i < message.actionOutputs.length; ++i) { + var error = $root.google.cloud.contentwarehouse.v1.ActionOutput.verify(message.actionOutputs[i]); + if (error) + return "actionOutputs." + error; + } + } + return null; + }; + + /** + * Creates a RuleActionsPair message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.RuleActionsPair + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.RuleActionsPair} RuleActionsPair + */ + RuleActionsPair.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.RuleActionsPair) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.RuleActionsPair(); + if (object.rule != null) { + if (typeof object.rule !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.RuleActionsPair.rule: object expected"); + message.rule = $root.google.cloud.contentwarehouse.v1.Rule.fromObject(object.rule); + } + if (object.actionOutputs) { + if (!Array.isArray(object.actionOutputs)) + throw TypeError(".google.cloud.contentwarehouse.v1.RuleActionsPair.actionOutputs: array expected"); + message.actionOutputs = []; + for (var i = 0; i < object.actionOutputs.length; ++i) { + if (typeof object.actionOutputs[i] !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.RuleActionsPair.actionOutputs: object expected"); + message.actionOutputs[i] = $root.google.cloud.contentwarehouse.v1.ActionOutput.fromObject(object.actionOutputs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RuleActionsPair message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.RuleActionsPair + * @static + * @param {google.cloud.contentwarehouse.v1.RuleActionsPair} message RuleActionsPair + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RuleActionsPair.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.actionOutputs = []; + if (options.defaults) + object.rule = null; + if (message.rule != null && message.hasOwnProperty("rule")) + object.rule = $root.google.cloud.contentwarehouse.v1.Rule.toObject(message.rule, options); + if (message.actionOutputs && message.actionOutputs.length) { + object.actionOutputs = []; + for (var j = 0; j < message.actionOutputs.length; ++j) + object.actionOutputs[j] = $root.google.cloud.contentwarehouse.v1.ActionOutput.toObject(message.actionOutputs[j], options); + } + return object; + }; + + /** + * Converts this RuleActionsPair to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.RuleActionsPair + * @instance + * @returns {Object.} JSON object + */ + RuleActionsPair.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RuleActionsPair + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.RuleActionsPair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RuleActionsPair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.RuleActionsPair"; + }; + + return RuleActionsPair; + })(); + + v1.ActionOutput = (function() { + + /** + * Properties of an ActionOutput. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IActionOutput + * @property {string|null} [actionId] ActionOutput actionId + * @property {google.cloud.contentwarehouse.v1.ActionOutput.State|null} [actionState] ActionOutput actionState + * @property {string|null} [outputMessage] ActionOutput outputMessage + */ + + /** + * Constructs a new ActionOutput. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents an ActionOutput. + * @implements IActionOutput + * @constructor + * @param {google.cloud.contentwarehouse.v1.IActionOutput=} [properties] Properties to set + */ + function ActionOutput(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]]; + } + + /** + * ActionOutput actionId. + * @member {string} actionId + * @memberof google.cloud.contentwarehouse.v1.ActionOutput + * @instance + */ + ActionOutput.prototype.actionId = ""; + + /** + * ActionOutput actionState. + * @member {google.cloud.contentwarehouse.v1.ActionOutput.State} actionState + * @memberof google.cloud.contentwarehouse.v1.ActionOutput + * @instance + */ + ActionOutput.prototype.actionState = 0; + + /** + * ActionOutput outputMessage. + * @member {string} outputMessage + * @memberof google.cloud.contentwarehouse.v1.ActionOutput + * @instance + */ + ActionOutput.prototype.outputMessage = ""; + + /** + * Creates a new ActionOutput instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.ActionOutput + * @static + * @param {google.cloud.contentwarehouse.v1.IActionOutput=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.ActionOutput} ActionOutput instance + */ + ActionOutput.create = function create(properties) { + return new ActionOutput(properties); + }; + + /** + * Encodes the specified ActionOutput message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ActionOutput.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.ActionOutput + * @static + * @param {google.cloud.contentwarehouse.v1.IActionOutput} message ActionOutput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ActionOutput.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.actionId != null && Object.hasOwnProperty.call(message, "actionId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.actionId); + if (message.actionState != null && Object.hasOwnProperty.call(message, "actionState")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.actionState); + if (message.outputMessage != null && Object.hasOwnProperty.call(message, "outputMessage")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputMessage); + return writer; + }; + + /** + * Encodes the specified ActionOutput message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ActionOutput.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.ActionOutput + * @static + * @param {google.cloud.contentwarehouse.v1.IActionOutput} message ActionOutput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ActionOutput.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ActionOutput message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.ActionOutput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.ActionOutput} ActionOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ActionOutput.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.ActionOutput(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.actionId = reader.string(); + break; + } + case 2: { + message.actionState = reader.int32(); + break; + } + case 3: { + message.outputMessage = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ActionOutput message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.ActionOutput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.ActionOutput} ActionOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ActionOutput.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ActionOutput message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.ActionOutput + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ActionOutput.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.actionId != null && message.hasOwnProperty("actionId")) + if (!$util.isString(message.actionId)) + return "actionId: string expected"; + if (message.actionState != null && message.hasOwnProperty("actionState")) + switch (message.actionState) { + default: + return "actionState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.outputMessage != null && message.hasOwnProperty("outputMessage")) + if (!$util.isString(message.outputMessage)) + return "outputMessage: string expected"; + return null; + }; + + /** + * Creates an ActionOutput message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.ActionOutput + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.ActionOutput} ActionOutput + */ + ActionOutput.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.ActionOutput) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.ActionOutput(); + if (object.actionId != null) + message.actionId = String(object.actionId); + switch (object.actionState) { + default: + if (typeof object.actionState === "number") { + message.actionState = object.actionState; + break; + } + break; + case "UNKNOWN": + case 0: + message.actionState = 0; + break; + case "ACTION_SUCCEEDED": + case 1: + message.actionState = 1; + break; + case "ACTION_FAILED": + case 2: + message.actionState = 2; + break; + case "ACTION_TIMED_OUT": + case 3: + message.actionState = 3; + break; + case "ACTION_PENDING": + case 4: + message.actionState = 4; + break; + } + if (object.outputMessage != null) + message.outputMessage = String(object.outputMessage); + return message; + }; + + /** + * Creates a plain object from an ActionOutput message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.ActionOutput + * @static + * @param {google.cloud.contentwarehouse.v1.ActionOutput} message ActionOutput + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ActionOutput.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.actionId = ""; + object.actionState = options.enums === String ? "UNKNOWN" : 0; + object.outputMessage = ""; + } + if (message.actionId != null && message.hasOwnProperty("actionId")) + object.actionId = message.actionId; + if (message.actionState != null && message.hasOwnProperty("actionState")) + object.actionState = options.enums === String ? $root.google.cloud.contentwarehouse.v1.ActionOutput.State[message.actionState] === undefined ? message.actionState : $root.google.cloud.contentwarehouse.v1.ActionOutput.State[message.actionState] : message.actionState; + if (message.outputMessage != null && message.hasOwnProperty("outputMessage")) + object.outputMessage = message.outputMessage; + return object; + }; + + /** + * Converts this ActionOutput to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.ActionOutput + * @instance + * @returns {Object.} JSON object + */ + ActionOutput.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ActionOutput + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.ActionOutput + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ActionOutput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.ActionOutput"; + }; + + /** + * State enum. + * @name google.cloud.contentwarehouse.v1.ActionOutput.State + * @enum {number} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} ACTION_SUCCEEDED=1 ACTION_SUCCEEDED value + * @property {number} ACTION_FAILED=2 ACTION_FAILED value + * @property {number} ACTION_TIMED_OUT=3 ACTION_TIMED_OUT value + * @property {number} ACTION_PENDING=4 ACTION_PENDING value + */ + ActionOutput.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "ACTION_SUCCEEDED"] = 1; + values[valuesById[2] = "ACTION_FAILED"] = 2; + values[valuesById[3] = "ACTION_TIMED_OUT"] = 3; + values[valuesById[4] = "ACTION_PENDING"] = 4; + return values; + })(); + + return ActionOutput; + })(); + + v1.PipelineService = (function() { + + /** + * Constructs a new PipelineService service. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a PipelineService + * @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 PipelineService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (PipelineService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = PipelineService; + + /** + * Creates new PipelineService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.contentwarehouse.v1.PipelineService + * @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 {PipelineService} RPC service. Useful where requests and/or responses are streamed. + */ + PipelineService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.PipelineService|runPipeline}. + * @memberof google.cloud.contentwarehouse.v1.PipelineService + * @typedef RunPipelineCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RunPipeline. + * @function runPipeline + * @memberof google.cloud.contentwarehouse.v1.PipelineService + * @instance + * @param {google.cloud.contentwarehouse.v1.IRunPipelineRequest} request RunPipelineRequest message or plain object + * @param {google.cloud.contentwarehouse.v1.PipelineService.RunPipelineCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PipelineService.prototype.runPipeline = function runPipeline(request, callback) { + return this.rpcCall(runPipeline, $root.google.cloud.contentwarehouse.v1.RunPipelineRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RunPipeline" }); + + /** + * Calls RunPipeline. + * @function runPipeline + * @memberof google.cloud.contentwarehouse.v1.PipelineService + * @instance + * @param {google.cloud.contentwarehouse.v1.IRunPipelineRequest} request RunPipelineRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return PipelineService; + })(); + + v1.RunPipelineRequest = (function() { + + /** + * Properties of a RunPipelineRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IRunPipelineRequest + * @property {string|null} [name] RunPipelineRequest name + * @property {google.cloud.contentwarehouse.v1.IGcsIngestPipeline|null} [gcsIngestPipeline] RunPipelineRequest gcsIngestPipeline + * @property {google.cloud.contentwarehouse.v1.IGcsIngestWithDocAiProcessorsPipeline|null} [gcsIngestWithDocAiProcessorsPipeline] RunPipelineRequest gcsIngestWithDocAiProcessorsPipeline + * @property {google.cloud.contentwarehouse.v1.IExportToCdwPipeline|null} [exportCdwPipeline] RunPipelineRequest exportCdwPipeline + * @property {google.cloud.contentwarehouse.v1.IProcessWithDocAiPipeline|null} [processWithDocAiPipeline] RunPipelineRequest processWithDocAiPipeline + * @property {google.cloud.contentwarehouse.v1.IRequestMetadata|null} [requestMetadata] RunPipelineRequest requestMetadata + */ + + /** + * Constructs a new RunPipelineRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a RunPipelineRequest. + * @implements IRunPipelineRequest + * @constructor + * @param {google.cloud.contentwarehouse.v1.IRunPipelineRequest=} [properties] Properties to set + */ + function RunPipelineRequest(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]]; + } + + /** + * RunPipelineRequest name. + * @member {string} name + * @memberof google.cloud.contentwarehouse.v1.RunPipelineRequest + * @instance + */ + RunPipelineRequest.prototype.name = ""; + + /** + * RunPipelineRequest gcsIngestPipeline. + * @member {google.cloud.contentwarehouse.v1.IGcsIngestPipeline|null|undefined} gcsIngestPipeline + * @memberof google.cloud.contentwarehouse.v1.RunPipelineRequest + * @instance + */ + RunPipelineRequest.prototype.gcsIngestPipeline = null; + + /** + * RunPipelineRequest gcsIngestWithDocAiProcessorsPipeline. + * @member {google.cloud.contentwarehouse.v1.IGcsIngestWithDocAiProcessorsPipeline|null|undefined} gcsIngestWithDocAiProcessorsPipeline + * @memberof google.cloud.contentwarehouse.v1.RunPipelineRequest + * @instance + */ + RunPipelineRequest.prototype.gcsIngestWithDocAiProcessorsPipeline = null; + + /** + * RunPipelineRequest exportCdwPipeline. + * @member {google.cloud.contentwarehouse.v1.IExportToCdwPipeline|null|undefined} exportCdwPipeline + * @memberof google.cloud.contentwarehouse.v1.RunPipelineRequest + * @instance + */ + RunPipelineRequest.prototype.exportCdwPipeline = null; + + /** + * RunPipelineRequest processWithDocAiPipeline. + * @member {google.cloud.contentwarehouse.v1.IProcessWithDocAiPipeline|null|undefined} processWithDocAiPipeline + * @memberof google.cloud.contentwarehouse.v1.RunPipelineRequest + * @instance + */ + RunPipelineRequest.prototype.processWithDocAiPipeline = null; + + /** + * RunPipelineRequest requestMetadata. + * @member {google.cloud.contentwarehouse.v1.IRequestMetadata|null|undefined} requestMetadata + * @memberof google.cloud.contentwarehouse.v1.RunPipelineRequest + * @instance + */ + RunPipelineRequest.prototype.requestMetadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RunPipelineRequest pipeline. + * @member {"gcsIngestPipeline"|"gcsIngestWithDocAiProcessorsPipeline"|"exportCdwPipeline"|"processWithDocAiPipeline"|undefined} pipeline + * @memberof google.cloud.contentwarehouse.v1.RunPipelineRequest + * @instance + */ + Object.defineProperty(RunPipelineRequest.prototype, "pipeline", { + get: $util.oneOfGetter($oneOfFields = ["gcsIngestPipeline", "gcsIngestWithDocAiProcessorsPipeline", "exportCdwPipeline", "processWithDocAiPipeline"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RunPipelineRequest instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.RunPipelineRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IRunPipelineRequest=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.RunPipelineRequest} RunPipelineRequest instance + */ + RunPipelineRequest.create = function create(properties) { + return new RunPipelineRequest(properties); + }; + + /** + * Encodes the specified RunPipelineRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.RunPipelineRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IRunPipelineRequest} message RunPipelineRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunPipelineRequest.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.gcsIngestPipeline != null && Object.hasOwnProperty.call(message, "gcsIngestPipeline")) + $root.google.cloud.contentwarehouse.v1.GcsIngestPipeline.encode(message.gcsIngestPipeline, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.gcsIngestWithDocAiProcessorsPipeline != null && Object.hasOwnProperty.call(message, "gcsIngestWithDocAiProcessorsPipeline")) + $root.google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline.encode(message.gcsIngestWithDocAiProcessorsPipeline, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.exportCdwPipeline != null && Object.hasOwnProperty.call(message, "exportCdwPipeline")) + $root.google.cloud.contentwarehouse.v1.ExportToCdwPipeline.encode(message.exportCdwPipeline, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.processWithDocAiPipeline != null && Object.hasOwnProperty.call(message, "processWithDocAiPipeline")) + $root.google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline.encode(message.processWithDocAiPipeline, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.requestMetadata != null && Object.hasOwnProperty.call(message, "requestMetadata")) + $root.google.cloud.contentwarehouse.v1.RequestMetadata.encode(message.requestMetadata, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RunPipelineRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.RunPipelineRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IRunPipelineRequest} message RunPipelineRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunPipelineRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunPipelineRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.RunPipelineRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.RunPipelineRequest} RunPipelineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunPipelineRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.RunPipelineRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.gcsIngestPipeline = $root.google.cloud.contentwarehouse.v1.GcsIngestPipeline.decode(reader, reader.uint32()); + break; + } + case 3: { + message.gcsIngestWithDocAiProcessorsPipeline = $root.google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline.decode(reader, reader.uint32()); + break; + } + case 4: { + message.exportCdwPipeline = $root.google.cloud.contentwarehouse.v1.ExportToCdwPipeline.decode(reader, reader.uint32()); + break; + } + case 5: { + message.processWithDocAiPipeline = $root.google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline.decode(reader, reader.uint32()); + break; + } + case 6: { + message.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RunPipelineRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.RunPipelineRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.RunPipelineRequest} RunPipelineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunPipelineRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunPipelineRequest message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.RunPipelineRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunPipelineRequest.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.gcsIngestPipeline != null && message.hasOwnProperty("gcsIngestPipeline")) { + properties.pipeline = 1; + { + var error = $root.google.cloud.contentwarehouse.v1.GcsIngestPipeline.verify(message.gcsIngestPipeline); + if (error) + return "gcsIngestPipeline." + error; + } + } + if (message.gcsIngestWithDocAiProcessorsPipeline != null && message.hasOwnProperty("gcsIngestWithDocAiProcessorsPipeline")) { + if (properties.pipeline === 1) + return "pipeline: multiple values"; + properties.pipeline = 1; + { + var error = $root.google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline.verify(message.gcsIngestWithDocAiProcessorsPipeline); + if (error) + return "gcsIngestWithDocAiProcessorsPipeline." + error; + } + } + if (message.exportCdwPipeline != null && message.hasOwnProperty("exportCdwPipeline")) { + if (properties.pipeline === 1) + return "pipeline: multiple values"; + properties.pipeline = 1; + { + var error = $root.google.cloud.contentwarehouse.v1.ExportToCdwPipeline.verify(message.exportCdwPipeline); + if (error) + return "exportCdwPipeline." + error; + } + } + if (message.processWithDocAiPipeline != null && message.hasOwnProperty("processWithDocAiPipeline")) { + if (properties.pipeline === 1) + return "pipeline: multiple values"; + properties.pipeline = 1; + { + var error = $root.google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline.verify(message.processWithDocAiPipeline); + if (error) + return "processWithDocAiPipeline." + error; + } + } + if (message.requestMetadata != null && message.hasOwnProperty("requestMetadata")) { + var error = $root.google.cloud.contentwarehouse.v1.RequestMetadata.verify(message.requestMetadata); + if (error) + return "requestMetadata." + error; + } + return null; + }; + + /** + * Creates a RunPipelineRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.RunPipelineRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.RunPipelineRequest} RunPipelineRequest + */ + RunPipelineRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.RunPipelineRequest) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.RunPipelineRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.gcsIngestPipeline != null) { + if (typeof object.gcsIngestPipeline !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.RunPipelineRequest.gcsIngestPipeline: object expected"); + message.gcsIngestPipeline = $root.google.cloud.contentwarehouse.v1.GcsIngestPipeline.fromObject(object.gcsIngestPipeline); + } + if (object.gcsIngestWithDocAiProcessorsPipeline != null) { + if (typeof object.gcsIngestWithDocAiProcessorsPipeline !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.RunPipelineRequest.gcsIngestWithDocAiProcessorsPipeline: object expected"); + message.gcsIngestWithDocAiProcessorsPipeline = $root.google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline.fromObject(object.gcsIngestWithDocAiProcessorsPipeline); + } + if (object.exportCdwPipeline != null) { + if (typeof object.exportCdwPipeline !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.RunPipelineRequest.exportCdwPipeline: object expected"); + message.exportCdwPipeline = $root.google.cloud.contentwarehouse.v1.ExportToCdwPipeline.fromObject(object.exportCdwPipeline); + } + if (object.processWithDocAiPipeline != null) { + if (typeof object.processWithDocAiPipeline !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.RunPipelineRequest.processWithDocAiPipeline: object expected"); + message.processWithDocAiPipeline = $root.google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline.fromObject(object.processWithDocAiPipeline); + } + if (object.requestMetadata != null) { + if (typeof object.requestMetadata !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.RunPipelineRequest.requestMetadata: object expected"); + message.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.fromObject(object.requestMetadata); + } + return message; + }; + + /** + * Creates a plain object from a RunPipelineRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.RunPipelineRequest + * @static + * @param {google.cloud.contentwarehouse.v1.RunPipelineRequest} message RunPipelineRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunPipelineRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestMetadata = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.gcsIngestPipeline != null && message.hasOwnProperty("gcsIngestPipeline")) { + object.gcsIngestPipeline = $root.google.cloud.contentwarehouse.v1.GcsIngestPipeline.toObject(message.gcsIngestPipeline, options); + if (options.oneofs) + object.pipeline = "gcsIngestPipeline"; + } + if (message.gcsIngestWithDocAiProcessorsPipeline != null && message.hasOwnProperty("gcsIngestWithDocAiProcessorsPipeline")) { + object.gcsIngestWithDocAiProcessorsPipeline = $root.google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline.toObject(message.gcsIngestWithDocAiProcessorsPipeline, options); + if (options.oneofs) + object.pipeline = "gcsIngestWithDocAiProcessorsPipeline"; + } + if (message.exportCdwPipeline != null && message.hasOwnProperty("exportCdwPipeline")) { + object.exportCdwPipeline = $root.google.cloud.contentwarehouse.v1.ExportToCdwPipeline.toObject(message.exportCdwPipeline, options); + if (options.oneofs) + object.pipeline = "exportCdwPipeline"; + } + if (message.processWithDocAiPipeline != null && message.hasOwnProperty("processWithDocAiPipeline")) { + object.processWithDocAiPipeline = $root.google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline.toObject(message.processWithDocAiPipeline, options); + if (options.oneofs) + object.pipeline = "processWithDocAiPipeline"; + } + if (message.requestMetadata != null && message.hasOwnProperty("requestMetadata")) + object.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.toObject(message.requestMetadata, options); + return object; + }; + + /** + * Converts this RunPipelineRequest to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.RunPipelineRequest + * @instance + * @returns {Object.} JSON object + */ + RunPipelineRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RunPipelineRequest + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.RunPipelineRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunPipelineRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.RunPipelineRequest"; + }; + + return RunPipelineRequest; + })(); + + v1.RunPipelineResponse = (function() { + + /** + * Properties of a RunPipelineResponse. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IRunPipelineResponse + */ + + /** + * Constructs a new RunPipelineResponse. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a RunPipelineResponse. + * @implements IRunPipelineResponse + * @constructor + * @param {google.cloud.contentwarehouse.v1.IRunPipelineResponse=} [properties] Properties to set + */ + function RunPipelineResponse(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 RunPipelineResponse instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.RunPipelineResponse + * @static + * @param {google.cloud.contentwarehouse.v1.IRunPipelineResponse=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.RunPipelineResponse} RunPipelineResponse instance + */ + RunPipelineResponse.create = function create(properties) { + return new RunPipelineResponse(properties); + }; + + /** + * Encodes the specified RunPipelineResponse message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.RunPipelineResponse + * @static + * @param {google.cloud.contentwarehouse.v1.IRunPipelineResponse} message RunPipelineResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunPipelineResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified RunPipelineResponse message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.RunPipelineResponse + * @static + * @param {google.cloud.contentwarehouse.v1.IRunPipelineResponse} message RunPipelineResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunPipelineResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunPipelineResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.RunPipelineResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.RunPipelineResponse} RunPipelineResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunPipelineResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.RunPipelineResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RunPipelineResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.RunPipelineResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.RunPipelineResponse} RunPipelineResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunPipelineResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunPipelineResponse message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.RunPipelineResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunPipelineResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a RunPipelineResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.RunPipelineResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.RunPipelineResponse} RunPipelineResponse + */ + RunPipelineResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.RunPipelineResponse) + return object; + return new $root.google.cloud.contentwarehouse.v1.RunPipelineResponse(); + }; + + /** + * Creates a plain object from a RunPipelineResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.RunPipelineResponse + * @static + * @param {google.cloud.contentwarehouse.v1.RunPipelineResponse} message RunPipelineResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunPipelineResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this RunPipelineResponse to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.RunPipelineResponse + * @instance + * @returns {Object.} JSON object + */ + RunPipelineResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RunPipelineResponse + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.RunPipelineResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunPipelineResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.RunPipelineResponse"; + }; + + return RunPipelineResponse; + })(); + + v1.RunPipelineMetadata = (function() { + + /** + * Properties of a RunPipelineMetadata. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IRunPipelineMetadata + * @property {number|null} [totalFileCount] RunPipelineMetadata totalFileCount + * @property {number|null} [failedFileCount] RunPipelineMetadata failedFileCount + * @property {google.cloud.contentwarehouse.v1.IUserInfo|null} [userInfo] RunPipelineMetadata userInfo + * @property {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IGcsIngestPipelineMetadata|null} [gcsIngestPipelineMetadata] RunPipelineMetadata gcsIngestPipelineMetadata + * @property {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IExportToCdwPipelineMetadata|null} [exportToCdwPipelineMetadata] RunPipelineMetadata exportToCdwPipelineMetadata + * @property {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IProcessWithDocAiPipelineMetadata|null} [processWithDocAiPipelineMetadata] RunPipelineMetadata processWithDocAiPipelineMetadata + * @property {Array.|null} [individualDocumentStatuses] RunPipelineMetadata individualDocumentStatuses + */ + + /** + * Constructs a new RunPipelineMetadata. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a RunPipelineMetadata. + * @implements IRunPipelineMetadata + * @constructor + * @param {google.cloud.contentwarehouse.v1.IRunPipelineMetadata=} [properties] Properties to set + */ + function RunPipelineMetadata(properties) { + this.individualDocumentStatuses = []; + 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]]; + } + + /** + * RunPipelineMetadata totalFileCount. + * @member {number} totalFileCount + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata + * @instance + */ + RunPipelineMetadata.prototype.totalFileCount = 0; + + /** + * RunPipelineMetadata failedFileCount. + * @member {number} failedFileCount + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata + * @instance + */ + RunPipelineMetadata.prototype.failedFileCount = 0; + + /** + * RunPipelineMetadata userInfo. + * @member {google.cloud.contentwarehouse.v1.IUserInfo|null|undefined} userInfo + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata + * @instance + */ + RunPipelineMetadata.prototype.userInfo = null; + + /** + * RunPipelineMetadata gcsIngestPipelineMetadata. + * @member {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IGcsIngestPipelineMetadata|null|undefined} gcsIngestPipelineMetadata + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata + * @instance + */ + RunPipelineMetadata.prototype.gcsIngestPipelineMetadata = null; + + /** + * RunPipelineMetadata exportToCdwPipelineMetadata. + * @member {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IExportToCdwPipelineMetadata|null|undefined} exportToCdwPipelineMetadata + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata + * @instance + */ + RunPipelineMetadata.prototype.exportToCdwPipelineMetadata = null; + + /** + * RunPipelineMetadata processWithDocAiPipelineMetadata. + * @member {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IProcessWithDocAiPipelineMetadata|null|undefined} processWithDocAiPipelineMetadata + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata + * @instance + */ + RunPipelineMetadata.prototype.processWithDocAiPipelineMetadata = null; + + /** + * RunPipelineMetadata individualDocumentStatuses. + * @member {Array.} individualDocumentStatuses + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata + * @instance + */ + RunPipelineMetadata.prototype.individualDocumentStatuses = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RunPipelineMetadata pipelineMetadata. + * @member {"gcsIngestPipelineMetadata"|"exportToCdwPipelineMetadata"|"processWithDocAiPipelineMetadata"|undefined} pipelineMetadata + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata + * @instance + */ + Object.defineProperty(RunPipelineMetadata.prototype, "pipelineMetadata", { + get: $util.oneOfGetter($oneOfFields = ["gcsIngestPipelineMetadata", "exportToCdwPipelineMetadata", "processWithDocAiPipelineMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RunPipelineMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata + * @static + * @param {google.cloud.contentwarehouse.v1.IRunPipelineMetadata=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.RunPipelineMetadata} RunPipelineMetadata instance + */ + RunPipelineMetadata.create = function create(properties) { + return new RunPipelineMetadata(properties); + }; + + /** + * Encodes the specified RunPipelineMetadata message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata + * @static + * @param {google.cloud.contentwarehouse.v1.IRunPipelineMetadata} message RunPipelineMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunPipelineMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.totalFileCount != null && Object.hasOwnProperty.call(message, "totalFileCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.totalFileCount); + if (message.failedFileCount != null && Object.hasOwnProperty.call(message, "failedFileCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.failedFileCount); + if (message.userInfo != null && Object.hasOwnProperty.call(message, "userInfo")) + $root.google.cloud.contentwarehouse.v1.UserInfo.encode(message.userInfo, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.gcsIngestPipelineMetadata != null && Object.hasOwnProperty.call(message, "gcsIngestPipelineMetadata")) + $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata.encode(message.gcsIngestPipelineMetadata, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.individualDocumentStatuses != null && message.individualDocumentStatuses.length) + for (var i = 0; i < message.individualDocumentStatuses.length; ++i) + $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus.encode(message.individualDocumentStatuses[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.exportToCdwPipelineMetadata != null && Object.hasOwnProperty.call(message, "exportToCdwPipelineMetadata")) + $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata.encode(message.exportToCdwPipelineMetadata, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.processWithDocAiPipelineMetadata != null && Object.hasOwnProperty.call(message, "processWithDocAiPipelineMetadata")) + $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata.encode(message.processWithDocAiPipelineMetadata, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RunPipelineMetadata message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata + * @static + * @param {google.cloud.contentwarehouse.v1.IRunPipelineMetadata} message RunPipelineMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunPipelineMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunPipelineMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.RunPipelineMetadata} RunPipelineMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunPipelineMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.totalFileCount = reader.int32(); + break; + } + case 2: { + message.failedFileCount = reader.int32(); + break; + } + case 3: { + message.userInfo = $root.google.cloud.contentwarehouse.v1.UserInfo.decode(reader, reader.uint32()); + break; + } + case 4: { + message.gcsIngestPipelineMetadata = $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata.decode(reader, reader.uint32()); + break; + } + case 6: { + message.exportToCdwPipelineMetadata = $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata.decode(reader, reader.uint32()); + break; + } + case 7: { + message.processWithDocAiPipelineMetadata = $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata.decode(reader, reader.uint32()); + break; + } + case 5: { + if (!(message.individualDocumentStatuses && message.individualDocumentStatuses.length)) + message.individualDocumentStatuses = []; + message.individualDocumentStatuses.push($root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RunPipelineMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.RunPipelineMetadata} RunPipelineMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunPipelineMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunPipelineMetadata message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunPipelineMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.totalFileCount != null && message.hasOwnProperty("totalFileCount")) + if (!$util.isInteger(message.totalFileCount)) + return "totalFileCount: integer expected"; + if (message.failedFileCount != null && message.hasOwnProperty("failedFileCount")) + if (!$util.isInteger(message.failedFileCount)) + return "failedFileCount: integer expected"; + if (message.userInfo != null && message.hasOwnProperty("userInfo")) { + var error = $root.google.cloud.contentwarehouse.v1.UserInfo.verify(message.userInfo); + if (error) + return "userInfo." + error; + } + if (message.gcsIngestPipelineMetadata != null && message.hasOwnProperty("gcsIngestPipelineMetadata")) { + properties.pipelineMetadata = 1; + { + var error = $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata.verify(message.gcsIngestPipelineMetadata); + if (error) + return "gcsIngestPipelineMetadata." + error; + } + } + if (message.exportToCdwPipelineMetadata != null && message.hasOwnProperty("exportToCdwPipelineMetadata")) { + if (properties.pipelineMetadata === 1) + return "pipelineMetadata: multiple values"; + properties.pipelineMetadata = 1; + { + var error = $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata.verify(message.exportToCdwPipelineMetadata); + if (error) + return "exportToCdwPipelineMetadata." + error; + } + } + if (message.processWithDocAiPipelineMetadata != null && message.hasOwnProperty("processWithDocAiPipelineMetadata")) { + if (properties.pipelineMetadata === 1) + return "pipelineMetadata: multiple values"; + properties.pipelineMetadata = 1; + { + var error = $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata.verify(message.processWithDocAiPipelineMetadata); + if (error) + return "processWithDocAiPipelineMetadata." + error; + } + } + if (message.individualDocumentStatuses != null && message.hasOwnProperty("individualDocumentStatuses")) { + if (!Array.isArray(message.individualDocumentStatuses)) + return "individualDocumentStatuses: array expected"; + for (var i = 0; i < message.individualDocumentStatuses.length; ++i) { + var error = $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus.verify(message.individualDocumentStatuses[i]); + if (error) + return "individualDocumentStatuses." + error; + } + } + return null; + }; + + /** + * Creates a RunPipelineMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.RunPipelineMetadata} RunPipelineMetadata + */ + RunPipelineMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata(); + if (object.totalFileCount != null) + message.totalFileCount = object.totalFileCount | 0; + if (object.failedFileCount != null) + message.failedFileCount = object.failedFileCount | 0; + if (object.userInfo != null) { + if (typeof object.userInfo !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.RunPipelineMetadata.userInfo: object expected"); + message.userInfo = $root.google.cloud.contentwarehouse.v1.UserInfo.fromObject(object.userInfo); + } + if (object.gcsIngestPipelineMetadata != null) { + if (typeof object.gcsIngestPipelineMetadata !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.RunPipelineMetadata.gcsIngestPipelineMetadata: object expected"); + message.gcsIngestPipelineMetadata = $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata.fromObject(object.gcsIngestPipelineMetadata); + } + if (object.exportToCdwPipelineMetadata != null) { + if (typeof object.exportToCdwPipelineMetadata !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.RunPipelineMetadata.exportToCdwPipelineMetadata: object expected"); + message.exportToCdwPipelineMetadata = $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata.fromObject(object.exportToCdwPipelineMetadata); + } + if (object.processWithDocAiPipelineMetadata != null) { + if (typeof object.processWithDocAiPipelineMetadata !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.RunPipelineMetadata.processWithDocAiPipelineMetadata: object expected"); + message.processWithDocAiPipelineMetadata = $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata.fromObject(object.processWithDocAiPipelineMetadata); + } + if (object.individualDocumentStatuses) { + if (!Array.isArray(object.individualDocumentStatuses)) + throw TypeError(".google.cloud.contentwarehouse.v1.RunPipelineMetadata.individualDocumentStatuses: array expected"); + message.individualDocumentStatuses = []; + for (var i = 0; i < object.individualDocumentStatuses.length; ++i) { + if (typeof object.individualDocumentStatuses[i] !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.RunPipelineMetadata.individualDocumentStatuses: object expected"); + message.individualDocumentStatuses[i] = $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus.fromObject(object.individualDocumentStatuses[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RunPipelineMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata + * @static + * @param {google.cloud.contentwarehouse.v1.RunPipelineMetadata} message RunPipelineMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunPipelineMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.individualDocumentStatuses = []; + if (options.defaults) { + object.totalFileCount = 0; + object.failedFileCount = 0; + object.userInfo = null; + } + if (message.totalFileCount != null && message.hasOwnProperty("totalFileCount")) + object.totalFileCount = message.totalFileCount; + if (message.failedFileCount != null && message.hasOwnProperty("failedFileCount")) + object.failedFileCount = message.failedFileCount; + if (message.userInfo != null && message.hasOwnProperty("userInfo")) + object.userInfo = $root.google.cloud.contentwarehouse.v1.UserInfo.toObject(message.userInfo, options); + if (message.gcsIngestPipelineMetadata != null && message.hasOwnProperty("gcsIngestPipelineMetadata")) { + object.gcsIngestPipelineMetadata = $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata.toObject(message.gcsIngestPipelineMetadata, options); + if (options.oneofs) + object.pipelineMetadata = "gcsIngestPipelineMetadata"; + } + if (message.individualDocumentStatuses && message.individualDocumentStatuses.length) { + object.individualDocumentStatuses = []; + for (var j = 0; j < message.individualDocumentStatuses.length; ++j) + object.individualDocumentStatuses[j] = $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus.toObject(message.individualDocumentStatuses[j], options); + } + if (message.exportToCdwPipelineMetadata != null && message.hasOwnProperty("exportToCdwPipelineMetadata")) { + object.exportToCdwPipelineMetadata = $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata.toObject(message.exportToCdwPipelineMetadata, options); + if (options.oneofs) + object.pipelineMetadata = "exportToCdwPipelineMetadata"; + } + if (message.processWithDocAiPipelineMetadata != null && message.hasOwnProperty("processWithDocAiPipelineMetadata")) { + object.processWithDocAiPipelineMetadata = $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata.toObject(message.processWithDocAiPipelineMetadata, options); + if (options.oneofs) + object.pipelineMetadata = "processWithDocAiPipelineMetadata"; + } + return object; + }; + + /** + * Converts this RunPipelineMetadata to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata + * @instance + * @returns {Object.} JSON object + */ + RunPipelineMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RunPipelineMetadata + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunPipelineMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.RunPipelineMetadata"; + }; + + RunPipelineMetadata.GcsIngestPipelineMetadata = (function() { + + /** + * Properties of a GcsIngestPipelineMetadata. + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata + * @interface IGcsIngestPipelineMetadata + * @property {string|null} [inputPath] GcsIngestPipelineMetadata inputPath + */ + + /** + * Constructs a new GcsIngestPipelineMetadata. + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata + * @classdesc Represents a GcsIngestPipelineMetadata. + * @implements IGcsIngestPipelineMetadata + * @constructor + * @param {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IGcsIngestPipelineMetadata=} [properties] Properties to set + */ + function GcsIngestPipelineMetadata(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]]; + } + + /** + * GcsIngestPipelineMetadata inputPath. + * @member {string} inputPath + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata + * @instance + */ + GcsIngestPipelineMetadata.prototype.inputPath = ""; + + /** + * Creates a new GcsIngestPipelineMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata + * @static + * @param {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IGcsIngestPipelineMetadata=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata} GcsIngestPipelineMetadata instance + */ + GcsIngestPipelineMetadata.create = function create(properties) { + return new GcsIngestPipelineMetadata(properties); + }; + + /** + * Encodes the specified GcsIngestPipelineMetadata message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata + * @static + * @param {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IGcsIngestPipelineMetadata} message GcsIngestPipelineMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsIngestPipelineMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputPath != null && Object.hasOwnProperty.call(message, "inputPath")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputPath); + return writer; + }; + + /** + * Encodes the specified GcsIngestPipelineMetadata message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata + * @static + * @param {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IGcsIngestPipelineMetadata} message GcsIngestPipelineMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsIngestPipelineMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsIngestPipelineMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata} GcsIngestPipelineMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsIngestPipelineMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.inputPath = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcsIngestPipelineMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata} GcsIngestPipelineMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsIngestPipelineMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsIngestPipelineMetadata message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsIngestPipelineMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputPath != null && message.hasOwnProperty("inputPath")) + if (!$util.isString(message.inputPath)) + return "inputPath: string expected"; + return null; + }; + + /** + * Creates a GcsIngestPipelineMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata} GcsIngestPipelineMetadata + */ + GcsIngestPipelineMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata(); + if (object.inputPath != null) + message.inputPath = String(object.inputPath); + return message; + }; + + /** + * Creates a plain object from a GcsIngestPipelineMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata + * @static + * @param {google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata} message GcsIngestPipelineMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsIngestPipelineMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.inputPath = ""; + if (message.inputPath != null && message.hasOwnProperty("inputPath")) + object.inputPath = message.inputPath; + return object; + }; + + /** + * Converts this GcsIngestPipelineMetadata to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata + * @instance + * @returns {Object.} JSON object + */ + GcsIngestPipelineMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GcsIngestPipelineMetadata + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcsIngestPipelineMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata"; + }; + + return GcsIngestPipelineMetadata; + })(); + + RunPipelineMetadata.ExportToCdwPipelineMetadata = (function() { + + /** + * Properties of an ExportToCdwPipelineMetadata. + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata + * @interface IExportToCdwPipelineMetadata + * @property {Array.|null} [documents] ExportToCdwPipelineMetadata documents + * @property {string|null} [docAiDataset] ExportToCdwPipelineMetadata docAiDataset + * @property {string|null} [outputPath] ExportToCdwPipelineMetadata outputPath + */ + + /** + * Constructs a new ExportToCdwPipelineMetadata. + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata + * @classdesc Represents an ExportToCdwPipelineMetadata. + * @implements IExportToCdwPipelineMetadata + * @constructor + * @param {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IExportToCdwPipelineMetadata=} [properties] Properties to set + */ + function ExportToCdwPipelineMetadata(properties) { + this.documents = []; + 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]]; + } + + /** + * ExportToCdwPipelineMetadata documents. + * @member {Array.} documents + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata + * @instance + */ + ExportToCdwPipelineMetadata.prototype.documents = $util.emptyArray; + + /** + * ExportToCdwPipelineMetadata docAiDataset. + * @member {string} docAiDataset + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata + * @instance + */ + ExportToCdwPipelineMetadata.prototype.docAiDataset = ""; + + /** + * ExportToCdwPipelineMetadata outputPath. + * @member {string} outputPath + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata + * @instance + */ + ExportToCdwPipelineMetadata.prototype.outputPath = ""; + + /** + * Creates a new ExportToCdwPipelineMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata + * @static + * @param {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IExportToCdwPipelineMetadata=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata} ExportToCdwPipelineMetadata instance + */ + ExportToCdwPipelineMetadata.create = function create(properties) { + return new ExportToCdwPipelineMetadata(properties); + }; + + /** + * Encodes the specified ExportToCdwPipelineMetadata message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata + * @static + * @param {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IExportToCdwPipelineMetadata} message ExportToCdwPipelineMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportToCdwPipelineMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documents != null && message.documents.length) + for (var i = 0; i < message.documents.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.documents[i]); + if (message.docAiDataset != null && Object.hasOwnProperty.call(message, "docAiDataset")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.docAiDataset); + if (message.outputPath != null && Object.hasOwnProperty.call(message, "outputPath")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputPath); + return writer; + }; + + /** + * Encodes the specified ExportToCdwPipelineMetadata message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata + * @static + * @param {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IExportToCdwPipelineMetadata} message ExportToCdwPipelineMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportToCdwPipelineMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportToCdwPipelineMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata} ExportToCdwPipelineMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportToCdwPipelineMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.documents && message.documents.length)) + message.documents = []; + message.documents.push(reader.string()); + break; + } + case 2: { + message.docAiDataset = reader.string(); + break; + } + case 3: { + message.outputPath = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportToCdwPipelineMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata} ExportToCdwPipelineMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportToCdwPipelineMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportToCdwPipelineMetadata message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportToCdwPipelineMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.documents != null && message.hasOwnProperty("documents")) { + if (!Array.isArray(message.documents)) + return "documents: array expected"; + for (var i = 0; i < message.documents.length; ++i) + if (!$util.isString(message.documents[i])) + return "documents: string[] expected"; + } + if (message.docAiDataset != null && message.hasOwnProperty("docAiDataset")) + if (!$util.isString(message.docAiDataset)) + return "docAiDataset: string expected"; + if (message.outputPath != null && message.hasOwnProperty("outputPath")) + if (!$util.isString(message.outputPath)) + return "outputPath: string expected"; + return null; + }; + + /** + * Creates an ExportToCdwPipelineMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata} ExportToCdwPipelineMetadata + */ + ExportToCdwPipelineMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata(); + if (object.documents) { + if (!Array.isArray(object.documents)) + throw TypeError(".google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata.documents: array expected"); + message.documents = []; + for (var i = 0; i < object.documents.length; ++i) + message.documents[i] = String(object.documents[i]); + } + if (object.docAiDataset != null) + message.docAiDataset = String(object.docAiDataset); + if (object.outputPath != null) + message.outputPath = String(object.outputPath); + return message; + }; + + /** + * Creates a plain object from an ExportToCdwPipelineMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata + * @static + * @param {google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata} message ExportToCdwPipelineMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportToCdwPipelineMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.documents = []; + if (options.defaults) { + object.docAiDataset = ""; + object.outputPath = ""; + } + if (message.documents && message.documents.length) { + object.documents = []; + for (var j = 0; j < message.documents.length; ++j) + object.documents[j] = message.documents[j]; + } + if (message.docAiDataset != null && message.hasOwnProperty("docAiDataset")) + object.docAiDataset = message.docAiDataset; + if (message.outputPath != null && message.hasOwnProperty("outputPath")) + object.outputPath = message.outputPath; + return object; + }; + + /** + * Converts this ExportToCdwPipelineMetadata to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata + * @instance + * @returns {Object.} JSON object + */ + ExportToCdwPipelineMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportToCdwPipelineMetadata + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportToCdwPipelineMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata"; + }; + + return ExportToCdwPipelineMetadata; + })(); + + RunPipelineMetadata.ProcessWithDocAiPipelineMetadata = (function() { + + /** + * Properties of a ProcessWithDocAiPipelineMetadata. + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata + * @interface IProcessWithDocAiPipelineMetadata + * @property {Array.|null} [documents] ProcessWithDocAiPipelineMetadata documents + * @property {google.cloud.contentwarehouse.v1.IProcessorInfo|null} [processorInfo] ProcessWithDocAiPipelineMetadata processorInfo + */ + + /** + * Constructs a new ProcessWithDocAiPipelineMetadata. + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata + * @classdesc Represents a ProcessWithDocAiPipelineMetadata. + * @implements IProcessWithDocAiPipelineMetadata + * @constructor + * @param {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IProcessWithDocAiPipelineMetadata=} [properties] Properties to set + */ + function ProcessWithDocAiPipelineMetadata(properties) { + this.documents = []; + 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]]; + } + + /** + * ProcessWithDocAiPipelineMetadata documents. + * @member {Array.} documents + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata + * @instance + */ + ProcessWithDocAiPipelineMetadata.prototype.documents = $util.emptyArray; + + /** + * ProcessWithDocAiPipelineMetadata processorInfo. + * @member {google.cloud.contentwarehouse.v1.IProcessorInfo|null|undefined} processorInfo + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata + * @instance + */ + ProcessWithDocAiPipelineMetadata.prototype.processorInfo = null; + + /** + * Creates a new ProcessWithDocAiPipelineMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata + * @static + * @param {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IProcessWithDocAiPipelineMetadata=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata} ProcessWithDocAiPipelineMetadata instance + */ + ProcessWithDocAiPipelineMetadata.create = function create(properties) { + return new ProcessWithDocAiPipelineMetadata(properties); + }; + + /** + * Encodes the specified ProcessWithDocAiPipelineMetadata message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata + * @static + * @param {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IProcessWithDocAiPipelineMetadata} message ProcessWithDocAiPipelineMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProcessWithDocAiPipelineMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documents != null && message.documents.length) + for (var i = 0; i < message.documents.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.documents[i]); + if (message.processorInfo != null && Object.hasOwnProperty.call(message, "processorInfo")) + $root.google.cloud.contentwarehouse.v1.ProcessorInfo.encode(message.processorInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ProcessWithDocAiPipelineMetadata message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata + * @static + * @param {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IProcessWithDocAiPipelineMetadata} message ProcessWithDocAiPipelineMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProcessWithDocAiPipelineMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProcessWithDocAiPipelineMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata} ProcessWithDocAiPipelineMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProcessWithDocAiPipelineMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.documents && message.documents.length)) + message.documents = []; + message.documents.push(reader.string()); + break; + } + case 2: { + message.processorInfo = $root.google.cloud.contentwarehouse.v1.ProcessorInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProcessWithDocAiPipelineMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata} ProcessWithDocAiPipelineMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProcessWithDocAiPipelineMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProcessWithDocAiPipelineMetadata message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProcessWithDocAiPipelineMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.documents != null && message.hasOwnProperty("documents")) { + if (!Array.isArray(message.documents)) + return "documents: array expected"; + for (var i = 0; i < message.documents.length; ++i) + if (!$util.isString(message.documents[i])) + return "documents: string[] expected"; + } + if (message.processorInfo != null && message.hasOwnProperty("processorInfo")) { + var error = $root.google.cloud.contentwarehouse.v1.ProcessorInfo.verify(message.processorInfo); + if (error) + return "processorInfo." + error; + } + return null; + }; + + /** + * Creates a ProcessWithDocAiPipelineMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata} ProcessWithDocAiPipelineMetadata + */ + ProcessWithDocAiPipelineMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata(); + if (object.documents) { + if (!Array.isArray(object.documents)) + throw TypeError(".google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata.documents: array expected"); + message.documents = []; + for (var i = 0; i < object.documents.length; ++i) + message.documents[i] = String(object.documents[i]); + } + if (object.processorInfo != null) { + if (typeof object.processorInfo !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata.processorInfo: object expected"); + message.processorInfo = $root.google.cloud.contentwarehouse.v1.ProcessorInfo.fromObject(object.processorInfo); + } + return message; + }; + + /** + * Creates a plain object from a ProcessWithDocAiPipelineMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata + * @static + * @param {google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata} message ProcessWithDocAiPipelineMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProcessWithDocAiPipelineMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.documents = []; + if (options.defaults) + object.processorInfo = null; + if (message.documents && message.documents.length) { + object.documents = []; + for (var j = 0; j < message.documents.length; ++j) + object.documents[j] = message.documents[j]; + } + if (message.processorInfo != null && message.hasOwnProperty("processorInfo")) + object.processorInfo = $root.google.cloud.contentwarehouse.v1.ProcessorInfo.toObject(message.processorInfo, options); + return object; + }; + + /** + * Converts this ProcessWithDocAiPipelineMetadata to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata + * @instance + * @returns {Object.} JSON object + */ + ProcessWithDocAiPipelineMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ProcessWithDocAiPipelineMetadata + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ProcessWithDocAiPipelineMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata"; + }; + + return ProcessWithDocAiPipelineMetadata; + })(); + + RunPipelineMetadata.IndividualDocumentStatus = (function() { + + /** + * Properties of an IndividualDocumentStatus. + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata + * @interface IIndividualDocumentStatus + * @property {string|null} [documentId] IndividualDocumentStatus documentId + * @property {google.rpc.IStatus|null} [status] IndividualDocumentStatus status + */ + + /** + * Constructs a new IndividualDocumentStatus. + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata + * @classdesc Represents an IndividualDocumentStatus. + * @implements IIndividualDocumentStatus + * @constructor + * @param {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IIndividualDocumentStatus=} [properties] Properties to set + */ + function IndividualDocumentStatus(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]]; + } + + /** + * IndividualDocumentStatus documentId. + * @member {string} documentId + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus + * @instance + */ + IndividualDocumentStatus.prototype.documentId = ""; + + /** + * IndividualDocumentStatus status. + * @member {google.rpc.IStatus|null|undefined} status + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus + * @instance + */ + IndividualDocumentStatus.prototype.status = null; + + /** + * Creates a new IndividualDocumentStatus instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus + * @static + * @param {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IIndividualDocumentStatus=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus} IndividualDocumentStatus instance + */ + IndividualDocumentStatus.create = function create(properties) { + return new IndividualDocumentStatus(properties); + }; + + /** + * Encodes the specified IndividualDocumentStatus message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus + * @static + * @param {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IIndividualDocumentStatus} message IndividualDocumentStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IndividualDocumentStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documentId != null && Object.hasOwnProperty.call(message, "documentId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.documentId); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IndividualDocumentStatus message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus + * @static + * @param {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IIndividualDocumentStatus} message IndividualDocumentStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IndividualDocumentStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IndividualDocumentStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus} IndividualDocumentStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IndividualDocumentStatus.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.documentId = reader.string(); + break; + } + case 2: { + message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IndividualDocumentStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus} IndividualDocumentStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IndividualDocumentStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IndividualDocumentStatus message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IndividualDocumentStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.documentId != null && message.hasOwnProperty("documentId")) + if (!$util.isString(message.documentId)) + return "documentId: string expected"; + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.rpc.Status.verify(message.status); + if (error) + return "status." + error; + } + return null; + }; + + /** + * Creates an IndividualDocumentStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus} IndividualDocumentStatus + */ + IndividualDocumentStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus(); + if (object.documentId != null) + message.documentId = String(object.documentId); + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus.status: object expected"); + message.status = $root.google.rpc.Status.fromObject(object.status); + } + return message; + }; + + /** + * Creates a plain object from an IndividualDocumentStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus + * @static + * @param {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus} message IndividualDocumentStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IndividualDocumentStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.documentId = ""; + object.status = null; + } + if (message.documentId != null && message.hasOwnProperty("documentId")) + object.documentId = message.documentId; + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.rpc.Status.toObject(message.status, options); + return object; + }; + + /** + * Converts this IndividualDocumentStatus to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus + * @instance + * @returns {Object.} JSON object + */ + IndividualDocumentStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IndividualDocumentStatus + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IndividualDocumentStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus"; + }; + + return IndividualDocumentStatus; + })(); + + return RunPipelineMetadata; + })(); + + v1.ProcessorInfo = (function() { + + /** + * Properties of a ProcessorInfo. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IProcessorInfo + * @property {string|null} [processorName] ProcessorInfo processorName + * @property {string|null} [documentType] ProcessorInfo documentType + * @property {string|null} [schemaName] ProcessorInfo schemaName + */ + + /** + * Constructs a new ProcessorInfo. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a ProcessorInfo. + * @implements IProcessorInfo + * @constructor + * @param {google.cloud.contentwarehouse.v1.IProcessorInfo=} [properties] Properties to set + */ + function ProcessorInfo(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]]; + } + + /** + * ProcessorInfo processorName. + * @member {string} processorName + * @memberof google.cloud.contentwarehouse.v1.ProcessorInfo + * @instance + */ + ProcessorInfo.prototype.processorName = ""; + + /** + * ProcessorInfo documentType. + * @member {string} documentType + * @memberof google.cloud.contentwarehouse.v1.ProcessorInfo + * @instance + */ + ProcessorInfo.prototype.documentType = ""; + + /** + * ProcessorInfo schemaName. + * @member {string} schemaName + * @memberof google.cloud.contentwarehouse.v1.ProcessorInfo + * @instance + */ + ProcessorInfo.prototype.schemaName = ""; + + /** + * Creates a new ProcessorInfo instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.ProcessorInfo + * @static + * @param {google.cloud.contentwarehouse.v1.IProcessorInfo=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.ProcessorInfo} ProcessorInfo instance + */ + ProcessorInfo.create = function create(properties) { + return new ProcessorInfo(properties); + }; + + /** + * Encodes the specified ProcessorInfo message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ProcessorInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.ProcessorInfo + * @static + * @param {google.cloud.contentwarehouse.v1.IProcessorInfo} message ProcessorInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProcessorInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.processorName != null && Object.hasOwnProperty.call(message, "processorName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.processorName); + if (message.documentType != null && Object.hasOwnProperty.call(message, "documentType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.documentType); + if (message.schemaName != null && Object.hasOwnProperty.call(message, "schemaName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.schemaName); + return writer; + }; + + /** + * Encodes the specified ProcessorInfo message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ProcessorInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.ProcessorInfo + * @static + * @param {google.cloud.contentwarehouse.v1.IProcessorInfo} message ProcessorInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProcessorInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProcessorInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.ProcessorInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.ProcessorInfo} ProcessorInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProcessorInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.ProcessorInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.processorName = reader.string(); + break; + } + case 2: { + message.documentType = reader.string(); + break; + } + case 3: { + message.schemaName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProcessorInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.ProcessorInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.ProcessorInfo} ProcessorInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProcessorInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProcessorInfo message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.ProcessorInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProcessorInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.processorName != null && message.hasOwnProperty("processorName")) + if (!$util.isString(message.processorName)) + return "processorName: string expected"; + if (message.documentType != null && message.hasOwnProperty("documentType")) + if (!$util.isString(message.documentType)) + return "documentType: string expected"; + if (message.schemaName != null && message.hasOwnProperty("schemaName")) + if (!$util.isString(message.schemaName)) + return "schemaName: string expected"; + return null; + }; + + /** + * Creates a ProcessorInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.ProcessorInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.ProcessorInfo} ProcessorInfo + */ + ProcessorInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.ProcessorInfo) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.ProcessorInfo(); + if (object.processorName != null) + message.processorName = String(object.processorName); + if (object.documentType != null) + message.documentType = String(object.documentType); + if (object.schemaName != null) + message.schemaName = String(object.schemaName); + return message; + }; + + /** + * Creates a plain object from a ProcessorInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.ProcessorInfo + * @static + * @param {google.cloud.contentwarehouse.v1.ProcessorInfo} message ProcessorInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProcessorInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.processorName = ""; + object.documentType = ""; + object.schemaName = ""; + } + if (message.processorName != null && message.hasOwnProperty("processorName")) + object.processorName = message.processorName; + if (message.documentType != null && message.hasOwnProperty("documentType")) + object.documentType = message.documentType; + if (message.schemaName != null && message.hasOwnProperty("schemaName")) + object.schemaName = message.schemaName; + return object; + }; + + /** + * Converts this ProcessorInfo to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.ProcessorInfo + * @instance + * @returns {Object.} JSON object + */ + ProcessorInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ProcessorInfo + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.ProcessorInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ProcessorInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.ProcessorInfo"; + }; + + return ProcessorInfo; + })(); + + v1.IngestPipelineConfig = (function() { + + /** + * Properties of an IngestPipelineConfig. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IIngestPipelineConfig + * @property {google.iam.v1.IPolicy|null} [documentAclPolicy] IngestPipelineConfig documentAclPolicy + * @property {boolean|null} [enableDocumentTextExtraction] IngestPipelineConfig enableDocumentTextExtraction + * @property {string|null} [folder] IngestPipelineConfig folder + * @property {string|null} [cloudFunction] IngestPipelineConfig cloudFunction + */ + + /** + * Constructs a new IngestPipelineConfig. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents an IngestPipelineConfig. + * @implements IIngestPipelineConfig + * @constructor + * @param {google.cloud.contentwarehouse.v1.IIngestPipelineConfig=} [properties] Properties to set + */ + function IngestPipelineConfig(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]]; + } + + /** + * IngestPipelineConfig documentAclPolicy. + * @member {google.iam.v1.IPolicy|null|undefined} documentAclPolicy + * @memberof google.cloud.contentwarehouse.v1.IngestPipelineConfig + * @instance + */ + IngestPipelineConfig.prototype.documentAclPolicy = null; + + /** + * IngestPipelineConfig enableDocumentTextExtraction. + * @member {boolean} enableDocumentTextExtraction + * @memberof google.cloud.contentwarehouse.v1.IngestPipelineConfig + * @instance + */ + IngestPipelineConfig.prototype.enableDocumentTextExtraction = false; + + /** + * IngestPipelineConfig folder. + * @member {string} folder + * @memberof google.cloud.contentwarehouse.v1.IngestPipelineConfig + * @instance + */ + IngestPipelineConfig.prototype.folder = ""; + + /** + * IngestPipelineConfig cloudFunction. + * @member {string} cloudFunction + * @memberof google.cloud.contentwarehouse.v1.IngestPipelineConfig + * @instance + */ + IngestPipelineConfig.prototype.cloudFunction = ""; + + /** + * Creates a new IngestPipelineConfig instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.IngestPipelineConfig + * @static + * @param {google.cloud.contentwarehouse.v1.IIngestPipelineConfig=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.IngestPipelineConfig} IngestPipelineConfig instance + */ + IngestPipelineConfig.create = function create(properties) { + return new IngestPipelineConfig(properties); + }; + + /** + * Encodes the specified IngestPipelineConfig message. Does not implicitly {@link google.cloud.contentwarehouse.v1.IngestPipelineConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.IngestPipelineConfig + * @static + * @param {google.cloud.contentwarehouse.v1.IIngestPipelineConfig} message IngestPipelineConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngestPipelineConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documentAclPolicy != null && Object.hasOwnProperty.call(message, "documentAclPolicy")) + $root.google.iam.v1.Policy.encode(message.documentAclPolicy, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.enableDocumentTextExtraction != null && Object.hasOwnProperty.call(message, "enableDocumentTextExtraction")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enableDocumentTextExtraction); + if (message.folder != null && Object.hasOwnProperty.call(message, "folder")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.folder); + if (message.cloudFunction != null && Object.hasOwnProperty.call(message, "cloudFunction")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.cloudFunction); + return writer; + }; + + /** + * Encodes the specified IngestPipelineConfig message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.IngestPipelineConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.IngestPipelineConfig + * @static + * @param {google.cloud.contentwarehouse.v1.IIngestPipelineConfig} message IngestPipelineConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngestPipelineConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IngestPipelineConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.IngestPipelineConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.IngestPipelineConfig} IngestPipelineConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngestPipelineConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.IngestPipelineConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.documentAclPolicy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + } + case 2: { + message.enableDocumentTextExtraction = reader.bool(); + break; + } + case 3: { + message.folder = reader.string(); + break; + } + case 4: { + message.cloudFunction = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IngestPipelineConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.IngestPipelineConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.IngestPipelineConfig} IngestPipelineConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngestPipelineConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IngestPipelineConfig message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.IngestPipelineConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IngestPipelineConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.documentAclPolicy != null && message.hasOwnProperty("documentAclPolicy")) { + var error = $root.google.iam.v1.Policy.verify(message.documentAclPolicy); + if (error) + return "documentAclPolicy." + error; + } + if (message.enableDocumentTextExtraction != null && message.hasOwnProperty("enableDocumentTextExtraction")) + if (typeof message.enableDocumentTextExtraction !== "boolean") + return "enableDocumentTextExtraction: boolean expected"; + if (message.folder != null && message.hasOwnProperty("folder")) + if (!$util.isString(message.folder)) + return "folder: string expected"; + if (message.cloudFunction != null && message.hasOwnProperty("cloudFunction")) + if (!$util.isString(message.cloudFunction)) + return "cloudFunction: string expected"; + return null; + }; + + /** + * Creates an IngestPipelineConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.IngestPipelineConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.IngestPipelineConfig} IngestPipelineConfig + */ + IngestPipelineConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.IngestPipelineConfig) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.IngestPipelineConfig(); + if (object.documentAclPolicy != null) { + if (typeof object.documentAclPolicy !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.IngestPipelineConfig.documentAclPolicy: object expected"); + message.documentAclPolicy = $root.google.iam.v1.Policy.fromObject(object.documentAclPolicy); + } + if (object.enableDocumentTextExtraction != null) + message.enableDocumentTextExtraction = Boolean(object.enableDocumentTextExtraction); + if (object.folder != null) + message.folder = String(object.folder); + if (object.cloudFunction != null) + message.cloudFunction = String(object.cloudFunction); + return message; + }; + + /** + * Creates a plain object from an IngestPipelineConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.IngestPipelineConfig + * @static + * @param {google.cloud.contentwarehouse.v1.IngestPipelineConfig} message IngestPipelineConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IngestPipelineConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.documentAclPolicy = null; + object.enableDocumentTextExtraction = false; + object.folder = ""; + object.cloudFunction = ""; + } + if (message.documentAclPolicy != null && message.hasOwnProperty("documentAclPolicy")) + object.documentAclPolicy = $root.google.iam.v1.Policy.toObject(message.documentAclPolicy, options); + if (message.enableDocumentTextExtraction != null && message.hasOwnProperty("enableDocumentTextExtraction")) + object.enableDocumentTextExtraction = message.enableDocumentTextExtraction; + if (message.folder != null && message.hasOwnProperty("folder")) + object.folder = message.folder; + if (message.cloudFunction != null && message.hasOwnProperty("cloudFunction")) + object.cloudFunction = message.cloudFunction; + return object; + }; + + /** + * Converts this IngestPipelineConfig to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.IngestPipelineConfig + * @instance + * @returns {Object.} JSON object + */ + IngestPipelineConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IngestPipelineConfig + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.IngestPipelineConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IngestPipelineConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.IngestPipelineConfig"; + }; + + return IngestPipelineConfig; + })(); + + v1.GcsIngestPipeline = (function() { + + /** + * Properties of a GcsIngestPipeline. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IGcsIngestPipeline + * @property {string|null} [inputPath] GcsIngestPipeline inputPath + * @property {string|null} [schemaName] GcsIngestPipeline schemaName + * @property {string|null} [processorType] GcsIngestPipeline processorType + * @property {boolean|null} [skipIngestedDocuments] GcsIngestPipeline skipIngestedDocuments + * @property {google.cloud.contentwarehouse.v1.IIngestPipelineConfig|null} [pipelineConfig] GcsIngestPipeline pipelineConfig + */ + + /** + * Constructs a new GcsIngestPipeline. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a GcsIngestPipeline. + * @implements IGcsIngestPipeline + * @constructor + * @param {google.cloud.contentwarehouse.v1.IGcsIngestPipeline=} [properties] Properties to set + */ + function GcsIngestPipeline(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]]; + } + + /** + * GcsIngestPipeline inputPath. + * @member {string} inputPath + * @memberof google.cloud.contentwarehouse.v1.GcsIngestPipeline + * @instance + */ + GcsIngestPipeline.prototype.inputPath = ""; + + /** + * GcsIngestPipeline schemaName. + * @member {string} schemaName + * @memberof google.cloud.contentwarehouse.v1.GcsIngestPipeline + * @instance + */ + GcsIngestPipeline.prototype.schemaName = ""; + + /** + * GcsIngestPipeline processorType. + * @member {string} processorType + * @memberof google.cloud.contentwarehouse.v1.GcsIngestPipeline + * @instance + */ + GcsIngestPipeline.prototype.processorType = ""; + + /** + * GcsIngestPipeline skipIngestedDocuments. + * @member {boolean} skipIngestedDocuments + * @memberof google.cloud.contentwarehouse.v1.GcsIngestPipeline + * @instance + */ + GcsIngestPipeline.prototype.skipIngestedDocuments = false; + + /** + * GcsIngestPipeline pipelineConfig. + * @member {google.cloud.contentwarehouse.v1.IIngestPipelineConfig|null|undefined} pipelineConfig + * @memberof google.cloud.contentwarehouse.v1.GcsIngestPipeline + * @instance + */ + GcsIngestPipeline.prototype.pipelineConfig = null; + + /** + * Creates a new GcsIngestPipeline instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.GcsIngestPipeline + * @static + * @param {google.cloud.contentwarehouse.v1.IGcsIngestPipeline=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.GcsIngestPipeline} GcsIngestPipeline instance + */ + GcsIngestPipeline.create = function create(properties) { + return new GcsIngestPipeline(properties); + }; + + /** + * Encodes the specified GcsIngestPipeline message. Does not implicitly {@link google.cloud.contentwarehouse.v1.GcsIngestPipeline.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.GcsIngestPipeline + * @static + * @param {google.cloud.contentwarehouse.v1.IGcsIngestPipeline} message GcsIngestPipeline message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsIngestPipeline.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputPath != null && Object.hasOwnProperty.call(message, "inputPath")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputPath); + if (message.schemaName != null && Object.hasOwnProperty.call(message, "schemaName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.schemaName); + if (message.processorType != null && Object.hasOwnProperty.call(message, "processorType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.processorType); + if (message.skipIngestedDocuments != null && Object.hasOwnProperty.call(message, "skipIngestedDocuments")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.skipIngestedDocuments); + if (message.pipelineConfig != null && Object.hasOwnProperty.call(message, "pipelineConfig")) + $root.google.cloud.contentwarehouse.v1.IngestPipelineConfig.encode(message.pipelineConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GcsIngestPipeline message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.GcsIngestPipeline.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.GcsIngestPipeline + * @static + * @param {google.cloud.contentwarehouse.v1.IGcsIngestPipeline} message GcsIngestPipeline message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsIngestPipeline.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsIngestPipeline message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.GcsIngestPipeline + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.GcsIngestPipeline} GcsIngestPipeline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsIngestPipeline.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.GcsIngestPipeline(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.inputPath = reader.string(); + break; + } + case 2: { + message.schemaName = reader.string(); + break; + } + case 3: { + message.processorType = reader.string(); + break; + } + case 4: { + message.skipIngestedDocuments = reader.bool(); + break; + } + case 5: { + message.pipelineConfig = $root.google.cloud.contentwarehouse.v1.IngestPipelineConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcsIngestPipeline message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.GcsIngestPipeline + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.GcsIngestPipeline} GcsIngestPipeline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsIngestPipeline.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsIngestPipeline message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.GcsIngestPipeline + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsIngestPipeline.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputPath != null && message.hasOwnProperty("inputPath")) + if (!$util.isString(message.inputPath)) + return "inputPath: string expected"; + if (message.schemaName != null && message.hasOwnProperty("schemaName")) + if (!$util.isString(message.schemaName)) + return "schemaName: string expected"; + if (message.processorType != null && message.hasOwnProperty("processorType")) + if (!$util.isString(message.processorType)) + return "processorType: string expected"; + if (message.skipIngestedDocuments != null && message.hasOwnProperty("skipIngestedDocuments")) + if (typeof message.skipIngestedDocuments !== "boolean") + return "skipIngestedDocuments: boolean expected"; + if (message.pipelineConfig != null && message.hasOwnProperty("pipelineConfig")) { + var error = $root.google.cloud.contentwarehouse.v1.IngestPipelineConfig.verify(message.pipelineConfig); + if (error) + return "pipelineConfig." + error; + } + return null; + }; + + /** + * Creates a GcsIngestPipeline message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.GcsIngestPipeline + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.GcsIngestPipeline} GcsIngestPipeline + */ + GcsIngestPipeline.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.GcsIngestPipeline) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.GcsIngestPipeline(); + if (object.inputPath != null) + message.inputPath = String(object.inputPath); + if (object.schemaName != null) + message.schemaName = String(object.schemaName); + if (object.processorType != null) + message.processorType = String(object.processorType); + if (object.skipIngestedDocuments != null) + message.skipIngestedDocuments = Boolean(object.skipIngestedDocuments); + if (object.pipelineConfig != null) { + if (typeof object.pipelineConfig !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.GcsIngestPipeline.pipelineConfig: object expected"); + message.pipelineConfig = $root.google.cloud.contentwarehouse.v1.IngestPipelineConfig.fromObject(object.pipelineConfig); + } + return message; + }; + + /** + * Creates a plain object from a GcsIngestPipeline message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.GcsIngestPipeline + * @static + * @param {google.cloud.contentwarehouse.v1.GcsIngestPipeline} message GcsIngestPipeline + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsIngestPipeline.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.inputPath = ""; + object.schemaName = ""; + object.processorType = ""; + object.skipIngestedDocuments = false; + object.pipelineConfig = null; + } + if (message.inputPath != null && message.hasOwnProperty("inputPath")) + object.inputPath = message.inputPath; + if (message.schemaName != null && message.hasOwnProperty("schemaName")) + object.schemaName = message.schemaName; + if (message.processorType != null && message.hasOwnProperty("processorType")) + object.processorType = message.processorType; + if (message.skipIngestedDocuments != null && message.hasOwnProperty("skipIngestedDocuments")) + object.skipIngestedDocuments = message.skipIngestedDocuments; + if (message.pipelineConfig != null && message.hasOwnProperty("pipelineConfig")) + object.pipelineConfig = $root.google.cloud.contentwarehouse.v1.IngestPipelineConfig.toObject(message.pipelineConfig, options); + return object; + }; + + /** + * Converts this GcsIngestPipeline to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.GcsIngestPipeline + * @instance + * @returns {Object.} JSON object + */ + GcsIngestPipeline.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GcsIngestPipeline + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.GcsIngestPipeline + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcsIngestPipeline.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.GcsIngestPipeline"; + }; + + return GcsIngestPipeline; + })(); + + v1.GcsIngestWithDocAiProcessorsPipeline = (function() { + + /** + * Properties of a GcsIngestWithDocAiProcessorsPipeline. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IGcsIngestWithDocAiProcessorsPipeline + * @property {string|null} [inputPath] GcsIngestWithDocAiProcessorsPipeline inputPath + * @property {google.cloud.contentwarehouse.v1.IProcessorInfo|null} [splitClassifyProcessorInfo] GcsIngestWithDocAiProcessorsPipeline splitClassifyProcessorInfo + * @property {Array.|null} [extractProcessorInfos] GcsIngestWithDocAiProcessorsPipeline extractProcessorInfos + * @property {string|null} [processorResultsFolderPath] GcsIngestWithDocAiProcessorsPipeline processorResultsFolderPath + * @property {boolean|null} [skipIngestedDocuments] GcsIngestWithDocAiProcessorsPipeline skipIngestedDocuments + * @property {google.cloud.contentwarehouse.v1.IIngestPipelineConfig|null} [pipelineConfig] GcsIngestWithDocAiProcessorsPipeline pipelineConfig + */ + + /** + * Constructs a new GcsIngestWithDocAiProcessorsPipeline. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a GcsIngestWithDocAiProcessorsPipeline. + * @implements IGcsIngestWithDocAiProcessorsPipeline + * @constructor + * @param {google.cloud.contentwarehouse.v1.IGcsIngestWithDocAiProcessorsPipeline=} [properties] Properties to set + */ + function GcsIngestWithDocAiProcessorsPipeline(properties) { + this.extractProcessorInfos = []; + 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]]; + } + + /** + * GcsIngestWithDocAiProcessorsPipeline inputPath. + * @member {string} inputPath + * @memberof google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline + * @instance + */ + GcsIngestWithDocAiProcessorsPipeline.prototype.inputPath = ""; + + /** + * GcsIngestWithDocAiProcessorsPipeline splitClassifyProcessorInfo. + * @member {google.cloud.contentwarehouse.v1.IProcessorInfo|null|undefined} splitClassifyProcessorInfo + * @memberof google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline + * @instance + */ + GcsIngestWithDocAiProcessorsPipeline.prototype.splitClassifyProcessorInfo = null; + + /** + * GcsIngestWithDocAiProcessorsPipeline extractProcessorInfos. + * @member {Array.} extractProcessorInfos + * @memberof google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline + * @instance + */ + GcsIngestWithDocAiProcessorsPipeline.prototype.extractProcessorInfos = $util.emptyArray; + + /** + * GcsIngestWithDocAiProcessorsPipeline processorResultsFolderPath. + * @member {string} processorResultsFolderPath + * @memberof google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline + * @instance + */ + GcsIngestWithDocAiProcessorsPipeline.prototype.processorResultsFolderPath = ""; + + /** + * GcsIngestWithDocAiProcessorsPipeline skipIngestedDocuments. + * @member {boolean} skipIngestedDocuments + * @memberof google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline + * @instance + */ + GcsIngestWithDocAiProcessorsPipeline.prototype.skipIngestedDocuments = false; + + /** + * GcsIngestWithDocAiProcessorsPipeline pipelineConfig. + * @member {google.cloud.contentwarehouse.v1.IIngestPipelineConfig|null|undefined} pipelineConfig + * @memberof google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline + * @instance + */ + GcsIngestWithDocAiProcessorsPipeline.prototype.pipelineConfig = null; + + /** + * Creates a new GcsIngestWithDocAiProcessorsPipeline instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline + * @static + * @param {google.cloud.contentwarehouse.v1.IGcsIngestWithDocAiProcessorsPipeline=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline} GcsIngestWithDocAiProcessorsPipeline instance + */ + GcsIngestWithDocAiProcessorsPipeline.create = function create(properties) { + return new GcsIngestWithDocAiProcessorsPipeline(properties); + }; + + /** + * Encodes the specified GcsIngestWithDocAiProcessorsPipeline message. Does not implicitly {@link google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline + * @static + * @param {google.cloud.contentwarehouse.v1.IGcsIngestWithDocAiProcessorsPipeline} message GcsIngestWithDocAiProcessorsPipeline message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsIngestWithDocAiProcessorsPipeline.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputPath != null && Object.hasOwnProperty.call(message, "inputPath")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputPath); + if (message.splitClassifyProcessorInfo != null && Object.hasOwnProperty.call(message, "splitClassifyProcessorInfo")) + $root.google.cloud.contentwarehouse.v1.ProcessorInfo.encode(message.splitClassifyProcessorInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.extractProcessorInfos != null && message.extractProcessorInfos.length) + for (var i = 0; i < message.extractProcessorInfos.length; ++i) + $root.google.cloud.contentwarehouse.v1.ProcessorInfo.encode(message.extractProcessorInfos[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.processorResultsFolderPath != null && Object.hasOwnProperty.call(message, "processorResultsFolderPath")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.processorResultsFolderPath); + if (message.skipIngestedDocuments != null && Object.hasOwnProperty.call(message, "skipIngestedDocuments")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.skipIngestedDocuments); + if (message.pipelineConfig != null && Object.hasOwnProperty.call(message, "pipelineConfig")) + $root.google.cloud.contentwarehouse.v1.IngestPipelineConfig.encode(message.pipelineConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GcsIngestWithDocAiProcessorsPipeline message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline + * @static + * @param {google.cloud.contentwarehouse.v1.IGcsIngestWithDocAiProcessorsPipeline} message GcsIngestWithDocAiProcessorsPipeline message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsIngestWithDocAiProcessorsPipeline.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsIngestWithDocAiProcessorsPipeline message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline} GcsIngestWithDocAiProcessorsPipeline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsIngestWithDocAiProcessorsPipeline.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.inputPath = reader.string(); + break; + } + case 2: { + message.splitClassifyProcessorInfo = $root.google.cloud.contentwarehouse.v1.ProcessorInfo.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.extractProcessorInfos && message.extractProcessorInfos.length)) + message.extractProcessorInfos = []; + message.extractProcessorInfos.push($root.google.cloud.contentwarehouse.v1.ProcessorInfo.decode(reader, reader.uint32())); + break; + } + case 4: { + message.processorResultsFolderPath = reader.string(); + break; + } + case 5: { + message.skipIngestedDocuments = reader.bool(); + break; + } + case 6: { + message.pipelineConfig = $root.google.cloud.contentwarehouse.v1.IngestPipelineConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcsIngestWithDocAiProcessorsPipeline message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline} GcsIngestWithDocAiProcessorsPipeline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsIngestWithDocAiProcessorsPipeline.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsIngestWithDocAiProcessorsPipeline message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsIngestWithDocAiProcessorsPipeline.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputPath != null && message.hasOwnProperty("inputPath")) + if (!$util.isString(message.inputPath)) + return "inputPath: string expected"; + if (message.splitClassifyProcessorInfo != null && message.hasOwnProperty("splitClassifyProcessorInfo")) { + var error = $root.google.cloud.contentwarehouse.v1.ProcessorInfo.verify(message.splitClassifyProcessorInfo); + if (error) + return "splitClassifyProcessorInfo." + error; + } + if (message.extractProcessorInfos != null && message.hasOwnProperty("extractProcessorInfos")) { + if (!Array.isArray(message.extractProcessorInfos)) + return "extractProcessorInfos: array expected"; + for (var i = 0; i < message.extractProcessorInfos.length; ++i) { + var error = $root.google.cloud.contentwarehouse.v1.ProcessorInfo.verify(message.extractProcessorInfos[i]); + if (error) + return "extractProcessorInfos." + error; + } + } + if (message.processorResultsFolderPath != null && message.hasOwnProperty("processorResultsFolderPath")) + if (!$util.isString(message.processorResultsFolderPath)) + return "processorResultsFolderPath: string expected"; + if (message.skipIngestedDocuments != null && message.hasOwnProperty("skipIngestedDocuments")) + if (typeof message.skipIngestedDocuments !== "boolean") + return "skipIngestedDocuments: boolean expected"; + if (message.pipelineConfig != null && message.hasOwnProperty("pipelineConfig")) { + var error = $root.google.cloud.contentwarehouse.v1.IngestPipelineConfig.verify(message.pipelineConfig); + if (error) + return "pipelineConfig." + error; + } + return null; + }; + + /** + * Creates a GcsIngestWithDocAiProcessorsPipeline message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline} GcsIngestWithDocAiProcessorsPipeline + */ + GcsIngestWithDocAiProcessorsPipeline.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline(); + if (object.inputPath != null) + message.inputPath = String(object.inputPath); + if (object.splitClassifyProcessorInfo != null) { + if (typeof object.splitClassifyProcessorInfo !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline.splitClassifyProcessorInfo: object expected"); + message.splitClassifyProcessorInfo = $root.google.cloud.contentwarehouse.v1.ProcessorInfo.fromObject(object.splitClassifyProcessorInfo); + } + if (object.extractProcessorInfos) { + if (!Array.isArray(object.extractProcessorInfos)) + throw TypeError(".google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline.extractProcessorInfos: array expected"); + message.extractProcessorInfos = []; + for (var i = 0; i < object.extractProcessorInfos.length; ++i) { + if (typeof object.extractProcessorInfos[i] !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline.extractProcessorInfos: object expected"); + message.extractProcessorInfos[i] = $root.google.cloud.contentwarehouse.v1.ProcessorInfo.fromObject(object.extractProcessorInfos[i]); + } + } + if (object.processorResultsFolderPath != null) + message.processorResultsFolderPath = String(object.processorResultsFolderPath); + if (object.skipIngestedDocuments != null) + message.skipIngestedDocuments = Boolean(object.skipIngestedDocuments); + if (object.pipelineConfig != null) { + if (typeof object.pipelineConfig !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline.pipelineConfig: object expected"); + message.pipelineConfig = $root.google.cloud.contentwarehouse.v1.IngestPipelineConfig.fromObject(object.pipelineConfig); + } + return message; + }; + + /** + * Creates a plain object from a GcsIngestWithDocAiProcessorsPipeline message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline + * @static + * @param {google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline} message GcsIngestWithDocAiProcessorsPipeline + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsIngestWithDocAiProcessorsPipeline.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.extractProcessorInfos = []; + if (options.defaults) { + object.inputPath = ""; + object.splitClassifyProcessorInfo = null; + object.processorResultsFolderPath = ""; + object.skipIngestedDocuments = false; + object.pipelineConfig = null; + } + if (message.inputPath != null && message.hasOwnProperty("inputPath")) + object.inputPath = message.inputPath; + if (message.splitClassifyProcessorInfo != null && message.hasOwnProperty("splitClassifyProcessorInfo")) + object.splitClassifyProcessorInfo = $root.google.cloud.contentwarehouse.v1.ProcessorInfo.toObject(message.splitClassifyProcessorInfo, options); + if (message.extractProcessorInfos && message.extractProcessorInfos.length) { + object.extractProcessorInfos = []; + for (var j = 0; j < message.extractProcessorInfos.length; ++j) + object.extractProcessorInfos[j] = $root.google.cloud.contentwarehouse.v1.ProcessorInfo.toObject(message.extractProcessorInfos[j], options); + } + if (message.processorResultsFolderPath != null && message.hasOwnProperty("processorResultsFolderPath")) + object.processorResultsFolderPath = message.processorResultsFolderPath; + if (message.skipIngestedDocuments != null && message.hasOwnProperty("skipIngestedDocuments")) + object.skipIngestedDocuments = message.skipIngestedDocuments; + if (message.pipelineConfig != null && message.hasOwnProperty("pipelineConfig")) + object.pipelineConfig = $root.google.cloud.contentwarehouse.v1.IngestPipelineConfig.toObject(message.pipelineConfig, options); + return object; + }; + + /** + * Converts this GcsIngestWithDocAiProcessorsPipeline to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline + * @instance + * @returns {Object.} JSON object + */ + GcsIngestWithDocAiProcessorsPipeline.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GcsIngestWithDocAiProcessorsPipeline + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcsIngestWithDocAiProcessorsPipeline.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline"; + }; + + return GcsIngestWithDocAiProcessorsPipeline; + })(); + + v1.ExportToCdwPipeline = (function() { + + /** + * Properties of an ExportToCdwPipeline. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IExportToCdwPipeline + * @property {Array.|null} [documents] ExportToCdwPipeline documents + * @property {string|null} [exportFolderPath] ExportToCdwPipeline exportFolderPath + * @property {string|null} [docAiDataset] ExportToCdwPipeline docAiDataset + * @property {number|null} [trainingSplitRatio] ExportToCdwPipeline trainingSplitRatio + */ + + /** + * Constructs a new ExportToCdwPipeline. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents an ExportToCdwPipeline. + * @implements IExportToCdwPipeline + * @constructor + * @param {google.cloud.contentwarehouse.v1.IExportToCdwPipeline=} [properties] Properties to set + */ + function ExportToCdwPipeline(properties) { + this.documents = []; + 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]]; + } + + /** + * ExportToCdwPipeline documents. + * @member {Array.} documents + * @memberof google.cloud.contentwarehouse.v1.ExportToCdwPipeline + * @instance + */ + ExportToCdwPipeline.prototype.documents = $util.emptyArray; + + /** + * ExportToCdwPipeline exportFolderPath. + * @member {string} exportFolderPath + * @memberof google.cloud.contentwarehouse.v1.ExportToCdwPipeline + * @instance + */ + ExportToCdwPipeline.prototype.exportFolderPath = ""; + + /** + * ExportToCdwPipeline docAiDataset. + * @member {string} docAiDataset + * @memberof google.cloud.contentwarehouse.v1.ExportToCdwPipeline + * @instance + */ + ExportToCdwPipeline.prototype.docAiDataset = ""; + + /** + * ExportToCdwPipeline trainingSplitRatio. + * @member {number} trainingSplitRatio + * @memberof google.cloud.contentwarehouse.v1.ExportToCdwPipeline + * @instance + */ + ExportToCdwPipeline.prototype.trainingSplitRatio = 0; + + /** + * Creates a new ExportToCdwPipeline instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.ExportToCdwPipeline + * @static + * @param {google.cloud.contentwarehouse.v1.IExportToCdwPipeline=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.ExportToCdwPipeline} ExportToCdwPipeline instance + */ + ExportToCdwPipeline.create = function create(properties) { + return new ExportToCdwPipeline(properties); + }; + + /** + * Encodes the specified ExportToCdwPipeline message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ExportToCdwPipeline.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.ExportToCdwPipeline + * @static + * @param {google.cloud.contentwarehouse.v1.IExportToCdwPipeline} message ExportToCdwPipeline message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportToCdwPipeline.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documents != null && message.documents.length) + for (var i = 0; i < message.documents.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.documents[i]); + if (message.exportFolderPath != null && Object.hasOwnProperty.call(message, "exportFolderPath")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.exportFolderPath); + if (message.docAiDataset != null && Object.hasOwnProperty.call(message, "docAiDataset")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.docAiDataset); + if (message.trainingSplitRatio != null && Object.hasOwnProperty.call(message, "trainingSplitRatio")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.trainingSplitRatio); + return writer; + }; + + /** + * Encodes the specified ExportToCdwPipeline message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ExportToCdwPipeline.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.ExportToCdwPipeline + * @static + * @param {google.cloud.contentwarehouse.v1.IExportToCdwPipeline} message ExportToCdwPipeline message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportToCdwPipeline.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportToCdwPipeline message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.ExportToCdwPipeline + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.ExportToCdwPipeline} ExportToCdwPipeline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportToCdwPipeline.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.ExportToCdwPipeline(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.documents && message.documents.length)) + message.documents = []; + message.documents.push(reader.string()); + break; + } + case 2: { + message.exportFolderPath = reader.string(); + break; + } + case 3: { + message.docAiDataset = reader.string(); + break; + } + case 4: { + message.trainingSplitRatio = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportToCdwPipeline message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.ExportToCdwPipeline + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.ExportToCdwPipeline} ExportToCdwPipeline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportToCdwPipeline.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportToCdwPipeline message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.ExportToCdwPipeline + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportToCdwPipeline.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.documents != null && message.hasOwnProperty("documents")) { + if (!Array.isArray(message.documents)) + return "documents: array expected"; + for (var i = 0; i < message.documents.length; ++i) + if (!$util.isString(message.documents[i])) + return "documents: string[] expected"; + } + if (message.exportFolderPath != null && message.hasOwnProperty("exportFolderPath")) + if (!$util.isString(message.exportFolderPath)) + return "exportFolderPath: string expected"; + if (message.docAiDataset != null && message.hasOwnProperty("docAiDataset")) + if (!$util.isString(message.docAiDataset)) + return "docAiDataset: string expected"; + if (message.trainingSplitRatio != null && message.hasOwnProperty("trainingSplitRatio")) + if (typeof message.trainingSplitRatio !== "number") + return "trainingSplitRatio: number expected"; + return null; + }; + + /** + * Creates an ExportToCdwPipeline message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.ExportToCdwPipeline + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.ExportToCdwPipeline} ExportToCdwPipeline + */ + ExportToCdwPipeline.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.ExportToCdwPipeline) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.ExportToCdwPipeline(); + if (object.documents) { + if (!Array.isArray(object.documents)) + throw TypeError(".google.cloud.contentwarehouse.v1.ExportToCdwPipeline.documents: array expected"); + message.documents = []; + for (var i = 0; i < object.documents.length; ++i) + message.documents[i] = String(object.documents[i]); + } + if (object.exportFolderPath != null) + message.exportFolderPath = String(object.exportFolderPath); + if (object.docAiDataset != null) + message.docAiDataset = String(object.docAiDataset); + if (object.trainingSplitRatio != null) + message.trainingSplitRatio = Number(object.trainingSplitRatio); + return message; + }; + + /** + * Creates a plain object from an ExportToCdwPipeline message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.ExportToCdwPipeline + * @static + * @param {google.cloud.contentwarehouse.v1.ExportToCdwPipeline} message ExportToCdwPipeline + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportToCdwPipeline.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.documents = []; + if (options.defaults) { + object.exportFolderPath = ""; + object.docAiDataset = ""; + object.trainingSplitRatio = 0; + } + if (message.documents && message.documents.length) { + object.documents = []; + for (var j = 0; j < message.documents.length; ++j) + object.documents[j] = message.documents[j]; + } + if (message.exportFolderPath != null && message.hasOwnProperty("exportFolderPath")) + object.exportFolderPath = message.exportFolderPath; + if (message.docAiDataset != null && message.hasOwnProperty("docAiDataset")) + object.docAiDataset = message.docAiDataset; + if (message.trainingSplitRatio != null && message.hasOwnProperty("trainingSplitRatio")) + object.trainingSplitRatio = options.json && !isFinite(message.trainingSplitRatio) ? String(message.trainingSplitRatio) : message.trainingSplitRatio; + return object; + }; + + /** + * Converts this ExportToCdwPipeline to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.ExportToCdwPipeline + * @instance + * @returns {Object.} JSON object + */ + ExportToCdwPipeline.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportToCdwPipeline + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.ExportToCdwPipeline + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportToCdwPipeline.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.ExportToCdwPipeline"; + }; + + return ExportToCdwPipeline; + })(); + + v1.ProcessWithDocAiPipeline = (function() { + + /** + * Properties of a ProcessWithDocAiPipeline. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IProcessWithDocAiPipeline + * @property {Array.|null} [documents] ProcessWithDocAiPipeline documents + * @property {string|null} [exportFolderPath] ProcessWithDocAiPipeline exportFolderPath + * @property {google.cloud.contentwarehouse.v1.IProcessorInfo|null} [processorInfo] ProcessWithDocAiPipeline processorInfo + * @property {string|null} [processorResultsFolderPath] ProcessWithDocAiPipeline processorResultsFolderPath + */ + + /** + * Constructs a new ProcessWithDocAiPipeline. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a ProcessWithDocAiPipeline. + * @implements IProcessWithDocAiPipeline + * @constructor + * @param {google.cloud.contentwarehouse.v1.IProcessWithDocAiPipeline=} [properties] Properties to set + */ + function ProcessWithDocAiPipeline(properties) { + this.documents = []; + 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]]; + } + + /** + * ProcessWithDocAiPipeline documents. + * @member {Array.} documents + * @memberof google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline + * @instance + */ + ProcessWithDocAiPipeline.prototype.documents = $util.emptyArray; + + /** + * ProcessWithDocAiPipeline exportFolderPath. + * @member {string} exportFolderPath + * @memberof google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline + * @instance + */ + ProcessWithDocAiPipeline.prototype.exportFolderPath = ""; + + /** + * ProcessWithDocAiPipeline processorInfo. + * @member {google.cloud.contentwarehouse.v1.IProcessorInfo|null|undefined} processorInfo + * @memberof google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline + * @instance + */ + ProcessWithDocAiPipeline.prototype.processorInfo = null; + + /** + * ProcessWithDocAiPipeline processorResultsFolderPath. + * @member {string} processorResultsFolderPath + * @memberof google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline + * @instance + */ + ProcessWithDocAiPipeline.prototype.processorResultsFolderPath = ""; + + /** + * Creates a new ProcessWithDocAiPipeline instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline + * @static + * @param {google.cloud.contentwarehouse.v1.IProcessWithDocAiPipeline=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline} ProcessWithDocAiPipeline instance + */ + ProcessWithDocAiPipeline.create = function create(properties) { + return new ProcessWithDocAiPipeline(properties); + }; + + /** + * Encodes the specified ProcessWithDocAiPipeline message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline + * @static + * @param {google.cloud.contentwarehouse.v1.IProcessWithDocAiPipeline} message ProcessWithDocAiPipeline message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProcessWithDocAiPipeline.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documents != null && message.documents.length) + for (var i = 0; i < message.documents.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.documents[i]); + if (message.exportFolderPath != null && Object.hasOwnProperty.call(message, "exportFolderPath")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.exportFolderPath); + if (message.processorInfo != null && Object.hasOwnProperty.call(message, "processorInfo")) + $root.google.cloud.contentwarehouse.v1.ProcessorInfo.encode(message.processorInfo, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.processorResultsFolderPath != null && Object.hasOwnProperty.call(message, "processorResultsFolderPath")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.processorResultsFolderPath); + return writer; + }; + + /** + * Encodes the specified ProcessWithDocAiPipeline message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline + * @static + * @param {google.cloud.contentwarehouse.v1.IProcessWithDocAiPipeline} message ProcessWithDocAiPipeline message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProcessWithDocAiPipeline.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProcessWithDocAiPipeline message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline} ProcessWithDocAiPipeline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProcessWithDocAiPipeline.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.documents && message.documents.length)) + message.documents = []; + message.documents.push(reader.string()); + break; + } + case 2: { + message.exportFolderPath = reader.string(); + break; + } + case 3: { + message.processorInfo = $root.google.cloud.contentwarehouse.v1.ProcessorInfo.decode(reader, reader.uint32()); + break; + } + case 4: { + message.processorResultsFolderPath = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProcessWithDocAiPipeline message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline} ProcessWithDocAiPipeline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProcessWithDocAiPipeline.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProcessWithDocAiPipeline message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProcessWithDocAiPipeline.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.documents != null && message.hasOwnProperty("documents")) { + if (!Array.isArray(message.documents)) + return "documents: array expected"; + for (var i = 0; i < message.documents.length; ++i) + if (!$util.isString(message.documents[i])) + return "documents: string[] expected"; + } + if (message.exportFolderPath != null && message.hasOwnProperty("exportFolderPath")) + if (!$util.isString(message.exportFolderPath)) + return "exportFolderPath: string expected"; + if (message.processorInfo != null && message.hasOwnProperty("processorInfo")) { + var error = $root.google.cloud.contentwarehouse.v1.ProcessorInfo.verify(message.processorInfo); + if (error) + return "processorInfo." + error; + } + if (message.processorResultsFolderPath != null && message.hasOwnProperty("processorResultsFolderPath")) + if (!$util.isString(message.processorResultsFolderPath)) + return "processorResultsFolderPath: string expected"; + return null; + }; + + /** + * Creates a ProcessWithDocAiPipeline message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline} ProcessWithDocAiPipeline + */ + ProcessWithDocAiPipeline.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline(); + if (object.documents) { + if (!Array.isArray(object.documents)) + throw TypeError(".google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline.documents: array expected"); + message.documents = []; + for (var i = 0; i < object.documents.length; ++i) + message.documents[i] = String(object.documents[i]); + } + if (object.exportFolderPath != null) + message.exportFolderPath = String(object.exportFolderPath); + if (object.processorInfo != null) { + if (typeof object.processorInfo !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline.processorInfo: object expected"); + message.processorInfo = $root.google.cloud.contentwarehouse.v1.ProcessorInfo.fromObject(object.processorInfo); + } + if (object.processorResultsFolderPath != null) + message.processorResultsFolderPath = String(object.processorResultsFolderPath); + return message; + }; + + /** + * Creates a plain object from a ProcessWithDocAiPipeline message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline + * @static + * @param {google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline} message ProcessWithDocAiPipeline + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProcessWithDocAiPipeline.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.documents = []; + if (options.defaults) { + object.exportFolderPath = ""; + object.processorInfo = null; + object.processorResultsFolderPath = ""; + } + if (message.documents && message.documents.length) { + object.documents = []; + for (var j = 0; j < message.documents.length; ++j) + object.documents[j] = message.documents[j]; + } + if (message.exportFolderPath != null && message.hasOwnProperty("exportFolderPath")) + object.exportFolderPath = message.exportFolderPath; + if (message.processorInfo != null && message.hasOwnProperty("processorInfo")) + object.processorInfo = $root.google.cloud.contentwarehouse.v1.ProcessorInfo.toObject(message.processorInfo, options); + if (message.processorResultsFolderPath != null && message.hasOwnProperty("processorResultsFolderPath")) + object.processorResultsFolderPath = message.processorResultsFolderPath; + return object; + }; + + /** + * Converts this ProcessWithDocAiPipeline to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline + * @instance + * @returns {Object.} JSON object + */ + ProcessWithDocAiPipeline.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ProcessWithDocAiPipeline + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ProcessWithDocAiPipeline.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline"; + }; + + return ProcessWithDocAiPipeline; + })(); + + v1.RuleSetService = (function() { + + /** + * Constructs a new RuleSetService service. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a RuleSetService + * @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 RuleSetService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (RuleSetService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = RuleSetService; + + /** + * Creates new RuleSetService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.contentwarehouse.v1.RuleSetService + * @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 {RuleSetService} RPC service. Useful where requests and/or responses are streamed. + */ + RuleSetService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.RuleSetService|createRuleSet}. + * @memberof google.cloud.contentwarehouse.v1.RuleSetService + * @typedef CreateRuleSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.contentwarehouse.v1.RuleSet} [response] RuleSet + */ + + /** + * Calls CreateRuleSet. + * @function createRuleSet + * @memberof google.cloud.contentwarehouse.v1.RuleSetService + * @instance + * @param {google.cloud.contentwarehouse.v1.ICreateRuleSetRequest} request CreateRuleSetRequest message or plain object + * @param {google.cloud.contentwarehouse.v1.RuleSetService.CreateRuleSetCallback} callback Node-style callback called with the error, if any, and RuleSet + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RuleSetService.prototype.createRuleSet = function createRuleSet(request, callback) { + return this.rpcCall(createRuleSet, $root.google.cloud.contentwarehouse.v1.CreateRuleSetRequest, $root.google.cloud.contentwarehouse.v1.RuleSet, request, callback); + }, "name", { value: "CreateRuleSet" }); + + /** + * Calls CreateRuleSet. + * @function createRuleSet + * @memberof google.cloud.contentwarehouse.v1.RuleSetService + * @instance + * @param {google.cloud.contentwarehouse.v1.ICreateRuleSetRequest} request CreateRuleSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.RuleSetService|getRuleSet}. + * @memberof google.cloud.contentwarehouse.v1.RuleSetService + * @typedef GetRuleSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.contentwarehouse.v1.RuleSet} [response] RuleSet + */ + + /** + * Calls GetRuleSet. + * @function getRuleSet + * @memberof google.cloud.contentwarehouse.v1.RuleSetService + * @instance + * @param {google.cloud.contentwarehouse.v1.IGetRuleSetRequest} request GetRuleSetRequest message or plain object + * @param {google.cloud.contentwarehouse.v1.RuleSetService.GetRuleSetCallback} callback Node-style callback called with the error, if any, and RuleSet + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RuleSetService.prototype.getRuleSet = function getRuleSet(request, callback) { + return this.rpcCall(getRuleSet, $root.google.cloud.contentwarehouse.v1.GetRuleSetRequest, $root.google.cloud.contentwarehouse.v1.RuleSet, request, callback); + }, "name", { value: "GetRuleSet" }); + + /** + * Calls GetRuleSet. + * @function getRuleSet + * @memberof google.cloud.contentwarehouse.v1.RuleSetService + * @instance + * @param {google.cloud.contentwarehouse.v1.IGetRuleSetRequest} request GetRuleSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.RuleSetService|updateRuleSet}. + * @memberof google.cloud.contentwarehouse.v1.RuleSetService + * @typedef UpdateRuleSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.contentwarehouse.v1.RuleSet} [response] RuleSet + */ + + /** + * Calls UpdateRuleSet. + * @function updateRuleSet + * @memberof google.cloud.contentwarehouse.v1.RuleSetService + * @instance + * @param {google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest} request UpdateRuleSetRequest message or plain object + * @param {google.cloud.contentwarehouse.v1.RuleSetService.UpdateRuleSetCallback} callback Node-style callback called with the error, if any, and RuleSet + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RuleSetService.prototype.updateRuleSet = function updateRuleSet(request, callback) { + return this.rpcCall(updateRuleSet, $root.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest, $root.google.cloud.contentwarehouse.v1.RuleSet, request, callback); + }, "name", { value: "UpdateRuleSet" }); + + /** + * Calls UpdateRuleSet. + * @function updateRuleSet + * @memberof google.cloud.contentwarehouse.v1.RuleSetService + * @instance + * @param {google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest} request UpdateRuleSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.RuleSetService|deleteRuleSet}. + * @memberof google.cloud.contentwarehouse.v1.RuleSetService + * @typedef DeleteRuleSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteRuleSet. + * @function deleteRuleSet + * @memberof google.cloud.contentwarehouse.v1.RuleSetService + * @instance + * @param {google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest} request DeleteRuleSetRequest message or plain object + * @param {google.cloud.contentwarehouse.v1.RuleSetService.DeleteRuleSetCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RuleSetService.prototype.deleteRuleSet = function deleteRuleSet(request, callback) { + return this.rpcCall(deleteRuleSet, $root.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteRuleSet" }); + + /** + * Calls DeleteRuleSet. + * @function deleteRuleSet + * @memberof google.cloud.contentwarehouse.v1.RuleSetService + * @instance + * @param {google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest} request DeleteRuleSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.RuleSetService|listRuleSets}. + * @memberof google.cloud.contentwarehouse.v1.RuleSetService + * @typedef ListRuleSetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.contentwarehouse.v1.ListRuleSetsResponse} [response] ListRuleSetsResponse + */ + + /** + * Calls ListRuleSets. + * @function listRuleSets + * @memberof google.cloud.contentwarehouse.v1.RuleSetService + * @instance + * @param {google.cloud.contentwarehouse.v1.IListRuleSetsRequest} request ListRuleSetsRequest message or plain object + * @param {google.cloud.contentwarehouse.v1.RuleSetService.ListRuleSetsCallback} callback Node-style callback called with the error, if any, and ListRuleSetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RuleSetService.prototype.listRuleSets = function listRuleSets(request, callback) { + return this.rpcCall(listRuleSets, $root.google.cloud.contentwarehouse.v1.ListRuleSetsRequest, $root.google.cloud.contentwarehouse.v1.ListRuleSetsResponse, request, callback); + }, "name", { value: "ListRuleSets" }); + + /** + * Calls ListRuleSets. + * @function listRuleSets + * @memberof google.cloud.contentwarehouse.v1.RuleSetService + * @instance + * @param {google.cloud.contentwarehouse.v1.IListRuleSetsRequest} request ListRuleSetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return RuleSetService; + })(); + + v1.CreateRuleSetRequest = (function() { + + /** + * Properties of a CreateRuleSetRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @interface ICreateRuleSetRequest + * @property {string|null} [parent] CreateRuleSetRequest parent + * @property {google.cloud.contentwarehouse.v1.IRuleSet|null} [ruleSet] CreateRuleSetRequest ruleSet + */ + + /** + * Constructs a new CreateRuleSetRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a CreateRuleSetRequest. + * @implements ICreateRuleSetRequest + * @constructor + * @param {google.cloud.contentwarehouse.v1.ICreateRuleSetRequest=} [properties] Properties to set + */ + function CreateRuleSetRequest(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]]; + } + + /** + * CreateRuleSetRequest parent. + * @member {string} parent + * @memberof google.cloud.contentwarehouse.v1.CreateRuleSetRequest + * @instance + */ + CreateRuleSetRequest.prototype.parent = ""; + + /** + * CreateRuleSetRequest ruleSet. + * @member {google.cloud.contentwarehouse.v1.IRuleSet|null|undefined} ruleSet + * @memberof google.cloud.contentwarehouse.v1.CreateRuleSetRequest + * @instance + */ + CreateRuleSetRequest.prototype.ruleSet = null; + + /** + * Creates a new CreateRuleSetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.CreateRuleSetRequest + * @static + * @param {google.cloud.contentwarehouse.v1.ICreateRuleSetRequest=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.CreateRuleSetRequest} CreateRuleSetRequest instance + */ + CreateRuleSetRequest.create = function create(properties) { + return new CreateRuleSetRequest(properties); + }; + + /** + * Encodes the specified CreateRuleSetRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateRuleSetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.CreateRuleSetRequest + * @static + * @param {google.cloud.contentwarehouse.v1.ICreateRuleSetRequest} message CreateRuleSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateRuleSetRequest.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.ruleSet != null && Object.hasOwnProperty.call(message, "ruleSet")) + $root.google.cloud.contentwarehouse.v1.RuleSet.encode(message.ruleSet, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateRuleSetRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateRuleSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.CreateRuleSetRequest + * @static + * @param {google.cloud.contentwarehouse.v1.ICreateRuleSetRequest} message CreateRuleSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateRuleSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateRuleSetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.CreateRuleSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.CreateRuleSetRequest} CreateRuleSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateRuleSetRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.CreateRuleSetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.ruleSet = $root.google.cloud.contentwarehouse.v1.RuleSet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateRuleSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.CreateRuleSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.CreateRuleSetRequest} CreateRuleSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateRuleSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateRuleSetRequest message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.CreateRuleSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateRuleSetRequest.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.ruleSet != null && message.hasOwnProperty("ruleSet")) { + var error = $root.google.cloud.contentwarehouse.v1.RuleSet.verify(message.ruleSet); + if (error) + return "ruleSet." + error; + } + return null; + }; + + /** + * Creates a CreateRuleSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.CreateRuleSetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.CreateRuleSetRequest} CreateRuleSetRequest + */ + CreateRuleSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.CreateRuleSetRequest) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.CreateRuleSetRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.ruleSet != null) { + if (typeof object.ruleSet !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.CreateRuleSetRequest.ruleSet: object expected"); + message.ruleSet = $root.google.cloud.contentwarehouse.v1.RuleSet.fromObject(object.ruleSet); + } + return message; + }; + + /** + * Creates a plain object from a CreateRuleSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.CreateRuleSetRequest + * @static + * @param {google.cloud.contentwarehouse.v1.CreateRuleSetRequest} message CreateRuleSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateRuleSetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.ruleSet = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.ruleSet != null && message.hasOwnProperty("ruleSet")) + object.ruleSet = $root.google.cloud.contentwarehouse.v1.RuleSet.toObject(message.ruleSet, options); + return object; + }; + + /** + * Converts this CreateRuleSetRequest to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.CreateRuleSetRequest + * @instance + * @returns {Object.} JSON object + */ + CreateRuleSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateRuleSetRequest + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.CreateRuleSetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateRuleSetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.CreateRuleSetRequest"; + }; + + return CreateRuleSetRequest; + })(); + + v1.GetRuleSetRequest = (function() { + + /** + * Properties of a GetRuleSetRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IGetRuleSetRequest + * @property {string|null} [name] GetRuleSetRequest name + */ + + /** + * Constructs a new GetRuleSetRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a GetRuleSetRequest. + * @implements IGetRuleSetRequest + * @constructor + * @param {google.cloud.contentwarehouse.v1.IGetRuleSetRequest=} [properties] Properties to set + */ + function GetRuleSetRequest(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]]; + } + + /** + * GetRuleSetRequest name. + * @member {string} name + * @memberof google.cloud.contentwarehouse.v1.GetRuleSetRequest + * @instance + */ + GetRuleSetRequest.prototype.name = ""; + + /** + * Creates a new GetRuleSetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.GetRuleSetRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IGetRuleSetRequest=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.GetRuleSetRequest} GetRuleSetRequest instance + */ + GetRuleSetRequest.create = function create(properties) { + return new GetRuleSetRequest(properties); + }; + + /** + * Encodes the specified GetRuleSetRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.GetRuleSetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.GetRuleSetRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IGetRuleSetRequest} message GetRuleSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRuleSetRequest.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 GetRuleSetRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.GetRuleSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.GetRuleSetRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IGetRuleSetRequest} message GetRuleSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRuleSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetRuleSetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.GetRuleSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.GetRuleSetRequest} GetRuleSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRuleSetRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.GetRuleSetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetRuleSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.GetRuleSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.GetRuleSetRequest} GetRuleSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRuleSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetRuleSetRequest message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.GetRuleSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetRuleSetRequest.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 GetRuleSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.GetRuleSetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.GetRuleSetRequest} GetRuleSetRequest + */ + GetRuleSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.GetRuleSetRequest) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.GetRuleSetRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetRuleSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.GetRuleSetRequest + * @static + * @param {google.cloud.contentwarehouse.v1.GetRuleSetRequest} message GetRuleSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetRuleSetRequest.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 GetRuleSetRequest to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.GetRuleSetRequest + * @instance + * @returns {Object.} JSON object + */ + GetRuleSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetRuleSetRequest + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.GetRuleSetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetRuleSetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.GetRuleSetRequest"; + }; + + return GetRuleSetRequest; + })(); + + v1.UpdateRuleSetRequest = (function() { + + /** + * Properties of an UpdateRuleSetRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IUpdateRuleSetRequest + * @property {string|null} [name] UpdateRuleSetRequest name + * @property {google.cloud.contentwarehouse.v1.IRuleSet|null} [ruleSet] UpdateRuleSetRequest ruleSet + */ + + /** + * Constructs a new UpdateRuleSetRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents an UpdateRuleSetRequest. + * @implements IUpdateRuleSetRequest + * @constructor + * @param {google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest=} [properties] Properties to set + */ + function UpdateRuleSetRequest(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]]; + } + + /** + * UpdateRuleSetRequest name. + * @member {string} name + * @memberof google.cloud.contentwarehouse.v1.UpdateRuleSetRequest + * @instance + */ + UpdateRuleSetRequest.prototype.name = ""; + + /** + * UpdateRuleSetRequest ruleSet. + * @member {google.cloud.contentwarehouse.v1.IRuleSet|null|undefined} ruleSet + * @memberof google.cloud.contentwarehouse.v1.UpdateRuleSetRequest + * @instance + */ + UpdateRuleSetRequest.prototype.ruleSet = null; + + /** + * Creates a new UpdateRuleSetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.UpdateRuleSetRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.UpdateRuleSetRequest} UpdateRuleSetRequest instance + */ + UpdateRuleSetRequest.create = function create(properties) { + return new UpdateRuleSetRequest(properties); + }; + + /** + * Encodes the specified UpdateRuleSetRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateRuleSetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.UpdateRuleSetRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest} message UpdateRuleSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateRuleSetRequest.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.ruleSet != null && Object.hasOwnProperty.call(message, "ruleSet")) + $root.google.cloud.contentwarehouse.v1.RuleSet.encode(message.ruleSet, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateRuleSetRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateRuleSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.UpdateRuleSetRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest} message UpdateRuleSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateRuleSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateRuleSetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.UpdateRuleSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.UpdateRuleSetRequest} UpdateRuleSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateRuleSetRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.ruleSet = $root.google.cloud.contentwarehouse.v1.RuleSet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateRuleSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.UpdateRuleSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.UpdateRuleSetRequest} UpdateRuleSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateRuleSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateRuleSetRequest message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.UpdateRuleSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateRuleSetRequest.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.ruleSet != null && message.hasOwnProperty("ruleSet")) { + var error = $root.google.cloud.contentwarehouse.v1.RuleSet.verify(message.ruleSet); + if (error) + return "ruleSet." + error; + } + return null; + }; + + /** + * Creates an UpdateRuleSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.UpdateRuleSetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.UpdateRuleSetRequest} UpdateRuleSetRequest + */ + UpdateRuleSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.ruleSet != null) { + if (typeof object.ruleSet !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.UpdateRuleSetRequest.ruleSet: object expected"); + message.ruleSet = $root.google.cloud.contentwarehouse.v1.RuleSet.fromObject(object.ruleSet); + } + return message; + }; + + /** + * Creates a plain object from an UpdateRuleSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.UpdateRuleSetRequest + * @static + * @param {google.cloud.contentwarehouse.v1.UpdateRuleSetRequest} message UpdateRuleSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateRuleSetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.ruleSet = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.ruleSet != null && message.hasOwnProperty("ruleSet")) + object.ruleSet = $root.google.cloud.contentwarehouse.v1.RuleSet.toObject(message.ruleSet, options); + return object; + }; + + /** + * Converts this UpdateRuleSetRequest to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.UpdateRuleSetRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateRuleSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateRuleSetRequest + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.UpdateRuleSetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateRuleSetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.UpdateRuleSetRequest"; + }; + + return UpdateRuleSetRequest; + })(); + + v1.DeleteRuleSetRequest = (function() { + + /** + * Properties of a DeleteRuleSetRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IDeleteRuleSetRequest + * @property {string|null} [name] DeleteRuleSetRequest name + */ + + /** + * Constructs a new DeleteRuleSetRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a DeleteRuleSetRequest. + * @implements IDeleteRuleSetRequest + * @constructor + * @param {google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest=} [properties] Properties to set + */ + function DeleteRuleSetRequest(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]]; + } + + /** + * DeleteRuleSetRequest name. + * @member {string} name + * @memberof google.cloud.contentwarehouse.v1.DeleteRuleSetRequest + * @instance + */ + DeleteRuleSetRequest.prototype.name = ""; + + /** + * Creates a new DeleteRuleSetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.DeleteRuleSetRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.DeleteRuleSetRequest} DeleteRuleSetRequest instance + */ + DeleteRuleSetRequest.create = function create(properties) { + return new DeleteRuleSetRequest(properties); + }; + + /** + * Encodes the specified DeleteRuleSetRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DeleteRuleSetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.DeleteRuleSetRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest} message DeleteRuleSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRuleSetRequest.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 DeleteRuleSetRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DeleteRuleSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.DeleteRuleSetRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest} message DeleteRuleSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRuleSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteRuleSetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.DeleteRuleSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.DeleteRuleSetRequest} DeleteRuleSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRuleSetRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteRuleSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.DeleteRuleSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.DeleteRuleSetRequest} DeleteRuleSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRuleSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteRuleSetRequest message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.DeleteRuleSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteRuleSetRequest.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 DeleteRuleSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.DeleteRuleSetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.DeleteRuleSetRequest} DeleteRuleSetRequest + */ + DeleteRuleSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteRuleSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.DeleteRuleSetRequest + * @static + * @param {google.cloud.contentwarehouse.v1.DeleteRuleSetRequest} message DeleteRuleSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteRuleSetRequest.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 DeleteRuleSetRequest to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.DeleteRuleSetRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteRuleSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteRuleSetRequest + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.DeleteRuleSetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteRuleSetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.DeleteRuleSetRequest"; + }; + + return DeleteRuleSetRequest; + })(); + + v1.ListRuleSetsRequest = (function() { + + /** + * Properties of a ListRuleSetsRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IListRuleSetsRequest + * @property {string|null} [parent] ListRuleSetsRequest parent + * @property {number|null} [pageSize] ListRuleSetsRequest pageSize + * @property {string|null} [pageToken] ListRuleSetsRequest pageToken + */ + + /** + * Constructs a new ListRuleSetsRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a ListRuleSetsRequest. + * @implements IListRuleSetsRequest + * @constructor + * @param {google.cloud.contentwarehouse.v1.IListRuleSetsRequest=} [properties] Properties to set + */ + function ListRuleSetsRequest(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]]; + } + + /** + * ListRuleSetsRequest parent. + * @member {string} parent + * @memberof google.cloud.contentwarehouse.v1.ListRuleSetsRequest + * @instance + */ + ListRuleSetsRequest.prototype.parent = ""; + + /** + * ListRuleSetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.contentwarehouse.v1.ListRuleSetsRequest + * @instance + */ + ListRuleSetsRequest.prototype.pageSize = 0; + + /** + * ListRuleSetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.contentwarehouse.v1.ListRuleSetsRequest + * @instance + */ + ListRuleSetsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListRuleSetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.ListRuleSetsRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IListRuleSetsRequest=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.ListRuleSetsRequest} ListRuleSetsRequest instance + */ + ListRuleSetsRequest.create = function create(properties) { + return new ListRuleSetsRequest(properties); + }; + + /** + * Encodes the specified ListRuleSetsRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListRuleSetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.ListRuleSetsRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IListRuleSetsRequest} message ListRuleSetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRuleSetsRequest.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.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); + return writer; + }; + + /** + * Encodes the specified ListRuleSetsRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListRuleSetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.ListRuleSetsRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IListRuleSetsRequest} message ListRuleSetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRuleSetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRuleSetsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.ListRuleSetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.ListRuleSetsRequest} ListRuleSetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRuleSetsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.ListRuleSetsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRuleSetsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.ListRuleSetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.ListRuleSetsRequest} ListRuleSetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRuleSetsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRuleSetsRequest message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.ListRuleSetsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRuleSetsRequest.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.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"; + return null; + }; + + /** + * Creates a ListRuleSetsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.ListRuleSetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.ListRuleSetsRequest} ListRuleSetsRequest + */ + ListRuleSetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.ListRuleSetsRequest) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.ListRuleSetsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListRuleSetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.ListRuleSetsRequest + * @static + * @param {google.cloud.contentwarehouse.v1.ListRuleSetsRequest} message ListRuleSetsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRuleSetsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListRuleSetsRequest to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.ListRuleSetsRequest + * @instance + * @returns {Object.} JSON object + */ + ListRuleSetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListRuleSetsRequest + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.ListRuleSetsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListRuleSetsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.ListRuleSetsRequest"; + }; + + return ListRuleSetsRequest; + })(); + + v1.ListRuleSetsResponse = (function() { + + /** + * Properties of a ListRuleSetsResponse. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IListRuleSetsResponse + * @property {Array.|null} [ruleSets] ListRuleSetsResponse ruleSets + * @property {string|null} [nextPageToken] ListRuleSetsResponse nextPageToken + */ + + /** + * Constructs a new ListRuleSetsResponse. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a ListRuleSetsResponse. + * @implements IListRuleSetsResponse + * @constructor + * @param {google.cloud.contentwarehouse.v1.IListRuleSetsResponse=} [properties] Properties to set + */ + function ListRuleSetsResponse(properties) { + this.ruleSets = []; + 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]]; + } + + /** + * ListRuleSetsResponse ruleSets. + * @member {Array.} ruleSets + * @memberof google.cloud.contentwarehouse.v1.ListRuleSetsResponse + * @instance + */ + ListRuleSetsResponse.prototype.ruleSets = $util.emptyArray; + + /** + * ListRuleSetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.contentwarehouse.v1.ListRuleSetsResponse + * @instance + */ + ListRuleSetsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListRuleSetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.ListRuleSetsResponse + * @static + * @param {google.cloud.contentwarehouse.v1.IListRuleSetsResponse=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.ListRuleSetsResponse} ListRuleSetsResponse instance + */ + ListRuleSetsResponse.create = function create(properties) { + return new ListRuleSetsResponse(properties); + }; + + /** + * Encodes the specified ListRuleSetsResponse message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListRuleSetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.ListRuleSetsResponse + * @static + * @param {google.cloud.contentwarehouse.v1.IListRuleSetsResponse} message ListRuleSetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRuleSetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ruleSets != null && message.ruleSets.length) + for (var i = 0; i < message.ruleSets.length; ++i) + $root.google.cloud.contentwarehouse.v1.RuleSet.encode(message.ruleSets[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 ListRuleSetsResponse message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListRuleSetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.ListRuleSetsResponse + * @static + * @param {google.cloud.contentwarehouse.v1.IListRuleSetsResponse} message ListRuleSetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRuleSetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRuleSetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.ListRuleSetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.ListRuleSetsResponse} ListRuleSetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRuleSetsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.ListRuleSetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.ruleSets && message.ruleSets.length)) + message.ruleSets = []; + message.ruleSets.push($root.google.cloud.contentwarehouse.v1.RuleSet.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRuleSetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.ListRuleSetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.ListRuleSetsResponse} ListRuleSetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRuleSetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRuleSetsResponse message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.ListRuleSetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRuleSetsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ruleSets != null && message.hasOwnProperty("ruleSets")) { + if (!Array.isArray(message.ruleSets)) + return "ruleSets: array expected"; + for (var i = 0; i < message.ruleSets.length; ++i) { + var error = $root.google.cloud.contentwarehouse.v1.RuleSet.verify(message.ruleSets[i]); + if (error) + return "ruleSets." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListRuleSetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.ListRuleSetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.ListRuleSetsResponse} ListRuleSetsResponse + */ + ListRuleSetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.ListRuleSetsResponse) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.ListRuleSetsResponse(); + if (object.ruleSets) { + if (!Array.isArray(object.ruleSets)) + throw TypeError(".google.cloud.contentwarehouse.v1.ListRuleSetsResponse.ruleSets: array expected"); + message.ruleSets = []; + for (var i = 0; i < object.ruleSets.length; ++i) { + if (typeof object.ruleSets[i] !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.ListRuleSetsResponse.ruleSets: object expected"); + message.ruleSets[i] = $root.google.cloud.contentwarehouse.v1.RuleSet.fromObject(object.ruleSets[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListRuleSetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.ListRuleSetsResponse + * @static + * @param {google.cloud.contentwarehouse.v1.ListRuleSetsResponse} message ListRuleSetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRuleSetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ruleSets = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.ruleSets && message.ruleSets.length) { + object.ruleSets = []; + for (var j = 0; j < message.ruleSets.length; ++j) + object.ruleSets[j] = $root.google.cloud.contentwarehouse.v1.RuleSet.toObject(message.ruleSets[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListRuleSetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.ListRuleSetsResponse + * @instance + * @returns {Object.} JSON object + */ + ListRuleSetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListRuleSetsResponse + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.ListRuleSetsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListRuleSetsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.ListRuleSetsResponse"; + }; + + return ListRuleSetsResponse; + })(); + + v1.SynonymSet = (function() { + + /** + * Properties of a SynonymSet. + * @memberof google.cloud.contentwarehouse.v1 + * @interface ISynonymSet + * @property {string|null} [name] SynonymSet name + * @property {string|null} [context] SynonymSet context + * @property {Array.|null} [synonyms] SynonymSet synonyms + */ + + /** + * Constructs a new SynonymSet. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a SynonymSet. + * @implements ISynonymSet + * @constructor + * @param {google.cloud.contentwarehouse.v1.ISynonymSet=} [properties] Properties to set + */ + function SynonymSet(properties) { + this.synonyms = []; + 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]]; + } + + /** + * SynonymSet name. + * @member {string} name + * @memberof google.cloud.contentwarehouse.v1.SynonymSet + * @instance + */ + SynonymSet.prototype.name = ""; + + /** + * SynonymSet context. + * @member {string} context + * @memberof google.cloud.contentwarehouse.v1.SynonymSet + * @instance + */ + SynonymSet.prototype.context = ""; + + /** + * SynonymSet synonyms. + * @member {Array.} synonyms + * @memberof google.cloud.contentwarehouse.v1.SynonymSet + * @instance + */ + SynonymSet.prototype.synonyms = $util.emptyArray; + + /** + * Creates a new SynonymSet instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.SynonymSet + * @static + * @param {google.cloud.contentwarehouse.v1.ISynonymSet=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.SynonymSet} SynonymSet instance + */ + SynonymSet.create = function create(properties) { + return new SynonymSet(properties); + }; + + /** + * Encodes the specified SynonymSet message. Does not implicitly {@link google.cloud.contentwarehouse.v1.SynonymSet.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.SynonymSet + * @static + * @param {google.cloud.contentwarehouse.v1.ISynonymSet} message SynonymSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SynonymSet.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.context != null && Object.hasOwnProperty.call(message, "context")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.context); + if (message.synonyms != null && message.synonyms.length) + for (var i = 0; i < message.synonyms.length; ++i) + $root.google.cloud.contentwarehouse.v1.SynonymSet.Synonym.encode(message.synonyms[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SynonymSet message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.SynonymSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.SynonymSet + * @static + * @param {google.cloud.contentwarehouse.v1.ISynonymSet} message SynonymSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SynonymSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SynonymSet message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.SynonymSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.SynonymSet} SynonymSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SynonymSet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.SynonymSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.context = reader.string(); + break; + } + case 3: { + if (!(message.synonyms && message.synonyms.length)) + message.synonyms = []; + message.synonyms.push($root.google.cloud.contentwarehouse.v1.SynonymSet.Synonym.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SynonymSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.SynonymSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.SynonymSet} SynonymSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SynonymSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SynonymSet message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.SynonymSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SynonymSet.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.context != null && message.hasOwnProperty("context")) + if (!$util.isString(message.context)) + return "context: string expected"; + if (message.synonyms != null && message.hasOwnProperty("synonyms")) { + if (!Array.isArray(message.synonyms)) + return "synonyms: array expected"; + for (var i = 0; i < message.synonyms.length; ++i) { + var error = $root.google.cloud.contentwarehouse.v1.SynonymSet.Synonym.verify(message.synonyms[i]); + if (error) + return "synonyms." + error; + } + } + return null; + }; + + /** + * Creates a SynonymSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.SynonymSet + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.SynonymSet} SynonymSet + */ + SynonymSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.SynonymSet) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.SynonymSet(); + if (object.name != null) + message.name = String(object.name); + if (object.context != null) + message.context = String(object.context); + if (object.synonyms) { + if (!Array.isArray(object.synonyms)) + throw TypeError(".google.cloud.contentwarehouse.v1.SynonymSet.synonyms: array expected"); + message.synonyms = []; + for (var i = 0; i < object.synonyms.length; ++i) { + if (typeof object.synonyms[i] !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.SynonymSet.synonyms: object expected"); + message.synonyms[i] = $root.google.cloud.contentwarehouse.v1.SynonymSet.Synonym.fromObject(object.synonyms[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SynonymSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.SynonymSet + * @static + * @param {google.cloud.contentwarehouse.v1.SynonymSet} message SynonymSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SynonymSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.synonyms = []; + if (options.defaults) { + object.name = ""; + object.context = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.context != null && message.hasOwnProperty("context")) + object.context = message.context; + if (message.synonyms && message.synonyms.length) { + object.synonyms = []; + for (var j = 0; j < message.synonyms.length; ++j) + object.synonyms[j] = $root.google.cloud.contentwarehouse.v1.SynonymSet.Synonym.toObject(message.synonyms[j], options); + } + return object; + }; + + /** + * Converts this SynonymSet to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.SynonymSet + * @instance + * @returns {Object.} JSON object + */ + SynonymSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SynonymSet + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.SynonymSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SynonymSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.SynonymSet"; + }; + + SynonymSet.Synonym = (function() { + + /** + * Properties of a Synonym. + * @memberof google.cloud.contentwarehouse.v1.SynonymSet + * @interface ISynonym + * @property {Array.|null} [words] Synonym words + */ + + /** + * Constructs a new Synonym. + * @memberof google.cloud.contentwarehouse.v1.SynonymSet + * @classdesc Represents a Synonym. + * @implements ISynonym + * @constructor + * @param {google.cloud.contentwarehouse.v1.SynonymSet.ISynonym=} [properties] Properties to set + */ + function Synonym(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]]; + } + + /** + * Synonym words. + * @member {Array.} words + * @memberof google.cloud.contentwarehouse.v1.SynonymSet.Synonym + * @instance + */ + Synonym.prototype.words = $util.emptyArray; + + /** + * Creates a new Synonym instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.SynonymSet.Synonym + * @static + * @param {google.cloud.contentwarehouse.v1.SynonymSet.ISynonym=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.SynonymSet.Synonym} Synonym instance + */ + Synonym.create = function create(properties) { + return new Synonym(properties); + }; + + /** + * Encodes the specified Synonym message. Does not implicitly {@link google.cloud.contentwarehouse.v1.SynonymSet.Synonym.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.SynonymSet.Synonym + * @static + * @param {google.cloud.contentwarehouse.v1.SynonymSet.ISynonym} message Synonym message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Synonym.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 Synonym message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.SynonymSet.Synonym.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.SynonymSet.Synonym + * @static + * @param {google.cloud.contentwarehouse.v1.SynonymSet.ISynonym} message Synonym message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Synonym.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Synonym message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.SynonymSet.Synonym + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.SynonymSet.Synonym} Synonym + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Synonym.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.SynonymSet.Synonym(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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 Synonym message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.SynonymSet.Synonym + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.SynonymSet.Synonym} Synonym + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Synonym.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Synonym message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.SynonymSet.Synonym + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Synonym.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 Synonym message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.SynonymSet.Synonym + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.SynonymSet.Synonym} Synonym + */ + Synonym.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.SynonymSet.Synonym) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.SynonymSet.Synonym(); + if (object.words) { + if (!Array.isArray(object.words)) + throw TypeError(".google.cloud.contentwarehouse.v1.SynonymSet.Synonym.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 Synonym message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.SynonymSet.Synonym + * @static + * @param {google.cloud.contentwarehouse.v1.SynonymSet.Synonym} message Synonym + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Synonym.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 Synonym to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.SynonymSet.Synonym + * @instance + * @returns {Object.} JSON object + */ + Synonym.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Synonym + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.SynonymSet.Synonym + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Synonym.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.SynonymSet.Synonym"; + }; + + return Synonym; + })(); + + return SynonymSet; + })(); + + v1.SynonymSetService = (function() { + + /** + * Constructs a new SynonymSetService service. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a SynonymSetService + * @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 SynonymSetService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (SynonymSetService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SynonymSetService; + + /** + * Creates new SynonymSetService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.contentwarehouse.v1.SynonymSetService + * @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 {SynonymSetService} RPC service. Useful where requests and/or responses are streamed. + */ + SynonymSetService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.SynonymSetService|createSynonymSet}. + * @memberof google.cloud.contentwarehouse.v1.SynonymSetService + * @typedef CreateSynonymSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.contentwarehouse.v1.SynonymSet} [response] SynonymSet + */ + + /** + * Calls CreateSynonymSet. + * @function createSynonymSet + * @memberof google.cloud.contentwarehouse.v1.SynonymSetService + * @instance + * @param {google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest} request CreateSynonymSetRequest message or plain object + * @param {google.cloud.contentwarehouse.v1.SynonymSetService.CreateSynonymSetCallback} callback Node-style callback called with the error, if any, and SynonymSet + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SynonymSetService.prototype.createSynonymSet = function createSynonymSet(request, callback) { + return this.rpcCall(createSynonymSet, $root.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest, $root.google.cloud.contentwarehouse.v1.SynonymSet, request, callback); + }, "name", { value: "CreateSynonymSet" }); + + /** + * Calls CreateSynonymSet. + * @function createSynonymSet + * @memberof google.cloud.contentwarehouse.v1.SynonymSetService + * @instance + * @param {google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest} request CreateSynonymSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.SynonymSetService|getSynonymSet}. + * @memberof google.cloud.contentwarehouse.v1.SynonymSetService + * @typedef GetSynonymSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.contentwarehouse.v1.SynonymSet} [response] SynonymSet + */ + + /** + * Calls GetSynonymSet. + * @function getSynonymSet + * @memberof google.cloud.contentwarehouse.v1.SynonymSetService + * @instance + * @param {google.cloud.contentwarehouse.v1.IGetSynonymSetRequest} request GetSynonymSetRequest message or plain object + * @param {google.cloud.contentwarehouse.v1.SynonymSetService.GetSynonymSetCallback} callback Node-style callback called with the error, if any, and SynonymSet + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SynonymSetService.prototype.getSynonymSet = function getSynonymSet(request, callback) { + return this.rpcCall(getSynonymSet, $root.google.cloud.contentwarehouse.v1.GetSynonymSetRequest, $root.google.cloud.contentwarehouse.v1.SynonymSet, request, callback); + }, "name", { value: "GetSynonymSet" }); + + /** + * Calls GetSynonymSet. + * @function getSynonymSet + * @memberof google.cloud.contentwarehouse.v1.SynonymSetService + * @instance + * @param {google.cloud.contentwarehouse.v1.IGetSynonymSetRequest} request GetSynonymSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.SynonymSetService|updateSynonymSet}. + * @memberof google.cloud.contentwarehouse.v1.SynonymSetService + * @typedef UpdateSynonymSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.contentwarehouse.v1.SynonymSet} [response] SynonymSet + */ + + /** + * Calls UpdateSynonymSet. + * @function updateSynonymSet + * @memberof google.cloud.contentwarehouse.v1.SynonymSetService + * @instance + * @param {google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest} request UpdateSynonymSetRequest message or plain object + * @param {google.cloud.contentwarehouse.v1.SynonymSetService.UpdateSynonymSetCallback} callback Node-style callback called with the error, if any, and SynonymSet + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SynonymSetService.prototype.updateSynonymSet = function updateSynonymSet(request, callback) { + return this.rpcCall(updateSynonymSet, $root.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest, $root.google.cloud.contentwarehouse.v1.SynonymSet, request, callback); + }, "name", { value: "UpdateSynonymSet" }); + + /** + * Calls UpdateSynonymSet. + * @function updateSynonymSet + * @memberof google.cloud.contentwarehouse.v1.SynonymSetService + * @instance + * @param {google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest} request UpdateSynonymSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.SynonymSetService|deleteSynonymSet}. + * @memberof google.cloud.contentwarehouse.v1.SynonymSetService + * @typedef DeleteSynonymSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteSynonymSet. + * @function deleteSynonymSet + * @memberof google.cloud.contentwarehouse.v1.SynonymSetService + * @instance + * @param {google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest} request DeleteSynonymSetRequest message or plain object + * @param {google.cloud.contentwarehouse.v1.SynonymSetService.DeleteSynonymSetCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SynonymSetService.prototype.deleteSynonymSet = function deleteSynonymSet(request, callback) { + return this.rpcCall(deleteSynonymSet, $root.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteSynonymSet" }); + + /** + * Calls DeleteSynonymSet. + * @function deleteSynonymSet + * @memberof google.cloud.contentwarehouse.v1.SynonymSetService + * @instance + * @param {google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest} request DeleteSynonymSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.contentwarehouse.v1.SynonymSetService|listSynonymSets}. + * @memberof google.cloud.contentwarehouse.v1.SynonymSetService + * @typedef ListSynonymSetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.contentwarehouse.v1.ListSynonymSetsResponse} [response] ListSynonymSetsResponse + */ + + /** + * Calls ListSynonymSets. + * @function listSynonymSets + * @memberof google.cloud.contentwarehouse.v1.SynonymSetService + * @instance + * @param {google.cloud.contentwarehouse.v1.IListSynonymSetsRequest} request ListSynonymSetsRequest message or plain object + * @param {google.cloud.contentwarehouse.v1.SynonymSetService.ListSynonymSetsCallback} callback Node-style callback called with the error, if any, and ListSynonymSetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SynonymSetService.prototype.listSynonymSets = function listSynonymSets(request, callback) { + return this.rpcCall(listSynonymSets, $root.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest, $root.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse, request, callback); + }, "name", { value: "ListSynonymSets" }); + + /** + * Calls ListSynonymSets. + * @function listSynonymSets + * @memberof google.cloud.contentwarehouse.v1.SynonymSetService + * @instance + * @param {google.cloud.contentwarehouse.v1.IListSynonymSetsRequest} request ListSynonymSetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return SynonymSetService; + })(); + + v1.CreateSynonymSetRequest = (function() { + + /** + * Properties of a CreateSynonymSetRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @interface ICreateSynonymSetRequest + * @property {string|null} [parent] CreateSynonymSetRequest parent + * @property {google.cloud.contentwarehouse.v1.ISynonymSet|null} [synonymSet] CreateSynonymSetRequest synonymSet + */ + + /** + * Constructs a new CreateSynonymSetRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a CreateSynonymSetRequest. + * @implements ICreateSynonymSetRequest + * @constructor + * @param {google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest=} [properties] Properties to set + */ + function CreateSynonymSetRequest(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]]; + } + + /** + * CreateSynonymSetRequest parent. + * @member {string} parent + * @memberof google.cloud.contentwarehouse.v1.CreateSynonymSetRequest + * @instance + */ + CreateSynonymSetRequest.prototype.parent = ""; + + /** + * CreateSynonymSetRequest synonymSet. + * @member {google.cloud.contentwarehouse.v1.ISynonymSet|null|undefined} synonymSet + * @memberof google.cloud.contentwarehouse.v1.CreateSynonymSetRequest + * @instance + */ + CreateSynonymSetRequest.prototype.synonymSet = null; + + /** + * Creates a new CreateSynonymSetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.CreateSynonymSetRequest + * @static + * @param {google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.CreateSynonymSetRequest} CreateSynonymSetRequest instance + */ + CreateSynonymSetRequest.create = function create(properties) { + return new CreateSynonymSetRequest(properties); + }; + + /** + * Encodes the specified CreateSynonymSetRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateSynonymSetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.CreateSynonymSetRequest + * @static + * @param {google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest} message CreateSynonymSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSynonymSetRequest.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.synonymSet != null && Object.hasOwnProperty.call(message, "synonymSet")) + $root.google.cloud.contentwarehouse.v1.SynonymSet.encode(message.synonymSet, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateSynonymSetRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateSynonymSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.CreateSynonymSetRequest + * @static + * @param {google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest} message CreateSynonymSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSynonymSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSynonymSetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.CreateSynonymSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.CreateSynonymSetRequest} CreateSynonymSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSynonymSetRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.synonymSet = $root.google.cloud.contentwarehouse.v1.SynonymSet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSynonymSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.CreateSynonymSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.CreateSynonymSetRequest} CreateSynonymSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSynonymSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSynonymSetRequest message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.CreateSynonymSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSynonymSetRequest.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.synonymSet != null && message.hasOwnProperty("synonymSet")) { + var error = $root.google.cloud.contentwarehouse.v1.SynonymSet.verify(message.synonymSet); + if (error) + return "synonymSet." + error; + } + return null; + }; + + /** + * Creates a CreateSynonymSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.CreateSynonymSetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.CreateSynonymSetRequest} CreateSynonymSetRequest + */ + CreateSynonymSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.synonymSet != null) { + if (typeof object.synonymSet !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.CreateSynonymSetRequest.synonymSet: object expected"); + message.synonymSet = $root.google.cloud.contentwarehouse.v1.SynonymSet.fromObject(object.synonymSet); + } + return message; + }; + + /** + * Creates a plain object from a CreateSynonymSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.CreateSynonymSetRequest + * @static + * @param {google.cloud.contentwarehouse.v1.CreateSynonymSetRequest} message CreateSynonymSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSynonymSetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.synonymSet = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.synonymSet != null && message.hasOwnProperty("synonymSet")) + object.synonymSet = $root.google.cloud.contentwarehouse.v1.SynonymSet.toObject(message.synonymSet, options); + return object; + }; + + /** + * Converts this CreateSynonymSetRequest to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.CreateSynonymSetRequest + * @instance + * @returns {Object.} JSON object + */ + CreateSynonymSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateSynonymSetRequest + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.CreateSynonymSetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateSynonymSetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.CreateSynonymSetRequest"; + }; + + return CreateSynonymSetRequest; + })(); + + v1.GetSynonymSetRequest = (function() { + + /** + * Properties of a GetSynonymSetRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IGetSynonymSetRequest + * @property {string|null} [name] GetSynonymSetRequest name + */ + + /** + * Constructs a new GetSynonymSetRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a GetSynonymSetRequest. + * @implements IGetSynonymSetRequest + * @constructor + * @param {google.cloud.contentwarehouse.v1.IGetSynonymSetRequest=} [properties] Properties to set + */ + function GetSynonymSetRequest(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]]; + } + + /** + * GetSynonymSetRequest name. + * @member {string} name + * @memberof google.cloud.contentwarehouse.v1.GetSynonymSetRequest + * @instance + */ + GetSynonymSetRequest.prototype.name = ""; + + /** + * Creates a new GetSynonymSetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.GetSynonymSetRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IGetSynonymSetRequest=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.GetSynonymSetRequest} GetSynonymSetRequest instance + */ + GetSynonymSetRequest.create = function create(properties) { + return new GetSynonymSetRequest(properties); + }; + + /** + * Encodes the specified GetSynonymSetRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.GetSynonymSetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.GetSynonymSetRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IGetSynonymSetRequest} message GetSynonymSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSynonymSetRequest.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 GetSynonymSetRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.GetSynonymSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.GetSynonymSetRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IGetSynonymSetRequest} message GetSynonymSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSynonymSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSynonymSetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.GetSynonymSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.GetSynonymSetRequest} GetSynonymSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSynonymSetRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.GetSynonymSetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetSynonymSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.GetSynonymSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.GetSynonymSetRequest} GetSynonymSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSynonymSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSynonymSetRequest message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.GetSynonymSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSynonymSetRequest.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 GetSynonymSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.GetSynonymSetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.GetSynonymSetRequest} GetSynonymSetRequest + */ + GetSynonymSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.GetSynonymSetRequest) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.GetSynonymSetRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetSynonymSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.GetSynonymSetRequest + * @static + * @param {google.cloud.contentwarehouse.v1.GetSynonymSetRequest} message GetSynonymSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSynonymSetRequest.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 GetSynonymSetRequest to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.GetSynonymSetRequest + * @instance + * @returns {Object.} JSON object + */ + GetSynonymSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetSynonymSetRequest + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.GetSynonymSetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSynonymSetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.GetSynonymSetRequest"; + }; + + return GetSynonymSetRequest; + })(); + + v1.ListSynonymSetsRequest = (function() { + + /** + * Properties of a ListSynonymSetsRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IListSynonymSetsRequest + * @property {string|null} [parent] ListSynonymSetsRequest parent + * @property {number|null} [pageSize] ListSynonymSetsRequest pageSize + * @property {string|null} [pageToken] ListSynonymSetsRequest pageToken + */ + + /** + * Constructs a new ListSynonymSetsRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a ListSynonymSetsRequest. + * @implements IListSynonymSetsRequest + * @constructor + * @param {google.cloud.contentwarehouse.v1.IListSynonymSetsRequest=} [properties] Properties to set + */ + function ListSynonymSetsRequest(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]]; + } + + /** + * ListSynonymSetsRequest parent. + * @member {string} parent + * @memberof google.cloud.contentwarehouse.v1.ListSynonymSetsRequest + * @instance + */ + ListSynonymSetsRequest.prototype.parent = ""; + + /** + * ListSynonymSetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.contentwarehouse.v1.ListSynonymSetsRequest + * @instance + */ + ListSynonymSetsRequest.prototype.pageSize = 0; + + /** + * ListSynonymSetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.contentwarehouse.v1.ListSynonymSetsRequest + * @instance + */ + ListSynonymSetsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListSynonymSetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.ListSynonymSetsRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IListSynonymSetsRequest=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.ListSynonymSetsRequest} ListSynonymSetsRequest instance + */ + ListSynonymSetsRequest.create = function create(properties) { + return new ListSynonymSetsRequest(properties); + }; + + /** + * Encodes the specified ListSynonymSetsRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListSynonymSetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.ListSynonymSetsRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IListSynonymSetsRequest} message ListSynonymSetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSynonymSetsRequest.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.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); + return writer; + }; + + /** + * Encodes the specified ListSynonymSetsRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListSynonymSetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.ListSynonymSetsRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IListSynonymSetsRequest} message ListSynonymSetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSynonymSetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSynonymSetsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.ListSynonymSetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.ListSynonymSetsRequest} ListSynonymSetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSynonymSetsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSynonymSetsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.ListSynonymSetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.ListSynonymSetsRequest} ListSynonymSetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSynonymSetsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSynonymSetsRequest message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.ListSynonymSetsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSynonymSetsRequest.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.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"; + return null; + }; + + /** + * Creates a ListSynonymSetsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.ListSynonymSetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.ListSynonymSetsRequest} ListSynonymSetsRequest + */ + ListSynonymSetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListSynonymSetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.ListSynonymSetsRequest + * @static + * @param {google.cloud.contentwarehouse.v1.ListSynonymSetsRequest} message ListSynonymSetsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSynonymSetsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListSynonymSetsRequest to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.ListSynonymSetsRequest + * @instance + * @returns {Object.} JSON object + */ + ListSynonymSetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSynonymSetsRequest + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.ListSynonymSetsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSynonymSetsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.ListSynonymSetsRequest"; + }; + + return ListSynonymSetsRequest; + })(); + + v1.ListSynonymSetsResponse = (function() { + + /** + * Properties of a ListSynonymSetsResponse. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IListSynonymSetsResponse + * @property {Array.|null} [synonymSets] ListSynonymSetsResponse synonymSets + * @property {string|null} [nextPageToken] ListSynonymSetsResponse nextPageToken + */ + + /** + * Constructs a new ListSynonymSetsResponse. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a ListSynonymSetsResponse. + * @implements IListSynonymSetsResponse + * @constructor + * @param {google.cloud.contentwarehouse.v1.IListSynonymSetsResponse=} [properties] Properties to set + */ + function ListSynonymSetsResponse(properties) { + this.synonymSets = []; + 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]]; + } + + /** + * ListSynonymSetsResponse synonymSets. + * @member {Array.} synonymSets + * @memberof google.cloud.contentwarehouse.v1.ListSynonymSetsResponse + * @instance + */ + ListSynonymSetsResponse.prototype.synonymSets = $util.emptyArray; + + /** + * ListSynonymSetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.contentwarehouse.v1.ListSynonymSetsResponse + * @instance + */ + ListSynonymSetsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSynonymSetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.ListSynonymSetsResponse + * @static + * @param {google.cloud.contentwarehouse.v1.IListSynonymSetsResponse=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.ListSynonymSetsResponse} ListSynonymSetsResponse instance + */ + ListSynonymSetsResponse.create = function create(properties) { + return new ListSynonymSetsResponse(properties); + }; + + /** + * Encodes the specified ListSynonymSetsResponse message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListSynonymSetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.ListSynonymSetsResponse + * @static + * @param {google.cloud.contentwarehouse.v1.IListSynonymSetsResponse} message ListSynonymSetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSynonymSetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.synonymSets != null && message.synonymSets.length) + for (var i = 0; i < message.synonymSets.length; ++i) + $root.google.cloud.contentwarehouse.v1.SynonymSet.encode(message.synonymSets[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 ListSynonymSetsResponse message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListSynonymSetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.ListSynonymSetsResponse + * @static + * @param {google.cloud.contentwarehouse.v1.IListSynonymSetsResponse} message ListSynonymSetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSynonymSetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSynonymSetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.ListSynonymSetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.ListSynonymSetsResponse} ListSynonymSetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSynonymSetsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.synonymSets && message.synonymSets.length)) + message.synonymSets = []; + message.synonymSets.push($root.google.cloud.contentwarehouse.v1.SynonymSet.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSynonymSetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.ListSynonymSetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.ListSynonymSetsResponse} ListSynonymSetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSynonymSetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSynonymSetsResponse message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.ListSynonymSetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSynonymSetsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.synonymSets != null && message.hasOwnProperty("synonymSets")) { + if (!Array.isArray(message.synonymSets)) + return "synonymSets: array expected"; + for (var i = 0; i < message.synonymSets.length; ++i) { + var error = $root.google.cloud.contentwarehouse.v1.SynonymSet.verify(message.synonymSets[i]); + if (error) + return "synonymSets." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListSynonymSetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.ListSynonymSetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.ListSynonymSetsResponse} ListSynonymSetsResponse + */ + ListSynonymSetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse(); + if (object.synonymSets) { + if (!Array.isArray(object.synonymSets)) + throw TypeError(".google.cloud.contentwarehouse.v1.ListSynonymSetsResponse.synonymSets: array expected"); + message.synonymSets = []; + for (var i = 0; i < object.synonymSets.length; ++i) { + if (typeof object.synonymSets[i] !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.ListSynonymSetsResponse.synonymSets: object expected"); + message.synonymSets[i] = $root.google.cloud.contentwarehouse.v1.SynonymSet.fromObject(object.synonymSets[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListSynonymSetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.ListSynonymSetsResponse + * @static + * @param {google.cloud.contentwarehouse.v1.ListSynonymSetsResponse} message ListSynonymSetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSynonymSetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.synonymSets = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.synonymSets && message.synonymSets.length) { + object.synonymSets = []; + for (var j = 0; j < message.synonymSets.length; ++j) + object.synonymSets[j] = $root.google.cloud.contentwarehouse.v1.SynonymSet.toObject(message.synonymSets[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListSynonymSetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.ListSynonymSetsResponse + * @instance + * @returns {Object.} JSON object + */ + ListSynonymSetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSynonymSetsResponse + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.ListSynonymSetsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSynonymSetsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.ListSynonymSetsResponse"; + }; + + return ListSynonymSetsResponse; + })(); + + v1.UpdateSynonymSetRequest = (function() { + + /** + * Properties of an UpdateSynonymSetRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IUpdateSynonymSetRequest + * @property {string|null} [name] UpdateSynonymSetRequest name + * @property {google.cloud.contentwarehouse.v1.ISynonymSet|null} [synonymSet] UpdateSynonymSetRequest synonymSet + */ + + /** + * Constructs a new UpdateSynonymSetRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents an UpdateSynonymSetRequest. + * @implements IUpdateSynonymSetRequest + * @constructor + * @param {google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest=} [properties] Properties to set + */ + function UpdateSynonymSetRequest(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]]; + } + + /** + * UpdateSynonymSetRequest name. + * @member {string} name + * @memberof google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest + * @instance + */ + UpdateSynonymSetRequest.prototype.name = ""; + + /** + * UpdateSynonymSetRequest synonymSet. + * @member {google.cloud.contentwarehouse.v1.ISynonymSet|null|undefined} synonymSet + * @memberof google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest + * @instance + */ + UpdateSynonymSetRequest.prototype.synonymSet = null; + + /** + * Creates a new UpdateSynonymSetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest} UpdateSynonymSetRequest instance + */ + UpdateSynonymSetRequest.create = function create(properties) { + return new UpdateSynonymSetRequest(properties); + }; + + /** + * Encodes the specified UpdateSynonymSetRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest} message UpdateSynonymSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSynonymSetRequest.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.synonymSet != null && Object.hasOwnProperty.call(message, "synonymSet")) + $root.google.cloud.contentwarehouse.v1.SynonymSet.encode(message.synonymSet, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateSynonymSetRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest} message UpdateSynonymSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSynonymSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateSynonymSetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest} UpdateSynonymSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSynonymSetRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.synonymSet = $root.google.cloud.contentwarehouse.v1.SynonymSet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateSynonymSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest} UpdateSynonymSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSynonymSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateSynonymSetRequest message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSynonymSetRequest.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.synonymSet != null && message.hasOwnProperty("synonymSet")) { + var error = $root.google.cloud.contentwarehouse.v1.SynonymSet.verify(message.synonymSet); + if (error) + return "synonymSet." + error; + } + return null; + }; + + /** + * Creates an UpdateSynonymSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest} UpdateSynonymSetRequest + */ + UpdateSynonymSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.synonymSet != null) { + if (typeof object.synonymSet !== "object") + throw TypeError(".google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest.synonymSet: object expected"); + message.synonymSet = $root.google.cloud.contentwarehouse.v1.SynonymSet.fromObject(object.synonymSet); + } + return message; + }; + + /** + * Creates a plain object from an UpdateSynonymSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest + * @static + * @param {google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest} message UpdateSynonymSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSynonymSetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.synonymSet = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.synonymSet != null && message.hasOwnProperty("synonymSet")) + object.synonymSet = $root.google.cloud.contentwarehouse.v1.SynonymSet.toObject(message.synonymSet, options); + return object; + }; + + /** + * Converts this UpdateSynonymSetRequest to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSynonymSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateSynonymSetRequest + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateSynonymSetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest"; + }; + + return UpdateSynonymSetRequest; + })(); + + v1.DeleteSynonymSetRequest = (function() { + + /** + * Properties of a DeleteSynonymSetRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @interface IDeleteSynonymSetRequest + * @property {string|null} [name] DeleteSynonymSetRequest name + */ + + /** + * Constructs a new DeleteSynonymSetRequest. + * @memberof google.cloud.contentwarehouse.v1 + * @classdesc Represents a DeleteSynonymSetRequest. + * @implements IDeleteSynonymSetRequest + * @constructor + * @param {google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest=} [properties] Properties to set + */ + function DeleteSynonymSetRequest(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]]; + } + + /** + * DeleteSynonymSetRequest name. + * @member {string} name + * @memberof google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest + * @instance + */ + DeleteSynonymSetRequest.prototype.name = ""; + + /** + * Creates a new DeleteSynonymSetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest=} [properties] Properties to set + * @returns {google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest} DeleteSynonymSetRequest instance + */ + DeleteSynonymSetRequest.create = function create(properties) { + return new DeleteSynonymSetRequest(properties); + }; + + /** + * Encodes the specified DeleteSynonymSetRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest} message DeleteSynonymSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSynonymSetRequest.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 DeleteSynonymSetRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest + * @static + * @param {google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest} message DeleteSynonymSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSynonymSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteSynonymSetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest} DeleteSynonymSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSynonymSetRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteSynonymSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest} DeleteSynonymSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSynonymSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteSynonymSetRequest message. + * @function verify + * @memberof google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSynonymSetRequest.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 DeleteSynonymSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest} DeleteSynonymSetRequest + */ + DeleteSynonymSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest) + return object; + var message = new $root.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteSynonymSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest + * @static + * @param {google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest} message DeleteSynonymSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSynonymSetRequest.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 DeleteSynonymSetRequest to JSON. + * @function toJSON + * @memberof google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteSynonymSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteSynonymSetRequest + * @function getTypeUrl + * @memberof google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteSynonymSetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest"; + }; + + return DeleteSynonymSetRequest; + })(); + + return v1; + })(); + + return contentwarehouse; + })(); + + cloud.documentai = (function() { + + /** + * Namespace documentai. + * @memberof google.cloud + * @namespace + */ + var documentai = {}; + + documentai.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.documentai + * @namespace + */ + var v1 = {}; + + v1.Document = (function() { + + /** + * Properties of a Document. + * @memberof google.cloud.documentai.v1 + * @interface IDocument + * @property {string|null} [uri] Document uri + * @property {Uint8Array|null} [content] Document content + * @property {string|null} [docid] Document docid + * @property {string|null} [mimeType] Document mimeType + * @property {string|null} [text] Document text + * @property {Array.|null} [textStyles] Document textStyles + * @property {Array.|null} [pages] Document pages + * @property {Array.|null} [entities] Document entities + * @property {Array.|null} [entityRelations] Document entityRelations + * @property {Array.|null} [textChanges] Document textChanges + * @property {google.cloud.documentai.v1.Document.IShardInfo|null} [shardInfo] Document shardInfo + * @property {google.rpc.IStatus|null} [error] Document error + * @property {Array.|null} [revisions] Document revisions + * @property {google.cloud.documentai.v1.Document.IDocumentLayout|null} [documentLayout] Document documentLayout + * @property {google.cloud.documentai.v1.Document.IChunkedDocument|null} [chunkedDocument] Document chunkedDocument + * @property {google.cloud.documentai.v1.Document.IEntityValidationOutput|null} [entityValidationOutput] Document entityValidationOutput + * @property {Array.|null} [entitiesRevisions] Document entitiesRevisions + * @property {string|null} [entitiesRevisionId] Document entitiesRevisionId + */ + + /** + * Constructs a new Document. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a Document. + * @implements IDocument + * @constructor + * @param {google.cloud.documentai.v1.IDocument=} [properties] Properties to set + */ + function Document(properties) { + this.textStyles = []; + this.pages = []; + this.entities = []; + this.entityRelations = []; + this.textChanges = []; + this.revisions = []; + this.entitiesRevisions = []; + 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]]; + } + + /** + * Document uri. + * @member {string|null|undefined} uri + * @memberof google.cloud.documentai.v1.Document + * @instance + */ + Document.prototype.uri = null; + + /** + * Document content. + * @member {Uint8Array|null|undefined} content + * @memberof google.cloud.documentai.v1.Document + * @instance + */ + Document.prototype.content = null; + + /** + * Document docid. + * @member {string} docid + * @memberof google.cloud.documentai.v1.Document + * @instance + */ + Document.prototype.docid = ""; + + /** + * Document mimeType. + * @member {string} mimeType + * @memberof google.cloud.documentai.v1.Document + * @instance + */ + Document.prototype.mimeType = ""; + + /** + * Document text. + * @member {string} text + * @memberof google.cloud.documentai.v1.Document + * @instance + */ + Document.prototype.text = ""; + + /** + * Document textStyles. + * @member {Array.} textStyles + * @memberof google.cloud.documentai.v1.Document + * @instance + */ + Document.prototype.textStyles = $util.emptyArray; + + /** + * Document pages. + * @member {Array.} pages + * @memberof google.cloud.documentai.v1.Document + * @instance + */ + Document.prototype.pages = $util.emptyArray; + + /** + * Document entities. + * @member {Array.} entities + * @memberof google.cloud.documentai.v1.Document + * @instance + */ + Document.prototype.entities = $util.emptyArray; + + /** + * Document entityRelations. + * @member {Array.} entityRelations + * @memberof google.cloud.documentai.v1.Document + * @instance + */ + Document.prototype.entityRelations = $util.emptyArray; + + /** + * Document textChanges. + * @member {Array.} textChanges + * @memberof google.cloud.documentai.v1.Document + * @instance + */ + Document.prototype.textChanges = $util.emptyArray; + + /** + * Document shardInfo. + * @member {google.cloud.documentai.v1.Document.IShardInfo|null|undefined} shardInfo + * @memberof google.cloud.documentai.v1.Document + * @instance + */ + Document.prototype.shardInfo = null; + + /** + * Document error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.documentai.v1.Document + * @instance + */ + Document.prototype.error = null; + + /** + * Document revisions. + * @member {Array.} revisions + * @memberof google.cloud.documentai.v1.Document + * @instance + */ + Document.prototype.revisions = $util.emptyArray; + + /** + * Document documentLayout. + * @member {google.cloud.documentai.v1.Document.IDocumentLayout|null|undefined} documentLayout + * @memberof google.cloud.documentai.v1.Document + * @instance + */ + Document.prototype.documentLayout = null; + + /** + * Document chunkedDocument. + * @member {google.cloud.documentai.v1.Document.IChunkedDocument|null|undefined} chunkedDocument + * @memberof google.cloud.documentai.v1.Document + * @instance + */ + Document.prototype.chunkedDocument = null; + + /** + * Document entityValidationOutput. + * @member {google.cloud.documentai.v1.Document.IEntityValidationOutput|null|undefined} entityValidationOutput + * @memberof google.cloud.documentai.v1.Document + * @instance + */ + Document.prototype.entityValidationOutput = null; + + /** + * Document entitiesRevisions. + * @member {Array.} entitiesRevisions + * @memberof google.cloud.documentai.v1.Document + * @instance + */ + Document.prototype.entitiesRevisions = $util.emptyArray; + + /** + * Document entitiesRevisionId. + * @member {string} entitiesRevisionId + * @memberof google.cloud.documentai.v1.Document + * @instance + */ + Document.prototype.entitiesRevisionId = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Document source. + * @member {"uri"|"content"|undefined} source + * @memberof google.cloud.documentai.v1.Document + * @instance + */ + Object.defineProperty(Document.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["uri", "content"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Document instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document + * @static + * @param {google.cloud.documentai.v1.IDocument=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document} Document instance + */ + Document.create = function create(properties) { + return new Document(properties); + }; + + /** + * Encodes the specified Document message. Does not implicitly {@link google.cloud.documentai.v1.Document.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document + * @static + * @param {google.cloud.documentai.v1.IDocument} message Document message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Document.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.content); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.mimeType); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.text); + if (message.textStyles != null && message.textStyles.length) + for (var i = 0; i < message.textStyles.length; ++i) + $root.google.cloud.documentai.v1.Document.Style.encode(message.textStyles[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.pages != null && message.pages.length) + for (var i = 0; i < message.pages.length; ++i) + $root.google.cloud.documentai.v1.Document.Page.encode(message.pages[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.entities != null && message.entities.length) + for (var i = 0; i < message.entities.length; ++i) + $root.google.cloud.documentai.v1.Document.Entity.encode(message.entities[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.entityRelations != null && message.entityRelations.length) + for (var i = 0; i < message.entityRelations.length; ++i) + $root.google.cloud.documentai.v1.Document.EntityRelation.encode(message.entityRelations[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.shardInfo != null && Object.hasOwnProperty.call(message, "shardInfo")) + $root.google.cloud.documentai.v1.Document.ShardInfo.encode(message.shardInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.revisions != null && message.revisions.length) + for (var i = 0; i < message.revisions.length; ++i) + $root.google.cloud.documentai.v1.Document.Revision.encode(message.revisions[i], writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.textChanges != null && message.textChanges.length) + for (var i = 0; i < message.textChanges.length; ++i) + $root.google.cloud.documentai.v1.Document.TextChange.encode(message.textChanges[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.docid != null && Object.hasOwnProperty.call(message, "docid")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.docid); + if (message.documentLayout != null && Object.hasOwnProperty.call(message, "documentLayout")) + $root.google.cloud.documentai.v1.Document.DocumentLayout.encode(message.documentLayout, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.chunkedDocument != null && Object.hasOwnProperty.call(message, "chunkedDocument")) + $root.google.cloud.documentai.v1.Document.ChunkedDocument.encode(message.chunkedDocument, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.entityValidationOutput != null && Object.hasOwnProperty.call(message, "entityValidationOutput")) + $root.google.cloud.documentai.v1.Document.EntityValidationOutput.encode(message.entityValidationOutput, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.entitiesRevisions != null && message.entitiesRevisions.length) + for (var i = 0; i < message.entitiesRevisions.length; ++i) + $root.google.cloud.documentai.v1.Document.EntitiesRevision.encode(message.entitiesRevisions[i], writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.entitiesRevisionId != null && Object.hasOwnProperty.call(message, "entitiesRevisionId")) + writer.uint32(/* id 23, wireType 2 =*/186).string(message.entitiesRevisionId); + return writer; + }; + + /** + * Encodes the specified Document message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document + * @static + * @param {google.cloud.documentai.v1.IDocument} message Document message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Document.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Document message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document} Document + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Document.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.uri = reader.string(); + break; + } + case 2: { + message.content = reader.bytes(); + break; + } + case 15: { + message.docid = reader.string(); + break; + } + case 3: { + message.mimeType = reader.string(); + break; + } + case 4: { + message.text = reader.string(); + break; + } + case 5: { + if (!(message.textStyles && message.textStyles.length)) + message.textStyles = []; + message.textStyles.push($root.google.cloud.documentai.v1.Document.Style.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.pages && message.pages.length)) + message.pages = []; + message.pages.push($root.google.cloud.documentai.v1.Document.Page.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.entities && message.entities.length)) + message.entities = []; + message.entities.push($root.google.cloud.documentai.v1.Document.Entity.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.entityRelations && message.entityRelations.length)) + message.entityRelations = []; + message.entityRelations.push($root.google.cloud.documentai.v1.Document.EntityRelation.decode(reader, reader.uint32())); + break; + } + case 14: { + if (!(message.textChanges && message.textChanges.length)) + message.textChanges = []; + message.textChanges.push($root.google.cloud.documentai.v1.Document.TextChange.decode(reader, reader.uint32())); + break; + } + case 9: { + message.shardInfo = $root.google.cloud.documentai.v1.Document.ShardInfo.decode(reader, reader.uint32()); + break; + } + case 10: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 13: { + if (!(message.revisions && message.revisions.length)) + message.revisions = []; + message.revisions.push($root.google.cloud.documentai.v1.Document.Revision.decode(reader, reader.uint32())); + break; + } + case 17: { + message.documentLayout = $root.google.cloud.documentai.v1.Document.DocumentLayout.decode(reader, reader.uint32()); + break; + } + case 18: { + message.chunkedDocument = $root.google.cloud.documentai.v1.Document.ChunkedDocument.decode(reader, reader.uint32()); + break; + } + case 21: { + message.entityValidationOutput = $root.google.cloud.documentai.v1.Document.EntityValidationOutput.decode(reader, reader.uint32()); + break; + } + case 22: { + if (!(message.entitiesRevisions && message.entitiesRevisions.length)) + message.entitiesRevisions = []; + message.entitiesRevisions.push($root.google.cloud.documentai.v1.Document.EntitiesRevision.decode(reader, reader.uint32())); + break; + } + case 23: { + message.entitiesRevisionId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Document message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document} Document + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Document.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Document message. + * @function verify + * @memberof google.cloud.documentai.v1.Document + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Document.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.uri != null && message.hasOwnProperty("uri")) { + properties.source = 1; + if (!$util.isString(message.uri)) + return "uri: string expected"; + } + if (message.content != null && message.hasOwnProperty("content")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + if (!(message.content && typeof message.content.length === "number" || $util.isString(message.content))) + return "content: buffer expected"; + } + if (message.docid != null && message.hasOwnProperty("docid")) + if (!$util.isString(message.docid)) + return "docid: string expected"; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.textStyles != null && message.hasOwnProperty("textStyles")) { + if (!Array.isArray(message.textStyles)) + return "textStyles: array expected"; + for (var i = 0; i < message.textStyles.length; ++i) { + var error = $root.google.cloud.documentai.v1.Document.Style.verify(message.textStyles[i]); + if (error) + return "textStyles." + error; + } + } + if (message.pages != null && message.hasOwnProperty("pages")) { + if (!Array.isArray(message.pages)) + return "pages: array expected"; + for (var i = 0; i < message.pages.length; ++i) { + var error = $root.google.cloud.documentai.v1.Document.Page.verify(message.pages[i]); + if (error) + return "pages." + error; + } + } + if (message.entities != null && message.hasOwnProperty("entities")) { + if (!Array.isArray(message.entities)) + return "entities: array expected"; + for (var i = 0; i < message.entities.length; ++i) { + var error = $root.google.cloud.documentai.v1.Document.Entity.verify(message.entities[i]); + if (error) + return "entities." + error; + } + } + if (message.entityRelations != null && message.hasOwnProperty("entityRelations")) { + if (!Array.isArray(message.entityRelations)) + return "entityRelations: array expected"; + for (var i = 0; i < message.entityRelations.length; ++i) { + var error = $root.google.cloud.documentai.v1.Document.EntityRelation.verify(message.entityRelations[i]); + if (error) + return "entityRelations." + error; + } + } + if (message.textChanges != null && message.hasOwnProperty("textChanges")) { + if (!Array.isArray(message.textChanges)) + return "textChanges: array expected"; + for (var i = 0; i < message.textChanges.length; ++i) { + var error = $root.google.cloud.documentai.v1.Document.TextChange.verify(message.textChanges[i]); + if (error) + return "textChanges." + error; + } + } + if (message.shardInfo != null && message.hasOwnProperty("shardInfo")) { + var error = $root.google.cloud.documentai.v1.Document.ShardInfo.verify(message.shardInfo); + if (error) + return "shardInfo." + error; + } + if (message.error != null && message.hasOwnProperty("error")) { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + if (message.revisions != null && message.hasOwnProperty("revisions")) { + if (!Array.isArray(message.revisions)) + return "revisions: array expected"; + for (var i = 0; i < message.revisions.length; ++i) { + var error = $root.google.cloud.documentai.v1.Document.Revision.verify(message.revisions[i]); + if (error) + return "revisions." + error; + } + } + if (message.documentLayout != null && message.hasOwnProperty("documentLayout")) { + var error = $root.google.cloud.documentai.v1.Document.DocumentLayout.verify(message.documentLayout); + if (error) + return "documentLayout." + error; + } + if (message.chunkedDocument != null && message.hasOwnProperty("chunkedDocument")) { + var error = $root.google.cloud.documentai.v1.Document.ChunkedDocument.verify(message.chunkedDocument); + if (error) + return "chunkedDocument." + error; + } + if (message.entityValidationOutput != null && message.hasOwnProperty("entityValidationOutput")) { + var error = $root.google.cloud.documentai.v1.Document.EntityValidationOutput.verify(message.entityValidationOutput); + if (error) + return "entityValidationOutput." + error; + } + if (message.entitiesRevisions != null && message.hasOwnProperty("entitiesRevisions")) { + if (!Array.isArray(message.entitiesRevisions)) + return "entitiesRevisions: array expected"; + for (var i = 0; i < message.entitiesRevisions.length; ++i) { + var error = $root.google.cloud.documentai.v1.Document.EntitiesRevision.verify(message.entitiesRevisions[i]); + if (error) + return "entitiesRevisions." + error; + } + } + if (message.entitiesRevisionId != null && message.hasOwnProperty("entitiesRevisionId")) + if (!$util.isString(message.entitiesRevisionId)) + return "entitiesRevisionId: string expected"; + return null; + }; + + /** + * Creates a Document message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document} Document + */ + Document.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document) + return object; + var message = new $root.google.cloud.documentai.v1.Document(); + if (object.uri != null) + message.uri = String(object.uri); + if (object.content != null) + if (typeof object.content === "string") + $util.base64.decode(object.content, message.content = $util.newBuffer($util.base64.length(object.content)), 0); + else if (object.content.length >= 0) + message.content = object.content; + if (object.docid != null) + message.docid = String(object.docid); + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + if (object.text != null) + message.text = String(object.text); + if (object.textStyles) { + if (!Array.isArray(object.textStyles)) + throw TypeError(".google.cloud.documentai.v1.Document.textStyles: array expected"); + message.textStyles = []; + for (var i = 0; i < object.textStyles.length; ++i) { + if (typeof object.textStyles[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.textStyles: object expected"); + message.textStyles[i] = $root.google.cloud.documentai.v1.Document.Style.fromObject(object.textStyles[i]); + } + } + if (object.pages) { + if (!Array.isArray(object.pages)) + throw TypeError(".google.cloud.documentai.v1.Document.pages: array expected"); + message.pages = []; + for (var i = 0; i < object.pages.length; ++i) { + if (typeof object.pages[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.pages: object expected"); + message.pages[i] = $root.google.cloud.documentai.v1.Document.Page.fromObject(object.pages[i]); + } + } + if (object.entities) { + if (!Array.isArray(object.entities)) + throw TypeError(".google.cloud.documentai.v1.Document.entities: array expected"); + message.entities = []; + for (var i = 0; i < object.entities.length; ++i) { + if (typeof object.entities[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.entities: object expected"); + message.entities[i] = $root.google.cloud.documentai.v1.Document.Entity.fromObject(object.entities[i]); + } + } + if (object.entityRelations) { + if (!Array.isArray(object.entityRelations)) + throw TypeError(".google.cloud.documentai.v1.Document.entityRelations: array expected"); + message.entityRelations = []; + for (var i = 0; i < object.entityRelations.length; ++i) { + if (typeof object.entityRelations[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.entityRelations: object expected"); + message.entityRelations[i] = $root.google.cloud.documentai.v1.Document.EntityRelation.fromObject(object.entityRelations[i]); + } + } + if (object.textChanges) { + if (!Array.isArray(object.textChanges)) + throw TypeError(".google.cloud.documentai.v1.Document.textChanges: array expected"); + message.textChanges = []; + for (var i = 0; i < object.textChanges.length; ++i) { + if (typeof object.textChanges[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.textChanges: object expected"); + message.textChanges[i] = $root.google.cloud.documentai.v1.Document.TextChange.fromObject(object.textChanges[i]); + } + } + if (object.shardInfo != null) { + if (typeof object.shardInfo !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.shardInfo: object expected"); + message.shardInfo = $root.google.cloud.documentai.v1.Document.ShardInfo.fromObject(object.shardInfo); + } + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.revisions) { + if (!Array.isArray(object.revisions)) + throw TypeError(".google.cloud.documentai.v1.Document.revisions: array expected"); + message.revisions = []; + for (var i = 0; i < object.revisions.length; ++i) { + if (typeof object.revisions[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.revisions: object expected"); + message.revisions[i] = $root.google.cloud.documentai.v1.Document.Revision.fromObject(object.revisions[i]); + } + } + if (object.documentLayout != null) { + if (typeof object.documentLayout !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.documentLayout: object expected"); + message.documentLayout = $root.google.cloud.documentai.v1.Document.DocumentLayout.fromObject(object.documentLayout); + } + if (object.chunkedDocument != null) { + if (typeof object.chunkedDocument !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.chunkedDocument: object expected"); + message.chunkedDocument = $root.google.cloud.documentai.v1.Document.ChunkedDocument.fromObject(object.chunkedDocument); + } + if (object.entityValidationOutput != null) { + if (typeof object.entityValidationOutput !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.entityValidationOutput: object expected"); + message.entityValidationOutput = $root.google.cloud.documentai.v1.Document.EntityValidationOutput.fromObject(object.entityValidationOutput); + } + if (object.entitiesRevisions) { + if (!Array.isArray(object.entitiesRevisions)) + throw TypeError(".google.cloud.documentai.v1.Document.entitiesRevisions: array expected"); + message.entitiesRevisions = []; + for (var i = 0; i < object.entitiesRevisions.length; ++i) { + if (typeof object.entitiesRevisions[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.entitiesRevisions: object expected"); + message.entitiesRevisions[i] = $root.google.cloud.documentai.v1.Document.EntitiesRevision.fromObject(object.entitiesRevisions[i]); + } + } + if (object.entitiesRevisionId != null) + message.entitiesRevisionId = String(object.entitiesRevisionId); + return message; + }; + + /** + * Creates a plain object from a Document message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document + * @static + * @param {google.cloud.documentai.v1.Document} message Document + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Document.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.textStyles = []; + object.pages = []; + object.entities = []; + object.entityRelations = []; + object.revisions = []; + object.textChanges = []; + object.entitiesRevisions = []; + } + if (options.defaults) { + object.mimeType = ""; + object.text = ""; + object.shardInfo = null; + object.error = null; + object.docid = ""; + object.documentLayout = null; + object.chunkedDocument = null; + object.entityValidationOutput = null; + object.entitiesRevisionId = ""; + } + if (message.uri != null && message.hasOwnProperty("uri")) { + object.uri = message.uri; + if (options.oneofs) + object.source = "uri"; + } + if (message.content != null && message.hasOwnProperty("content")) { + object.content = options.bytes === String ? $util.base64.encode(message.content, 0, message.content.length) : options.bytes === Array ? Array.prototype.slice.call(message.content) : message.content; + if (options.oneofs) + object.source = "content"; + } + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.textStyles && message.textStyles.length) { + object.textStyles = []; + for (var j = 0; j < message.textStyles.length; ++j) + object.textStyles[j] = $root.google.cloud.documentai.v1.Document.Style.toObject(message.textStyles[j], options); + } + if (message.pages && message.pages.length) { + object.pages = []; + for (var j = 0; j < message.pages.length; ++j) + object.pages[j] = $root.google.cloud.documentai.v1.Document.Page.toObject(message.pages[j], options); + } + if (message.entities && message.entities.length) { + object.entities = []; + for (var j = 0; j < message.entities.length; ++j) + object.entities[j] = $root.google.cloud.documentai.v1.Document.Entity.toObject(message.entities[j], options); + } + if (message.entityRelations && message.entityRelations.length) { + object.entityRelations = []; + for (var j = 0; j < message.entityRelations.length; ++j) + object.entityRelations[j] = $root.google.cloud.documentai.v1.Document.EntityRelation.toObject(message.entityRelations[j], options); + } + if (message.shardInfo != null && message.hasOwnProperty("shardInfo")) + object.shardInfo = $root.google.cloud.documentai.v1.Document.ShardInfo.toObject(message.shardInfo, options); + if (message.error != null && message.hasOwnProperty("error")) + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (message.revisions && message.revisions.length) { + object.revisions = []; + for (var j = 0; j < message.revisions.length; ++j) + object.revisions[j] = $root.google.cloud.documentai.v1.Document.Revision.toObject(message.revisions[j], options); + } + if (message.textChanges && message.textChanges.length) { + object.textChanges = []; + for (var j = 0; j < message.textChanges.length; ++j) + object.textChanges[j] = $root.google.cloud.documentai.v1.Document.TextChange.toObject(message.textChanges[j], options); + } + if (message.docid != null && message.hasOwnProperty("docid")) + object.docid = message.docid; + if (message.documentLayout != null && message.hasOwnProperty("documentLayout")) + object.documentLayout = $root.google.cloud.documentai.v1.Document.DocumentLayout.toObject(message.documentLayout, options); + if (message.chunkedDocument != null && message.hasOwnProperty("chunkedDocument")) + object.chunkedDocument = $root.google.cloud.documentai.v1.Document.ChunkedDocument.toObject(message.chunkedDocument, options); + if (message.entityValidationOutput != null && message.hasOwnProperty("entityValidationOutput")) + object.entityValidationOutput = $root.google.cloud.documentai.v1.Document.EntityValidationOutput.toObject(message.entityValidationOutput, options); + if (message.entitiesRevisions && message.entitiesRevisions.length) { + object.entitiesRevisions = []; + for (var j = 0; j < message.entitiesRevisions.length; ++j) + object.entitiesRevisions[j] = $root.google.cloud.documentai.v1.Document.EntitiesRevision.toObject(message.entitiesRevisions[j], options); + } + if (message.entitiesRevisionId != null && message.hasOwnProperty("entitiesRevisionId")) + object.entitiesRevisionId = message.entitiesRevisionId; + return object; + }; + + /** + * Converts this Document to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document + * @instance + * @returns {Object.} JSON object + */ + Document.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Document + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Document.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document"; + }; + + Document.ShardInfo = (function() { + + /** + * Properties of a ShardInfo. + * @memberof google.cloud.documentai.v1.Document + * @interface IShardInfo + * @property {number|Long|null} [shardIndex] ShardInfo shardIndex + * @property {number|Long|null} [shardCount] ShardInfo shardCount + * @property {number|Long|null} [textOffset] ShardInfo textOffset + */ + + /** + * Constructs a new ShardInfo. + * @memberof google.cloud.documentai.v1.Document + * @classdesc Represents a ShardInfo. + * @implements IShardInfo + * @constructor + * @param {google.cloud.documentai.v1.Document.IShardInfo=} [properties] Properties to set + */ + function ShardInfo(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]]; + } + + /** + * ShardInfo shardIndex. + * @member {number|Long} shardIndex + * @memberof google.cloud.documentai.v1.Document.ShardInfo + * @instance + */ + ShardInfo.prototype.shardIndex = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ShardInfo shardCount. + * @member {number|Long} shardCount + * @memberof google.cloud.documentai.v1.Document.ShardInfo + * @instance + */ + ShardInfo.prototype.shardCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ShardInfo textOffset. + * @member {number|Long} textOffset + * @memberof google.cloud.documentai.v1.Document.ShardInfo + * @instance + */ + ShardInfo.prototype.textOffset = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ShardInfo instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.ShardInfo + * @static + * @param {google.cloud.documentai.v1.Document.IShardInfo=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.ShardInfo} ShardInfo instance + */ + ShardInfo.create = function create(properties) { + return new ShardInfo(properties); + }; + + /** + * Encodes the specified ShardInfo message. Does not implicitly {@link google.cloud.documentai.v1.Document.ShardInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.ShardInfo + * @static + * @param {google.cloud.documentai.v1.Document.IShardInfo} message ShardInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.shardIndex != null && Object.hasOwnProperty.call(message, "shardIndex")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.shardIndex); + if (message.shardCount != null && Object.hasOwnProperty.call(message, "shardCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.shardCount); + if (message.textOffset != null && Object.hasOwnProperty.call(message, "textOffset")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.textOffset); + return writer; + }; + + /** + * Encodes the specified ShardInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.ShardInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.ShardInfo + * @static + * @param {google.cloud.documentai.v1.Document.IShardInfo} message ShardInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ShardInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.ShardInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.ShardInfo} ShardInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.ShardInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.shardIndex = reader.int64(); + break; + } + case 2: { + message.shardCount = reader.int64(); + break; + } + case 3: { + message.textOffset = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ShardInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.ShardInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.ShardInfo} ShardInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ShardInfo message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.ShardInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ShardInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.shardIndex != null && message.hasOwnProperty("shardIndex")) + if (!$util.isInteger(message.shardIndex) && !(message.shardIndex && $util.isInteger(message.shardIndex.low) && $util.isInteger(message.shardIndex.high))) + return "shardIndex: integer|Long expected"; + if (message.shardCount != null && message.hasOwnProperty("shardCount")) + if (!$util.isInteger(message.shardCount) && !(message.shardCount && $util.isInteger(message.shardCount.low) && $util.isInteger(message.shardCount.high))) + return "shardCount: integer|Long expected"; + if (message.textOffset != null && message.hasOwnProperty("textOffset")) + if (!$util.isInteger(message.textOffset) && !(message.textOffset && $util.isInteger(message.textOffset.low) && $util.isInteger(message.textOffset.high))) + return "textOffset: integer|Long expected"; + return null; + }; + + /** + * Creates a ShardInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.ShardInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.ShardInfo} ShardInfo + */ + ShardInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.ShardInfo) + return object; + var message = new $root.google.cloud.documentai.v1.Document.ShardInfo(); + if (object.shardIndex != null) + if ($util.Long) + (message.shardIndex = $util.Long.fromValue(object.shardIndex)).unsigned = false; + else if (typeof object.shardIndex === "string") + message.shardIndex = parseInt(object.shardIndex, 10); + else if (typeof object.shardIndex === "number") + message.shardIndex = object.shardIndex; + else if (typeof object.shardIndex === "object") + message.shardIndex = new $util.LongBits(object.shardIndex.low >>> 0, object.shardIndex.high >>> 0).toNumber(); + if (object.shardCount != null) + if ($util.Long) + (message.shardCount = $util.Long.fromValue(object.shardCount)).unsigned = false; + else if (typeof object.shardCount === "string") + message.shardCount = parseInt(object.shardCount, 10); + else if (typeof object.shardCount === "number") + message.shardCount = object.shardCount; + else if (typeof object.shardCount === "object") + message.shardCount = new $util.LongBits(object.shardCount.low >>> 0, object.shardCount.high >>> 0).toNumber(); + if (object.textOffset != null) + if ($util.Long) + (message.textOffset = $util.Long.fromValue(object.textOffset)).unsigned = false; + else if (typeof object.textOffset === "string") + message.textOffset = parseInt(object.textOffset, 10); + else if (typeof object.textOffset === "number") + message.textOffset = object.textOffset; + else if (typeof object.textOffset === "object") + message.textOffset = new $util.LongBits(object.textOffset.low >>> 0, object.textOffset.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a ShardInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.ShardInfo + * @static + * @param {google.cloud.documentai.v1.Document.ShardInfo} message ShardInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ShardInfo.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.shardIndex = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.shardIndex = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.shardCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.shardCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.textOffset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.textOffset = options.longs === String ? "0" : 0; + } + if (message.shardIndex != null && message.hasOwnProperty("shardIndex")) + if (typeof message.shardIndex === "number") + object.shardIndex = options.longs === String ? String(message.shardIndex) : message.shardIndex; + else + object.shardIndex = options.longs === String ? $util.Long.prototype.toString.call(message.shardIndex) : options.longs === Number ? new $util.LongBits(message.shardIndex.low >>> 0, message.shardIndex.high >>> 0).toNumber() : message.shardIndex; + if (message.shardCount != null && message.hasOwnProperty("shardCount")) + if (typeof message.shardCount === "number") + object.shardCount = options.longs === String ? String(message.shardCount) : message.shardCount; + else + object.shardCount = options.longs === String ? $util.Long.prototype.toString.call(message.shardCount) : options.longs === Number ? new $util.LongBits(message.shardCount.low >>> 0, message.shardCount.high >>> 0).toNumber() : message.shardCount; + if (message.textOffset != null && message.hasOwnProperty("textOffset")) + if (typeof message.textOffset === "number") + object.textOffset = options.longs === String ? String(message.textOffset) : message.textOffset; + else + object.textOffset = options.longs === String ? $util.Long.prototype.toString.call(message.textOffset) : options.longs === Number ? new $util.LongBits(message.textOffset.low >>> 0, message.textOffset.high >>> 0).toNumber() : message.textOffset; + return object; + }; + + /** + * Converts this ShardInfo to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.ShardInfo + * @instance + * @returns {Object.} JSON object + */ + ShardInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ShardInfo + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.ShardInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.ShardInfo"; + }; + + return ShardInfo; + })(); + + Document.Style = (function() { + + /** + * Properties of a Style. + * @memberof google.cloud.documentai.v1.Document + * @interface IStyle + * @property {google.cloud.documentai.v1.Document.ITextAnchor|null} [textAnchor] Style textAnchor + * @property {google.type.IColor|null} [color] Style color + * @property {google.type.IColor|null} [backgroundColor] Style backgroundColor + * @property {string|null} [fontWeight] Style fontWeight + * @property {string|null} [textStyle] Style textStyle + * @property {string|null} [textDecoration] Style textDecoration + * @property {google.cloud.documentai.v1.Document.Style.IFontSize|null} [fontSize] Style fontSize + * @property {string|null} [fontFamily] Style fontFamily + */ + + /** + * Constructs a new Style. + * @memberof google.cloud.documentai.v1.Document + * @classdesc Represents a Style. + * @implements IStyle + * @constructor + * @param {google.cloud.documentai.v1.Document.IStyle=} [properties] Properties to set + */ + function Style(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]]; + } + + /** + * Style textAnchor. + * @member {google.cloud.documentai.v1.Document.ITextAnchor|null|undefined} textAnchor + * @memberof google.cloud.documentai.v1.Document.Style + * @instance + */ + Style.prototype.textAnchor = null; + + /** + * Style color. + * @member {google.type.IColor|null|undefined} color + * @memberof google.cloud.documentai.v1.Document.Style + * @instance + */ + Style.prototype.color = null; + + /** + * Style backgroundColor. + * @member {google.type.IColor|null|undefined} backgroundColor + * @memberof google.cloud.documentai.v1.Document.Style + * @instance + */ + Style.prototype.backgroundColor = null; + + /** + * Style fontWeight. + * @member {string} fontWeight + * @memberof google.cloud.documentai.v1.Document.Style + * @instance + */ + Style.prototype.fontWeight = ""; + + /** + * Style textStyle. + * @member {string} textStyle + * @memberof google.cloud.documentai.v1.Document.Style + * @instance + */ + Style.prototype.textStyle = ""; + + /** + * Style textDecoration. + * @member {string} textDecoration + * @memberof google.cloud.documentai.v1.Document.Style + * @instance + */ + Style.prototype.textDecoration = ""; + + /** + * Style fontSize. + * @member {google.cloud.documentai.v1.Document.Style.IFontSize|null|undefined} fontSize + * @memberof google.cloud.documentai.v1.Document.Style + * @instance + */ + Style.prototype.fontSize = null; + + /** + * Style fontFamily. + * @member {string} fontFamily + * @memberof google.cloud.documentai.v1.Document.Style + * @instance + */ + Style.prototype.fontFamily = ""; + + /** + * Creates a new Style instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.Style + * @static + * @param {google.cloud.documentai.v1.Document.IStyle=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.Style} Style instance + */ + Style.create = function create(properties) { + return new Style(properties); + }; + + /** + * Encodes the specified Style message. Does not implicitly {@link google.cloud.documentai.v1.Document.Style.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.Style + * @static + * @param {google.cloud.documentai.v1.Document.IStyle} message Style message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Style.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.textAnchor != null && Object.hasOwnProperty.call(message, "textAnchor")) + $root.google.cloud.documentai.v1.Document.TextAnchor.encode(message.textAnchor, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.color != null && Object.hasOwnProperty.call(message, "color")) + $root.google.type.Color.encode(message.color, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.backgroundColor != null && Object.hasOwnProperty.call(message, "backgroundColor")) + $root.google.type.Color.encode(message.backgroundColor, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.fontWeight != null && Object.hasOwnProperty.call(message, "fontWeight")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.fontWeight); + if (message.textStyle != null && Object.hasOwnProperty.call(message, "textStyle")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.textStyle); + if (message.textDecoration != null && Object.hasOwnProperty.call(message, "textDecoration")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.textDecoration); + if (message.fontSize != null && Object.hasOwnProperty.call(message, "fontSize")) + $root.google.cloud.documentai.v1.Document.Style.FontSize.encode(message.fontSize, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.fontFamily != null && Object.hasOwnProperty.call(message, "fontFamily")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.fontFamily); + return writer; + }; + + /** + * Encodes the specified Style message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Style.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.Style + * @static + * @param {google.cloud.documentai.v1.Document.IStyle} message Style message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Style.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Style message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.Style + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.Style} Style + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Style.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Style(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.textAnchor = $root.google.cloud.documentai.v1.Document.TextAnchor.decode(reader, reader.uint32()); + break; + } + case 2: { + message.color = $root.google.type.Color.decode(reader, reader.uint32()); + break; + } + case 3: { + message.backgroundColor = $root.google.type.Color.decode(reader, reader.uint32()); + break; + } + case 4: { + message.fontWeight = reader.string(); + break; + } + case 5: { + message.textStyle = reader.string(); + break; + } + case 6: { + message.textDecoration = reader.string(); + break; + } + case 7: { + message.fontSize = $root.google.cloud.documentai.v1.Document.Style.FontSize.decode(reader, reader.uint32()); + break; + } + case 8: { + message.fontFamily = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Style message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.Style + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.Style} Style + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Style.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Style message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.Style + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Style.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.textAnchor != null && message.hasOwnProperty("textAnchor")) { + var error = $root.google.cloud.documentai.v1.Document.TextAnchor.verify(message.textAnchor); + if (error) + return "textAnchor." + error; + } + if (message.color != null && message.hasOwnProperty("color")) { + var error = $root.google.type.Color.verify(message.color); + if (error) + return "color." + error; + } + if (message.backgroundColor != null && message.hasOwnProperty("backgroundColor")) { + var error = $root.google.type.Color.verify(message.backgroundColor); + if (error) + return "backgroundColor." + error; + } + if (message.fontWeight != null && message.hasOwnProperty("fontWeight")) + if (!$util.isString(message.fontWeight)) + return "fontWeight: string expected"; + if (message.textStyle != null && message.hasOwnProperty("textStyle")) + if (!$util.isString(message.textStyle)) + return "textStyle: string expected"; + if (message.textDecoration != null && message.hasOwnProperty("textDecoration")) + if (!$util.isString(message.textDecoration)) + return "textDecoration: string expected"; + if (message.fontSize != null && message.hasOwnProperty("fontSize")) { + var error = $root.google.cloud.documentai.v1.Document.Style.FontSize.verify(message.fontSize); + if (error) + return "fontSize." + error; + } + if (message.fontFamily != null && message.hasOwnProperty("fontFamily")) + if (!$util.isString(message.fontFamily)) + return "fontFamily: string expected"; + return null; + }; + + /** + * Creates a Style message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.Style + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.Style} Style + */ + Style.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.Style) + return object; + var message = new $root.google.cloud.documentai.v1.Document.Style(); + if (object.textAnchor != null) { + if (typeof object.textAnchor !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Style.textAnchor: object expected"); + message.textAnchor = $root.google.cloud.documentai.v1.Document.TextAnchor.fromObject(object.textAnchor); + } + if (object.color != null) { + if (typeof object.color !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Style.color: object expected"); + message.color = $root.google.type.Color.fromObject(object.color); + } + if (object.backgroundColor != null) { + if (typeof object.backgroundColor !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Style.backgroundColor: object expected"); + message.backgroundColor = $root.google.type.Color.fromObject(object.backgroundColor); + } + if (object.fontWeight != null) + message.fontWeight = String(object.fontWeight); + if (object.textStyle != null) + message.textStyle = String(object.textStyle); + if (object.textDecoration != null) + message.textDecoration = String(object.textDecoration); + if (object.fontSize != null) { + if (typeof object.fontSize !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Style.fontSize: object expected"); + message.fontSize = $root.google.cloud.documentai.v1.Document.Style.FontSize.fromObject(object.fontSize); + } + if (object.fontFamily != null) + message.fontFamily = String(object.fontFamily); + return message; + }; + + /** + * Creates a plain object from a Style message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.Style + * @static + * @param {google.cloud.documentai.v1.Document.Style} message Style + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Style.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.textAnchor = null; + object.color = null; + object.backgroundColor = null; + object.fontWeight = ""; + object.textStyle = ""; + object.textDecoration = ""; + object.fontSize = null; + object.fontFamily = ""; + } + if (message.textAnchor != null && message.hasOwnProperty("textAnchor")) + object.textAnchor = $root.google.cloud.documentai.v1.Document.TextAnchor.toObject(message.textAnchor, options); + if (message.color != null && message.hasOwnProperty("color")) + object.color = $root.google.type.Color.toObject(message.color, options); + if (message.backgroundColor != null && message.hasOwnProperty("backgroundColor")) + object.backgroundColor = $root.google.type.Color.toObject(message.backgroundColor, options); + if (message.fontWeight != null && message.hasOwnProperty("fontWeight")) + object.fontWeight = message.fontWeight; + if (message.textStyle != null && message.hasOwnProperty("textStyle")) + object.textStyle = message.textStyle; + if (message.textDecoration != null && message.hasOwnProperty("textDecoration")) + object.textDecoration = message.textDecoration; + if (message.fontSize != null && message.hasOwnProperty("fontSize")) + object.fontSize = $root.google.cloud.documentai.v1.Document.Style.FontSize.toObject(message.fontSize, options); + if (message.fontFamily != null && message.hasOwnProperty("fontFamily")) + object.fontFamily = message.fontFamily; + return object; + }; + + /** + * Converts this Style to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.Style + * @instance + * @returns {Object.} JSON object + */ + Style.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Style + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.Style + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Style.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Style"; + }; + + Style.FontSize = (function() { + + /** + * Properties of a FontSize. + * @memberof google.cloud.documentai.v1.Document.Style + * @interface IFontSize + * @property {number|null} [size] FontSize size + * @property {string|null} [unit] FontSize unit + */ + + /** + * Constructs a new FontSize. + * @memberof google.cloud.documentai.v1.Document.Style + * @classdesc Represents a FontSize. + * @implements IFontSize + * @constructor + * @param {google.cloud.documentai.v1.Document.Style.IFontSize=} [properties] Properties to set + */ + function FontSize(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]]; + } + + /** + * FontSize size. + * @member {number} size + * @memberof google.cloud.documentai.v1.Document.Style.FontSize + * @instance + */ + FontSize.prototype.size = 0; + + /** + * FontSize unit. + * @member {string} unit + * @memberof google.cloud.documentai.v1.Document.Style.FontSize + * @instance + */ + FontSize.prototype.unit = ""; + + /** + * Creates a new FontSize instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.Style.FontSize + * @static + * @param {google.cloud.documentai.v1.Document.Style.IFontSize=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.Style.FontSize} FontSize instance + */ + FontSize.create = function create(properties) { + return new FontSize(properties); + }; + + /** + * Encodes the specified FontSize message. Does not implicitly {@link google.cloud.documentai.v1.Document.Style.FontSize.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.Style.FontSize + * @static + * @param {google.cloud.documentai.v1.Document.Style.IFontSize} message FontSize message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FontSize.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.size != null && Object.hasOwnProperty.call(message, "size")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.size); + if (message.unit != null && Object.hasOwnProperty.call(message, "unit")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.unit); + return writer; + }; + + /** + * Encodes the specified FontSize message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Style.FontSize.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.Style.FontSize + * @static + * @param {google.cloud.documentai.v1.Document.Style.IFontSize} message FontSize message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FontSize.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FontSize message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.Style.FontSize + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.Style.FontSize} FontSize + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FontSize.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Style.FontSize(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.size = reader.float(); + break; + } + case 2: { + message.unit = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FontSize message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.Style.FontSize + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.Style.FontSize} FontSize + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FontSize.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FontSize message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.Style.FontSize + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FontSize.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.size != null && message.hasOwnProperty("size")) + if (typeof message.size !== "number") + return "size: number expected"; + if (message.unit != null && message.hasOwnProperty("unit")) + if (!$util.isString(message.unit)) + return "unit: string expected"; + return null; + }; + + /** + * Creates a FontSize message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.Style.FontSize + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.Style.FontSize} FontSize + */ + FontSize.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.Style.FontSize) + return object; + var message = new $root.google.cloud.documentai.v1.Document.Style.FontSize(); + if (object.size != null) + message.size = Number(object.size); + if (object.unit != null) + message.unit = String(object.unit); + return message; + }; + + /** + * Creates a plain object from a FontSize message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.Style.FontSize + * @static + * @param {google.cloud.documentai.v1.Document.Style.FontSize} message FontSize + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FontSize.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.size = 0; + object.unit = ""; + } + if (message.size != null && message.hasOwnProperty("size")) + object.size = options.json && !isFinite(message.size) ? String(message.size) : message.size; + if (message.unit != null && message.hasOwnProperty("unit")) + object.unit = message.unit; + return object; + }; + + /** + * Converts this FontSize to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.Style.FontSize + * @instance + * @returns {Object.} JSON object + */ + FontSize.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FontSize + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.Style.FontSize + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FontSize.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Style.FontSize"; + }; + + return FontSize; + })(); + + return Style; + })(); + + Document.Page = (function() { + + /** + * Properties of a Page. + * @memberof google.cloud.documentai.v1.Document + * @interface IPage + * @property {number|null} [pageNumber] Page pageNumber + * @property {google.cloud.documentai.v1.Document.Page.IImage|null} [image] Page image + * @property {Array.|null} [transforms] Page transforms + * @property {google.cloud.documentai.v1.Document.Page.IDimension|null} [dimension] Page dimension + * @property {google.cloud.documentai.v1.Document.Page.ILayout|null} [layout] Page layout + * @property {Array.|null} [detectedLanguages] Page detectedLanguages + * @property {Array.|null} [blocks] Page blocks + * @property {Array.|null} [paragraphs] Page paragraphs + * @property {Array.|null} [lines] Page lines + * @property {Array.|null} [tokens] Page tokens + * @property {Array.|null} [visualElements] Page visualElements + * @property {Array.|null} [tables] Page tables + * @property {Array.|null} [formFields] Page formFields + * @property {Array.|null} [symbols] Page symbols + * @property {Array.|null} [detectedBarcodes] Page detectedBarcodes + * @property {google.cloud.documentai.v1.Document.Page.IImageQualityScores|null} [imageQualityScores] Page imageQualityScores + * @property {google.cloud.documentai.v1.Document.IProvenance|null} [provenance] Page provenance + */ + + /** + * Constructs a new Page. + * @memberof google.cloud.documentai.v1.Document + * @classdesc Represents a Page. + * @implements IPage + * @constructor + * @param {google.cloud.documentai.v1.Document.IPage=} [properties] Properties to set + */ + function Page(properties) { + this.transforms = []; + this.detectedLanguages = []; + this.blocks = []; + this.paragraphs = []; + this.lines = []; + this.tokens = []; + this.visualElements = []; + this.tables = []; + this.formFields = []; + this.symbols = []; + this.detectedBarcodes = []; + 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]]; + } + + /** + * Page pageNumber. + * @member {number} pageNumber + * @memberof google.cloud.documentai.v1.Document.Page + * @instance + */ + Page.prototype.pageNumber = 0; + + /** + * Page image. + * @member {google.cloud.documentai.v1.Document.Page.IImage|null|undefined} image + * @memberof google.cloud.documentai.v1.Document.Page + * @instance + */ + Page.prototype.image = null; + + /** + * Page transforms. + * @member {Array.} transforms + * @memberof google.cloud.documentai.v1.Document.Page + * @instance + */ + Page.prototype.transforms = $util.emptyArray; + + /** + * Page dimension. + * @member {google.cloud.documentai.v1.Document.Page.IDimension|null|undefined} dimension + * @memberof google.cloud.documentai.v1.Document.Page + * @instance + */ + Page.prototype.dimension = null; + + /** + * Page layout. + * @member {google.cloud.documentai.v1.Document.Page.ILayout|null|undefined} layout + * @memberof google.cloud.documentai.v1.Document.Page + * @instance + */ + Page.prototype.layout = null; + + /** + * Page detectedLanguages. + * @member {Array.} detectedLanguages + * @memberof google.cloud.documentai.v1.Document.Page + * @instance + */ + Page.prototype.detectedLanguages = $util.emptyArray; + + /** + * Page blocks. + * @member {Array.} blocks + * @memberof google.cloud.documentai.v1.Document.Page + * @instance + */ + Page.prototype.blocks = $util.emptyArray; + + /** + * Page paragraphs. + * @member {Array.} paragraphs + * @memberof google.cloud.documentai.v1.Document.Page + * @instance + */ + Page.prototype.paragraphs = $util.emptyArray; + + /** + * Page lines. + * @member {Array.} lines + * @memberof google.cloud.documentai.v1.Document.Page + * @instance + */ + Page.prototype.lines = $util.emptyArray; + + /** + * Page tokens. + * @member {Array.} tokens + * @memberof google.cloud.documentai.v1.Document.Page + * @instance + */ + Page.prototype.tokens = $util.emptyArray; + + /** + * Page visualElements. + * @member {Array.} visualElements + * @memberof google.cloud.documentai.v1.Document.Page + * @instance + */ + Page.prototype.visualElements = $util.emptyArray; + + /** + * Page tables. + * @member {Array.} tables + * @memberof google.cloud.documentai.v1.Document.Page + * @instance + */ + Page.prototype.tables = $util.emptyArray; + + /** + * Page formFields. + * @member {Array.} formFields + * @memberof google.cloud.documentai.v1.Document.Page + * @instance + */ + Page.prototype.formFields = $util.emptyArray; + + /** + * Page symbols. + * @member {Array.} symbols + * @memberof google.cloud.documentai.v1.Document.Page + * @instance + */ + Page.prototype.symbols = $util.emptyArray; + + /** + * Page detectedBarcodes. + * @member {Array.} detectedBarcodes + * @memberof google.cloud.documentai.v1.Document.Page + * @instance + */ + Page.prototype.detectedBarcodes = $util.emptyArray; + + /** + * Page imageQualityScores. + * @member {google.cloud.documentai.v1.Document.Page.IImageQualityScores|null|undefined} imageQualityScores + * @memberof google.cloud.documentai.v1.Document.Page + * @instance + */ + Page.prototype.imageQualityScores = null; + + /** + * Page provenance. + * @member {google.cloud.documentai.v1.Document.IProvenance|null|undefined} provenance + * @memberof google.cloud.documentai.v1.Document.Page + * @instance + */ + Page.prototype.provenance = null; + + /** + * Creates a new Page instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.Page + * @static + * @param {google.cloud.documentai.v1.Document.IPage=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.Page} Page instance + */ + Page.create = function create(properties) { + return new Page(properties); + }; + + /** + * Encodes the specified Page message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.Page + * @static + * @param {google.cloud.documentai.v1.Document.IPage} message Page message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Page.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageNumber != null && Object.hasOwnProperty.call(message, "pageNumber")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.pageNumber); + if (message.dimension != null && Object.hasOwnProperty.call(message, "dimension")) + $root.google.cloud.documentai.v1.Document.Page.Dimension.encode(message.dimension, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.layout != null && Object.hasOwnProperty.call(message, "layout")) + $root.google.cloud.documentai.v1.Document.Page.Layout.encode(message.layout, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.detectedLanguages != null && message.detectedLanguages.length) + for (var i = 0; i < message.detectedLanguages.length; ++i) + $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.encode(message.detectedLanguages[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.blocks != null && message.blocks.length) + for (var i = 0; i < message.blocks.length; ++i) + $root.google.cloud.documentai.v1.Document.Page.Block.encode(message.blocks[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.paragraphs != null && message.paragraphs.length) + for (var i = 0; i < message.paragraphs.length; ++i) + $root.google.cloud.documentai.v1.Document.Page.Paragraph.encode(message.paragraphs[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.lines != null && message.lines.length) + for (var i = 0; i < message.lines.length; ++i) + $root.google.cloud.documentai.v1.Document.Page.Line.encode(message.lines[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.tokens != null && message.tokens.length) + for (var i = 0; i < message.tokens.length; ++i) + $root.google.cloud.documentai.v1.Document.Page.Token.encode(message.tokens[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.visualElements != null && message.visualElements.length) + for (var i = 0; i < message.visualElements.length; ++i) + $root.google.cloud.documentai.v1.Document.Page.VisualElement.encode(message.visualElements[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.tables != null && message.tables.length) + for (var i = 0; i < message.tables.length; ++i) + $root.google.cloud.documentai.v1.Document.Page.Table.encode(message.tables[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.formFields != null && message.formFields.length) + for (var i = 0; i < message.formFields.length; ++i) + $root.google.cloud.documentai.v1.Document.Page.FormField.encode(message.formFields[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.symbols != null && message.symbols.length) + for (var i = 0; i < message.symbols.length; ++i) + $root.google.cloud.documentai.v1.Document.Page.Symbol.encode(message.symbols[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.image != null && Object.hasOwnProperty.call(message, "image")) + $root.google.cloud.documentai.v1.Document.Page.Image.encode(message.image, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.transforms != null && message.transforms.length) + for (var i = 0; i < message.transforms.length; ++i) + $root.google.cloud.documentai.v1.Document.Page.Matrix.encode(message.transforms[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.detectedBarcodes != null && message.detectedBarcodes.length) + for (var i = 0; i < message.detectedBarcodes.length; ++i) + $root.google.cloud.documentai.v1.Document.Page.DetectedBarcode.encode(message.detectedBarcodes[i], writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.provenance != null && Object.hasOwnProperty.call(message, "provenance")) + $root.google.cloud.documentai.v1.Document.Provenance.encode(message.provenance, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.imageQualityScores != null && Object.hasOwnProperty.call(message, "imageQualityScores")) + $root.google.cloud.documentai.v1.Document.Page.ImageQualityScores.encode(message.imageQualityScores, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Page message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.Page + * @static + * @param {google.cloud.documentai.v1.Document.IPage} message Page message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Page.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Page message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.Page + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.Page} Page + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Page.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Page(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.pageNumber = reader.int32(); + break; + } + case 13: { + message.image = $root.google.cloud.documentai.v1.Document.Page.Image.decode(reader, reader.uint32()); + break; + } + case 14: { + if (!(message.transforms && message.transforms.length)) + message.transforms = []; + message.transforms.push($root.google.cloud.documentai.v1.Document.Page.Matrix.decode(reader, reader.uint32())); + break; + } + case 2: { + message.dimension = $root.google.cloud.documentai.v1.Document.Page.Dimension.decode(reader, reader.uint32()); + break; + } + case 3: { + message.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.detectedLanguages && message.detectedLanguages.length)) + message.detectedLanguages = []; + message.detectedLanguages.push($root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.blocks && message.blocks.length)) + message.blocks = []; + message.blocks.push($root.google.cloud.documentai.v1.Document.Page.Block.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.paragraphs && message.paragraphs.length)) + message.paragraphs = []; + message.paragraphs.push($root.google.cloud.documentai.v1.Document.Page.Paragraph.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.lines && message.lines.length)) + message.lines = []; + message.lines.push($root.google.cloud.documentai.v1.Document.Page.Line.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.tokens && message.tokens.length)) + message.tokens = []; + message.tokens.push($root.google.cloud.documentai.v1.Document.Page.Token.decode(reader, reader.uint32())); + break; + } + case 9: { + if (!(message.visualElements && message.visualElements.length)) + message.visualElements = []; + message.visualElements.push($root.google.cloud.documentai.v1.Document.Page.VisualElement.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.tables && message.tables.length)) + message.tables = []; + message.tables.push($root.google.cloud.documentai.v1.Document.Page.Table.decode(reader, reader.uint32())); + break; + } + case 11: { + if (!(message.formFields && message.formFields.length)) + message.formFields = []; + message.formFields.push($root.google.cloud.documentai.v1.Document.Page.FormField.decode(reader, reader.uint32())); + break; + } + case 12: { + if (!(message.symbols && message.symbols.length)) + message.symbols = []; + message.symbols.push($root.google.cloud.documentai.v1.Document.Page.Symbol.decode(reader, reader.uint32())); + break; + } + case 15: { + if (!(message.detectedBarcodes && message.detectedBarcodes.length)) + message.detectedBarcodes = []; + message.detectedBarcodes.push($root.google.cloud.documentai.v1.Document.Page.DetectedBarcode.decode(reader, reader.uint32())); + break; + } + case 17: { + message.imageQualityScores = $root.google.cloud.documentai.v1.Document.Page.ImageQualityScores.decode(reader, reader.uint32()); + break; + } + case 16: { + message.provenance = $root.google.cloud.documentai.v1.Document.Provenance.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Page message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.Page + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.Page} Page + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Page.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Page message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.Page + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Page.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pageNumber != null && message.hasOwnProperty("pageNumber")) + if (!$util.isInteger(message.pageNumber)) + return "pageNumber: integer expected"; + if (message.image != null && message.hasOwnProperty("image")) { + var error = $root.google.cloud.documentai.v1.Document.Page.Image.verify(message.image); + if (error) + return "image." + error; + } + if (message.transforms != null && message.hasOwnProperty("transforms")) { + if (!Array.isArray(message.transforms)) + return "transforms: array expected"; + for (var i = 0; i < message.transforms.length; ++i) { + var error = $root.google.cloud.documentai.v1.Document.Page.Matrix.verify(message.transforms[i]); + if (error) + return "transforms." + error; + } + } + if (message.dimension != null && message.hasOwnProperty("dimension")) { + var error = $root.google.cloud.documentai.v1.Document.Page.Dimension.verify(message.dimension); + if (error) + return "dimension." + error; + } + if (message.layout != null && message.hasOwnProperty("layout")) { + var error = $root.google.cloud.documentai.v1.Document.Page.Layout.verify(message.layout); + if (error) + return "layout." + error; + } + if (message.detectedLanguages != null && message.hasOwnProperty("detectedLanguages")) { + if (!Array.isArray(message.detectedLanguages)) + return "detectedLanguages: array expected"; + for (var i = 0; i < message.detectedLanguages.length; ++i) { + var error = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.verify(message.detectedLanguages[i]); + if (error) + return "detectedLanguages." + error; + } + } + if (message.blocks != null && message.hasOwnProperty("blocks")) { + if (!Array.isArray(message.blocks)) + return "blocks: array expected"; + for (var i = 0; i < message.blocks.length; ++i) { + var error = $root.google.cloud.documentai.v1.Document.Page.Block.verify(message.blocks[i]); + if (error) + return "blocks." + error; + } + } + if (message.paragraphs != null && message.hasOwnProperty("paragraphs")) { + if (!Array.isArray(message.paragraphs)) + return "paragraphs: array expected"; + for (var i = 0; i < message.paragraphs.length; ++i) { + var error = $root.google.cloud.documentai.v1.Document.Page.Paragraph.verify(message.paragraphs[i]); + if (error) + return "paragraphs." + error; + } + } + if (message.lines != null && message.hasOwnProperty("lines")) { + if (!Array.isArray(message.lines)) + return "lines: array expected"; + for (var i = 0; i < message.lines.length; ++i) { + var error = $root.google.cloud.documentai.v1.Document.Page.Line.verify(message.lines[i]); + if (error) + return "lines." + error; + } + } + if (message.tokens != null && message.hasOwnProperty("tokens")) { + if (!Array.isArray(message.tokens)) + return "tokens: array expected"; + for (var i = 0; i < message.tokens.length; ++i) { + var error = $root.google.cloud.documentai.v1.Document.Page.Token.verify(message.tokens[i]); + if (error) + return "tokens." + error; + } + } + if (message.visualElements != null && message.hasOwnProperty("visualElements")) { + if (!Array.isArray(message.visualElements)) + return "visualElements: array expected"; + for (var i = 0; i < message.visualElements.length; ++i) { + var error = $root.google.cloud.documentai.v1.Document.Page.VisualElement.verify(message.visualElements[i]); + if (error) + return "visualElements." + error; + } + } + if (message.tables != null && message.hasOwnProperty("tables")) { + if (!Array.isArray(message.tables)) + return "tables: array expected"; + for (var i = 0; i < message.tables.length; ++i) { + var error = $root.google.cloud.documentai.v1.Document.Page.Table.verify(message.tables[i]); + if (error) + return "tables." + error; + } + } + if (message.formFields != null && message.hasOwnProperty("formFields")) { + if (!Array.isArray(message.formFields)) + return "formFields: array expected"; + for (var i = 0; i < message.formFields.length; ++i) { + var error = $root.google.cloud.documentai.v1.Document.Page.FormField.verify(message.formFields[i]); + if (error) + return "formFields." + error; + } + } + if (message.symbols != null && message.hasOwnProperty("symbols")) { + if (!Array.isArray(message.symbols)) + return "symbols: array expected"; + for (var i = 0; i < message.symbols.length; ++i) { + var error = $root.google.cloud.documentai.v1.Document.Page.Symbol.verify(message.symbols[i]); + if (error) + return "symbols." + error; + } + } + if (message.detectedBarcodes != null && message.hasOwnProperty("detectedBarcodes")) { + if (!Array.isArray(message.detectedBarcodes)) + return "detectedBarcodes: array expected"; + for (var i = 0; i < message.detectedBarcodes.length; ++i) { + var error = $root.google.cloud.documentai.v1.Document.Page.DetectedBarcode.verify(message.detectedBarcodes[i]); + if (error) + return "detectedBarcodes." + error; + } + } + if (message.imageQualityScores != null && message.hasOwnProperty("imageQualityScores")) { + var error = $root.google.cloud.documentai.v1.Document.Page.ImageQualityScores.verify(message.imageQualityScores); + if (error) + return "imageQualityScores." + error; + } + if (message.provenance != null && message.hasOwnProperty("provenance")) { + var error = $root.google.cloud.documentai.v1.Document.Provenance.verify(message.provenance); + if (error) + return "provenance." + error; + } + return null; + }; + + /** + * Creates a Page message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.Page + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.Page} Page + */ + Page.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.Page) + return object; + var message = new $root.google.cloud.documentai.v1.Document.Page(); + if (object.pageNumber != null) + message.pageNumber = object.pageNumber | 0; + if (object.image != null) { + if (typeof object.image !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.image: object expected"); + message.image = $root.google.cloud.documentai.v1.Document.Page.Image.fromObject(object.image); + } + if (object.transforms) { + if (!Array.isArray(object.transforms)) + throw TypeError(".google.cloud.documentai.v1.Document.Page.transforms: array expected"); + message.transforms = []; + for (var i = 0; i < object.transforms.length; ++i) { + if (typeof object.transforms[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.transforms: object expected"); + message.transforms[i] = $root.google.cloud.documentai.v1.Document.Page.Matrix.fromObject(object.transforms[i]); + } + } + if (object.dimension != null) { + if (typeof object.dimension !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.dimension: object expected"); + message.dimension = $root.google.cloud.documentai.v1.Document.Page.Dimension.fromObject(object.dimension); + } + if (object.layout != null) { + if (typeof object.layout !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.layout: object expected"); + message.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.fromObject(object.layout); + } + if (object.detectedLanguages) { + if (!Array.isArray(object.detectedLanguages)) + throw TypeError(".google.cloud.documentai.v1.Document.Page.detectedLanguages: array expected"); + message.detectedLanguages = []; + for (var i = 0; i < object.detectedLanguages.length; ++i) { + if (typeof object.detectedLanguages[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.detectedLanguages: object expected"); + message.detectedLanguages[i] = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.fromObject(object.detectedLanguages[i]); + } + } + if (object.blocks) { + if (!Array.isArray(object.blocks)) + throw TypeError(".google.cloud.documentai.v1.Document.Page.blocks: array expected"); + message.blocks = []; + for (var i = 0; i < object.blocks.length; ++i) { + if (typeof object.blocks[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.blocks: object expected"); + message.blocks[i] = $root.google.cloud.documentai.v1.Document.Page.Block.fromObject(object.blocks[i]); + } + } + if (object.paragraphs) { + if (!Array.isArray(object.paragraphs)) + throw TypeError(".google.cloud.documentai.v1.Document.Page.paragraphs: array expected"); + message.paragraphs = []; + for (var i = 0; i < object.paragraphs.length; ++i) { + if (typeof object.paragraphs[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.paragraphs: object expected"); + message.paragraphs[i] = $root.google.cloud.documentai.v1.Document.Page.Paragraph.fromObject(object.paragraphs[i]); + } + } + if (object.lines) { + if (!Array.isArray(object.lines)) + throw TypeError(".google.cloud.documentai.v1.Document.Page.lines: array expected"); + message.lines = []; + for (var i = 0; i < object.lines.length; ++i) { + if (typeof object.lines[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.lines: object expected"); + message.lines[i] = $root.google.cloud.documentai.v1.Document.Page.Line.fromObject(object.lines[i]); + } + } + if (object.tokens) { + if (!Array.isArray(object.tokens)) + throw TypeError(".google.cloud.documentai.v1.Document.Page.tokens: array expected"); + message.tokens = []; + for (var i = 0; i < object.tokens.length; ++i) { + if (typeof object.tokens[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.tokens: object expected"); + message.tokens[i] = $root.google.cloud.documentai.v1.Document.Page.Token.fromObject(object.tokens[i]); + } + } + if (object.visualElements) { + if (!Array.isArray(object.visualElements)) + throw TypeError(".google.cloud.documentai.v1.Document.Page.visualElements: array expected"); + message.visualElements = []; + for (var i = 0; i < object.visualElements.length; ++i) { + if (typeof object.visualElements[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.visualElements: object expected"); + message.visualElements[i] = $root.google.cloud.documentai.v1.Document.Page.VisualElement.fromObject(object.visualElements[i]); + } + } + if (object.tables) { + if (!Array.isArray(object.tables)) + throw TypeError(".google.cloud.documentai.v1.Document.Page.tables: array expected"); + message.tables = []; + for (var i = 0; i < object.tables.length; ++i) { + if (typeof object.tables[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.tables: object expected"); + message.tables[i] = $root.google.cloud.documentai.v1.Document.Page.Table.fromObject(object.tables[i]); + } + } + if (object.formFields) { + if (!Array.isArray(object.formFields)) + throw TypeError(".google.cloud.documentai.v1.Document.Page.formFields: array expected"); + message.formFields = []; + for (var i = 0; i < object.formFields.length; ++i) { + if (typeof object.formFields[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.formFields: object expected"); + message.formFields[i] = $root.google.cloud.documentai.v1.Document.Page.FormField.fromObject(object.formFields[i]); + } + } + if (object.symbols) { + if (!Array.isArray(object.symbols)) + throw TypeError(".google.cloud.documentai.v1.Document.Page.symbols: array expected"); + message.symbols = []; + for (var i = 0; i < object.symbols.length; ++i) { + if (typeof object.symbols[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.symbols: object expected"); + message.symbols[i] = $root.google.cloud.documentai.v1.Document.Page.Symbol.fromObject(object.symbols[i]); + } + } + if (object.detectedBarcodes) { + if (!Array.isArray(object.detectedBarcodes)) + throw TypeError(".google.cloud.documentai.v1.Document.Page.detectedBarcodes: array expected"); + message.detectedBarcodes = []; + for (var i = 0; i < object.detectedBarcodes.length; ++i) { + if (typeof object.detectedBarcodes[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.detectedBarcodes: object expected"); + message.detectedBarcodes[i] = $root.google.cloud.documentai.v1.Document.Page.DetectedBarcode.fromObject(object.detectedBarcodes[i]); + } + } + if (object.imageQualityScores != null) { + if (typeof object.imageQualityScores !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.imageQualityScores: object expected"); + message.imageQualityScores = $root.google.cloud.documentai.v1.Document.Page.ImageQualityScores.fromObject(object.imageQualityScores); + } + if (object.provenance != null) { + if (typeof object.provenance !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.provenance: object expected"); + message.provenance = $root.google.cloud.documentai.v1.Document.Provenance.fromObject(object.provenance); + } + return message; + }; + + /** + * Creates a plain object from a Page message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.Page + * @static + * @param {google.cloud.documentai.v1.Document.Page} message Page + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Page.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.detectedLanguages = []; + object.blocks = []; + object.paragraphs = []; + object.lines = []; + object.tokens = []; + object.visualElements = []; + object.tables = []; + object.formFields = []; + object.symbols = []; + object.transforms = []; + object.detectedBarcodes = []; + } + if (options.defaults) { + object.pageNumber = 0; + object.dimension = null; + object.layout = null; + object.image = null; + object.provenance = null; + object.imageQualityScores = null; + } + if (message.pageNumber != null && message.hasOwnProperty("pageNumber")) + object.pageNumber = message.pageNumber; + if (message.dimension != null && message.hasOwnProperty("dimension")) + object.dimension = $root.google.cloud.documentai.v1.Document.Page.Dimension.toObject(message.dimension, options); + if (message.layout != null && message.hasOwnProperty("layout")) + object.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.toObject(message.layout, options); + if (message.detectedLanguages && message.detectedLanguages.length) { + object.detectedLanguages = []; + for (var j = 0; j < message.detectedLanguages.length; ++j) + object.detectedLanguages[j] = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.toObject(message.detectedLanguages[j], options); + } + if (message.blocks && message.blocks.length) { + object.blocks = []; + for (var j = 0; j < message.blocks.length; ++j) + object.blocks[j] = $root.google.cloud.documentai.v1.Document.Page.Block.toObject(message.blocks[j], options); + } + if (message.paragraphs && message.paragraphs.length) { + object.paragraphs = []; + for (var j = 0; j < message.paragraphs.length; ++j) + object.paragraphs[j] = $root.google.cloud.documentai.v1.Document.Page.Paragraph.toObject(message.paragraphs[j], options); + } + if (message.lines && message.lines.length) { + object.lines = []; + for (var j = 0; j < message.lines.length; ++j) + object.lines[j] = $root.google.cloud.documentai.v1.Document.Page.Line.toObject(message.lines[j], options); + } + if (message.tokens && message.tokens.length) { + object.tokens = []; + for (var j = 0; j < message.tokens.length; ++j) + object.tokens[j] = $root.google.cloud.documentai.v1.Document.Page.Token.toObject(message.tokens[j], options); + } + if (message.visualElements && message.visualElements.length) { + object.visualElements = []; + for (var j = 0; j < message.visualElements.length; ++j) + object.visualElements[j] = $root.google.cloud.documentai.v1.Document.Page.VisualElement.toObject(message.visualElements[j], options); + } + if (message.tables && message.tables.length) { + object.tables = []; + for (var j = 0; j < message.tables.length; ++j) + object.tables[j] = $root.google.cloud.documentai.v1.Document.Page.Table.toObject(message.tables[j], options); + } + if (message.formFields && message.formFields.length) { + object.formFields = []; + for (var j = 0; j < message.formFields.length; ++j) + object.formFields[j] = $root.google.cloud.documentai.v1.Document.Page.FormField.toObject(message.formFields[j], options); + } + if (message.symbols && message.symbols.length) { + object.symbols = []; + for (var j = 0; j < message.symbols.length; ++j) + object.symbols[j] = $root.google.cloud.documentai.v1.Document.Page.Symbol.toObject(message.symbols[j], options); + } + if (message.image != null && message.hasOwnProperty("image")) + object.image = $root.google.cloud.documentai.v1.Document.Page.Image.toObject(message.image, options); + if (message.transforms && message.transforms.length) { + object.transforms = []; + for (var j = 0; j < message.transforms.length; ++j) + object.transforms[j] = $root.google.cloud.documentai.v1.Document.Page.Matrix.toObject(message.transforms[j], options); + } + if (message.detectedBarcodes && message.detectedBarcodes.length) { + object.detectedBarcodes = []; + for (var j = 0; j < message.detectedBarcodes.length; ++j) + object.detectedBarcodes[j] = $root.google.cloud.documentai.v1.Document.Page.DetectedBarcode.toObject(message.detectedBarcodes[j], options); + } + if (message.provenance != null && message.hasOwnProperty("provenance")) + object.provenance = $root.google.cloud.documentai.v1.Document.Provenance.toObject(message.provenance, options); + if (message.imageQualityScores != null && message.hasOwnProperty("imageQualityScores")) + object.imageQualityScores = $root.google.cloud.documentai.v1.Document.Page.ImageQualityScores.toObject(message.imageQualityScores, options); + return object; + }; + + /** + * Converts this Page to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.Page + * @instance + * @returns {Object.} JSON object + */ + Page.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Page + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.Page + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Page.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Page"; + }; + + Page.Dimension = (function() { + + /** + * Properties of a Dimension. + * @memberof google.cloud.documentai.v1.Document.Page + * @interface IDimension + * @property {number|null} [width] Dimension width + * @property {number|null} [height] Dimension height + * @property {string|null} [unit] Dimension unit + */ + + /** + * Constructs a new Dimension. + * @memberof google.cloud.documentai.v1.Document.Page + * @classdesc Represents a Dimension. + * @implements IDimension + * @constructor + * @param {google.cloud.documentai.v1.Document.Page.IDimension=} [properties] Properties to set + */ + function Dimension(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]]; + } + + /** + * Dimension width. + * @member {number} width + * @memberof google.cloud.documentai.v1.Document.Page.Dimension + * @instance + */ + Dimension.prototype.width = 0; + + /** + * Dimension height. + * @member {number} height + * @memberof google.cloud.documentai.v1.Document.Page.Dimension + * @instance + */ + Dimension.prototype.height = 0; + + /** + * Dimension unit. + * @member {string} unit + * @memberof google.cloud.documentai.v1.Document.Page.Dimension + * @instance + */ + Dimension.prototype.unit = ""; + + /** + * Creates a new Dimension instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.Page.Dimension + * @static + * @param {google.cloud.documentai.v1.Document.Page.IDimension=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.Page.Dimension} Dimension instance + */ + Dimension.create = function create(properties) { + return new Dimension(properties); + }; + + /** + * Encodes the specified Dimension message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Dimension.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.Page.Dimension + * @static + * @param {google.cloud.documentai.v1.Document.Page.IDimension} message Dimension message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Dimension.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.width != null && Object.hasOwnProperty.call(message, "width")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.width); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.height); + if (message.unit != null && Object.hasOwnProperty.call(message, "unit")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unit); + return writer; + }; + + /** + * Encodes the specified Dimension message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Dimension.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.Page.Dimension + * @static + * @param {google.cloud.documentai.v1.Document.Page.IDimension} message Dimension message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Dimension.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Dimension message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.Page.Dimension + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.Page.Dimension} Dimension + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Dimension.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Page.Dimension(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.width = reader.float(); + break; + } + case 2: { + message.height = reader.float(); + break; + } + case 3: { + message.unit = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Dimension message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.Page.Dimension + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.Page.Dimension} Dimension + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Dimension.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Dimension message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.Page.Dimension + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Dimension.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.width != null && message.hasOwnProperty("width")) + if (typeof message.width !== "number") + return "width: number expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height !== "number") + return "height: number expected"; + if (message.unit != null && message.hasOwnProperty("unit")) + if (!$util.isString(message.unit)) + return "unit: string expected"; + return null; + }; + + /** + * Creates a Dimension message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.Page.Dimension + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.Page.Dimension} Dimension + */ + Dimension.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.Page.Dimension) + return object; + var message = new $root.google.cloud.documentai.v1.Document.Page.Dimension(); + if (object.width != null) + message.width = Number(object.width); + if (object.height != null) + message.height = Number(object.height); + if (object.unit != null) + message.unit = String(object.unit); + return message; + }; + + /** + * Creates a plain object from a Dimension message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.Page.Dimension + * @static + * @param {google.cloud.documentai.v1.Document.Page.Dimension} message Dimension + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Dimension.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.width = 0; + object.height = 0; + object.unit = ""; + } + if (message.width != null && message.hasOwnProperty("width")) + object.width = options.json && !isFinite(message.width) ? String(message.width) : message.width; + if (message.height != null && message.hasOwnProperty("height")) + object.height = options.json && !isFinite(message.height) ? String(message.height) : message.height; + if (message.unit != null && message.hasOwnProperty("unit")) + object.unit = message.unit; + return object; + }; + + /** + * Converts this Dimension to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.Page.Dimension + * @instance + * @returns {Object.} JSON object + */ + Dimension.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Dimension + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.Page.Dimension + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Dimension.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Page.Dimension"; + }; + + return Dimension; + })(); + + Page.Image = (function() { + + /** + * Properties of an Image. + * @memberof google.cloud.documentai.v1.Document.Page + * @interface IImage + * @property {Uint8Array|null} [content] Image content + * @property {string|null} [mimeType] Image mimeType + * @property {number|null} [width] Image width + * @property {number|null} [height] Image height + */ + + /** + * Constructs a new Image. + * @memberof google.cloud.documentai.v1.Document.Page + * @classdesc Represents an Image. + * @implements IImage + * @constructor + * @param {google.cloud.documentai.v1.Document.Page.IImage=} [properties] Properties to set + */ + function Image(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]]; + } + + /** + * Image content. + * @member {Uint8Array} content + * @memberof google.cloud.documentai.v1.Document.Page.Image + * @instance + */ + Image.prototype.content = $util.newBuffer([]); + + /** + * Image mimeType. + * @member {string} mimeType + * @memberof google.cloud.documentai.v1.Document.Page.Image + * @instance + */ + Image.prototype.mimeType = ""; + + /** + * Image width. + * @member {number} width + * @memberof google.cloud.documentai.v1.Document.Page.Image + * @instance + */ + Image.prototype.width = 0; + + /** + * Image height. + * @member {number} height + * @memberof google.cloud.documentai.v1.Document.Page.Image + * @instance + */ + Image.prototype.height = 0; + + /** + * Creates a new Image instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.Page.Image + * @static + * @param {google.cloud.documentai.v1.Document.Page.IImage=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.Page.Image} Image instance + */ + Image.create = function create(properties) { + return new Image(properties); + }; + + /** + * Encodes the specified Image message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Image.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.Page.Image + * @static + * @param {google.cloud.documentai.v1.Document.Page.IImage} message Image message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Image.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.content); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimeType); + 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 Image message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Image.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.Page.Image + * @static + * @param {google.cloud.documentai.v1.Document.Page.IImage} message Image message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Image.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Image message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.Page.Image + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.Page.Image} Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Image.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Page.Image(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.content = reader.bytes(); + break; + } + case 2: { + message.mimeType = reader.string(); + break; + } + case 3: { + message.width = reader.int32(); + break; + } + case 4: { + message.height = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Image message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.Page.Image + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.Page.Image} Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Image.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Image message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.Page.Image + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Image.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.content != null && message.hasOwnProperty("content")) + if (!(message.content && typeof message.content.length === "number" || $util.isString(message.content))) + return "content: buffer expected"; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string 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 an Image message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.Page.Image + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.Page.Image} Image + */ + Image.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.Page.Image) + return object; + var message = new $root.google.cloud.documentai.v1.Document.Page.Image(); + if (object.content != null) + if (typeof object.content === "string") + $util.base64.decode(object.content, message.content = $util.newBuffer($util.base64.length(object.content)), 0); + else if (object.content.length >= 0) + message.content = object.content; + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + 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 an Image message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.Page.Image + * @static + * @param {google.cloud.documentai.v1.Document.Page.Image} message Image + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Image.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.content = ""; + else { + object.content = []; + if (options.bytes !== Array) + object.content = $util.newBuffer(object.content); + } + object.mimeType = ""; + object.width = 0; + object.height = 0; + } + if (message.content != null && message.hasOwnProperty("content")) + object.content = options.bytes === String ? $util.base64.encode(message.content, 0, message.content.length) : options.bytes === Array ? Array.prototype.slice.call(message.content) : message.content; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + 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 Image to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.Page.Image + * @instance + * @returns {Object.} JSON object + */ + Image.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Image + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.Page.Image + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Image.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Page.Image"; + }; + + return Image; + })(); + + Page.Matrix = (function() { + + /** + * Properties of a Matrix. + * @memberof google.cloud.documentai.v1.Document.Page + * @interface IMatrix + * @property {number|null} [rows] Matrix rows + * @property {number|null} [cols] Matrix cols + * @property {number|null} [type] Matrix type + * @property {Uint8Array|null} [data] Matrix data + */ + + /** + * Constructs a new Matrix. + * @memberof google.cloud.documentai.v1.Document.Page + * @classdesc Represents a Matrix. + * @implements IMatrix + * @constructor + * @param {google.cloud.documentai.v1.Document.Page.IMatrix=} [properties] Properties to set + */ + function Matrix(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]]; + } + + /** + * Matrix rows. + * @member {number} rows + * @memberof google.cloud.documentai.v1.Document.Page.Matrix + * @instance + */ + Matrix.prototype.rows = 0; + + /** + * Matrix cols. + * @member {number} cols + * @memberof google.cloud.documentai.v1.Document.Page.Matrix + * @instance + */ + Matrix.prototype.cols = 0; + + /** + * Matrix type. + * @member {number} type + * @memberof google.cloud.documentai.v1.Document.Page.Matrix + * @instance + */ + Matrix.prototype.type = 0; + + /** + * Matrix data. + * @member {Uint8Array} data + * @memberof google.cloud.documentai.v1.Document.Page.Matrix + * @instance + */ + Matrix.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Matrix instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.Page.Matrix + * @static + * @param {google.cloud.documentai.v1.Document.Page.IMatrix=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.Page.Matrix} Matrix instance + */ + Matrix.create = function create(properties) { + return new Matrix(properties); + }; + + /** + * Encodes the specified Matrix message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Matrix.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.Page.Matrix + * @static + * @param {google.cloud.documentai.v1.Document.Page.IMatrix} message Matrix message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Matrix.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rows != null && Object.hasOwnProperty.call(message, "rows")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.rows); + if (message.cols != null && Object.hasOwnProperty.call(message, "cols")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.cols); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.data); + return writer; + }; + + /** + * Encodes the specified Matrix message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Matrix.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.Page.Matrix + * @static + * @param {google.cloud.documentai.v1.Document.Page.IMatrix} message Matrix message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Matrix.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Matrix message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.Page.Matrix + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.Page.Matrix} Matrix + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Matrix.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Page.Matrix(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.rows = reader.int32(); + break; + } + case 2: { + message.cols = reader.int32(); + break; + } + case 3: { + message.type = reader.int32(); + break; + } + case 4: { + message.data = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Matrix message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.Page.Matrix + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.Page.Matrix} Matrix + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Matrix.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Matrix message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.Page.Matrix + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Matrix.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rows != null && message.hasOwnProperty("rows")) + if (!$util.isInteger(message.rows)) + return "rows: integer expected"; + if (message.cols != null && message.hasOwnProperty("cols")) + if (!$util.isInteger(message.cols)) + return "cols: integer expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isInteger(message.type)) + return "type: integer expected"; + 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 Matrix message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.Page.Matrix + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.Page.Matrix} Matrix + */ + Matrix.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.Page.Matrix) + return object; + var message = new $root.google.cloud.documentai.v1.Document.Page.Matrix(); + if (object.rows != null) + message.rows = object.rows | 0; + if (object.cols != null) + message.cols = object.cols | 0; + if (object.type != null) + message.type = object.type | 0; + 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 >= 0) + message.data = object.data; + return message; + }; + + /** + * Creates a plain object from a Matrix message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.Page.Matrix + * @static + * @param {google.cloud.documentai.v1.Document.Page.Matrix} message Matrix + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Matrix.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.rows = 0; + object.cols = 0; + object.type = 0; + if (options.bytes === String) + object.data = ""; + else { + object.data = []; + if (options.bytes !== Array) + object.data = $util.newBuffer(object.data); + } + } + if (message.rows != null && message.hasOwnProperty("rows")) + object.rows = message.rows; + if (message.cols != null && message.hasOwnProperty("cols")) + object.cols = message.cols; + if (message.type != null && message.hasOwnProperty("type")) + object.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 Matrix to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.Page.Matrix + * @instance + * @returns {Object.} JSON object + */ + Matrix.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Matrix + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.Page.Matrix + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Matrix.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Page.Matrix"; + }; + + return Matrix; + })(); + + Page.Layout = (function() { + + /** + * Properties of a Layout. + * @memberof google.cloud.documentai.v1.Document.Page + * @interface ILayout + * @property {google.cloud.documentai.v1.Document.ITextAnchor|null} [textAnchor] Layout textAnchor + * @property {number|null} [confidence] Layout confidence + * @property {google.cloud.documentai.v1.IBoundingPoly|null} [boundingPoly] Layout boundingPoly + * @property {google.cloud.documentai.v1.Document.Page.Layout.Orientation|null} [orientation] Layout orientation + */ + + /** + * Constructs a new Layout. + * @memberof google.cloud.documentai.v1.Document.Page + * @classdesc Represents a Layout. + * @implements ILayout + * @constructor + * @param {google.cloud.documentai.v1.Document.Page.ILayout=} [properties] Properties to set + */ + function Layout(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]]; + } + + /** + * Layout textAnchor. + * @member {google.cloud.documentai.v1.Document.ITextAnchor|null|undefined} textAnchor + * @memberof google.cloud.documentai.v1.Document.Page.Layout + * @instance + */ + Layout.prototype.textAnchor = null; + + /** + * Layout confidence. + * @member {number} confidence + * @memberof google.cloud.documentai.v1.Document.Page.Layout + * @instance + */ + Layout.prototype.confidence = 0; + + /** + * Layout boundingPoly. + * @member {google.cloud.documentai.v1.IBoundingPoly|null|undefined} boundingPoly + * @memberof google.cloud.documentai.v1.Document.Page.Layout + * @instance + */ + Layout.prototype.boundingPoly = null; + + /** + * Layout orientation. + * @member {google.cloud.documentai.v1.Document.Page.Layout.Orientation} orientation + * @memberof google.cloud.documentai.v1.Document.Page.Layout + * @instance + */ + Layout.prototype.orientation = 0; + + /** + * Creates a new Layout instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.Page.Layout + * @static + * @param {google.cloud.documentai.v1.Document.Page.ILayout=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.Page.Layout} Layout instance + */ + Layout.create = function create(properties) { + return new Layout(properties); + }; + + /** + * Encodes the specified Layout message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Layout.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.Page.Layout + * @static + * @param {google.cloud.documentai.v1.Document.Page.ILayout} message Layout message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Layout.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.textAnchor != null && Object.hasOwnProperty.call(message, "textAnchor")) + $root.google.cloud.documentai.v1.Document.TextAnchor.encode(message.textAnchor, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); + if (message.boundingPoly != null && Object.hasOwnProperty.call(message, "boundingPoly")) + $root.google.cloud.documentai.v1.BoundingPoly.encode(message.boundingPoly, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.orientation != null && Object.hasOwnProperty.call(message, "orientation")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.orientation); + return writer; + }; + + /** + * Encodes the specified Layout message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Layout.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.Page.Layout + * @static + * @param {google.cloud.documentai.v1.Document.Page.ILayout} message Layout message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Layout.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Layout message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.Page.Layout + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.Page.Layout} Layout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Layout.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Page.Layout(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.textAnchor = $root.google.cloud.documentai.v1.Document.TextAnchor.decode(reader, reader.uint32()); + break; + } + case 2: { + message.confidence = reader.float(); + break; + } + case 3: { + message.boundingPoly = $root.google.cloud.documentai.v1.BoundingPoly.decode(reader, reader.uint32()); + break; + } + case 4: { + message.orientation = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Layout message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.Page.Layout + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.Page.Layout} Layout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Layout.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Layout message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.Page.Layout + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Layout.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.textAnchor != null && message.hasOwnProperty("textAnchor")) { + var error = $root.google.cloud.documentai.v1.Document.TextAnchor.verify(message.textAnchor); + if (error) + return "textAnchor." + error; + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) { + var error = $root.google.cloud.documentai.v1.BoundingPoly.verify(message.boundingPoly); + if (error) + return "boundingPoly." + error; + } + if (message.orientation != null && message.hasOwnProperty("orientation")) + switch (message.orientation) { + default: + return "orientation: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a Layout message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.Page.Layout + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.Page.Layout} Layout + */ + Layout.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.Page.Layout) + return object; + var message = new $root.google.cloud.documentai.v1.Document.Page.Layout(); + if (object.textAnchor != null) { + if (typeof object.textAnchor !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.Layout.textAnchor: object expected"); + message.textAnchor = $root.google.cloud.documentai.v1.Document.TextAnchor.fromObject(object.textAnchor); + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + if (object.boundingPoly != null) { + if (typeof object.boundingPoly !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.Layout.boundingPoly: object expected"); + message.boundingPoly = $root.google.cloud.documentai.v1.BoundingPoly.fromObject(object.boundingPoly); + } + switch (object.orientation) { + default: + if (typeof object.orientation === "number") { + message.orientation = object.orientation; + break; + } + break; + case "ORIENTATION_UNSPECIFIED": + case 0: + message.orientation = 0; + break; + case "PAGE_UP": + case 1: + message.orientation = 1; + break; + case "PAGE_RIGHT": + case 2: + message.orientation = 2; + break; + case "PAGE_DOWN": + case 3: + message.orientation = 3; + break; + case "PAGE_LEFT": + case 4: + message.orientation = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a Layout message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.Page.Layout + * @static + * @param {google.cloud.documentai.v1.Document.Page.Layout} message Layout + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Layout.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.textAnchor = null; + object.confidence = 0; + object.boundingPoly = null; + object.orientation = options.enums === String ? "ORIENTATION_UNSPECIFIED" : 0; + } + if (message.textAnchor != null && message.hasOwnProperty("textAnchor")) + object.textAnchor = $root.google.cloud.documentai.v1.Document.TextAnchor.toObject(message.textAnchor, options); + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + object.boundingPoly = $root.google.cloud.documentai.v1.BoundingPoly.toObject(message.boundingPoly, options); + if (message.orientation != null && message.hasOwnProperty("orientation")) + object.orientation = options.enums === String ? $root.google.cloud.documentai.v1.Document.Page.Layout.Orientation[message.orientation] === undefined ? message.orientation : $root.google.cloud.documentai.v1.Document.Page.Layout.Orientation[message.orientation] : message.orientation; + return object; + }; + + /** + * Converts this Layout to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.Page.Layout + * @instance + * @returns {Object.} JSON object + */ + Layout.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Layout + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.Page.Layout + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Layout.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Page.Layout"; + }; + + /** + * Orientation enum. + * @name google.cloud.documentai.v1.Document.Page.Layout.Orientation + * @enum {number} + * @property {number} ORIENTATION_UNSPECIFIED=0 ORIENTATION_UNSPECIFIED value + * @property {number} PAGE_UP=1 PAGE_UP value + * @property {number} PAGE_RIGHT=2 PAGE_RIGHT value + * @property {number} PAGE_DOWN=3 PAGE_DOWN value + * @property {number} PAGE_LEFT=4 PAGE_LEFT value + */ + Layout.Orientation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ORIENTATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "PAGE_UP"] = 1; + values[valuesById[2] = "PAGE_RIGHT"] = 2; + values[valuesById[3] = "PAGE_DOWN"] = 3; + values[valuesById[4] = "PAGE_LEFT"] = 4; + return values; + })(); + + return Layout; + })(); + + Page.Block = (function() { + + /** + * Properties of a Block. + * @memberof google.cloud.documentai.v1.Document.Page + * @interface IBlock + * @property {google.cloud.documentai.v1.Document.Page.ILayout|null} [layout] Block layout + * @property {Array.|null} [detectedLanguages] Block detectedLanguages + * @property {google.cloud.documentai.v1.Document.IProvenance|null} [provenance] Block provenance + */ + + /** + * Constructs a new Block. + * @memberof google.cloud.documentai.v1.Document.Page + * @classdesc Represents a Block. + * @implements IBlock + * @constructor + * @param {google.cloud.documentai.v1.Document.Page.IBlock=} [properties] Properties to set + */ + function Block(properties) { + this.detectedLanguages = []; + 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]]; + } + + /** + * Block layout. + * @member {google.cloud.documentai.v1.Document.Page.ILayout|null|undefined} layout + * @memberof google.cloud.documentai.v1.Document.Page.Block + * @instance + */ + Block.prototype.layout = null; + + /** + * Block detectedLanguages. + * @member {Array.} detectedLanguages + * @memberof google.cloud.documentai.v1.Document.Page.Block + * @instance + */ + Block.prototype.detectedLanguages = $util.emptyArray; + + /** + * Block provenance. + * @member {google.cloud.documentai.v1.Document.IProvenance|null|undefined} provenance + * @memberof google.cloud.documentai.v1.Document.Page.Block + * @instance + */ + Block.prototype.provenance = null; + + /** + * Creates a new Block instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.Page.Block + * @static + * @param {google.cloud.documentai.v1.Document.Page.IBlock=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.Page.Block} Block instance + */ + Block.create = function create(properties) { + return new Block(properties); + }; + + /** + * Encodes the specified Block message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Block.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.Page.Block + * @static + * @param {google.cloud.documentai.v1.Document.Page.IBlock} message Block message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Block.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.layout != null && Object.hasOwnProperty.call(message, "layout")) + $root.google.cloud.documentai.v1.Document.Page.Layout.encode(message.layout, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.detectedLanguages != null && message.detectedLanguages.length) + for (var i = 0; i < message.detectedLanguages.length; ++i) + $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.encode(message.detectedLanguages[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.provenance != null && Object.hasOwnProperty.call(message, "provenance")) + $root.google.cloud.documentai.v1.Document.Provenance.encode(message.provenance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Block message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Block.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.Page.Block + * @static + * @param {google.cloud.documentai.v1.Document.Page.IBlock} message Block message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Block.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Block message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.Page.Block + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.Page.Block} Block + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Block.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Page.Block(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.detectedLanguages && message.detectedLanguages.length)) + message.detectedLanguages = []; + message.detectedLanguages.push($root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.decode(reader, reader.uint32())); + break; + } + case 3: { + message.provenance = $root.google.cloud.documentai.v1.Document.Provenance.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Block message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.Page.Block + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.Page.Block} Block + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Block.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Block message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.Page.Block + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Block.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.layout != null && message.hasOwnProperty("layout")) { + var error = $root.google.cloud.documentai.v1.Document.Page.Layout.verify(message.layout); + if (error) + return "layout." + error; + } + if (message.detectedLanguages != null && message.hasOwnProperty("detectedLanguages")) { + if (!Array.isArray(message.detectedLanguages)) + return "detectedLanguages: array expected"; + for (var i = 0; i < message.detectedLanguages.length; ++i) { + var error = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.verify(message.detectedLanguages[i]); + if (error) + return "detectedLanguages." + error; + } + } + if (message.provenance != null && message.hasOwnProperty("provenance")) { + var error = $root.google.cloud.documentai.v1.Document.Provenance.verify(message.provenance); + if (error) + return "provenance." + error; + } + return null; + }; + + /** + * Creates a Block message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.Page.Block + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.Page.Block} Block + */ + Block.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.Page.Block) + return object; + var message = new $root.google.cloud.documentai.v1.Document.Page.Block(); + if (object.layout != null) { + if (typeof object.layout !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.Block.layout: object expected"); + message.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.fromObject(object.layout); + } + if (object.detectedLanguages) { + if (!Array.isArray(object.detectedLanguages)) + throw TypeError(".google.cloud.documentai.v1.Document.Page.Block.detectedLanguages: array expected"); + message.detectedLanguages = []; + for (var i = 0; i < object.detectedLanguages.length; ++i) { + if (typeof object.detectedLanguages[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.Block.detectedLanguages: object expected"); + message.detectedLanguages[i] = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.fromObject(object.detectedLanguages[i]); + } + } + if (object.provenance != null) { + if (typeof object.provenance !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.Block.provenance: object expected"); + message.provenance = $root.google.cloud.documentai.v1.Document.Provenance.fromObject(object.provenance); + } + return message; + }; + + /** + * Creates a plain object from a Block message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.Page.Block + * @static + * @param {google.cloud.documentai.v1.Document.Page.Block} message Block + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Block.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.detectedLanguages = []; + if (options.defaults) { + object.layout = null; + object.provenance = null; + } + if (message.layout != null && message.hasOwnProperty("layout")) + object.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.toObject(message.layout, options); + if (message.detectedLanguages && message.detectedLanguages.length) { + object.detectedLanguages = []; + for (var j = 0; j < message.detectedLanguages.length; ++j) + object.detectedLanguages[j] = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.toObject(message.detectedLanguages[j], options); + } + if (message.provenance != null && message.hasOwnProperty("provenance")) + object.provenance = $root.google.cloud.documentai.v1.Document.Provenance.toObject(message.provenance, options); + return object; + }; + + /** + * Converts this Block to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.Page.Block + * @instance + * @returns {Object.} JSON object + */ + Block.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Block + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.Page.Block + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Block.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Page.Block"; + }; + + return Block; + })(); + + Page.Paragraph = (function() { + + /** + * Properties of a Paragraph. + * @memberof google.cloud.documentai.v1.Document.Page + * @interface IParagraph + * @property {google.cloud.documentai.v1.Document.Page.ILayout|null} [layout] Paragraph layout + * @property {Array.|null} [detectedLanguages] Paragraph detectedLanguages + * @property {google.cloud.documentai.v1.Document.IProvenance|null} [provenance] Paragraph provenance + */ + + /** + * Constructs a new Paragraph. + * @memberof google.cloud.documentai.v1.Document.Page + * @classdesc Represents a Paragraph. + * @implements IParagraph + * @constructor + * @param {google.cloud.documentai.v1.Document.Page.IParagraph=} [properties] Properties to set + */ + function Paragraph(properties) { + this.detectedLanguages = []; + 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]]; + } + + /** + * Paragraph layout. + * @member {google.cloud.documentai.v1.Document.Page.ILayout|null|undefined} layout + * @memberof google.cloud.documentai.v1.Document.Page.Paragraph + * @instance + */ + Paragraph.prototype.layout = null; + + /** + * Paragraph detectedLanguages. + * @member {Array.} detectedLanguages + * @memberof google.cloud.documentai.v1.Document.Page.Paragraph + * @instance + */ + Paragraph.prototype.detectedLanguages = $util.emptyArray; + + /** + * Paragraph provenance. + * @member {google.cloud.documentai.v1.Document.IProvenance|null|undefined} provenance + * @memberof google.cloud.documentai.v1.Document.Page.Paragraph + * @instance + */ + Paragraph.prototype.provenance = null; + + /** + * Creates a new Paragraph instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.Page.Paragraph + * @static + * @param {google.cloud.documentai.v1.Document.Page.IParagraph=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.Page.Paragraph} Paragraph instance + */ + Paragraph.create = function create(properties) { + return new Paragraph(properties); + }; + + /** + * Encodes the specified Paragraph message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Paragraph.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.Page.Paragraph + * @static + * @param {google.cloud.documentai.v1.Document.Page.IParagraph} message Paragraph message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Paragraph.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.layout != null && Object.hasOwnProperty.call(message, "layout")) + $root.google.cloud.documentai.v1.Document.Page.Layout.encode(message.layout, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.detectedLanguages != null && message.detectedLanguages.length) + for (var i = 0; i < message.detectedLanguages.length; ++i) + $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.encode(message.detectedLanguages[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.provenance != null && Object.hasOwnProperty.call(message, "provenance")) + $root.google.cloud.documentai.v1.Document.Provenance.encode(message.provenance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Paragraph message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Paragraph.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.Page.Paragraph + * @static + * @param {google.cloud.documentai.v1.Document.Page.IParagraph} message Paragraph message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Paragraph.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Paragraph message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.Page.Paragraph + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.Page.Paragraph} Paragraph + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Paragraph.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Page.Paragraph(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.detectedLanguages && message.detectedLanguages.length)) + message.detectedLanguages = []; + message.detectedLanguages.push($root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.decode(reader, reader.uint32())); + break; + } + case 3: { + message.provenance = $root.google.cloud.documentai.v1.Document.Provenance.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Paragraph message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.Page.Paragraph + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.Page.Paragraph} Paragraph + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Paragraph.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Paragraph message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.Page.Paragraph + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Paragraph.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.layout != null && message.hasOwnProperty("layout")) { + var error = $root.google.cloud.documentai.v1.Document.Page.Layout.verify(message.layout); + if (error) + return "layout." + error; + } + if (message.detectedLanguages != null && message.hasOwnProperty("detectedLanguages")) { + if (!Array.isArray(message.detectedLanguages)) + return "detectedLanguages: array expected"; + for (var i = 0; i < message.detectedLanguages.length; ++i) { + var error = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.verify(message.detectedLanguages[i]); + if (error) + return "detectedLanguages." + error; + } + } + if (message.provenance != null && message.hasOwnProperty("provenance")) { + var error = $root.google.cloud.documentai.v1.Document.Provenance.verify(message.provenance); + if (error) + return "provenance." + error; + } + return null; + }; + + /** + * Creates a Paragraph message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.Page.Paragraph + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.Page.Paragraph} Paragraph + */ + Paragraph.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.Page.Paragraph) + return object; + var message = new $root.google.cloud.documentai.v1.Document.Page.Paragraph(); + if (object.layout != null) { + if (typeof object.layout !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.Paragraph.layout: object expected"); + message.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.fromObject(object.layout); + } + if (object.detectedLanguages) { + if (!Array.isArray(object.detectedLanguages)) + throw TypeError(".google.cloud.documentai.v1.Document.Page.Paragraph.detectedLanguages: array expected"); + message.detectedLanguages = []; + for (var i = 0; i < object.detectedLanguages.length; ++i) { + if (typeof object.detectedLanguages[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.Paragraph.detectedLanguages: object expected"); + message.detectedLanguages[i] = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.fromObject(object.detectedLanguages[i]); + } + } + if (object.provenance != null) { + if (typeof object.provenance !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.Paragraph.provenance: object expected"); + message.provenance = $root.google.cloud.documentai.v1.Document.Provenance.fromObject(object.provenance); + } + return message; + }; + + /** + * Creates a plain object from a Paragraph message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.Page.Paragraph + * @static + * @param {google.cloud.documentai.v1.Document.Page.Paragraph} message Paragraph + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Paragraph.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.detectedLanguages = []; + if (options.defaults) { + object.layout = null; + object.provenance = null; + } + if (message.layout != null && message.hasOwnProperty("layout")) + object.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.toObject(message.layout, options); + if (message.detectedLanguages && message.detectedLanguages.length) { + object.detectedLanguages = []; + for (var j = 0; j < message.detectedLanguages.length; ++j) + object.detectedLanguages[j] = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.toObject(message.detectedLanguages[j], options); + } + if (message.provenance != null && message.hasOwnProperty("provenance")) + object.provenance = $root.google.cloud.documentai.v1.Document.Provenance.toObject(message.provenance, options); + return object; + }; + + /** + * Converts this Paragraph to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.Page.Paragraph + * @instance + * @returns {Object.} JSON object + */ + Paragraph.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Paragraph + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.Page.Paragraph + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Paragraph.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Page.Paragraph"; + }; + + return Paragraph; + })(); + + Page.Line = (function() { + + /** + * Properties of a Line. + * @memberof google.cloud.documentai.v1.Document.Page + * @interface ILine + * @property {google.cloud.documentai.v1.Document.Page.ILayout|null} [layout] Line layout + * @property {Array.|null} [detectedLanguages] Line detectedLanguages + * @property {google.cloud.documentai.v1.Document.IProvenance|null} [provenance] Line provenance + */ + + /** + * Constructs a new Line. + * @memberof google.cloud.documentai.v1.Document.Page + * @classdesc Represents a Line. + * @implements ILine + * @constructor + * @param {google.cloud.documentai.v1.Document.Page.ILine=} [properties] Properties to set + */ + function Line(properties) { + this.detectedLanguages = []; + 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]]; + } + + /** + * Line layout. + * @member {google.cloud.documentai.v1.Document.Page.ILayout|null|undefined} layout + * @memberof google.cloud.documentai.v1.Document.Page.Line + * @instance + */ + Line.prototype.layout = null; + + /** + * Line detectedLanguages. + * @member {Array.} detectedLanguages + * @memberof google.cloud.documentai.v1.Document.Page.Line + * @instance + */ + Line.prototype.detectedLanguages = $util.emptyArray; + + /** + * Line provenance. + * @member {google.cloud.documentai.v1.Document.IProvenance|null|undefined} provenance + * @memberof google.cloud.documentai.v1.Document.Page.Line + * @instance + */ + Line.prototype.provenance = null; + + /** + * Creates a new Line instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.Page.Line + * @static + * @param {google.cloud.documentai.v1.Document.Page.ILine=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.Page.Line} Line instance + */ + Line.create = function create(properties) { + return new Line(properties); + }; + + /** + * Encodes the specified Line message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Line.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.Page.Line + * @static + * @param {google.cloud.documentai.v1.Document.Page.ILine} message Line message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Line.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.layout != null && Object.hasOwnProperty.call(message, "layout")) + $root.google.cloud.documentai.v1.Document.Page.Layout.encode(message.layout, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.detectedLanguages != null && message.detectedLanguages.length) + for (var i = 0; i < message.detectedLanguages.length; ++i) + $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.encode(message.detectedLanguages[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.provenance != null && Object.hasOwnProperty.call(message, "provenance")) + $root.google.cloud.documentai.v1.Document.Provenance.encode(message.provenance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Line message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Line.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.Page.Line + * @static + * @param {google.cloud.documentai.v1.Document.Page.ILine} message Line message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Line.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Line message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.Page.Line + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.Page.Line} Line + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Line.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Page.Line(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.detectedLanguages && message.detectedLanguages.length)) + message.detectedLanguages = []; + message.detectedLanguages.push($root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.decode(reader, reader.uint32())); + break; + } + case 3: { + message.provenance = $root.google.cloud.documentai.v1.Document.Provenance.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Line message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.Page.Line + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.Page.Line} Line + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Line.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Line message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.Page.Line + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Line.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.layout != null && message.hasOwnProperty("layout")) { + var error = $root.google.cloud.documentai.v1.Document.Page.Layout.verify(message.layout); + if (error) + return "layout." + error; + } + if (message.detectedLanguages != null && message.hasOwnProperty("detectedLanguages")) { + if (!Array.isArray(message.detectedLanguages)) + return "detectedLanguages: array expected"; + for (var i = 0; i < message.detectedLanguages.length; ++i) { + var error = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.verify(message.detectedLanguages[i]); + if (error) + return "detectedLanguages." + error; + } + } + if (message.provenance != null && message.hasOwnProperty("provenance")) { + var error = $root.google.cloud.documentai.v1.Document.Provenance.verify(message.provenance); + if (error) + return "provenance." + error; + } + return null; + }; + + /** + * Creates a Line message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.Page.Line + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.Page.Line} Line + */ + Line.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.Page.Line) + return object; + var message = new $root.google.cloud.documentai.v1.Document.Page.Line(); + if (object.layout != null) { + if (typeof object.layout !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.Line.layout: object expected"); + message.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.fromObject(object.layout); + } + if (object.detectedLanguages) { + if (!Array.isArray(object.detectedLanguages)) + throw TypeError(".google.cloud.documentai.v1.Document.Page.Line.detectedLanguages: array expected"); + message.detectedLanguages = []; + for (var i = 0; i < object.detectedLanguages.length; ++i) { + if (typeof object.detectedLanguages[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.Line.detectedLanguages: object expected"); + message.detectedLanguages[i] = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.fromObject(object.detectedLanguages[i]); + } + } + if (object.provenance != null) { + if (typeof object.provenance !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.Line.provenance: object expected"); + message.provenance = $root.google.cloud.documentai.v1.Document.Provenance.fromObject(object.provenance); + } + return message; + }; + + /** + * Creates a plain object from a Line message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.Page.Line + * @static + * @param {google.cloud.documentai.v1.Document.Page.Line} message Line + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Line.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.detectedLanguages = []; + if (options.defaults) { + object.layout = null; + object.provenance = null; + } + if (message.layout != null && message.hasOwnProperty("layout")) + object.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.toObject(message.layout, options); + if (message.detectedLanguages && message.detectedLanguages.length) { + object.detectedLanguages = []; + for (var j = 0; j < message.detectedLanguages.length; ++j) + object.detectedLanguages[j] = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.toObject(message.detectedLanguages[j], options); + } + if (message.provenance != null && message.hasOwnProperty("provenance")) + object.provenance = $root.google.cloud.documentai.v1.Document.Provenance.toObject(message.provenance, options); + return object; + }; + + /** + * Converts this Line to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.Page.Line + * @instance + * @returns {Object.} JSON object + */ + Line.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Line + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.Page.Line + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Line.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Page.Line"; + }; + + return Line; + })(); + + Page.Token = (function() { + + /** + * Properties of a Token. + * @memberof google.cloud.documentai.v1.Document.Page + * @interface IToken + * @property {google.cloud.documentai.v1.Document.Page.ILayout|null} [layout] Token layout + * @property {google.cloud.documentai.v1.Document.Page.Token.IDetectedBreak|null} [detectedBreak] Token detectedBreak + * @property {Array.|null} [detectedLanguages] Token detectedLanguages + * @property {google.cloud.documentai.v1.Document.IProvenance|null} [provenance] Token provenance + * @property {google.cloud.documentai.v1.Document.Page.Token.IStyleInfo|null} [styleInfo] Token styleInfo + */ + + /** + * Constructs a new Token. + * @memberof google.cloud.documentai.v1.Document.Page + * @classdesc Represents a Token. + * @implements IToken + * @constructor + * @param {google.cloud.documentai.v1.Document.Page.IToken=} [properties] Properties to set + */ + function Token(properties) { + this.detectedLanguages = []; + 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]]; + } + + /** + * Token layout. + * @member {google.cloud.documentai.v1.Document.Page.ILayout|null|undefined} layout + * @memberof google.cloud.documentai.v1.Document.Page.Token + * @instance + */ + Token.prototype.layout = null; + + /** + * Token detectedBreak. + * @member {google.cloud.documentai.v1.Document.Page.Token.IDetectedBreak|null|undefined} detectedBreak + * @memberof google.cloud.documentai.v1.Document.Page.Token + * @instance + */ + Token.prototype.detectedBreak = null; + + /** + * Token detectedLanguages. + * @member {Array.} detectedLanguages + * @memberof google.cloud.documentai.v1.Document.Page.Token + * @instance + */ + Token.prototype.detectedLanguages = $util.emptyArray; + + /** + * Token provenance. + * @member {google.cloud.documentai.v1.Document.IProvenance|null|undefined} provenance + * @memberof google.cloud.documentai.v1.Document.Page.Token + * @instance + */ + Token.prototype.provenance = null; + + /** + * Token styleInfo. + * @member {google.cloud.documentai.v1.Document.Page.Token.IStyleInfo|null|undefined} styleInfo + * @memberof google.cloud.documentai.v1.Document.Page.Token + * @instance + */ + Token.prototype.styleInfo = null; + + /** + * Creates a new Token instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.Page.Token + * @static + * @param {google.cloud.documentai.v1.Document.Page.IToken=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.Page.Token} Token instance + */ + Token.create = function create(properties) { + return new Token(properties); + }; + + /** + * Encodes the specified Token message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Token.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.Page.Token + * @static + * @param {google.cloud.documentai.v1.Document.Page.IToken} message Token message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Token.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.layout != null && Object.hasOwnProperty.call(message, "layout")) + $root.google.cloud.documentai.v1.Document.Page.Layout.encode(message.layout, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.detectedBreak != null && Object.hasOwnProperty.call(message, "detectedBreak")) + $root.google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.encode(message.detectedBreak, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.detectedLanguages != null && message.detectedLanguages.length) + for (var i = 0; i < message.detectedLanguages.length; ++i) + $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.encode(message.detectedLanguages[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.provenance != null && Object.hasOwnProperty.call(message, "provenance")) + $root.google.cloud.documentai.v1.Document.Provenance.encode(message.provenance, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.styleInfo != null && Object.hasOwnProperty.call(message, "styleInfo")) + $root.google.cloud.documentai.v1.Document.Page.Token.StyleInfo.encode(message.styleInfo, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Token message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Token.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.Page.Token + * @static + * @param {google.cloud.documentai.v1.Document.Page.IToken} message Token message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Token.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Token message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.Page.Token + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.Page.Token} Token + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Token.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Page.Token(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.decode(reader, reader.uint32()); + break; + } + case 2: { + message.detectedBreak = $root.google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.detectedLanguages && message.detectedLanguages.length)) + message.detectedLanguages = []; + message.detectedLanguages.push($root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.decode(reader, reader.uint32())); + break; + } + case 4: { + message.provenance = $root.google.cloud.documentai.v1.Document.Provenance.decode(reader, reader.uint32()); + break; + } + case 5: { + message.styleInfo = $root.google.cloud.documentai.v1.Document.Page.Token.StyleInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Token message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.Page.Token + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.Page.Token} Token + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Token.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Token message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.Page.Token + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Token.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.layout != null && message.hasOwnProperty("layout")) { + var error = $root.google.cloud.documentai.v1.Document.Page.Layout.verify(message.layout); + if (error) + return "layout." + error; + } + if (message.detectedBreak != null && message.hasOwnProperty("detectedBreak")) { + var error = $root.google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.verify(message.detectedBreak); + if (error) + return "detectedBreak." + error; + } + if (message.detectedLanguages != null && message.hasOwnProperty("detectedLanguages")) { + if (!Array.isArray(message.detectedLanguages)) + return "detectedLanguages: array expected"; + for (var i = 0; i < message.detectedLanguages.length; ++i) { + var error = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.verify(message.detectedLanguages[i]); + if (error) + return "detectedLanguages." + error; + } + } + if (message.provenance != null && message.hasOwnProperty("provenance")) { + var error = $root.google.cloud.documentai.v1.Document.Provenance.verify(message.provenance); + if (error) + return "provenance." + error; + } + if (message.styleInfo != null && message.hasOwnProperty("styleInfo")) { + var error = $root.google.cloud.documentai.v1.Document.Page.Token.StyleInfo.verify(message.styleInfo); + if (error) + return "styleInfo." + error; + } + return null; + }; + + /** + * Creates a Token message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.Page.Token + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.Page.Token} Token + */ + Token.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.Page.Token) + return object; + var message = new $root.google.cloud.documentai.v1.Document.Page.Token(); + if (object.layout != null) { + if (typeof object.layout !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.Token.layout: object expected"); + message.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.fromObject(object.layout); + } + if (object.detectedBreak != null) { + if (typeof object.detectedBreak !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.Token.detectedBreak: object expected"); + message.detectedBreak = $root.google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.fromObject(object.detectedBreak); + } + if (object.detectedLanguages) { + if (!Array.isArray(object.detectedLanguages)) + throw TypeError(".google.cloud.documentai.v1.Document.Page.Token.detectedLanguages: array expected"); + message.detectedLanguages = []; + for (var i = 0; i < object.detectedLanguages.length; ++i) { + if (typeof object.detectedLanguages[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.Token.detectedLanguages: object expected"); + message.detectedLanguages[i] = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.fromObject(object.detectedLanguages[i]); + } + } + if (object.provenance != null) { + if (typeof object.provenance !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.Token.provenance: object expected"); + message.provenance = $root.google.cloud.documentai.v1.Document.Provenance.fromObject(object.provenance); + } + if (object.styleInfo != null) { + if (typeof object.styleInfo !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.Token.styleInfo: object expected"); + message.styleInfo = $root.google.cloud.documentai.v1.Document.Page.Token.StyleInfo.fromObject(object.styleInfo); + } + return message; + }; + + /** + * Creates a plain object from a Token message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.Page.Token + * @static + * @param {google.cloud.documentai.v1.Document.Page.Token} message Token + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Token.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.detectedLanguages = []; + if (options.defaults) { + object.layout = null; + object.detectedBreak = null; + object.provenance = null; + object.styleInfo = null; + } + if (message.layout != null && message.hasOwnProperty("layout")) + object.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.toObject(message.layout, options); + if (message.detectedBreak != null && message.hasOwnProperty("detectedBreak")) + object.detectedBreak = $root.google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.toObject(message.detectedBreak, options); + if (message.detectedLanguages && message.detectedLanguages.length) { + object.detectedLanguages = []; + for (var j = 0; j < message.detectedLanguages.length; ++j) + object.detectedLanguages[j] = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.toObject(message.detectedLanguages[j], options); + } + if (message.provenance != null && message.hasOwnProperty("provenance")) + object.provenance = $root.google.cloud.documentai.v1.Document.Provenance.toObject(message.provenance, options); + if (message.styleInfo != null && message.hasOwnProperty("styleInfo")) + object.styleInfo = $root.google.cloud.documentai.v1.Document.Page.Token.StyleInfo.toObject(message.styleInfo, options); + return object; + }; + + /** + * Converts this Token to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.Page.Token + * @instance + * @returns {Object.} JSON object + */ + Token.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Token + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.Page.Token + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Token.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Page.Token"; + }; + + Token.DetectedBreak = (function() { + + /** + * Properties of a DetectedBreak. + * @memberof google.cloud.documentai.v1.Document.Page.Token + * @interface IDetectedBreak + * @property {google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.Type|null} [type] DetectedBreak type + */ + + /** + * Constructs a new DetectedBreak. + * @memberof google.cloud.documentai.v1.Document.Page.Token + * @classdesc Represents a DetectedBreak. + * @implements IDetectedBreak + * @constructor + * @param {google.cloud.documentai.v1.Document.Page.Token.IDetectedBreak=} [properties] Properties to set + */ + function DetectedBreak(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]]; + } + + /** + * DetectedBreak type. + * @member {google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.Type} type + * @memberof google.cloud.documentai.v1.Document.Page.Token.DetectedBreak + * @instance + */ + DetectedBreak.prototype.type = 0; + + /** + * Creates a new DetectedBreak instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.Page.Token.DetectedBreak + * @static + * @param {google.cloud.documentai.v1.Document.Page.Token.IDetectedBreak=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.Page.Token.DetectedBreak} DetectedBreak instance + */ + DetectedBreak.create = function create(properties) { + return new DetectedBreak(properties); + }; + + /** + * Encodes the specified DetectedBreak message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.Page.Token.DetectedBreak + * @static + * @param {google.cloud.documentai.v1.Document.Page.Token.IDetectedBreak} message DetectedBreak message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectedBreak.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); + return writer; + }; + + /** + * Encodes the specified DetectedBreak message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.Page.Token.DetectedBreak + * @static + * @param {google.cloud.documentai.v1.Document.Page.Token.IDetectedBreak} message DetectedBreak message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectedBreak.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DetectedBreak message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.Page.Token.DetectedBreak + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.Page.Token.DetectedBreak} DetectedBreak + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectedBreak.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Page.Token.DetectedBreak(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DetectedBreak message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.Page.Token.DetectedBreak + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.Page.Token.DetectedBreak} DetectedBreak + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectedBreak.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DetectedBreak message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.Page.Token.DetectedBreak + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DetectedBreak.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 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a DetectedBreak message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.Page.Token.DetectedBreak + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.Page.Token.DetectedBreak} DetectedBreak + */ + DetectedBreak.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.Page.Token.DetectedBreak) + return object; + var message = new $root.google.cloud.documentai.v1.Document.Page.Token.DetectedBreak(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "SPACE": + case 1: + message.type = 1; + break; + case "WIDE_SPACE": + case 2: + message.type = 2; + break; + case "HYPHEN": + case 3: + message.type = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a DetectedBreak message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.Page.Token.DetectedBreak + * @static + * @param {google.cloud.documentai.v1.Document.Page.Token.DetectedBreak} message DetectedBreak + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DetectedBreak.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.Type[message.type] === undefined ? message.type : $root.google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.Type[message.type] : message.type; + return object; + }; + + /** + * Converts this DetectedBreak to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.Page.Token.DetectedBreak + * @instance + * @returns {Object.} JSON object + */ + DetectedBreak.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DetectedBreak + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.Page.Token.DetectedBreak + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DetectedBreak.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Page.Token.DetectedBreak"; + }; + + /** + * Type enum. + * @name google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} SPACE=1 SPACE value + * @property {number} WIDE_SPACE=2 WIDE_SPACE value + * @property {number} HYPHEN=3 HYPHEN value + */ + DetectedBreak.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SPACE"] = 1; + values[valuesById[2] = "WIDE_SPACE"] = 2; + values[valuesById[3] = "HYPHEN"] = 3; + return values; + })(); + + return DetectedBreak; + })(); + + Token.StyleInfo = (function() { + + /** + * Properties of a StyleInfo. + * @memberof google.cloud.documentai.v1.Document.Page.Token + * @interface IStyleInfo + * @property {number|null} [fontSize] StyleInfo fontSize + * @property {number|null} [pixelFontSize] StyleInfo pixelFontSize + * @property {number|null} [letterSpacing] StyleInfo letterSpacing + * @property {string|null} [fontType] StyleInfo fontType + * @property {boolean|null} [bold] StyleInfo bold + * @property {boolean|null} [italic] StyleInfo italic + * @property {boolean|null} [underlined] StyleInfo underlined + * @property {boolean|null} [strikeout] StyleInfo strikeout + * @property {boolean|null} [subscript] StyleInfo subscript + * @property {boolean|null} [superscript] StyleInfo superscript + * @property {boolean|null} [smallcaps] StyleInfo smallcaps + * @property {number|null} [fontWeight] StyleInfo fontWeight + * @property {boolean|null} [handwritten] StyleInfo handwritten + * @property {google.type.IColor|null} [textColor] StyleInfo textColor + * @property {google.type.IColor|null} [backgroundColor] StyleInfo backgroundColor + */ + + /** + * Constructs a new StyleInfo. + * @memberof google.cloud.documentai.v1.Document.Page.Token + * @classdesc Represents a StyleInfo. + * @implements IStyleInfo + * @constructor + * @param {google.cloud.documentai.v1.Document.Page.Token.IStyleInfo=} [properties] Properties to set + */ + function StyleInfo(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]]; + } + + /** + * StyleInfo fontSize. + * @member {number} fontSize + * @memberof google.cloud.documentai.v1.Document.Page.Token.StyleInfo + * @instance + */ + StyleInfo.prototype.fontSize = 0; + + /** + * StyleInfo pixelFontSize. + * @member {number} pixelFontSize + * @memberof google.cloud.documentai.v1.Document.Page.Token.StyleInfo + * @instance + */ + StyleInfo.prototype.pixelFontSize = 0; + + /** + * StyleInfo letterSpacing. + * @member {number} letterSpacing + * @memberof google.cloud.documentai.v1.Document.Page.Token.StyleInfo + * @instance + */ + StyleInfo.prototype.letterSpacing = 0; + + /** + * StyleInfo fontType. + * @member {string} fontType + * @memberof google.cloud.documentai.v1.Document.Page.Token.StyleInfo + * @instance + */ + StyleInfo.prototype.fontType = ""; + + /** + * StyleInfo bold. + * @member {boolean} bold + * @memberof google.cloud.documentai.v1.Document.Page.Token.StyleInfo + * @instance + */ + StyleInfo.prototype.bold = false; + + /** + * StyleInfo italic. + * @member {boolean} italic + * @memberof google.cloud.documentai.v1.Document.Page.Token.StyleInfo + * @instance + */ + StyleInfo.prototype.italic = false; + + /** + * StyleInfo underlined. + * @member {boolean} underlined + * @memberof google.cloud.documentai.v1.Document.Page.Token.StyleInfo + * @instance + */ + StyleInfo.prototype.underlined = false; + + /** + * StyleInfo strikeout. + * @member {boolean} strikeout + * @memberof google.cloud.documentai.v1.Document.Page.Token.StyleInfo + * @instance + */ + StyleInfo.prototype.strikeout = false; + + /** + * StyleInfo subscript. + * @member {boolean} subscript + * @memberof google.cloud.documentai.v1.Document.Page.Token.StyleInfo + * @instance + */ + StyleInfo.prototype.subscript = false; + + /** + * StyleInfo superscript. + * @member {boolean} superscript + * @memberof google.cloud.documentai.v1.Document.Page.Token.StyleInfo + * @instance + */ + StyleInfo.prototype.superscript = false; + + /** + * StyleInfo smallcaps. + * @member {boolean} smallcaps + * @memberof google.cloud.documentai.v1.Document.Page.Token.StyleInfo + * @instance + */ + StyleInfo.prototype.smallcaps = false; + + /** + * StyleInfo fontWeight. + * @member {number} fontWeight + * @memberof google.cloud.documentai.v1.Document.Page.Token.StyleInfo + * @instance + */ + StyleInfo.prototype.fontWeight = 0; + + /** + * StyleInfo handwritten. + * @member {boolean} handwritten + * @memberof google.cloud.documentai.v1.Document.Page.Token.StyleInfo + * @instance + */ + StyleInfo.prototype.handwritten = false; + + /** + * StyleInfo textColor. + * @member {google.type.IColor|null|undefined} textColor + * @memberof google.cloud.documentai.v1.Document.Page.Token.StyleInfo + * @instance + */ + StyleInfo.prototype.textColor = null; + + /** + * StyleInfo backgroundColor. + * @member {google.type.IColor|null|undefined} backgroundColor + * @memberof google.cloud.documentai.v1.Document.Page.Token.StyleInfo + * @instance + */ + StyleInfo.prototype.backgroundColor = null; + + /** + * Creates a new StyleInfo instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.Page.Token.StyleInfo + * @static + * @param {google.cloud.documentai.v1.Document.Page.Token.IStyleInfo=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.Page.Token.StyleInfo} StyleInfo instance + */ + StyleInfo.create = function create(properties) { + return new StyleInfo(properties); + }; + + /** + * Encodes the specified StyleInfo message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Token.StyleInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.Page.Token.StyleInfo + * @static + * @param {google.cloud.documentai.v1.Document.Page.Token.IStyleInfo} message StyleInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StyleInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fontSize != null && Object.hasOwnProperty.call(message, "fontSize")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fontSize); + if (message.pixelFontSize != null && Object.hasOwnProperty.call(message, "pixelFontSize")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.pixelFontSize); + if (message.letterSpacing != null && Object.hasOwnProperty.call(message, "letterSpacing")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.letterSpacing); + if (message.fontType != null && Object.hasOwnProperty.call(message, "fontType")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.fontType); + if (message.bold != null && Object.hasOwnProperty.call(message, "bold")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.bold); + if (message.italic != null && Object.hasOwnProperty.call(message, "italic")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.italic); + if (message.underlined != null && Object.hasOwnProperty.call(message, "underlined")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.underlined); + if (message.strikeout != null && Object.hasOwnProperty.call(message, "strikeout")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.strikeout); + if (message.subscript != null && Object.hasOwnProperty.call(message, "subscript")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.subscript); + if (message.superscript != null && Object.hasOwnProperty.call(message, "superscript")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.superscript); + if (message.smallcaps != null && Object.hasOwnProperty.call(message, "smallcaps")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.smallcaps); + if (message.fontWeight != null && Object.hasOwnProperty.call(message, "fontWeight")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.fontWeight); + if (message.handwritten != null && Object.hasOwnProperty.call(message, "handwritten")) + writer.uint32(/* id 13, wireType 0 =*/104).bool(message.handwritten); + if (message.textColor != null && Object.hasOwnProperty.call(message, "textColor")) + $root.google.type.Color.encode(message.textColor, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.backgroundColor != null && Object.hasOwnProperty.call(message, "backgroundColor")) + $root.google.type.Color.encode(message.backgroundColor, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StyleInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Token.StyleInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.Page.Token.StyleInfo + * @static + * @param {google.cloud.documentai.v1.Document.Page.Token.IStyleInfo} message StyleInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StyleInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StyleInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.Page.Token.StyleInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.Page.Token.StyleInfo} StyleInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StyleInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Page.Token.StyleInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.fontSize = reader.int32(); + break; + } + case 2: { + message.pixelFontSize = reader.double(); + break; + } + case 3: { + message.letterSpacing = reader.double(); + break; + } + case 4: { + message.fontType = reader.string(); + break; + } + case 5: { + message.bold = reader.bool(); + break; + } + case 6: { + message.italic = reader.bool(); + break; + } + case 7: { + message.underlined = reader.bool(); + break; + } + case 8: { + message.strikeout = reader.bool(); + break; + } + case 9: { + message.subscript = reader.bool(); + break; + } + case 10: { + message.superscript = reader.bool(); + break; + } + case 11: { + message.smallcaps = reader.bool(); + break; + } + case 12: { + message.fontWeight = reader.int32(); + break; + } + case 13: { + message.handwritten = reader.bool(); + break; + } + case 14: { + message.textColor = $root.google.type.Color.decode(reader, reader.uint32()); + break; + } + case 15: { + message.backgroundColor = $root.google.type.Color.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StyleInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.Page.Token.StyleInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.Page.Token.StyleInfo} StyleInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StyleInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StyleInfo message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.Page.Token.StyleInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StyleInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fontSize != null && message.hasOwnProperty("fontSize")) + if (!$util.isInteger(message.fontSize)) + return "fontSize: integer expected"; + if (message.pixelFontSize != null && message.hasOwnProperty("pixelFontSize")) + if (typeof message.pixelFontSize !== "number") + return "pixelFontSize: number expected"; + if (message.letterSpacing != null && message.hasOwnProperty("letterSpacing")) + if (typeof message.letterSpacing !== "number") + return "letterSpacing: number expected"; + if (message.fontType != null && message.hasOwnProperty("fontType")) + if (!$util.isString(message.fontType)) + return "fontType: string expected"; + if (message.bold != null && message.hasOwnProperty("bold")) + if (typeof message.bold !== "boolean") + return "bold: boolean expected"; + if (message.italic != null && message.hasOwnProperty("italic")) + if (typeof message.italic !== "boolean") + return "italic: boolean expected"; + if (message.underlined != null && message.hasOwnProperty("underlined")) + if (typeof message.underlined !== "boolean") + return "underlined: boolean expected"; + if (message.strikeout != null && message.hasOwnProperty("strikeout")) + if (typeof message.strikeout !== "boolean") + return "strikeout: boolean expected"; + if (message.subscript != null && message.hasOwnProperty("subscript")) + if (typeof message.subscript !== "boolean") + return "subscript: boolean expected"; + if (message.superscript != null && message.hasOwnProperty("superscript")) + if (typeof message.superscript !== "boolean") + return "superscript: boolean expected"; + if (message.smallcaps != null && message.hasOwnProperty("smallcaps")) + if (typeof message.smallcaps !== "boolean") + return "smallcaps: boolean expected"; + if (message.fontWeight != null && message.hasOwnProperty("fontWeight")) + if (!$util.isInteger(message.fontWeight)) + return "fontWeight: integer expected"; + if (message.handwritten != null && message.hasOwnProperty("handwritten")) + if (typeof message.handwritten !== "boolean") + return "handwritten: boolean expected"; + if (message.textColor != null && message.hasOwnProperty("textColor")) { + var error = $root.google.type.Color.verify(message.textColor); + if (error) + return "textColor." + error; + } + if (message.backgroundColor != null && message.hasOwnProperty("backgroundColor")) { + var error = $root.google.type.Color.verify(message.backgroundColor); + if (error) + return "backgroundColor." + error; + } + return null; + }; + + /** + * Creates a StyleInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.Page.Token.StyleInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.Page.Token.StyleInfo} StyleInfo + */ + StyleInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.Page.Token.StyleInfo) + return object; + var message = new $root.google.cloud.documentai.v1.Document.Page.Token.StyleInfo(); + if (object.fontSize != null) + message.fontSize = object.fontSize | 0; + if (object.pixelFontSize != null) + message.pixelFontSize = Number(object.pixelFontSize); + if (object.letterSpacing != null) + message.letterSpacing = Number(object.letterSpacing); + if (object.fontType != null) + message.fontType = String(object.fontType); + if (object.bold != null) + message.bold = Boolean(object.bold); + if (object.italic != null) + message.italic = Boolean(object.italic); + if (object.underlined != null) + message.underlined = Boolean(object.underlined); + if (object.strikeout != null) + message.strikeout = Boolean(object.strikeout); + if (object.subscript != null) + message.subscript = Boolean(object.subscript); + if (object.superscript != null) + message.superscript = Boolean(object.superscript); + if (object.smallcaps != null) + message.smallcaps = Boolean(object.smallcaps); + if (object.fontWeight != null) + message.fontWeight = object.fontWeight | 0; + if (object.handwritten != null) + message.handwritten = Boolean(object.handwritten); + if (object.textColor != null) { + if (typeof object.textColor !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.Token.StyleInfo.textColor: object expected"); + message.textColor = $root.google.type.Color.fromObject(object.textColor); + } + if (object.backgroundColor != null) { + if (typeof object.backgroundColor !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.Token.StyleInfo.backgroundColor: object expected"); + message.backgroundColor = $root.google.type.Color.fromObject(object.backgroundColor); + } + return message; + }; + + /** + * Creates a plain object from a StyleInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.Page.Token.StyleInfo + * @static + * @param {google.cloud.documentai.v1.Document.Page.Token.StyleInfo} message StyleInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StyleInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fontSize = 0; + object.pixelFontSize = 0; + object.letterSpacing = 0; + object.fontType = ""; + object.bold = false; + object.italic = false; + object.underlined = false; + object.strikeout = false; + object.subscript = false; + object.superscript = false; + object.smallcaps = false; + object.fontWeight = 0; + object.handwritten = false; + object.textColor = null; + object.backgroundColor = null; + } + if (message.fontSize != null && message.hasOwnProperty("fontSize")) + object.fontSize = message.fontSize; + if (message.pixelFontSize != null && message.hasOwnProperty("pixelFontSize")) + object.pixelFontSize = options.json && !isFinite(message.pixelFontSize) ? String(message.pixelFontSize) : message.pixelFontSize; + if (message.letterSpacing != null && message.hasOwnProperty("letterSpacing")) + object.letterSpacing = options.json && !isFinite(message.letterSpacing) ? String(message.letterSpacing) : message.letterSpacing; + if (message.fontType != null && message.hasOwnProperty("fontType")) + object.fontType = message.fontType; + if (message.bold != null && message.hasOwnProperty("bold")) + object.bold = message.bold; + if (message.italic != null && message.hasOwnProperty("italic")) + object.italic = message.italic; + if (message.underlined != null && message.hasOwnProperty("underlined")) + object.underlined = message.underlined; + if (message.strikeout != null && message.hasOwnProperty("strikeout")) + object.strikeout = message.strikeout; + if (message.subscript != null && message.hasOwnProperty("subscript")) + object.subscript = message.subscript; + if (message.superscript != null && message.hasOwnProperty("superscript")) + object.superscript = message.superscript; + if (message.smallcaps != null && message.hasOwnProperty("smallcaps")) + object.smallcaps = message.smallcaps; + if (message.fontWeight != null && message.hasOwnProperty("fontWeight")) + object.fontWeight = message.fontWeight; + if (message.handwritten != null && message.hasOwnProperty("handwritten")) + object.handwritten = message.handwritten; + if (message.textColor != null && message.hasOwnProperty("textColor")) + object.textColor = $root.google.type.Color.toObject(message.textColor, options); + if (message.backgroundColor != null && message.hasOwnProperty("backgroundColor")) + object.backgroundColor = $root.google.type.Color.toObject(message.backgroundColor, options); + return object; + }; + + /** + * Converts this StyleInfo to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.Page.Token.StyleInfo + * @instance + * @returns {Object.} JSON object + */ + StyleInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StyleInfo + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.Page.Token.StyleInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StyleInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Page.Token.StyleInfo"; + }; + + return StyleInfo; + })(); + + return Token; + })(); + + Page.Symbol = (function() { + + /** + * Properties of a Symbol. + * @memberof google.cloud.documentai.v1.Document.Page + * @interface ISymbol + * @property {google.cloud.documentai.v1.Document.Page.ILayout|null} [layout] Symbol layout + * @property {Array.|null} [detectedLanguages] Symbol detectedLanguages + */ + + /** + * Constructs a new Symbol. + * @memberof google.cloud.documentai.v1.Document.Page + * @classdesc Represents a Symbol. + * @implements ISymbol + * @constructor + * @param {google.cloud.documentai.v1.Document.Page.ISymbol=} [properties] Properties to set + */ + function Symbol(properties) { + this.detectedLanguages = []; + 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]]; + } + + /** + * Symbol layout. + * @member {google.cloud.documentai.v1.Document.Page.ILayout|null|undefined} layout + * @memberof google.cloud.documentai.v1.Document.Page.Symbol + * @instance + */ + Symbol.prototype.layout = null; + + /** + * Symbol detectedLanguages. + * @member {Array.} detectedLanguages + * @memberof google.cloud.documentai.v1.Document.Page.Symbol + * @instance + */ + Symbol.prototype.detectedLanguages = $util.emptyArray; + + /** + * Creates a new Symbol instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.Page.Symbol + * @static + * @param {google.cloud.documentai.v1.Document.Page.ISymbol=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.Page.Symbol} Symbol instance + */ + Symbol.create = function create(properties) { + return new Symbol(properties); + }; + + /** + * Encodes the specified Symbol message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Symbol.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.Page.Symbol + * @static + * @param {google.cloud.documentai.v1.Document.Page.ISymbol} message Symbol message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Symbol.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.layout != null && Object.hasOwnProperty.call(message, "layout")) + $root.google.cloud.documentai.v1.Document.Page.Layout.encode(message.layout, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.detectedLanguages != null && message.detectedLanguages.length) + for (var i = 0; i < message.detectedLanguages.length; ++i) + $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.encode(message.detectedLanguages[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Symbol message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Symbol.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.Page.Symbol + * @static + * @param {google.cloud.documentai.v1.Document.Page.ISymbol} message Symbol message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Symbol.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Symbol message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.Page.Symbol + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.Page.Symbol} Symbol + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Symbol.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Page.Symbol(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.detectedLanguages && message.detectedLanguages.length)) + message.detectedLanguages = []; + message.detectedLanguages.push($root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Symbol message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.Page.Symbol + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.Page.Symbol} Symbol + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Symbol.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Symbol message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.Page.Symbol + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Symbol.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.layout != null && message.hasOwnProperty("layout")) { + var error = $root.google.cloud.documentai.v1.Document.Page.Layout.verify(message.layout); + if (error) + return "layout." + error; + } + if (message.detectedLanguages != null && message.hasOwnProperty("detectedLanguages")) { + if (!Array.isArray(message.detectedLanguages)) + return "detectedLanguages: array expected"; + for (var i = 0; i < message.detectedLanguages.length; ++i) { + var error = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.verify(message.detectedLanguages[i]); + if (error) + return "detectedLanguages." + error; + } + } + return null; + }; + + /** + * Creates a Symbol message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.Page.Symbol + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.Page.Symbol} Symbol + */ + Symbol.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.Page.Symbol) + return object; + var message = new $root.google.cloud.documentai.v1.Document.Page.Symbol(); + if (object.layout != null) { + if (typeof object.layout !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.Symbol.layout: object expected"); + message.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.fromObject(object.layout); + } + if (object.detectedLanguages) { + if (!Array.isArray(object.detectedLanguages)) + throw TypeError(".google.cloud.documentai.v1.Document.Page.Symbol.detectedLanguages: array expected"); + message.detectedLanguages = []; + for (var i = 0; i < object.detectedLanguages.length; ++i) { + if (typeof object.detectedLanguages[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.Symbol.detectedLanguages: object expected"); + message.detectedLanguages[i] = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.fromObject(object.detectedLanguages[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Symbol message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.Page.Symbol + * @static + * @param {google.cloud.documentai.v1.Document.Page.Symbol} message Symbol + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Symbol.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.detectedLanguages = []; + if (options.defaults) + object.layout = null; + if (message.layout != null && message.hasOwnProperty("layout")) + object.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.toObject(message.layout, options); + if (message.detectedLanguages && message.detectedLanguages.length) { + object.detectedLanguages = []; + for (var j = 0; j < message.detectedLanguages.length; ++j) + object.detectedLanguages[j] = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.toObject(message.detectedLanguages[j], options); + } + return object; + }; + + /** + * Converts this Symbol to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.Page.Symbol + * @instance + * @returns {Object.} JSON object + */ + Symbol.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Symbol + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.Page.Symbol + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Symbol.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Page.Symbol"; + }; + + return Symbol; + })(); + + Page.VisualElement = (function() { + + /** + * Properties of a VisualElement. + * @memberof google.cloud.documentai.v1.Document.Page + * @interface IVisualElement + * @property {google.cloud.documentai.v1.Document.Page.ILayout|null} [layout] VisualElement layout + * @property {string|null} [type] VisualElement type + * @property {Array.|null} [detectedLanguages] VisualElement detectedLanguages + */ + + /** + * Constructs a new VisualElement. + * @memberof google.cloud.documentai.v1.Document.Page + * @classdesc Represents a VisualElement. + * @implements IVisualElement + * @constructor + * @param {google.cloud.documentai.v1.Document.Page.IVisualElement=} [properties] Properties to set + */ + function VisualElement(properties) { + this.detectedLanguages = []; + 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]]; + } + + /** + * VisualElement layout. + * @member {google.cloud.documentai.v1.Document.Page.ILayout|null|undefined} layout + * @memberof google.cloud.documentai.v1.Document.Page.VisualElement + * @instance + */ + VisualElement.prototype.layout = null; + + /** + * VisualElement type. + * @member {string} type + * @memberof google.cloud.documentai.v1.Document.Page.VisualElement + * @instance + */ + VisualElement.prototype.type = ""; + + /** + * VisualElement detectedLanguages. + * @member {Array.} detectedLanguages + * @memberof google.cloud.documentai.v1.Document.Page.VisualElement + * @instance + */ + VisualElement.prototype.detectedLanguages = $util.emptyArray; + + /** + * Creates a new VisualElement instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.Page.VisualElement + * @static + * @param {google.cloud.documentai.v1.Document.Page.IVisualElement=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.Page.VisualElement} VisualElement instance + */ + VisualElement.create = function create(properties) { + return new VisualElement(properties); + }; + + /** + * Encodes the specified VisualElement message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.VisualElement.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.Page.VisualElement + * @static + * @param {google.cloud.documentai.v1.Document.Page.IVisualElement} message VisualElement message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VisualElement.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.layout != null && Object.hasOwnProperty.call(message, "layout")) + $root.google.cloud.documentai.v1.Document.Page.Layout.encode(message.layout, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); + if (message.detectedLanguages != null && message.detectedLanguages.length) + for (var i = 0; i < message.detectedLanguages.length; ++i) + $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.encode(message.detectedLanguages[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VisualElement message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.VisualElement.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.Page.VisualElement + * @static + * @param {google.cloud.documentai.v1.Document.Page.IVisualElement} message VisualElement message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VisualElement.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VisualElement message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.Page.VisualElement + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.Page.VisualElement} VisualElement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VisualElement.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Page.VisualElement(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.decode(reader, reader.uint32()); + break; + } + case 2: { + message.type = reader.string(); + break; + } + case 3: { + if (!(message.detectedLanguages && message.detectedLanguages.length)) + message.detectedLanguages = []; + message.detectedLanguages.push($root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VisualElement message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.Page.VisualElement + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.Page.VisualElement} VisualElement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VisualElement.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VisualElement message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.Page.VisualElement + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VisualElement.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.layout != null && message.hasOwnProperty("layout")) { + var error = $root.google.cloud.documentai.v1.Document.Page.Layout.verify(message.layout); + if (error) + return "layout." + error; + } + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.detectedLanguages != null && message.hasOwnProperty("detectedLanguages")) { + if (!Array.isArray(message.detectedLanguages)) + return "detectedLanguages: array expected"; + for (var i = 0; i < message.detectedLanguages.length; ++i) { + var error = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.verify(message.detectedLanguages[i]); + if (error) + return "detectedLanguages." + error; + } + } + return null; + }; + + /** + * Creates a VisualElement message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.Page.VisualElement + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.Page.VisualElement} VisualElement + */ + VisualElement.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.Page.VisualElement) + return object; + var message = new $root.google.cloud.documentai.v1.Document.Page.VisualElement(); + if (object.layout != null) { + if (typeof object.layout !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.VisualElement.layout: object expected"); + message.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.fromObject(object.layout); + } + if (object.type != null) + message.type = String(object.type); + if (object.detectedLanguages) { + if (!Array.isArray(object.detectedLanguages)) + throw TypeError(".google.cloud.documentai.v1.Document.Page.VisualElement.detectedLanguages: array expected"); + message.detectedLanguages = []; + for (var i = 0; i < object.detectedLanguages.length; ++i) { + if (typeof object.detectedLanguages[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.VisualElement.detectedLanguages: object expected"); + message.detectedLanguages[i] = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.fromObject(object.detectedLanguages[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a VisualElement message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.Page.VisualElement + * @static + * @param {google.cloud.documentai.v1.Document.Page.VisualElement} message VisualElement + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VisualElement.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.detectedLanguages = []; + if (options.defaults) { + object.layout = null; + object.type = ""; + } + if (message.layout != null && message.hasOwnProperty("layout")) + object.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.toObject(message.layout, options); + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.detectedLanguages && message.detectedLanguages.length) { + object.detectedLanguages = []; + for (var j = 0; j < message.detectedLanguages.length; ++j) + object.detectedLanguages[j] = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.toObject(message.detectedLanguages[j], options); + } + return object; + }; + + /** + * Converts this VisualElement to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.Page.VisualElement + * @instance + * @returns {Object.} JSON object + */ + VisualElement.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VisualElement + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.Page.VisualElement + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VisualElement.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Page.VisualElement"; + }; + + return VisualElement; + })(); + + Page.Table = (function() { + + /** + * Properties of a Table. + * @memberof google.cloud.documentai.v1.Document.Page + * @interface ITable + * @property {google.cloud.documentai.v1.Document.Page.ILayout|null} [layout] Table layout + * @property {Array.|null} [headerRows] Table headerRows + * @property {Array.|null} [bodyRows] Table bodyRows + * @property {Array.|null} [detectedLanguages] Table detectedLanguages + * @property {google.cloud.documentai.v1.Document.IProvenance|null} [provenance] Table provenance + */ + + /** + * Constructs a new Table. + * @memberof google.cloud.documentai.v1.Document.Page + * @classdesc Represents a Table. + * @implements ITable + * @constructor + * @param {google.cloud.documentai.v1.Document.Page.ITable=} [properties] Properties to set + */ + function Table(properties) { + this.headerRows = []; + this.bodyRows = []; + this.detectedLanguages = []; + 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 layout. + * @member {google.cloud.documentai.v1.Document.Page.ILayout|null|undefined} layout + * @memberof google.cloud.documentai.v1.Document.Page.Table + * @instance + */ + Table.prototype.layout = null; + + /** + * Table headerRows. + * @member {Array.} headerRows + * @memberof google.cloud.documentai.v1.Document.Page.Table + * @instance + */ + Table.prototype.headerRows = $util.emptyArray; + + /** + * Table bodyRows. + * @member {Array.} bodyRows + * @memberof google.cloud.documentai.v1.Document.Page.Table + * @instance + */ + Table.prototype.bodyRows = $util.emptyArray; + + /** + * Table detectedLanguages. + * @member {Array.} detectedLanguages + * @memberof google.cloud.documentai.v1.Document.Page.Table + * @instance + */ + Table.prototype.detectedLanguages = $util.emptyArray; + + /** + * Table provenance. + * @member {google.cloud.documentai.v1.Document.IProvenance|null|undefined} provenance + * @memberof google.cloud.documentai.v1.Document.Page.Table + * @instance + */ + Table.prototype.provenance = null; + + /** + * Creates a new Table instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.Page.Table + * @static + * @param {google.cloud.documentai.v1.Document.Page.ITable=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.Page.Table} Table instance + */ + Table.create = function create(properties) { + return new Table(properties); + }; + + /** + * Encodes the specified Table message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Table.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.Page.Table + * @static + * @param {google.cloud.documentai.v1.Document.Page.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.layout != null && Object.hasOwnProperty.call(message, "layout")) + $root.google.cloud.documentai.v1.Document.Page.Layout.encode(message.layout, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.headerRows != null && message.headerRows.length) + for (var i = 0; i < message.headerRows.length; ++i) + $root.google.cloud.documentai.v1.Document.Page.Table.TableRow.encode(message.headerRows[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.bodyRows != null && message.bodyRows.length) + for (var i = 0; i < message.bodyRows.length; ++i) + $root.google.cloud.documentai.v1.Document.Page.Table.TableRow.encode(message.bodyRows[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.detectedLanguages != null && message.detectedLanguages.length) + for (var i = 0; i < message.detectedLanguages.length; ++i) + $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.encode(message.detectedLanguages[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.provenance != null && Object.hasOwnProperty.call(message, "provenance")) + $root.google.cloud.documentai.v1.Document.Provenance.encode(message.provenance, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Table message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Table.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.Page.Table + * @static + * @param {google.cloud.documentai.v1.Document.Page.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.cloud.documentai.v1.Document.Page.Table + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.Page.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Page.Table(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.headerRows && message.headerRows.length)) + message.headerRows = []; + message.headerRows.push($root.google.cloud.documentai.v1.Document.Page.Table.TableRow.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.bodyRows && message.bodyRows.length)) + message.bodyRows = []; + message.bodyRows.push($root.google.cloud.documentai.v1.Document.Page.Table.TableRow.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.detectedLanguages && message.detectedLanguages.length)) + message.detectedLanguages = []; + message.detectedLanguages.push($root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.decode(reader, reader.uint32())); + break; + } + case 5: { + message.provenance = $root.google.cloud.documentai.v1.Document.Provenance.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.cloud.documentai.v1.Document.Page.Table + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.Page.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.cloud.documentai.v1.Document.Page.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.layout != null && message.hasOwnProperty("layout")) { + var error = $root.google.cloud.documentai.v1.Document.Page.Layout.verify(message.layout); + if (error) + return "layout." + error; + } + if (message.headerRows != null && message.hasOwnProperty("headerRows")) { + if (!Array.isArray(message.headerRows)) + return "headerRows: array expected"; + for (var i = 0; i < message.headerRows.length; ++i) { + var error = $root.google.cloud.documentai.v1.Document.Page.Table.TableRow.verify(message.headerRows[i]); + if (error) + return "headerRows." + error; + } + } + if (message.bodyRows != null && message.hasOwnProperty("bodyRows")) { + if (!Array.isArray(message.bodyRows)) + return "bodyRows: array expected"; + for (var i = 0; i < message.bodyRows.length; ++i) { + var error = $root.google.cloud.documentai.v1.Document.Page.Table.TableRow.verify(message.bodyRows[i]); + if (error) + return "bodyRows." + error; + } + } + if (message.detectedLanguages != null && message.hasOwnProperty("detectedLanguages")) { + if (!Array.isArray(message.detectedLanguages)) + return "detectedLanguages: array expected"; + for (var i = 0; i < message.detectedLanguages.length; ++i) { + var error = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.verify(message.detectedLanguages[i]); + if (error) + return "detectedLanguages." + error; + } + } + if (message.provenance != null && message.hasOwnProperty("provenance")) { + var error = $root.google.cloud.documentai.v1.Document.Provenance.verify(message.provenance); + if (error) + return "provenance." + error; + } + return null; + }; + + /** + * Creates a Table message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.Page.Table + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.Page.Table} Table + */ + Table.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.Page.Table) + return object; + var message = new $root.google.cloud.documentai.v1.Document.Page.Table(); + if (object.layout != null) { + if (typeof object.layout !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.Table.layout: object expected"); + message.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.fromObject(object.layout); + } + if (object.headerRows) { + if (!Array.isArray(object.headerRows)) + throw TypeError(".google.cloud.documentai.v1.Document.Page.Table.headerRows: array expected"); + message.headerRows = []; + for (var i = 0; i < object.headerRows.length; ++i) { + if (typeof object.headerRows[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.Table.headerRows: object expected"); + message.headerRows[i] = $root.google.cloud.documentai.v1.Document.Page.Table.TableRow.fromObject(object.headerRows[i]); + } + } + if (object.bodyRows) { + if (!Array.isArray(object.bodyRows)) + throw TypeError(".google.cloud.documentai.v1.Document.Page.Table.bodyRows: array expected"); + message.bodyRows = []; + for (var i = 0; i < object.bodyRows.length; ++i) { + if (typeof object.bodyRows[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.Table.bodyRows: object expected"); + message.bodyRows[i] = $root.google.cloud.documentai.v1.Document.Page.Table.TableRow.fromObject(object.bodyRows[i]); + } + } + if (object.detectedLanguages) { + if (!Array.isArray(object.detectedLanguages)) + throw TypeError(".google.cloud.documentai.v1.Document.Page.Table.detectedLanguages: array expected"); + message.detectedLanguages = []; + for (var i = 0; i < object.detectedLanguages.length; ++i) { + if (typeof object.detectedLanguages[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.Table.detectedLanguages: object expected"); + message.detectedLanguages[i] = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.fromObject(object.detectedLanguages[i]); + } + } + if (object.provenance != null) { + if (typeof object.provenance !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.Table.provenance: object expected"); + message.provenance = $root.google.cloud.documentai.v1.Document.Provenance.fromObject(object.provenance); + } + return message; + }; + + /** + * Creates a plain object from a Table message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.Page.Table + * @static + * @param {google.cloud.documentai.v1.Document.Page.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.headerRows = []; + object.bodyRows = []; + object.detectedLanguages = []; + } + if (options.defaults) { + object.layout = null; + object.provenance = null; + } + if (message.layout != null && message.hasOwnProperty("layout")) + object.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.toObject(message.layout, options); + if (message.headerRows && message.headerRows.length) { + object.headerRows = []; + for (var j = 0; j < message.headerRows.length; ++j) + object.headerRows[j] = $root.google.cloud.documentai.v1.Document.Page.Table.TableRow.toObject(message.headerRows[j], options); + } + if (message.bodyRows && message.bodyRows.length) { + object.bodyRows = []; + for (var j = 0; j < message.bodyRows.length; ++j) + object.bodyRows[j] = $root.google.cloud.documentai.v1.Document.Page.Table.TableRow.toObject(message.bodyRows[j], options); + } + if (message.detectedLanguages && message.detectedLanguages.length) { + object.detectedLanguages = []; + for (var j = 0; j < message.detectedLanguages.length; ++j) + object.detectedLanguages[j] = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.toObject(message.detectedLanguages[j], options); + } + if (message.provenance != null && message.hasOwnProperty("provenance")) + object.provenance = $root.google.cloud.documentai.v1.Document.Provenance.toObject(message.provenance, options); + return object; + }; + + /** + * Converts this Table to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.Page.Table + * @instance + * @returns {Object.} JSON object + */ + Table.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Table + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.Page.Table + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Table.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Page.Table"; + }; + + Table.TableRow = (function() { + + /** + * Properties of a TableRow. + * @memberof google.cloud.documentai.v1.Document.Page.Table + * @interface ITableRow + * @property {Array.|null} [cells] TableRow cells + */ + + /** + * Constructs a new TableRow. + * @memberof google.cloud.documentai.v1.Document.Page.Table + * @classdesc Represents a TableRow. + * @implements ITableRow + * @constructor + * @param {google.cloud.documentai.v1.Document.Page.Table.ITableRow=} [properties] Properties to set + */ + function TableRow(properties) { + this.cells = []; + 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]]; + } + + /** + * TableRow cells. + * @member {Array.} cells + * @memberof google.cloud.documentai.v1.Document.Page.Table.TableRow + * @instance + */ + TableRow.prototype.cells = $util.emptyArray; + + /** + * Creates a new TableRow instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.Page.Table.TableRow + * @static + * @param {google.cloud.documentai.v1.Document.Page.Table.ITableRow=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.Page.Table.TableRow} TableRow instance + */ + TableRow.create = function create(properties) { + return new TableRow(properties); + }; + + /** + * Encodes the specified TableRow message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Table.TableRow.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.Page.Table.TableRow + * @static + * @param {google.cloud.documentai.v1.Document.Page.Table.ITableRow} message TableRow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableRow.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cells != null && message.cells.length) + for (var i = 0; i < message.cells.length; ++i) + $root.google.cloud.documentai.v1.Document.Page.Table.TableCell.encode(message.cells[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TableRow message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Table.TableRow.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.Page.Table.TableRow + * @static + * @param {google.cloud.documentai.v1.Document.Page.Table.ITableRow} message TableRow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableRow.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TableRow message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.Page.Table.TableRow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.Page.Table.TableRow} TableRow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableRow.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Page.Table.TableRow(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.cells && message.cells.length)) + message.cells = []; + message.cells.push($root.google.cloud.documentai.v1.Document.Page.Table.TableCell.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TableRow message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.Page.Table.TableRow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.Page.Table.TableRow} TableRow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableRow.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TableRow message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.Page.Table.TableRow + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TableRow.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cells != null && message.hasOwnProperty("cells")) { + if (!Array.isArray(message.cells)) + return "cells: array expected"; + for (var i = 0; i < message.cells.length; ++i) { + var error = $root.google.cloud.documentai.v1.Document.Page.Table.TableCell.verify(message.cells[i]); + if (error) + return "cells." + error; + } + } + return null; + }; + + /** + * Creates a TableRow message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.Page.Table.TableRow + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.Page.Table.TableRow} TableRow + */ + TableRow.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.Page.Table.TableRow) + return object; + var message = new $root.google.cloud.documentai.v1.Document.Page.Table.TableRow(); + if (object.cells) { + if (!Array.isArray(object.cells)) + throw TypeError(".google.cloud.documentai.v1.Document.Page.Table.TableRow.cells: array expected"); + message.cells = []; + for (var i = 0; i < object.cells.length; ++i) { + if (typeof object.cells[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.Table.TableRow.cells: object expected"); + message.cells[i] = $root.google.cloud.documentai.v1.Document.Page.Table.TableCell.fromObject(object.cells[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TableRow message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.Page.Table.TableRow + * @static + * @param {google.cloud.documentai.v1.Document.Page.Table.TableRow} message TableRow + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TableRow.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.cells = []; + if (message.cells && message.cells.length) { + object.cells = []; + for (var j = 0; j < message.cells.length; ++j) + object.cells[j] = $root.google.cloud.documentai.v1.Document.Page.Table.TableCell.toObject(message.cells[j], options); + } + return object; + }; + + /** + * Converts this TableRow to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.Page.Table.TableRow + * @instance + * @returns {Object.} JSON object + */ + TableRow.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TableRow + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.Page.Table.TableRow + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TableRow.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Page.Table.TableRow"; + }; + + return TableRow; + })(); + + Table.TableCell = (function() { + + /** + * Properties of a TableCell. + * @memberof google.cloud.documentai.v1.Document.Page.Table + * @interface ITableCell + * @property {google.cloud.documentai.v1.Document.Page.ILayout|null} [layout] TableCell layout + * @property {number|null} [rowSpan] TableCell rowSpan + * @property {number|null} [colSpan] TableCell colSpan + * @property {Array.|null} [detectedLanguages] TableCell detectedLanguages + */ + + /** + * Constructs a new TableCell. + * @memberof google.cloud.documentai.v1.Document.Page.Table + * @classdesc Represents a TableCell. + * @implements ITableCell + * @constructor + * @param {google.cloud.documentai.v1.Document.Page.Table.ITableCell=} [properties] Properties to set + */ + function TableCell(properties) { + this.detectedLanguages = []; + 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]]; + } + + /** + * TableCell layout. + * @member {google.cloud.documentai.v1.Document.Page.ILayout|null|undefined} layout + * @memberof google.cloud.documentai.v1.Document.Page.Table.TableCell + * @instance + */ + TableCell.prototype.layout = null; + + /** + * TableCell rowSpan. + * @member {number} rowSpan + * @memberof google.cloud.documentai.v1.Document.Page.Table.TableCell + * @instance + */ + TableCell.prototype.rowSpan = 0; + + /** + * TableCell colSpan. + * @member {number} colSpan + * @memberof google.cloud.documentai.v1.Document.Page.Table.TableCell + * @instance + */ + TableCell.prototype.colSpan = 0; + + /** + * TableCell detectedLanguages. + * @member {Array.} detectedLanguages + * @memberof google.cloud.documentai.v1.Document.Page.Table.TableCell + * @instance + */ + TableCell.prototype.detectedLanguages = $util.emptyArray; + + /** + * Creates a new TableCell instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.Page.Table.TableCell + * @static + * @param {google.cloud.documentai.v1.Document.Page.Table.ITableCell=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.Page.Table.TableCell} TableCell instance + */ + TableCell.create = function create(properties) { + return new TableCell(properties); + }; + + /** + * Encodes the specified TableCell message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Table.TableCell.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.Page.Table.TableCell + * @static + * @param {google.cloud.documentai.v1.Document.Page.Table.ITableCell} message TableCell message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableCell.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.layout != null && Object.hasOwnProperty.call(message, "layout")) + $root.google.cloud.documentai.v1.Document.Page.Layout.encode(message.layout, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.rowSpan != null && Object.hasOwnProperty.call(message, "rowSpan")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.rowSpan); + if (message.colSpan != null && Object.hasOwnProperty.call(message, "colSpan")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.colSpan); + if (message.detectedLanguages != null && message.detectedLanguages.length) + for (var i = 0; i < message.detectedLanguages.length; ++i) + $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.encode(message.detectedLanguages[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TableCell message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Table.TableCell.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.Page.Table.TableCell + * @static + * @param {google.cloud.documentai.v1.Document.Page.Table.ITableCell} message TableCell message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableCell.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TableCell message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.Page.Table.TableCell + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.Page.Table.TableCell} TableCell + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableCell.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Page.Table.TableCell(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.decode(reader, reader.uint32()); + break; + } + case 2: { + message.rowSpan = reader.int32(); + break; + } + case 3: { + message.colSpan = reader.int32(); + break; + } + case 4: { + if (!(message.detectedLanguages && message.detectedLanguages.length)) + message.detectedLanguages = []; + message.detectedLanguages.push($root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TableCell message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.Page.Table.TableCell + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.Page.Table.TableCell} TableCell + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableCell.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TableCell message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.Page.Table.TableCell + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TableCell.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.layout != null && message.hasOwnProperty("layout")) { + var error = $root.google.cloud.documentai.v1.Document.Page.Layout.verify(message.layout); + if (error) + return "layout." + error; + } + if (message.rowSpan != null && message.hasOwnProperty("rowSpan")) + if (!$util.isInteger(message.rowSpan)) + return "rowSpan: integer expected"; + if (message.colSpan != null && message.hasOwnProperty("colSpan")) + if (!$util.isInteger(message.colSpan)) + return "colSpan: integer expected"; + if (message.detectedLanguages != null && message.hasOwnProperty("detectedLanguages")) { + if (!Array.isArray(message.detectedLanguages)) + return "detectedLanguages: array expected"; + for (var i = 0; i < message.detectedLanguages.length; ++i) { + var error = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.verify(message.detectedLanguages[i]); + if (error) + return "detectedLanguages." + error; + } + } + return null; + }; + + /** + * Creates a TableCell message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.Page.Table.TableCell + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.Page.Table.TableCell} TableCell + */ + TableCell.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.Page.Table.TableCell) + return object; + var message = new $root.google.cloud.documentai.v1.Document.Page.Table.TableCell(); + if (object.layout != null) { + if (typeof object.layout !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.Table.TableCell.layout: object expected"); + message.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.fromObject(object.layout); + } + if (object.rowSpan != null) + message.rowSpan = object.rowSpan | 0; + if (object.colSpan != null) + message.colSpan = object.colSpan | 0; + if (object.detectedLanguages) { + if (!Array.isArray(object.detectedLanguages)) + throw TypeError(".google.cloud.documentai.v1.Document.Page.Table.TableCell.detectedLanguages: array expected"); + message.detectedLanguages = []; + for (var i = 0; i < object.detectedLanguages.length; ++i) { + if (typeof object.detectedLanguages[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.Table.TableCell.detectedLanguages: object expected"); + message.detectedLanguages[i] = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.fromObject(object.detectedLanguages[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TableCell message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.Page.Table.TableCell + * @static + * @param {google.cloud.documentai.v1.Document.Page.Table.TableCell} message TableCell + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TableCell.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.detectedLanguages = []; + if (options.defaults) { + object.layout = null; + object.rowSpan = 0; + object.colSpan = 0; + } + if (message.layout != null && message.hasOwnProperty("layout")) + object.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.toObject(message.layout, options); + if (message.rowSpan != null && message.hasOwnProperty("rowSpan")) + object.rowSpan = message.rowSpan; + if (message.colSpan != null && message.hasOwnProperty("colSpan")) + object.colSpan = message.colSpan; + if (message.detectedLanguages && message.detectedLanguages.length) { + object.detectedLanguages = []; + for (var j = 0; j < message.detectedLanguages.length; ++j) + object.detectedLanguages[j] = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.toObject(message.detectedLanguages[j], options); + } + return object; + }; + + /** + * Converts this TableCell to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.Page.Table.TableCell + * @instance + * @returns {Object.} JSON object + */ + TableCell.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TableCell + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.Page.Table.TableCell + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TableCell.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Page.Table.TableCell"; + }; + + return TableCell; + })(); + + return Table; + })(); + + Page.FormField = (function() { + + /** + * Properties of a FormField. + * @memberof google.cloud.documentai.v1.Document.Page + * @interface IFormField + * @property {google.cloud.documentai.v1.Document.Page.ILayout|null} [fieldName] FormField fieldName + * @property {google.cloud.documentai.v1.Document.Page.ILayout|null} [fieldValue] FormField fieldValue + * @property {Array.|null} [nameDetectedLanguages] FormField nameDetectedLanguages + * @property {Array.|null} [valueDetectedLanguages] FormField valueDetectedLanguages + * @property {string|null} [valueType] FormField valueType + * @property {string|null} [correctedKeyText] FormField correctedKeyText + * @property {string|null} [correctedValueText] FormField correctedValueText + * @property {google.cloud.documentai.v1.Document.IProvenance|null} [provenance] FormField provenance + */ + + /** + * Constructs a new FormField. + * @memberof google.cloud.documentai.v1.Document.Page + * @classdesc Represents a FormField. + * @implements IFormField + * @constructor + * @param {google.cloud.documentai.v1.Document.Page.IFormField=} [properties] Properties to set + */ + function FormField(properties) { + this.nameDetectedLanguages = []; + this.valueDetectedLanguages = []; + 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]]; + } + + /** + * FormField fieldName. + * @member {google.cloud.documentai.v1.Document.Page.ILayout|null|undefined} fieldName + * @memberof google.cloud.documentai.v1.Document.Page.FormField + * @instance + */ + FormField.prototype.fieldName = null; + + /** + * FormField fieldValue. + * @member {google.cloud.documentai.v1.Document.Page.ILayout|null|undefined} fieldValue + * @memberof google.cloud.documentai.v1.Document.Page.FormField + * @instance + */ + FormField.prototype.fieldValue = null; + + /** + * FormField nameDetectedLanguages. + * @member {Array.} nameDetectedLanguages + * @memberof google.cloud.documentai.v1.Document.Page.FormField + * @instance + */ + FormField.prototype.nameDetectedLanguages = $util.emptyArray; + + /** + * FormField valueDetectedLanguages. + * @member {Array.} valueDetectedLanguages + * @memberof google.cloud.documentai.v1.Document.Page.FormField + * @instance + */ + FormField.prototype.valueDetectedLanguages = $util.emptyArray; + + /** + * FormField valueType. + * @member {string} valueType + * @memberof google.cloud.documentai.v1.Document.Page.FormField + * @instance + */ + FormField.prototype.valueType = ""; + + /** + * FormField correctedKeyText. + * @member {string} correctedKeyText + * @memberof google.cloud.documentai.v1.Document.Page.FormField + * @instance + */ + FormField.prototype.correctedKeyText = ""; + + /** + * FormField correctedValueText. + * @member {string} correctedValueText + * @memberof google.cloud.documentai.v1.Document.Page.FormField + * @instance + */ + FormField.prototype.correctedValueText = ""; + + /** + * FormField provenance. + * @member {google.cloud.documentai.v1.Document.IProvenance|null|undefined} provenance + * @memberof google.cloud.documentai.v1.Document.Page.FormField + * @instance + */ + FormField.prototype.provenance = null; + + /** + * Creates a new FormField instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.Page.FormField + * @static + * @param {google.cloud.documentai.v1.Document.Page.IFormField=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.Page.FormField} FormField instance + */ + FormField.create = function create(properties) { + return new FormField(properties); + }; + + /** + * Encodes the specified FormField message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.FormField.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.Page.FormField + * @static + * @param {google.cloud.documentai.v1.Document.Page.IFormField} message FormField message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FormField.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldName != null && Object.hasOwnProperty.call(message, "fieldName")) + $root.google.cloud.documentai.v1.Document.Page.Layout.encode(message.fieldName, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fieldValue != null && Object.hasOwnProperty.call(message, "fieldValue")) + $root.google.cloud.documentai.v1.Document.Page.Layout.encode(message.fieldValue, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nameDetectedLanguages != null && message.nameDetectedLanguages.length) + for (var i = 0; i < message.nameDetectedLanguages.length; ++i) + $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.encode(message.nameDetectedLanguages[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.valueDetectedLanguages != null && message.valueDetectedLanguages.length) + for (var i = 0; i < message.valueDetectedLanguages.length; ++i) + $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.encode(message.valueDetectedLanguages[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.valueType != null && Object.hasOwnProperty.call(message, "valueType")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.valueType); + if (message.correctedKeyText != null && Object.hasOwnProperty.call(message, "correctedKeyText")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.correctedKeyText); + if (message.correctedValueText != null && Object.hasOwnProperty.call(message, "correctedValueText")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.correctedValueText); + if (message.provenance != null && Object.hasOwnProperty.call(message, "provenance")) + $root.google.cloud.documentai.v1.Document.Provenance.encode(message.provenance, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FormField message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.FormField.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.Page.FormField + * @static + * @param {google.cloud.documentai.v1.Document.Page.IFormField} message FormField message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FormField.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FormField message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.Page.FormField + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.Page.FormField} FormField + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FormField.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Page.FormField(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.fieldName = $root.google.cloud.documentai.v1.Document.Page.Layout.decode(reader, reader.uint32()); + break; + } + case 2: { + message.fieldValue = $root.google.cloud.documentai.v1.Document.Page.Layout.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.nameDetectedLanguages && message.nameDetectedLanguages.length)) + message.nameDetectedLanguages = []; + message.nameDetectedLanguages.push($root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.valueDetectedLanguages && message.valueDetectedLanguages.length)) + message.valueDetectedLanguages = []; + message.valueDetectedLanguages.push($root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.decode(reader, reader.uint32())); + break; + } + case 5: { + message.valueType = reader.string(); + break; + } + case 6: { + message.correctedKeyText = reader.string(); + break; + } + case 7: { + message.correctedValueText = reader.string(); + break; + } + case 8: { + message.provenance = $root.google.cloud.documentai.v1.Document.Provenance.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FormField message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.Page.FormField + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.Page.FormField} FormField + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FormField.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FormField message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.Page.FormField + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FormField.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldName != null && message.hasOwnProperty("fieldName")) { + var error = $root.google.cloud.documentai.v1.Document.Page.Layout.verify(message.fieldName); + if (error) + return "fieldName." + error; + } + if (message.fieldValue != null && message.hasOwnProperty("fieldValue")) { + var error = $root.google.cloud.documentai.v1.Document.Page.Layout.verify(message.fieldValue); + if (error) + return "fieldValue." + error; + } + if (message.nameDetectedLanguages != null && message.hasOwnProperty("nameDetectedLanguages")) { + if (!Array.isArray(message.nameDetectedLanguages)) + return "nameDetectedLanguages: array expected"; + for (var i = 0; i < message.nameDetectedLanguages.length; ++i) { + var error = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.verify(message.nameDetectedLanguages[i]); + if (error) + return "nameDetectedLanguages." + error; + } + } + if (message.valueDetectedLanguages != null && message.hasOwnProperty("valueDetectedLanguages")) { + if (!Array.isArray(message.valueDetectedLanguages)) + return "valueDetectedLanguages: array expected"; + for (var i = 0; i < message.valueDetectedLanguages.length; ++i) { + var error = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.verify(message.valueDetectedLanguages[i]); + if (error) + return "valueDetectedLanguages." + error; + } + } + if (message.valueType != null && message.hasOwnProperty("valueType")) + if (!$util.isString(message.valueType)) + return "valueType: string expected"; + if (message.correctedKeyText != null && message.hasOwnProperty("correctedKeyText")) + if (!$util.isString(message.correctedKeyText)) + return "correctedKeyText: string expected"; + if (message.correctedValueText != null && message.hasOwnProperty("correctedValueText")) + if (!$util.isString(message.correctedValueText)) + return "correctedValueText: string expected"; + if (message.provenance != null && message.hasOwnProperty("provenance")) { + var error = $root.google.cloud.documentai.v1.Document.Provenance.verify(message.provenance); + if (error) + return "provenance." + error; + } + return null; + }; + + /** + * Creates a FormField message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.Page.FormField + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.Page.FormField} FormField + */ + FormField.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.Page.FormField) + return object; + var message = new $root.google.cloud.documentai.v1.Document.Page.FormField(); + if (object.fieldName != null) { + if (typeof object.fieldName !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.FormField.fieldName: object expected"); + message.fieldName = $root.google.cloud.documentai.v1.Document.Page.Layout.fromObject(object.fieldName); + } + if (object.fieldValue != null) { + if (typeof object.fieldValue !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.FormField.fieldValue: object expected"); + message.fieldValue = $root.google.cloud.documentai.v1.Document.Page.Layout.fromObject(object.fieldValue); + } + if (object.nameDetectedLanguages) { + if (!Array.isArray(object.nameDetectedLanguages)) + throw TypeError(".google.cloud.documentai.v1.Document.Page.FormField.nameDetectedLanguages: array expected"); + message.nameDetectedLanguages = []; + for (var i = 0; i < object.nameDetectedLanguages.length; ++i) { + if (typeof object.nameDetectedLanguages[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.FormField.nameDetectedLanguages: object expected"); + message.nameDetectedLanguages[i] = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.fromObject(object.nameDetectedLanguages[i]); + } + } + if (object.valueDetectedLanguages) { + if (!Array.isArray(object.valueDetectedLanguages)) + throw TypeError(".google.cloud.documentai.v1.Document.Page.FormField.valueDetectedLanguages: array expected"); + message.valueDetectedLanguages = []; + for (var i = 0; i < object.valueDetectedLanguages.length; ++i) { + if (typeof object.valueDetectedLanguages[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.FormField.valueDetectedLanguages: object expected"); + message.valueDetectedLanguages[i] = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.fromObject(object.valueDetectedLanguages[i]); + } + } + if (object.valueType != null) + message.valueType = String(object.valueType); + if (object.correctedKeyText != null) + message.correctedKeyText = String(object.correctedKeyText); + if (object.correctedValueText != null) + message.correctedValueText = String(object.correctedValueText); + if (object.provenance != null) { + if (typeof object.provenance !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.FormField.provenance: object expected"); + message.provenance = $root.google.cloud.documentai.v1.Document.Provenance.fromObject(object.provenance); + } + return message; + }; + + /** + * Creates a plain object from a FormField message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.Page.FormField + * @static + * @param {google.cloud.documentai.v1.Document.Page.FormField} message FormField + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FormField.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.nameDetectedLanguages = []; + object.valueDetectedLanguages = []; + } + if (options.defaults) { + object.fieldName = null; + object.fieldValue = null; + object.valueType = ""; + object.correctedKeyText = ""; + object.correctedValueText = ""; + object.provenance = null; + } + if (message.fieldName != null && message.hasOwnProperty("fieldName")) + object.fieldName = $root.google.cloud.documentai.v1.Document.Page.Layout.toObject(message.fieldName, options); + if (message.fieldValue != null && message.hasOwnProperty("fieldValue")) + object.fieldValue = $root.google.cloud.documentai.v1.Document.Page.Layout.toObject(message.fieldValue, options); + if (message.nameDetectedLanguages && message.nameDetectedLanguages.length) { + object.nameDetectedLanguages = []; + for (var j = 0; j < message.nameDetectedLanguages.length; ++j) + object.nameDetectedLanguages[j] = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.toObject(message.nameDetectedLanguages[j], options); + } + if (message.valueDetectedLanguages && message.valueDetectedLanguages.length) { + object.valueDetectedLanguages = []; + for (var j = 0; j < message.valueDetectedLanguages.length; ++j) + object.valueDetectedLanguages[j] = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.toObject(message.valueDetectedLanguages[j], options); + } + if (message.valueType != null && message.hasOwnProperty("valueType")) + object.valueType = message.valueType; + if (message.correctedKeyText != null && message.hasOwnProperty("correctedKeyText")) + object.correctedKeyText = message.correctedKeyText; + if (message.correctedValueText != null && message.hasOwnProperty("correctedValueText")) + object.correctedValueText = message.correctedValueText; + if (message.provenance != null && message.hasOwnProperty("provenance")) + object.provenance = $root.google.cloud.documentai.v1.Document.Provenance.toObject(message.provenance, options); + return object; + }; + + /** + * Converts this FormField to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.Page.FormField + * @instance + * @returns {Object.} JSON object + */ + FormField.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FormField + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.Page.FormField + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FormField.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Page.FormField"; + }; + + return FormField; + })(); + + Page.DetectedBarcode = (function() { + + /** + * Properties of a DetectedBarcode. + * @memberof google.cloud.documentai.v1.Document.Page + * @interface IDetectedBarcode + * @property {google.cloud.documentai.v1.Document.Page.ILayout|null} [layout] DetectedBarcode layout + * @property {google.cloud.documentai.v1.IBarcode|null} [barcode] DetectedBarcode barcode + */ + + /** + * Constructs a new DetectedBarcode. + * @memberof google.cloud.documentai.v1.Document.Page + * @classdesc Represents a DetectedBarcode. + * @implements IDetectedBarcode + * @constructor + * @param {google.cloud.documentai.v1.Document.Page.IDetectedBarcode=} [properties] Properties to set + */ + function DetectedBarcode(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]]; + } + + /** + * DetectedBarcode layout. + * @member {google.cloud.documentai.v1.Document.Page.ILayout|null|undefined} layout + * @memberof google.cloud.documentai.v1.Document.Page.DetectedBarcode + * @instance + */ + DetectedBarcode.prototype.layout = null; + + /** + * DetectedBarcode barcode. + * @member {google.cloud.documentai.v1.IBarcode|null|undefined} barcode + * @memberof google.cloud.documentai.v1.Document.Page.DetectedBarcode + * @instance + */ + DetectedBarcode.prototype.barcode = null; + + /** + * Creates a new DetectedBarcode instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.Page.DetectedBarcode + * @static + * @param {google.cloud.documentai.v1.Document.Page.IDetectedBarcode=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.Page.DetectedBarcode} DetectedBarcode instance + */ + DetectedBarcode.create = function create(properties) { + return new DetectedBarcode(properties); + }; + + /** + * Encodes the specified DetectedBarcode message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.DetectedBarcode.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.Page.DetectedBarcode + * @static + * @param {google.cloud.documentai.v1.Document.Page.IDetectedBarcode} message DetectedBarcode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectedBarcode.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.layout != null && Object.hasOwnProperty.call(message, "layout")) + $root.google.cloud.documentai.v1.Document.Page.Layout.encode(message.layout, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.barcode != null && Object.hasOwnProperty.call(message, "barcode")) + $root.google.cloud.documentai.v1.Barcode.encode(message.barcode, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DetectedBarcode message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.DetectedBarcode.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.Page.DetectedBarcode + * @static + * @param {google.cloud.documentai.v1.Document.Page.IDetectedBarcode} message DetectedBarcode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectedBarcode.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DetectedBarcode message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.Page.DetectedBarcode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.Page.DetectedBarcode} DetectedBarcode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectedBarcode.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Page.DetectedBarcode(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.decode(reader, reader.uint32()); + break; + } + case 2: { + message.barcode = $root.google.cloud.documentai.v1.Barcode.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DetectedBarcode message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.Page.DetectedBarcode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.Page.DetectedBarcode} DetectedBarcode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectedBarcode.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DetectedBarcode message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.Page.DetectedBarcode + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DetectedBarcode.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.layout != null && message.hasOwnProperty("layout")) { + var error = $root.google.cloud.documentai.v1.Document.Page.Layout.verify(message.layout); + if (error) + return "layout." + error; + } + if (message.barcode != null && message.hasOwnProperty("barcode")) { + var error = $root.google.cloud.documentai.v1.Barcode.verify(message.barcode); + if (error) + return "barcode." + error; + } + return null; + }; + + /** + * Creates a DetectedBarcode message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.Page.DetectedBarcode + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.Page.DetectedBarcode} DetectedBarcode + */ + DetectedBarcode.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.Page.DetectedBarcode) + return object; + var message = new $root.google.cloud.documentai.v1.Document.Page.DetectedBarcode(); + if (object.layout != null) { + if (typeof object.layout !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.DetectedBarcode.layout: object expected"); + message.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.fromObject(object.layout); + } + if (object.barcode != null) { + if (typeof object.barcode !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.DetectedBarcode.barcode: object expected"); + message.barcode = $root.google.cloud.documentai.v1.Barcode.fromObject(object.barcode); + } + return message; + }; + + /** + * Creates a plain object from a DetectedBarcode message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.Page.DetectedBarcode + * @static + * @param {google.cloud.documentai.v1.Document.Page.DetectedBarcode} message DetectedBarcode + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DetectedBarcode.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.layout = null; + object.barcode = null; + } + if (message.layout != null && message.hasOwnProperty("layout")) + object.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.toObject(message.layout, options); + if (message.barcode != null && message.hasOwnProperty("barcode")) + object.barcode = $root.google.cloud.documentai.v1.Barcode.toObject(message.barcode, options); + return object; + }; + + /** + * Converts this DetectedBarcode to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.Page.DetectedBarcode + * @instance + * @returns {Object.} JSON object + */ + DetectedBarcode.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DetectedBarcode + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.Page.DetectedBarcode + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DetectedBarcode.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Page.DetectedBarcode"; + }; + + return DetectedBarcode; + })(); + + Page.DetectedLanguage = (function() { + + /** + * Properties of a DetectedLanguage. + * @memberof google.cloud.documentai.v1.Document.Page + * @interface IDetectedLanguage + * @property {string|null} [languageCode] DetectedLanguage languageCode + * @property {number|null} [confidence] DetectedLanguage confidence + */ + + /** + * Constructs a new DetectedLanguage. + * @memberof google.cloud.documentai.v1.Document.Page + * @classdesc Represents a DetectedLanguage. + * @implements IDetectedLanguage + * @constructor + * @param {google.cloud.documentai.v1.Document.Page.IDetectedLanguage=} [properties] Properties to set + */ + function DetectedLanguage(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]]; + } + + /** + * DetectedLanguage languageCode. + * @member {string} languageCode + * @memberof google.cloud.documentai.v1.Document.Page.DetectedLanguage + * @instance + */ + DetectedLanguage.prototype.languageCode = ""; + + /** + * DetectedLanguage confidence. + * @member {number} confidence + * @memberof google.cloud.documentai.v1.Document.Page.DetectedLanguage + * @instance + */ + DetectedLanguage.prototype.confidence = 0; + + /** + * Creates a new DetectedLanguage instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.Page.DetectedLanguage + * @static + * @param {google.cloud.documentai.v1.Document.Page.IDetectedLanguage=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.Page.DetectedLanguage} DetectedLanguage instance + */ + DetectedLanguage.create = function create(properties) { + return new DetectedLanguage(properties); + }; + + /** + * Encodes the specified DetectedLanguage message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.DetectedLanguage.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.Page.DetectedLanguage + * @static + * @param {google.cloud.documentai.v1.Document.Page.IDetectedLanguage} message DetectedLanguage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectedLanguage.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.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified DetectedLanguage message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.DetectedLanguage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.Page.DetectedLanguage + * @static + * @param {google.cloud.documentai.v1.Document.Page.IDetectedLanguage} message DetectedLanguage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectedLanguage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DetectedLanguage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.Page.DetectedLanguage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.Page.DetectedLanguage} DetectedLanguage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectedLanguage.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.languageCode = reader.string(); + break; + } + case 2: { + message.confidence = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DetectedLanguage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.Page.DetectedLanguage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.Page.DetectedLanguage} DetectedLanguage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectedLanguage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DetectedLanguage message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.Page.DetectedLanguage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DetectedLanguage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a DetectedLanguage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.Page.DetectedLanguage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.Page.DetectedLanguage} DetectedLanguage + */ + DetectedLanguage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage) + return object; + var message = new $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage(); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a DetectedLanguage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.Page.DetectedLanguage + * @static + * @param {google.cloud.documentai.v1.Document.Page.DetectedLanguage} message DetectedLanguage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DetectedLanguage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.languageCode = ""; + object.confidence = 0; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this DetectedLanguage to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.Page.DetectedLanguage + * @instance + * @returns {Object.} JSON object + */ + DetectedLanguage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DetectedLanguage + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.Page.DetectedLanguage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DetectedLanguage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Page.DetectedLanguage"; + }; + + return DetectedLanguage; + })(); + + Page.ImageQualityScores = (function() { + + /** + * Properties of an ImageQualityScores. + * @memberof google.cloud.documentai.v1.Document.Page + * @interface IImageQualityScores + * @property {number|null} [qualityScore] ImageQualityScores qualityScore + * @property {Array.|null} [detectedDefects] ImageQualityScores detectedDefects + */ + + /** + * Constructs a new ImageQualityScores. + * @memberof google.cloud.documentai.v1.Document.Page + * @classdesc Represents an ImageQualityScores. + * @implements IImageQualityScores + * @constructor + * @param {google.cloud.documentai.v1.Document.Page.IImageQualityScores=} [properties] Properties to set + */ + function ImageQualityScores(properties) { + this.detectedDefects = []; + 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]]; + } + + /** + * ImageQualityScores qualityScore. + * @member {number} qualityScore + * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores + * @instance + */ + ImageQualityScores.prototype.qualityScore = 0; + + /** + * ImageQualityScores detectedDefects. + * @member {Array.} detectedDefects + * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores + * @instance + */ + ImageQualityScores.prototype.detectedDefects = $util.emptyArray; + + /** + * Creates a new ImageQualityScores instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores + * @static + * @param {google.cloud.documentai.v1.Document.Page.IImageQualityScores=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.Page.ImageQualityScores} ImageQualityScores instance + */ + ImageQualityScores.create = function create(properties) { + return new ImageQualityScores(properties); + }; + + /** + * Encodes the specified ImageQualityScores message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.ImageQualityScores.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores + * @static + * @param {google.cloud.documentai.v1.Document.Page.IImageQualityScores} message ImageQualityScores message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageQualityScores.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.qualityScore != null && Object.hasOwnProperty.call(message, "qualityScore")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.qualityScore); + if (message.detectedDefects != null && message.detectedDefects.length) + for (var i = 0; i < message.detectedDefects.length; ++i) + $root.google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect.encode(message.detectedDefects[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImageQualityScores message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.ImageQualityScores.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores + * @static + * @param {google.cloud.documentai.v1.Document.Page.IImageQualityScores} message ImageQualityScores message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageQualityScores.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageQualityScores message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.Page.ImageQualityScores} ImageQualityScores + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageQualityScores.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Page.ImageQualityScores(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.qualityScore = reader.float(); + break; + } + case 2: { + if (!(message.detectedDefects && message.detectedDefects.length)) + message.detectedDefects = []; + message.detectedDefects.push($root.google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageQualityScores message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.Page.ImageQualityScores} ImageQualityScores + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageQualityScores.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageQualityScores message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageQualityScores.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.qualityScore != null && message.hasOwnProperty("qualityScore")) + if (typeof message.qualityScore !== "number") + return "qualityScore: number expected"; + if (message.detectedDefects != null && message.hasOwnProperty("detectedDefects")) { + if (!Array.isArray(message.detectedDefects)) + return "detectedDefects: array expected"; + for (var i = 0; i < message.detectedDefects.length; ++i) { + var error = $root.google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect.verify(message.detectedDefects[i]); + if (error) + return "detectedDefects." + error; + } + } + return null; + }; + + /** + * Creates an ImageQualityScores message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.Page.ImageQualityScores} ImageQualityScores + */ + ImageQualityScores.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.Page.ImageQualityScores) + return object; + var message = new $root.google.cloud.documentai.v1.Document.Page.ImageQualityScores(); + if (object.qualityScore != null) + message.qualityScore = Number(object.qualityScore); + if (object.detectedDefects) { + if (!Array.isArray(object.detectedDefects)) + throw TypeError(".google.cloud.documentai.v1.Document.Page.ImageQualityScores.detectedDefects: array expected"); + message.detectedDefects = []; + for (var i = 0; i < object.detectedDefects.length; ++i) { + if (typeof object.detectedDefects[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.ImageQualityScores.detectedDefects: object expected"); + message.detectedDefects[i] = $root.google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect.fromObject(object.detectedDefects[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ImageQualityScores message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores + * @static + * @param {google.cloud.documentai.v1.Document.Page.ImageQualityScores} message ImageQualityScores + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageQualityScores.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.detectedDefects = []; + if (options.defaults) + object.qualityScore = 0; + if (message.qualityScore != null && message.hasOwnProperty("qualityScore")) + object.qualityScore = options.json && !isFinite(message.qualityScore) ? String(message.qualityScore) : message.qualityScore; + if (message.detectedDefects && message.detectedDefects.length) { + object.detectedDefects = []; + for (var j = 0; j < message.detectedDefects.length; ++j) + object.detectedDefects[j] = $root.google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect.toObject(message.detectedDefects[j], options); + } + return object; + }; + + /** + * Converts this ImageQualityScores to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores + * @instance + * @returns {Object.} JSON object + */ + ImageQualityScores.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImageQualityScores + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImageQualityScores.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Page.ImageQualityScores"; + }; + + ImageQualityScores.DetectedDefect = (function() { + + /** + * Properties of a DetectedDefect. + * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores + * @interface IDetectedDefect + * @property {string|null} [type] DetectedDefect type + * @property {number|null} [confidence] DetectedDefect confidence + */ + + /** + * Constructs a new DetectedDefect. + * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores + * @classdesc Represents a DetectedDefect. + * @implements IDetectedDefect + * @constructor + * @param {google.cloud.documentai.v1.Document.Page.ImageQualityScores.IDetectedDefect=} [properties] Properties to set + */ + function DetectedDefect(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]]; + } + + /** + * DetectedDefect type. + * @member {string} type + * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect + * @instance + */ + DetectedDefect.prototype.type = ""; + + /** + * DetectedDefect confidence. + * @member {number} confidence + * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect + * @instance + */ + DetectedDefect.prototype.confidence = 0; + + /** + * Creates a new DetectedDefect instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect + * @static + * @param {google.cloud.documentai.v1.Document.Page.ImageQualityScores.IDetectedDefect=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect} DetectedDefect instance + */ + DetectedDefect.create = function create(properties) { + return new DetectedDefect(properties); + }; + + /** + * Encodes the specified DetectedDefect message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect + * @static + * @param {google.cloud.documentai.v1.Document.Page.ImageQualityScores.IDetectedDefect} message DetectedDefect message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectedDefect.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.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified DetectedDefect message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect + * @static + * @param {google.cloud.documentai.v1.Document.Page.ImageQualityScores.IDetectedDefect} message DetectedDefect message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectedDefect.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DetectedDefect message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect} DetectedDefect + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectedDefect.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.confidence = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DetectedDefect message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect} DetectedDefect + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectedDefect.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DetectedDefect message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DetectedDefect.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.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a DetectedDefect message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect} DetectedDefect + */ + DetectedDefect.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect) + return object; + var message = new $root.google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect(); + if (object.type != null) + message.type = String(object.type); + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a DetectedDefect message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect + * @static + * @param {google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect} message DetectedDefect + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DetectedDefect.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.confidence = 0; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this DetectedDefect to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect + * @instance + * @returns {Object.} JSON object + */ + DetectedDefect.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DetectedDefect + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DetectedDefect.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect"; + }; + + return DetectedDefect; + })(); + + return ImageQualityScores; + })(); + + return Page; + })(); + + Document.Entity = (function() { + + /** + * Properties of an Entity. + * @memberof google.cloud.documentai.v1.Document + * @interface IEntity + * @property {google.cloud.documentai.v1.Document.ITextAnchor|null} [textAnchor] Entity textAnchor + * @property {string|null} [type] Entity type + * @property {string|null} [mentionText] Entity mentionText + * @property {string|null} [mentionId] Entity mentionId + * @property {number|null} [confidence] Entity confidence + * @property {google.cloud.documentai.v1.Document.IPageAnchor|null} [pageAnchor] Entity pageAnchor + * @property {string|null} [id] Entity id + * @property {google.cloud.documentai.v1.Document.Entity.INormalizedValue|null} [normalizedValue] Entity normalizedValue + * @property {Array.|null} [properties] Entity properties + * @property {google.cloud.documentai.v1.Document.IProvenance|null} [provenance] Entity provenance + * @property {boolean|null} [redacted] Entity redacted + * @property {google.cloud.documentai.v1.Document.Entity.Method|null} [method] Entity method + */ + + /** + * Constructs a new Entity. + * @memberof google.cloud.documentai.v1.Document + * @classdesc Represents an Entity. + * @implements IEntity + * @constructor + * @param {google.cloud.documentai.v1.Document.IEntity=} [properties] Properties to set + */ + function Entity(properties) { + this.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]]; + } + + /** + * Entity textAnchor. + * @member {google.cloud.documentai.v1.Document.ITextAnchor|null|undefined} textAnchor + * @memberof google.cloud.documentai.v1.Document.Entity + * @instance + */ + Entity.prototype.textAnchor = null; + + /** + * Entity type. + * @member {string} type + * @memberof google.cloud.documentai.v1.Document.Entity + * @instance + */ + Entity.prototype.type = ""; + + /** + * Entity mentionText. + * @member {string} mentionText + * @memberof google.cloud.documentai.v1.Document.Entity + * @instance + */ + Entity.prototype.mentionText = ""; + + /** + * Entity mentionId. + * @member {string} mentionId + * @memberof google.cloud.documentai.v1.Document.Entity + * @instance + */ + Entity.prototype.mentionId = ""; + + /** + * Entity confidence. + * @member {number} confidence + * @memberof google.cloud.documentai.v1.Document.Entity + * @instance + */ + Entity.prototype.confidence = 0; + + /** + * Entity pageAnchor. + * @member {google.cloud.documentai.v1.Document.IPageAnchor|null|undefined} pageAnchor + * @memberof google.cloud.documentai.v1.Document.Entity + * @instance + */ + Entity.prototype.pageAnchor = null; + + /** + * Entity id. + * @member {string} id + * @memberof google.cloud.documentai.v1.Document.Entity + * @instance + */ + Entity.prototype.id = ""; + + /** + * Entity normalizedValue. + * @member {google.cloud.documentai.v1.Document.Entity.INormalizedValue|null|undefined} normalizedValue + * @memberof google.cloud.documentai.v1.Document.Entity + * @instance + */ + Entity.prototype.normalizedValue = null; + + /** + * Entity properties. + * @member {Array.} properties + * @memberof google.cloud.documentai.v1.Document.Entity + * @instance + */ + Entity.prototype.properties = $util.emptyArray; + + /** + * Entity provenance. + * @member {google.cloud.documentai.v1.Document.IProvenance|null|undefined} provenance + * @memberof google.cloud.documentai.v1.Document.Entity + * @instance + */ + Entity.prototype.provenance = null; + + /** + * Entity redacted. + * @member {boolean} redacted + * @memberof google.cloud.documentai.v1.Document.Entity + * @instance + */ + Entity.prototype.redacted = false; + + /** + * Entity method. + * @member {google.cloud.documentai.v1.Document.Entity.Method} method + * @memberof google.cloud.documentai.v1.Document.Entity + * @instance + */ + Entity.prototype.method = 0; + + /** + * Creates a new Entity instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.Entity + * @static + * @param {google.cloud.documentai.v1.Document.IEntity=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.Entity} Entity instance + */ + Entity.create = function create(properties) { + return new Entity(properties); + }; + + /** + * Encodes the specified Entity message. Does not implicitly {@link google.cloud.documentai.v1.Document.Entity.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.Entity + * @static + * @param {google.cloud.documentai.v1.Document.IEntity} message Entity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.textAnchor != null && Object.hasOwnProperty.call(message, "textAnchor")) + $root.google.cloud.documentai.v1.Document.TextAnchor.encode(message.textAnchor, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); + if (message.mentionText != null && Object.hasOwnProperty.call(message, "mentionText")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.mentionText); + if (message.mentionId != null && Object.hasOwnProperty.call(message, "mentionId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.mentionId); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.confidence); + if (message.pageAnchor != null && Object.hasOwnProperty.call(message, "pageAnchor")) + $root.google.cloud.documentai.v1.Document.PageAnchor.encode(message.pageAnchor, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.id); + if (message.normalizedValue != null && Object.hasOwnProperty.call(message, "normalizedValue")) + $root.google.cloud.documentai.v1.Document.Entity.NormalizedValue.encode(message.normalizedValue, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.properties != null && message.properties.length) + for (var i = 0; i < message.properties.length; ++i) + $root.google.cloud.documentai.v1.Document.Entity.encode(message.properties[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.provenance != null && Object.hasOwnProperty.call(message, "provenance")) + $root.google.cloud.documentai.v1.Document.Provenance.encode(message.provenance, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.redacted != null && Object.hasOwnProperty.call(message, "redacted")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.redacted); + if (message.method != null && Object.hasOwnProperty.call(message, "method")) + writer.uint32(/* id 15, wireType 0 =*/120).int32(message.method); + return writer; + }; + + /** + * Encodes the specified Entity message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Entity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.Entity + * @static + * @param {google.cloud.documentai.v1.Document.IEntity} message Entity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Entity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.Entity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.Entity} Entity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entity.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Entity(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.textAnchor = $root.google.cloud.documentai.v1.Document.TextAnchor.decode(reader, reader.uint32()); + break; + } + case 2: { + message.type = reader.string(); + break; + } + case 3: { + message.mentionText = reader.string(); + break; + } + case 4: { + message.mentionId = reader.string(); + break; + } + case 5: { + message.confidence = reader.float(); + break; + } + case 6: { + message.pageAnchor = $root.google.cloud.documentai.v1.Document.PageAnchor.decode(reader, reader.uint32()); + break; + } + case 7: { + message.id = reader.string(); + break; + } + case 9: { + message.normalizedValue = $root.google.cloud.documentai.v1.Document.Entity.NormalizedValue.decode(reader, reader.uint32()); + break; + } + case 10: { + if (!(message.properties && message.properties.length)) + message.properties = []; + message.properties.push($root.google.cloud.documentai.v1.Document.Entity.decode(reader, reader.uint32())); + break; + } + case 11: { + message.provenance = $root.google.cloud.documentai.v1.Document.Provenance.decode(reader, reader.uint32()); + break; + } + case 12: { + message.redacted = reader.bool(); + break; + } + case 15: { + message.method = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Entity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.Entity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.Entity} Entity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Entity message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.Entity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Entity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.textAnchor != null && message.hasOwnProperty("textAnchor")) { + var error = $root.google.cloud.documentai.v1.Document.TextAnchor.verify(message.textAnchor); + if (error) + return "textAnchor." + error; + } + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.mentionText != null && message.hasOwnProperty("mentionText")) + if (!$util.isString(message.mentionText)) + return "mentionText: string expected"; + if (message.mentionId != null && message.hasOwnProperty("mentionId")) + if (!$util.isString(message.mentionId)) + return "mentionId: string expected"; + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + if (message.pageAnchor != null && message.hasOwnProperty("pageAnchor")) { + var error = $root.google.cloud.documentai.v1.Document.PageAnchor.verify(message.pageAnchor); + if (error) + return "pageAnchor." + error; + } + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.normalizedValue != null && message.hasOwnProperty("normalizedValue")) { + var error = $root.google.cloud.documentai.v1.Document.Entity.NormalizedValue.verify(message.normalizedValue); + if (error) + return "normalizedValue." + error; + } + if (message.properties != null && message.hasOwnProperty("properties")) { + if (!Array.isArray(message.properties)) + return "properties: array expected"; + for (var i = 0; i < message.properties.length; ++i) { + var error = $root.google.cloud.documentai.v1.Document.Entity.verify(message.properties[i]); + if (error) + return "properties." + error; + } + } + if (message.provenance != null && message.hasOwnProperty("provenance")) { + var error = $root.google.cloud.documentai.v1.Document.Provenance.verify(message.provenance); + if (error) + return "provenance." + error; + } + if (message.redacted != null && message.hasOwnProperty("redacted")) + if (typeof message.redacted !== "boolean") + return "redacted: boolean expected"; + if (message.method != null && message.hasOwnProperty("method")) + switch (message.method) { + default: + return "method: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Entity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.Entity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.Entity} Entity + */ + Entity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.Entity) + return object; + var message = new $root.google.cloud.documentai.v1.Document.Entity(); + if (object.textAnchor != null) { + if (typeof object.textAnchor !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Entity.textAnchor: object expected"); + message.textAnchor = $root.google.cloud.documentai.v1.Document.TextAnchor.fromObject(object.textAnchor); + } + if (object.type != null) + message.type = String(object.type); + if (object.mentionText != null) + message.mentionText = String(object.mentionText); + if (object.mentionId != null) + message.mentionId = String(object.mentionId); + if (object.confidence != null) + message.confidence = Number(object.confidence); + if (object.pageAnchor != null) { + if (typeof object.pageAnchor !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Entity.pageAnchor: object expected"); + message.pageAnchor = $root.google.cloud.documentai.v1.Document.PageAnchor.fromObject(object.pageAnchor); + } + if (object.id != null) + message.id = String(object.id); + if (object.normalizedValue != null) { + if (typeof object.normalizedValue !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Entity.normalizedValue: object expected"); + message.normalizedValue = $root.google.cloud.documentai.v1.Document.Entity.NormalizedValue.fromObject(object.normalizedValue); + } + if (object.properties) { + if (!Array.isArray(object.properties)) + throw TypeError(".google.cloud.documentai.v1.Document.Entity.properties: array expected"); + message.properties = []; + for (var i = 0; i < object.properties.length; ++i) { + if (typeof object.properties[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Entity.properties: object expected"); + message.properties[i] = $root.google.cloud.documentai.v1.Document.Entity.fromObject(object.properties[i]); + } + } + if (object.provenance != null) { + if (typeof object.provenance !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Entity.provenance: object expected"); + message.provenance = $root.google.cloud.documentai.v1.Document.Provenance.fromObject(object.provenance); + } + if (object.redacted != null) + message.redacted = Boolean(object.redacted); + switch (object.method) { + default: + if (typeof object.method === "number") { + message.method = object.method; + break; + } + break; + case "METHOD_UNSPECIFIED": + case 0: + message.method = 0; + break; + case "EXTRACT": + case 1: + message.method = 1; + break; + case "DERIVE": + case 2: + message.method = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Entity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.Entity + * @static + * @param {google.cloud.documentai.v1.Document.Entity} message Entity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Entity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.properties = []; + if (options.defaults) { + object.textAnchor = null; + object.type = ""; + object.mentionText = ""; + object.mentionId = ""; + object.confidence = 0; + object.pageAnchor = null; + object.id = ""; + object.normalizedValue = null; + object.provenance = null; + object.redacted = false; + object.method = options.enums === String ? "METHOD_UNSPECIFIED" : 0; + } + if (message.textAnchor != null && message.hasOwnProperty("textAnchor")) + object.textAnchor = $root.google.cloud.documentai.v1.Document.TextAnchor.toObject(message.textAnchor, options); + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.mentionText != null && message.hasOwnProperty("mentionText")) + object.mentionText = message.mentionText; + if (message.mentionId != null && message.hasOwnProperty("mentionId")) + object.mentionId = message.mentionId; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + if (message.pageAnchor != null && message.hasOwnProperty("pageAnchor")) + object.pageAnchor = $root.google.cloud.documentai.v1.Document.PageAnchor.toObject(message.pageAnchor, options); + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.normalizedValue != null && message.hasOwnProperty("normalizedValue")) + object.normalizedValue = $root.google.cloud.documentai.v1.Document.Entity.NormalizedValue.toObject(message.normalizedValue, options); + if (message.properties && message.properties.length) { + object.properties = []; + for (var j = 0; j < message.properties.length; ++j) + object.properties[j] = $root.google.cloud.documentai.v1.Document.Entity.toObject(message.properties[j], options); + } + if (message.provenance != null && message.hasOwnProperty("provenance")) + object.provenance = $root.google.cloud.documentai.v1.Document.Provenance.toObject(message.provenance, options); + if (message.redacted != null && message.hasOwnProperty("redacted")) + object.redacted = message.redacted; + if (message.method != null && message.hasOwnProperty("method")) + object.method = options.enums === String ? $root.google.cloud.documentai.v1.Document.Entity.Method[message.method] === undefined ? message.method : $root.google.cloud.documentai.v1.Document.Entity.Method[message.method] : message.method; + return object; + }; + + /** + * Converts this Entity to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.Entity + * @instance + * @returns {Object.} JSON object + */ + Entity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Entity + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.Entity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Entity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Entity"; + }; + + Entity.NormalizedValue = (function() { + + /** + * Properties of a NormalizedValue. + * @memberof google.cloud.documentai.v1.Document.Entity + * @interface INormalizedValue + * @property {google.type.IMoney|null} [moneyValue] NormalizedValue moneyValue + * @property {google.type.IDate|null} [dateValue] NormalizedValue dateValue + * @property {google.type.IDateTime|null} [datetimeValue] NormalizedValue datetimeValue + * @property {google.type.IPostalAddress|null} [addressValue] NormalizedValue addressValue + * @property {boolean|null} [booleanValue] NormalizedValue booleanValue + * @property {number|null} [integerValue] NormalizedValue integerValue + * @property {number|null} [floatValue] NormalizedValue floatValue + * @property {boolean|null} [signatureValue] NormalizedValue signatureValue + * @property {string|null} [text] NormalizedValue text + */ + + /** + * Constructs a new NormalizedValue. + * @memberof google.cloud.documentai.v1.Document.Entity + * @classdesc Represents a NormalizedValue. + * @implements INormalizedValue + * @constructor + * @param {google.cloud.documentai.v1.Document.Entity.INormalizedValue=} [properties] Properties to set + */ + function NormalizedValue(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]]; + } + + /** + * NormalizedValue moneyValue. + * @member {google.type.IMoney|null|undefined} moneyValue + * @memberof google.cloud.documentai.v1.Document.Entity.NormalizedValue + * @instance + */ + NormalizedValue.prototype.moneyValue = null; + + /** + * NormalizedValue dateValue. + * @member {google.type.IDate|null|undefined} dateValue + * @memberof google.cloud.documentai.v1.Document.Entity.NormalizedValue + * @instance + */ + NormalizedValue.prototype.dateValue = null; + + /** + * NormalizedValue datetimeValue. + * @member {google.type.IDateTime|null|undefined} datetimeValue + * @memberof google.cloud.documentai.v1.Document.Entity.NormalizedValue + * @instance + */ + NormalizedValue.prototype.datetimeValue = null; + + /** + * NormalizedValue addressValue. + * @member {google.type.IPostalAddress|null|undefined} addressValue + * @memberof google.cloud.documentai.v1.Document.Entity.NormalizedValue + * @instance + */ + NormalizedValue.prototype.addressValue = null; + + /** + * NormalizedValue booleanValue. + * @member {boolean|null|undefined} booleanValue + * @memberof google.cloud.documentai.v1.Document.Entity.NormalizedValue + * @instance + */ + NormalizedValue.prototype.booleanValue = null; + + /** + * NormalizedValue integerValue. + * @member {number|null|undefined} integerValue + * @memberof google.cloud.documentai.v1.Document.Entity.NormalizedValue + * @instance + */ + NormalizedValue.prototype.integerValue = null; + + /** + * NormalizedValue floatValue. + * @member {number|null|undefined} floatValue + * @memberof google.cloud.documentai.v1.Document.Entity.NormalizedValue + * @instance + */ + NormalizedValue.prototype.floatValue = null; + + /** + * NormalizedValue signatureValue. + * @member {boolean|null|undefined} signatureValue + * @memberof google.cloud.documentai.v1.Document.Entity.NormalizedValue + * @instance + */ + NormalizedValue.prototype.signatureValue = null; + + /** + * NormalizedValue text. + * @member {string} text + * @memberof google.cloud.documentai.v1.Document.Entity.NormalizedValue + * @instance + */ + NormalizedValue.prototype.text = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NormalizedValue structuredValue. + * @member {"moneyValue"|"dateValue"|"datetimeValue"|"addressValue"|"booleanValue"|"integerValue"|"floatValue"|"signatureValue"|undefined} structuredValue + * @memberof google.cloud.documentai.v1.Document.Entity.NormalizedValue + * @instance + */ + Object.defineProperty(NormalizedValue.prototype, "structuredValue", { + get: $util.oneOfGetter($oneOfFields = ["moneyValue", "dateValue", "datetimeValue", "addressValue", "booleanValue", "integerValue", "floatValue", "signatureValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NormalizedValue instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.Entity.NormalizedValue + * @static + * @param {google.cloud.documentai.v1.Document.Entity.INormalizedValue=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.Entity.NormalizedValue} NormalizedValue instance + */ + NormalizedValue.create = function create(properties) { + return new NormalizedValue(properties); + }; + + /** + * Encodes the specified NormalizedValue message. Does not implicitly {@link google.cloud.documentai.v1.Document.Entity.NormalizedValue.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.Entity.NormalizedValue + * @static + * @param {google.cloud.documentai.v1.Document.Entity.INormalizedValue} message NormalizedValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NormalizedValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.moneyValue != null && Object.hasOwnProperty.call(message, "moneyValue")) + $root.google.type.Money.encode(message.moneyValue, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.dateValue != null && Object.hasOwnProperty.call(message, "dateValue")) + $root.google.type.Date.encode(message.dateValue, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.datetimeValue != null && Object.hasOwnProperty.call(message, "datetimeValue")) + $root.google.type.DateTime.encode(message.datetimeValue, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.addressValue != null && Object.hasOwnProperty.call(message, "addressValue")) + $root.google.type.PostalAddress.encode(message.addressValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.booleanValue != null && Object.hasOwnProperty.call(message, "booleanValue")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.booleanValue); + if (message.integerValue != null && Object.hasOwnProperty.call(message, "integerValue")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.integerValue); + if (message.floatValue != null && Object.hasOwnProperty.call(message, "floatValue")) + writer.uint32(/* id 8, wireType 5 =*/69).float(message.floatValue); + if (message.signatureValue != null && Object.hasOwnProperty.call(message, "signatureValue")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.signatureValue); + return writer; + }; + + /** + * Encodes the specified NormalizedValue message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Entity.NormalizedValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.Entity.NormalizedValue + * @static + * @param {google.cloud.documentai.v1.Document.Entity.INormalizedValue} message NormalizedValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NormalizedValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NormalizedValue message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.Entity.NormalizedValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.Entity.NormalizedValue} NormalizedValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NormalizedValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Entity.NormalizedValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.moneyValue = $root.google.type.Money.decode(reader, reader.uint32()); + break; + } + case 3: { + message.dateValue = $root.google.type.Date.decode(reader, reader.uint32()); + break; + } + case 4: { + message.datetimeValue = $root.google.type.DateTime.decode(reader, reader.uint32()); + break; + } + case 5: { + message.addressValue = $root.google.type.PostalAddress.decode(reader, reader.uint32()); + break; + } + case 6: { + message.booleanValue = reader.bool(); + break; + } + case 7: { + message.integerValue = reader.int32(); + break; + } + case 8: { + message.floatValue = reader.float(); + break; + } + case 10: { + message.signatureValue = reader.bool(); + break; + } + case 1: { + message.text = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NormalizedValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.Entity.NormalizedValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.Entity.NormalizedValue} NormalizedValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NormalizedValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NormalizedValue message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.Entity.NormalizedValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NormalizedValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.moneyValue != null && message.hasOwnProperty("moneyValue")) { + properties.structuredValue = 1; + { + var error = $root.google.type.Money.verify(message.moneyValue); + if (error) + return "moneyValue." + error; + } + } + if (message.dateValue != null && message.hasOwnProperty("dateValue")) { + if (properties.structuredValue === 1) + return "structuredValue: multiple values"; + properties.structuredValue = 1; + { + var error = $root.google.type.Date.verify(message.dateValue); + if (error) + return "dateValue." + error; + } + } + if (message.datetimeValue != null && message.hasOwnProperty("datetimeValue")) { + if (properties.structuredValue === 1) + return "structuredValue: multiple values"; + properties.structuredValue = 1; + { + var error = $root.google.type.DateTime.verify(message.datetimeValue); + if (error) + return "datetimeValue." + error; + } + } + if (message.addressValue != null && message.hasOwnProperty("addressValue")) { + if (properties.structuredValue === 1) + return "structuredValue: multiple values"; + properties.structuredValue = 1; + { + var error = $root.google.type.PostalAddress.verify(message.addressValue); + if (error) + return "addressValue." + error; + } + } + if (message.booleanValue != null && message.hasOwnProperty("booleanValue")) { + if (properties.structuredValue === 1) + return "structuredValue: multiple values"; + properties.structuredValue = 1; + if (typeof message.booleanValue !== "boolean") + return "booleanValue: boolean expected"; + } + if (message.integerValue != null && message.hasOwnProperty("integerValue")) { + if (properties.structuredValue === 1) + return "structuredValue: multiple values"; + properties.structuredValue = 1; + if (!$util.isInteger(message.integerValue)) + return "integerValue: integer expected"; + } + if (message.floatValue != null && message.hasOwnProperty("floatValue")) { + if (properties.structuredValue === 1) + return "structuredValue: multiple values"; + properties.structuredValue = 1; + if (typeof message.floatValue !== "number") + return "floatValue: number expected"; + } + if (message.signatureValue != null && message.hasOwnProperty("signatureValue")) { + if (properties.structuredValue === 1) + return "structuredValue: multiple values"; + properties.structuredValue = 1; + if (typeof message.signatureValue !== "boolean") + return "signatureValue: boolean expected"; + } + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + return null; + }; + + /** + * Creates a NormalizedValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.Entity.NormalizedValue + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.Entity.NormalizedValue} NormalizedValue + */ + NormalizedValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.Entity.NormalizedValue) + return object; + var message = new $root.google.cloud.documentai.v1.Document.Entity.NormalizedValue(); + if (object.moneyValue != null) { + if (typeof object.moneyValue !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Entity.NormalizedValue.moneyValue: object expected"); + message.moneyValue = $root.google.type.Money.fromObject(object.moneyValue); + } + if (object.dateValue != null) { + if (typeof object.dateValue !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Entity.NormalizedValue.dateValue: object expected"); + message.dateValue = $root.google.type.Date.fromObject(object.dateValue); + } + if (object.datetimeValue != null) { + if (typeof object.datetimeValue !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Entity.NormalizedValue.datetimeValue: object expected"); + message.datetimeValue = $root.google.type.DateTime.fromObject(object.datetimeValue); + } + if (object.addressValue != null) { + if (typeof object.addressValue !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Entity.NormalizedValue.addressValue: object expected"); + message.addressValue = $root.google.type.PostalAddress.fromObject(object.addressValue); + } + if (object.booleanValue != null) + message.booleanValue = Boolean(object.booleanValue); + if (object.integerValue != null) + message.integerValue = object.integerValue | 0; + if (object.floatValue != null) + message.floatValue = Number(object.floatValue); + if (object.signatureValue != null) + message.signatureValue = Boolean(object.signatureValue); + if (object.text != null) + message.text = String(object.text); + return message; + }; + + /** + * Creates a plain object from a NormalizedValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.Entity.NormalizedValue + * @static + * @param {google.cloud.documentai.v1.Document.Entity.NormalizedValue} message NormalizedValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NormalizedValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.text = ""; + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.moneyValue != null && message.hasOwnProperty("moneyValue")) { + object.moneyValue = $root.google.type.Money.toObject(message.moneyValue, options); + if (options.oneofs) + object.structuredValue = "moneyValue"; + } + if (message.dateValue != null && message.hasOwnProperty("dateValue")) { + object.dateValue = $root.google.type.Date.toObject(message.dateValue, options); + if (options.oneofs) + object.structuredValue = "dateValue"; + } + if (message.datetimeValue != null && message.hasOwnProperty("datetimeValue")) { + object.datetimeValue = $root.google.type.DateTime.toObject(message.datetimeValue, options); + if (options.oneofs) + object.structuredValue = "datetimeValue"; + } + if (message.addressValue != null && message.hasOwnProperty("addressValue")) { + object.addressValue = $root.google.type.PostalAddress.toObject(message.addressValue, options); + if (options.oneofs) + object.structuredValue = "addressValue"; + } + if (message.booleanValue != null && message.hasOwnProperty("booleanValue")) { + object.booleanValue = message.booleanValue; + if (options.oneofs) + object.structuredValue = "booleanValue"; + } + if (message.integerValue != null && message.hasOwnProperty("integerValue")) { + object.integerValue = message.integerValue; + if (options.oneofs) + object.structuredValue = "integerValue"; + } + if (message.floatValue != null && message.hasOwnProperty("floatValue")) { + object.floatValue = options.json && !isFinite(message.floatValue) ? String(message.floatValue) : message.floatValue; + if (options.oneofs) + object.structuredValue = "floatValue"; + } + if (message.signatureValue != null && message.hasOwnProperty("signatureValue")) { + object.signatureValue = message.signatureValue; + if (options.oneofs) + object.structuredValue = "signatureValue"; + } + return object; + }; + + /** + * Converts this NormalizedValue to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.Entity.NormalizedValue + * @instance + * @returns {Object.} JSON object + */ + NormalizedValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NormalizedValue + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.Entity.NormalizedValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NormalizedValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Entity.NormalizedValue"; + }; + + return NormalizedValue; + })(); + + /** + * Method enum. + * @name google.cloud.documentai.v1.Document.Entity.Method + * @enum {number} + * @property {number} METHOD_UNSPECIFIED=0 METHOD_UNSPECIFIED value + * @property {number} EXTRACT=1 EXTRACT value + * @property {number} DERIVE=2 DERIVE value + */ + Entity.Method = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "METHOD_UNSPECIFIED"] = 0; + values[valuesById[1] = "EXTRACT"] = 1; + values[valuesById[2] = "DERIVE"] = 2; + return values; + })(); + + return Entity; + })(); + + Document.EntityRelation = (function() { + + /** + * Properties of an EntityRelation. + * @memberof google.cloud.documentai.v1.Document + * @interface IEntityRelation + * @property {string|null} [subjectId] EntityRelation subjectId + * @property {string|null} [objectId] EntityRelation objectId + * @property {string|null} [relation] EntityRelation relation + */ + + /** + * Constructs a new EntityRelation. + * @memberof google.cloud.documentai.v1.Document + * @classdesc Represents an EntityRelation. + * @implements IEntityRelation + * @constructor + * @param {google.cloud.documentai.v1.Document.IEntityRelation=} [properties] Properties to set + */ + function EntityRelation(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]]; + } + + /** + * EntityRelation subjectId. + * @member {string} subjectId + * @memberof google.cloud.documentai.v1.Document.EntityRelation + * @instance + */ + EntityRelation.prototype.subjectId = ""; + + /** + * EntityRelation objectId. + * @member {string} objectId + * @memberof google.cloud.documentai.v1.Document.EntityRelation + * @instance + */ + EntityRelation.prototype.objectId = ""; + + /** + * EntityRelation relation. + * @member {string} relation + * @memberof google.cloud.documentai.v1.Document.EntityRelation + * @instance + */ + EntityRelation.prototype.relation = ""; + + /** + * Creates a new EntityRelation instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.EntityRelation + * @static + * @param {google.cloud.documentai.v1.Document.IEntityRelation=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.EntityRelation} EntityRelation instance + */ + EntityRelation.create = function create(properties) { + return new EntityRelation(properties); + }; + + /** + * Encodes the specified EntityRelation message. Does not implicitly {@link google.cloud.documentai.v1.Document.EntityRelation.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.EntityRelation + * @static + * @param {google.cloud.documentai.v1.Document.IEntityRelation} message EntityRelation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityRelation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subjectId != null && Object.hasOwnProperty.call(message, "subjectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.subjectId); + if (message.objectId != null && Object.hasOwnProperty.call(message, "objectId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.objectId); + if (message.relation != null && Object.hasOwnProperty.call(message, "relation")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.relation); + return writer; + }; + + /** + * Encodes the specified EntityRelation message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.EntityRelation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.EntityRelation + * @static + * @param {google.cloud.documentai.v1.Document.IEntityRelation} message EntityRelation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityRelation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EntityRelation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.EntityRelation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.EntityRelation} EntityRelation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityRelation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.EntityRelation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.subjectId = reader.string(); + break; + } + case 2: { + message.objectId = reader.string(); + break; + } + case 3: { + message.relation = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EntityRelation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.EntityRelation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.EntityRelation} EntityRelation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityRelation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EntityRelation message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.EntityRelation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EntityRelation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subjectId != null && message.hasOwnProperty("subjectId")) + if (!$util.isString(message.subjectId)) + return "subjectId: string expected"; + if (message.objectId != null && message.hasOwnProperty("objectId")) + if (!$util.isString(message.objectId)) + return "objectId: string expected"; + if (message.relation != null && message.hasOwnProperty("relation")) + if (!$util.isString(message.relation)) + return "relation: string expected"; + return null; + }; + + /** + * Creates an EntityRelation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.EntityRelation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.EntityRelation} EntityRelation + */ + EntityRelation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.EntityRelation) + return object; + var message = new $root.google.cloud.documentai.v1.Document.EntityRelation(); + if (object.subjectId != null) + message.subjectId = String(object.subjectId); + if (object.objectId != null) + message.objectId = String(object.objectId); + if (object.relation != null) + message.relation = String(object.relation); + return message; + }; + + /** + * Creates a plain object from an EntityRelation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.EntityRelation + * @static + * @param {google.cloud.documentai.v1.Document.EntityRelation} message EntityRelation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EntityRelation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.subjectId = ""; + object.objectId = ""; + object.relation = ""; + } + if (message.subjectId != null && message.hasOwnProperty("subjectId")) + object.subjectId = message.subjectId; + if (message.objectId != null && message.hasOwnProperty("objectId")) + object.objectId = message.objectId; + if (message.relation != null && message.hasOwnProperty("relation")) + object.relation = message.relation; + return object; + }; + + /** + * Converts this EntityRelation to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.EntityRelation + * @instance + * @returns {Object.} JSON object + */ + EntityRelation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EntityRelation + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.EntityRelation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EntityRelation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.EntityRelation"; + }; + + return EntityRelation; + })(); + + Document.TextAnchor = (function() { + + /** + * Properties of a TextAnchor. + * @memberof google.cloud.documentai.v1.Document + * @interface ITextAnchor + * @property {Array.|null} [textSegments] TextAnchor textSegments + * @property {string|null} [content] TextAnchor content + */ + + /** + * Constructs a new TextAnchor. + * @memberof google.cloud.documentai.v1.Document + * @classdesc Represents a TextAnchor. + * @implements ITextAnchor + * @constructor + * @param {google.cloud.documentai.v1.Document.ITextAnchor=} [properties] Properties to set + */ + function TextAnchor(properties) { + this.textSegments = []; + 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]]; + } + + /** + * TextAnchor textSegments. + * @member {Array.} textSegments + * @memberof google.cloud.documentai.v1.Document.TextAnchor + * @instance + */ + TextAnchor.prototype.textSegments = $util.emptyArray; + + /** + * TextAnchor content. + * @member {string} content + * @memberof google.cloud.documentai.v1.Document.TextAnchor + * @instance + */ + TextAnchor.prototype.content = ""; + + /** + * Creates a new TextAnchor instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.TextAnchor + * @static + * @param {google.cloud.documentai.v1.Document.ITextAnchor=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.TextAnchor} TextAnchor instance + */ + TextAnchor.create = function create(properties) { + return new TextAnchor(properties); + }; + + /** + * Encodes the specified TextAnchor message. Does not implicitly {@link google.cloud.documentai.v1.Document.TextAnchor.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.TextAnchor + * @static + * @param {google.cloud.documentai.v1.Document.ITextAnchor} message TextAnchor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextAnchor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.textSegments != null && message.textSegments.length) + for (var i = 0; i < message.textSegments.length; ++i) + $root.google.cloud.documentai.v1.Document.TextAnchor.TextSegment.encode(message.textSegments[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.content); + return writer; + }; + + /** + * Encodes the specified TextAnchor message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.TextAnchor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.TextAnchor + * @static + * @param {google.cloud.documentai.v1.Document.ITextAnchor} message TextAnchor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextAnchor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextAnchor message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.TextAnchor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.TextAnchor} TextAnchor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextAnchor.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.TextAnchor(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.textSegments && message.textSegments.length)) + message.textSegments = []; + message.textSegments.push($root.google.cloud.documentai.v1.Document.TextAnchor.TextSegment.decode(reader, reader.uint32())); + break; + } + case 2: { + message.content = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextAnchor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.TextAnchor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.TextAnchor} TextAnchor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextAnchor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextAnchor message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.TextAnchor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextAnchor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.textSegments != null && message.hasOwnProperty("textSegments")) { + if (!Array.isArray(message.textSegments)) + return "textSegments: array expected"; + for (var i = 0; i < message.textSegments.length; ++i) { + var error = $root.google.cloud.documentai.v1.Document.TextAnchor.TextSegment.verify(message.textSegments[i]); + if (error) + return "textSegments." + error; + } + } + if (message.content != null && message.hasOwnProperty("content")) + if (!$util.isString(message.content)) + return "content: string expected"; + return null; + }; + + /** + * Creates a TextAnchor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.TextAnchor + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.TextAnchor} TextAnchor + */ + TextAnchor.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.TextAnchor) + return object; + var message = new $root.google.cloud.documentai.v1.Document.TextAnchor(); + if (object.textSegments) { + if (!Array.isArray(object.textSegments)) + throw TypeError(".google.cloud.documentai.v1.Document.TextAnchor.textSegments: array expected"); + message.textSegments = []; + for (var i = 0; i < object.textSegments.length; ++i) { + if (typeof object.textSegments[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.TextAnchor.textSegments: object expected"); + message.textSegments[i] = $root.google.cloud.documentai.v1.Document.TextAnchor.TextSegment.fromObject(object.textSegments[i]); + } + } + if (object.content != null) + message.content = String(object.content); + return message; + }; + + /** + * Creates a plain object from a TextAnchor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.TextAnchor + * @static + * @param {google.cloud.documentai.v1.Document.TextAnchor} message TextAnchor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextAnchor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.textSegments = []; + if (options.defaults) + object.content = ""; + if (message.textSegments && message.textSegments.length) { + object.textSegments = []; + for (var j = 0; j < message.textSegments.length; ++j) + object.textSegments[j] = $root.google.cloud.documentai.v1.Document.TextAnchor.TextSegment.toObject(message.textSegments[j], options); + } + if (message.content != null && message.hasOwnProperty("content")) + object.content = message.content; + return object; + }; + + /** + * Converts this TextAnchor to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.TextAnchor + * @instance + * @returns {Object.} JSON object + */ + TextAnchor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextAnchor + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.TextAnchor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextAnchor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.TextAnchor"; + }; + + TextAnchor.TextSegment = (function() { + + /** + * Properties of a TextSegment. + * @memberof google.cloud.documentai.v1.Document.TextAnchor + * @interface ITextSegment + * @property {number|Long|null} [startIndex] TextSegment startIndex + * @property {number|Long|null} [endIndex] TextSegment endIndex + */ + + /** + * Constructs a new TextSegment. + * @memberof google.cloud.documentai.v1.Document.TextAnchor + * @classdesc Represents a TextSegment. + * @implements ITextSegment + * @constructor + * @param {google.cloud.documentai.v1.Document.TextAnchor.ITextSegment=} [properties] Properties to set + */ + function TextSegment(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]]; + } + + /** + * TextSegment startIndex. + * @member {number|Long} startIndex + * @memberof google.cloud.documentai.v1.Document.TextAnchor.TextSegment + * @instance + */ + TextSegment.prototype.startIndex = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TextSegment endIndex. + * @member {number|Long} endIndex + * @memberof google.cloud.documentai.v1.Document.TextAnchor.TextSegment + * @instance + */ + TextSegment.prototype.endIndex = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TextSegment instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.TextAnchor.TextSegment + * @static + * @param {google.cloud.documentai.v1.Document.TextAnchor.ITextSegment=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.TextAnchor.TextSegment} TextSegment instance + */ + TextSegment.create = function create(properties) { + return new TextSegment(properties); + }; + + /** + * Encodes the specified TextSegment message. Does not implicitly {@link google.cloud.documentai.v1.Document.TextAnchor.TextSegment.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.TextAnchor.TextSegment + * @static + * @param {google.cloud.documentai.v1.Document.TextAnchor.ITextSegment} message TextSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSegment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startIndex != null && Object.hasOwnProperty.call(message, "startIndex")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.startIndex); + if (message.endIndex != null && Object.hasOwnProperty.call(message, "endIndex")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.endIndex); + return writer; + }; + + /** + * Encodes the specified TextSegment message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.TextAnchor.TextSegment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.TextAnchor.TextSegment + * @static + * @param {google.cloud.documentai.v1.Document.TextAnchor.ITextSegment} message TextSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSegment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextSegment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.TextAnchor.TextSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.TextAnchor.TextSegment} TextSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSegment.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.TextAnchor.TextSegment(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.startIndex = reader.int64(); + break; + } + case 2: { + message.endIndex = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextSegment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.TextAnchor.TextSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.TextAnchor.TextSegment} TextSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSegment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextSegment message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.TextAnchor.TextSegment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextSegment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startIndex != null && message.hasOwnProperty("startIndex")) + if (!$util.isInteger(message.startIndex) && !(message.startIndex && $util.isInteger(message.startIndex.low) && $util.isInteger(message.startIndex.high))) + return "startIndex: integer|Long expected"; + if (message.endIndex != null && message.hasOwnProperty("endIndex")) + if (!$util.isInteger(message.endIndex) && !(message.endIndex && $util.isInteger(message.endIndex.low) && $util.isInteger(message.endIndex.high))) + return "endIndex: integer|Long expected"; + return null; + }; + + /** + * Creates a TextSegment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.TextAnchor.TextSegment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.TextAnchor.TextSegment} TextSegment + */ + TextSegment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.TextAnchor.TextSegment) + return object; + var message = new $root.google.cloud.documentai.v1.Document.TextAnchor.TextSegment(); + if (object.startIndex != null) + if ($util.Long) + (message.startIndex = $util.Long.fromValue(object.startIndex)).unsigned = false; + else if (typeof object.startIndex === "string") + message.startIndex = parseInt(object.startIndex, 10); + else if (typeof object.startIndex === "number") + message.startIndex = object.startIndex; + else if (typeof object.startIndex === "object") + message.startIndex = new $util.LongBits(object.startIndex.low >>> 0, object.startIndex.high >>> 0).toNumber(); + if (object.endIndex != null) + if ($util.Long) + (message.endIndex = $util.Long.fromValue(object.endIndex)).unsigned = false; + else if (typeof object.endIndex === "string") + message.endIndex = parseInt(object.endIndex, 10); + else if (typeof object.endIndex === "number") + message.endIndex = object.endIndex; + else if (typeof object.endIndex === "object") + message.endIndex = new $util.LongBits(object.endIndex.low >>> 0, object.endIndex.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a TextSegment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.TextAnchor.TextSegment + * @static + * @param {google.cloud.documentai.v1.Document.TextAnchor.TextSegment} message TextSegment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextSegment.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.startIndex = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.startIndex = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.endIndex = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.endIndex = options.longs === String ? "0" : 0; + } + if (message.startIndex != null && message.hasOwnProperty("startIndex")) + if (typeof message.startIndex === "number") + object.startIndex = options.longs === String ? String(message.startIndex) : message.startIndex; + else + object.startIndex = options.longs === String ? $util.Long.prototype.toString.call(message.startIndex) : options.longs === Number ? new $util.LongBits(message.startIndex.low >>> 0, message.startIndex.high >>> 0).toNumber() : message.startIndex; + if (message.endIndex != null && message.hasOwnProperty("endIndex")) + if (typeof message.endIndex === "number") + object.endIndex = options.longs === String ? String(message.endIndex) : message.endIndex; + else + object.endIndex = options.longs === String ? $util.Long.prototype.toString.call(message.endIndex) : options.longs === Number ? new $util.LongBits(message.endIndex.low >>> 0, message.endIndex.high >>> 0).toNumber() : message.endIndex; + return object; + }; + + /** + * Converts this TextSegment to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.TextAnchor.TextSegment + * @instance + * @returns {Object.} JSON object + */ + TextSegment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextSegment + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.TextAnchor.TextSegment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextSegment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.TextAnchor.TextSegment"; + }; + + return TextSegment; + })(); + + return TextAnchor; + })(); + + Document.PageAnchor = (function() { + + /** + * Properties of a PageAnchor. + * @memberof google.cloud.documentai.v1.Document + * @interface IPageAnchor + * @property {Array.|null} [pageRefs] PageAnchor pageRefs + */ + + /** + * Constructs a new PageAnchor. + * @memberof google.cloud.documentai.v1.Document + * @classdesc Represents a PageAnchor. + * @implements IPageAnchor + * @constructor + * @param {google.cloud.documentai.v1.Document.IPageAnchor=} [properties] Properties to set + */ + function PageAnchor(properties) { + this.pageRefs = []; + 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]]; + } + + /** + * PageAnchor pageRefs. + * @member {Array.} pageRefs + * @memberof google.cloud.documentai.v1.Document.PageAnchor + * @instance + */ + PageAnchor.prototype.pageRefs = $util.emptyArray; + + /** + * Creates a new PageAnchor instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.PageAnchor + * @static + * @param {google.cloud.documentai.v1.Document.IPageAnchor=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.PageAnchor} PageAnchor instance + */ + PageAnchor.create = function create(properties) { + return new PageAnchor(properties); + }; + + /** + * Encodes the specified PageAnchor message. Does not implicitly {@link google.cloud.documentai.v1.Document.PageAnchor.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.PageAnchor + * @static + * @param {google.cloud.documentai.v1.Document.IPageAnchor} message PageAnchor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PageAnchor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageRefs != null && message.pageRefs.length) + for (var i = 0; i < message.pageRefs.length; ++i) + $root.google.cloud.documentai.v1.Document.PageAnchor.PageRef.encode(message.pageRefs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PageAnchor message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.PageAnchor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.PageAnchor + * @static + * @param {google.cloud.documentai.v1.Document.IPageAnchor} message PageAnchor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PageAnchor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PageAnchor message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.PageAnchor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.PageAnchor} PageAnchor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PageAnchor.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.PageAnchor(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.pageRefs && message.pageRefs.length)) + message.pageRefs = []; + message.pageRefs.push($root.google.cloud.documentai.v1.Document.PageAnchor.PageRef.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PageAnchor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.PageAnchor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.PageAnchor} PageAnchor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PageAnchor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PageAnchor message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.PageAnchor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PageAnchor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pageRefs != null && message.hasOwnProperty("pageRefs")) { + if (!Array.isArray(message.pageRefs)) + return "pageRefs: array expected"; + for (var i = 0; i < message.pageRefs.length; ++i) { + var error = $root.google.cloud.documentai.v1.Document.PageAnchor.PageRef.verify(message.pageRefs[i]); + if (error) + return "pageRefs." + error; + } + } + return null; + }; + + /** + * Creates a PageAnchor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.PageAnchor + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.PageAnchor} PageAnchor + */ + PageAnchor.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.PageAnchor) + return object; + var message = new $root.google.cloud.documentai.v1.Document.PageAnchor(); + if (object.pageRefs) { + if (!Array.isArray(object.pageRefs)) + throw TypeError(".google.cloud.documentai.v1.Document.PageAnchor.pageRefs: array expected"); + message.pageRefs = []; + for (var i = 0; i < object.pageRefs.length; ++i) { + if (typeof object.pageRefs[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.PageAnchor.pageRefs: object expected"); + message.pageRefs[i] = $root.google.cloud.documentai.v1.Document.PageAnchor.PageRef.fromObject(object.pageRefs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PageAnchor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.PageAnchor + * @static + * @param {google.cloud.documentai.v1.Document.PageAnchor} message PageAnchor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PageAnchor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.pageRefs = []; + if (message.pageRefs && message.pageRefs.length) { + object.pageRefs = []; + for (var j = 0; j < message.pageRefs.length; ++j) + object.pageRefs[j] = $root.google.cloud.documentai.v1.Document.PageAnchor.PageRef.toObject(message.pageRefs[j], options); + } + return object; + }; + + /** + * Converts this PageAnchor to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.PageAnchor + * @instance + * @returns {Object.} JSON object + */ + PageAnchor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PageAnchor + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.PageAnchor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PageAnchor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.PageAnchor"; + }; + + PageAnchor.PageRef = (function() { + + /** + * Properties of a PageRef. + * @memberof google.cloud.documentai.v1.Document.PageAnchor + * @interface IPageRef + * @property {number|Long|null} [page] PageRef page + * @property {google.cloud.documentai.v1.Document.PageAnchor.PageRef.LayoutType|null} [layoutType] PageRef layoutType + * @property {string|null} [layoutId] PageRef layoutId + * @property {google.cloud.documentai.v1.IBoundingPoly|null} [boundingPoly] PageRef boundingPoly + * @property {number|null} [confidence] PageRef confidence + */ + + /** + * Constructs a new PageRef. + * @memberof google.cloud.documentai.v1.Document.PageAnchor + * @classdesc Represents a PageRef. + * @implements IPageRef + * @constructor + * @param {google.cloud.documentai.v1.Document.PageAnchor.IPageRef=} [properties] Properties to set + */ + function PageRef(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]]; + } + + /** + * PageRef page. + * @member {number|Long} page + * @memberof google.cloud.documentai.v1.Document.PageAnchor.PageRef + * @instance + */ + PageRef.prototype.page = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * PageRef layoutType. + * @member {google.cloud.documentai.v1.Document.PageAnchor.PageRef.LayoutType} layoutType + * @memberof google.cloud.documentai.v1.Document.PageAnchor.PageRef + * @instance + */ + PageRef.prototype.layoutType = 0; + + /** + * PageRef layoutId. + * @member {string} layoutId + * @memberof google.cloud.documentai.v1.Document.PageAnchor.PageRef + * @instance + */ + PageRef.prototype.layoutId = ""; + + /** + * PageRef boundingPoly. + * @member {google.cloud.documentai.v1.IBoundingPoly|null|undefined} boundingPoly + * @memberof google.cloud.documentai.v1.Document.PageAnchor.PageRef + * @instance + */ + PageRef.prototype.boundingPoly = null; + + /** + * PageRef confidence. + * @member {number} confidence + * @memberof google.cloud.documentai.v1.Document.PageAnchor.PageRef + * @instance + */ + PageRef.prototype.confidence = 0; + + /** + * Creates a new PageRef instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.PageAnchor.PageRef + * @static + * @param {google.cloud.documentai.v1.Document.PageAnchor.IPageRef=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.PageAnchor.PageRef} PageRef instance + */ + PageRef.create = function create(properties) { + return new PageRef(properties); + }; + + /** + * Encodes the specified PageRef message. Does not implicitly {@link google.cloud.documentai.v1.Document.PageAnchor.PageRef.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.PageAnchor.PageRef + * @static + * @param {google.cloud.documentai.v1.Document.PageAnchor.IPageRef} message PageRef message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PageRef.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.page != null && Object.hasOwnProperty.call(message, "page")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.page); + if (message.layoutType != null && Object.hasOwnProperty.call(message, "layoutType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.layoutType); + if (message.layoutId != null && Object.hasOwnProperty.call(message, "layoutId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.layoutId); + if (message.boundingPoly != null && Object.hasOwnProperty.call(message, "boundingPoly")) + $root.google.cloud.documentai.v1.BoundingPoly.encode(message.boundingPoly, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified PageRef message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.PageAnchor.PageRef.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.PageAnchor.PageRef + * @static + * @param {google.cloud.documentai.v1.Document.PageAnchor.IPageRef} message PageRef message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PageRef.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PageRef message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.PageAnchor.PageRef + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.PageAnchor.PageRef} PageRef + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PageRef.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.PageAnchor.PageRef(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.page = reader.int64(); + break; + } + case 2: { + message.layoutType = reader.int32(); + break; + } + case 3: { + message.layoutId = reader.string(); + break; + } + case 4: { + message.boundingPoly = $root.google.cloud.documentai.v1.BoundingPoly.decode(reader, reader.uint32()); + break; + } + case 5: { + message.confidence = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PageRef message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.PageAnchor.PageRef + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.PageAnchor.PageRef} PageRef + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PageRef.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PageRef message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.PageAnchor.PageRef + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PageRef.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.page != null && message.hasOwnProperty("page")) + if (!$util.isInteger(message.page) && !(message.page && $util.isInteger(message.page.low) && $util.isInteger(message.page.high))) + return "page: integer|Long expected"; + if (message.layoutType != null && message.hasOwnProperty("layoutType")) + switch (message.layoutType) { + default: + return "layoutType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.layoutId != null && message.hasOwnProperty("layoutId")) + if (!$util.isString(message.layoutId)) + return "layoutId: string expected"; + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) { + var error = $root.google.cloud.documentai.v1.BoundingPoly.verify(message.boundingPoly); + if (error) + return "boundingPoly." + error; + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a PageRef message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.PageAnchor.PageRef + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.PageAnchor.PageRef} PageRef + */ + PageRef.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.PageAnchor.PageRef) + return object; + var message = new $root.google.cloud.documentai.v1.Document.PageAnchor.PageRef(); + if (object.page != null) + if ($util.Long) + (message.page = $util.Long.fromValue(object.page)).unsigned = false; + else if (typeof object.page === "string") + message.page = parseInt(object.page, 10); + else if (typeof object.page === "number") + message.page = object.page; + else if (typeof object.page === "object") + message.page = new $util.LongBits(object.page.low >>> 0, object.page.high >>> 0).toNumber(); + switch (object.layoutType) { + default: + if (typeof object.layoutType === "number") { + message.layoutType = object.layoutType; + break; + } + break; + case "LAYOUT_TYPE_UNSPECIFIED": + case 0: + message.layoutType = 0; + break; + case "BLOCK": + case 1: + message.layoutType = 1; + break; + case "PARAGRAPH": + case 2: + message.layoutType = 2; + break; + case "LINE": + case 3: + message.layoutType = 3; + break; + case "TOKEN": + case 4: + message.layoutType = 4; + break; + case "VISUAL_ELEMENT": + case 5: + message.layoutType = 5; + break; + case "TABLE": + case 6: + message.layoutType = 6; + break; + case "FORM_FIELD": + case 7: + message.layoutType = 7; + break; + } + if (object.layoutId != null) + message.layoutId = String(object.layoutId); + if (object.boundingPoly != null) { + if (typeof object.boundingPoly !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.PageAnchor.PageRef.boundingPoly: object expected"); + message.boundingPoly = $root.google.cloud.documentai.v1.BoundingPoly.fromObject(object.boundingPoly); + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a PageRef message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.PageAnchor.PageRef + * @static + * @param {google.cloud.documentai.v1.Document.PageAnchor.PageRef} message PageRef + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PageRef.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.page = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.page = options.longs === String ? "0" : 0; + object.layoutType = options.enums === String ? "LAYOUT_TYPE_UNSPECIFIED" : 0; + object.layoutId = ""; + object.boundingPoly = null; + object.confidence = 0; + } + if (message.page != null && message.hasOwnProperty("page")) + if (typeof message.page === "number") + object.page = options.longs === String ? String(message.page) : message.page; + else + object.page = options.longs === String ? $util.Long.prototype.toString.call(message.page) : options.longs === Number ? new $util.LongBits(message.page.low >>> 0, message.page.high >>> 0).toNumber() : message.page; + if (message.layoutType != null && message.hasOwnProperty("layoutType")) + object.layoutType = options.enums === String ? $root.google.cloud.documentai.v1.Document.PageAnchor.PageRef.LayoutType[message.layoutType] === undefined ? message.layoutType : $root.google.cloud.documentai.v1.Document.PageAnchor.PageRef.LayoutType[message.layoutType] : message.layoutType; + if (message.layoutId != null && message.hasOwnProperty("layoutId")) + object.layoutId = message.layoutId; + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + object.boundingPoly = $root.google.cloud.documentai.v1.BoundingPoly.toObject(message.boundingPoly, options); + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this PageRef to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.PageAnchor.PageRef + * @instance + * @returns {Object.} JSON object + */ + PageRef.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PageRef + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.PageAnchor.PageRef + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PageRef.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.PageAnchor.PageRef"; + }; + + /** + * LayoutType enum. + * @name google.cloud.documentai.v1.Document.PageAnchor.PageRef.LayoutType + * @enum {number} + * @property {number} LAYOUT_TYPE_UNSPECIFIED=0 LAYOUT_TYPE_UNSPECIFIED value + * @property {number} BLOCK=1 BLOCK value + * @property {number} PARAGRAPH=2 PARAGRAPH value + * @property {number} LINE=3 LINE value + * @property {number} TOKEN=4 TOKEN value + * @property {number} VISUAL_ELEMENT=5 VISUAL_ELEMENT value + * @property {number} TABLE=6 TABLE value + * @property {number} FORM_FIELD=7 FORM_FIELD value + */ + PageRef.LayoutType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAYOUT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "BLOCK"] = 1; + values[valuesById[2] = "PARAGRAPH"] = 2; + values[valuesById[3] = "LINE"] = 3; + values[valuesById[4] = "TOKEN"] = 4; + values[valuesById[5] = "VISUAL_ELEMENT"] = 5; + values[valuesById[6] = "TABLE"] = 6; + values[valuesById[7] = "FORM_FIELD"] = 7; + return values; + })(); + + return PageRef; + })(); + + return PageAnchor; + })(); + + Document.Provenance = (function() { + + /** + * Properties of a Provenance. + * @memberof google.cloud.documentai.v1.Document + * @interface IProvenance + * @property {number|null} [revision] Provenance revision + * @property {number|null} [id] Provenance id + * @property {Array.|null} [parents] Provenance parents + * @property {google.cloud.documentai.v1.Document.Provenance.OperationType|null} [type] Provenance type + */ + + /** + * Constructs a new Provenance. + * @memberof google.cloud.documentai.v1.Document + * @classdesc Represents a Provenance. + * @implements IProvenance + * @constructor + * @param {google.cloud.documentai.v1.Document.IProvenance=} [properties] Properties to set + */ + function Provenance(properties) { + this.parents = []; + 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]]; + } + + /** + * Provenance revision. + * @member {number} revision + * @memberof google.cloud.documentai.v1.Document.Provenance + * @instance + */ + Provenance.prototype.revision = 0; + + /** + * Provenance id. + * @member {number} id + * @memberof google.cloud.documentai.v1.Document.Provenance + * @instance + */ + Provenance.prototype.id = 0; + + /** + * Provenance parents. + * @member {Array.} parents + * @memberof google.cloud.documentai.v1.Document.Provenance + * @instance + */ + Provenance.prototype.parents = $util.emptyArray; + + /** + * Provenance type. + * @member {google.cloud.documentai.v1.Document.Provenance.OperationType} type + * @memberof google.cloud.documentai.v1.Document.Provenance + * @instance + */ + Provenance.prototype.type = 0; + + /** + * Creates a new Provenance instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.Provenance + * @static + * @param {google.cloud.documentai.v1.Document.IProvenance=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.Provenance} Provenance instance + */ + Provenance.create = function create(properties) { + return new Provenance(properties); + }; + + /** + * Encodes the specified Provenance message. Does not implicitly {@link google.cloud.documentai.v1.Document.Provenance.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.Provenance + * @static + * @param {google.cloud.documentai.v1.Document.IProvenance} message Provenance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Provenance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.revision != null && Object.hasOwnProperty.call(message, "revision")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.revision); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.id); + if (message.parents != null && message.parents.length) + for (var i = 0; i < message.parents.length; ++i) + $root.google.cloud.documentai.v1.Document.Provenance.Parent.encode(message.parents[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.type); + return writer; + }; + + /** + * Encodes the specified Provenance message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Provenance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.Provenance + * @static + * @param {google.cloud.documentai.v1.Document.IProvenance} message Provenance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Provenance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Provenance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.Provenance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.Provenance} Provenance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Provenance.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Provenance(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.revision = reader.int32(); + break; + } + case 2: { + message.id = reader.int32(); + break; + } + case 3: { + if (!(message.parents && message.parents.length)) + message.parents = []; + message.parents.push($root.google.cloud.documentai.v1.Document.Provenance.Parent.decode(reader, reader.uint32())); + break; + } + case 4: { + message.type = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Provenance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.Provenance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.Provenance} Provenance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Provenance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Provenance message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.Provenance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Provenance.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.revision != null && message.hasOwnProperty("revision")) + if (!$util.isInteger(message.revision)) + return "revision: integer expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isInteger(message.id)) + return "id: integer expected"; + if (message.parents != null && message.hasOwnProperty("parents")) { + if (!Array.isArray(message.parents)) + return "parents: array expected"; + for (var i = 0; i < message.parents.length; ++i) { + var error = $root.google.cloud.documentai.v1.Document.Provenance.Parent.verify(message.parents[i]); + if (error) + return "parents." + error; + } + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 7: + case 3: + case 4: + case 5: + case 6: + break; + } + return null; + }; + + /** + * Creates a Provenance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.Provenance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.Provenance} Provenance + */ + Provenance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.Provenance) + return object; + var message = new $root.google.cloud.documentai.v1.Document.Provenance(); + if (object.revision != null) + message.revision = object.revision | 0; + if (object.id != null) + message.id = object.id | 0; + if (object.parents) { + if (!Array.isArray(object.parents)) + throw TypeError(".google.cloud.documentai.v1.Document.Provenance.parents: array expected"); + message.parents = []; + for (var i = 0; i < object.parents.length; ++i) { + if (typeof object.parents[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Provenance.parents: object expected"); + message.parents[i] = $root.google.cloud.documentai.v1.Document.Provenance.Parent.fromObject(object.parents[i]); + } + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "OPERATION_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "ADD": + case 1: + message.type = 1; + break; + case "REMOVE": + case 2: + message.type = 2; + break; + case "UPDATE": + case 7: + message.type = 7; + break; + case "REPLACE": + case 3: + message.type = 3; + break; + case "EVAL_REQUESTED": + case 4: + message.type = 4; + break; + case "EVAL_APPROVED": + case 5: + message.type = 5; + break; + case "EVAL_SKIPPED": + case 6: + message.type = 6; + break; + } + return message; + }; + + /** + * Creates a plain object from a Provenance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.Provenance + * @static + * @param {google.cloud.documentai.v1.Document.Provenance} message Provenance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Provenance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.parents = []; + if (options.defaults) { + object.revision = 0; + object.id = 0; + object.type = options.enums === String ? "OPERATION_TYPE_UNSPECIFIED" : 0; + } + if (message.revision != null && message.hasOwnProperty("revision")) + object.revision = message.revision; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.parents && message.parents.length) { + object.parents = []; + for (var j = 0; j < message.parents.length; ++j) + object.parents[j] = $root.google.cloud.documentai.v1.Document.Provenance.Parent.toObject(message.parents[j], options); + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.documentai.v1.Document.Provenance.OperationType[message.type] === undefined ? message.type : $root.google.cloud.documentai.v1.Document.Provenance.OperationType[message.type] : message.type; + return object; + }; + + /** + * Converts this Provenance to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.Provenance + * @instance + * @returns {Object.} JSON object + */ + Provenance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Provenance + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.Provenance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Provenance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Provenance"; + }; + + Provenance.Parent = (function() { + + /** + * Properties of a Parent. + * @memberof google.cloud.documentai.v1.Document.Provenance + * @interface IParent + * @property {number|null} [revision] Parent revision + * @property {number|null} [index] Parent index + * @property {number|null} [id] Parent id + */ + + /** + * Constructs a new Parent. + * @memberof google.cloud.documentai.v1.Document.Provenance + * @classdesc Represents a Parent. + * @implements IParent + * @constructor + * @param {google.cloud.documentai.v1.Document.Provenance.IParent=} [properties] Properties to set + */ + function Parent(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]]; + } + + /** + * Parent revision. + * @member {number} revision + * @memberof google.cloud.documentai.v1.Document.Provenance.Parent + * @instance + */ + Parent.prototype.revision = 0; + + /** + * Parent index. + * @member {number} index + * @memberof google.cloud.documentai.v1.Document.Provenance.Parent + * @instance + */ + Parent.prototype.index = 0; + + /** + * Parent id. + * @member {number} id + * @memberof google.cloud.documentai.v1.Document.Provenance.Parent + * @instance + */ + Parent.prototype.id = 0; + + /** + * Creates a new Parent instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.Provenance.Parent + * @static + * @param {google.cloud.documentai.v1.Document.Provenance.IParent=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.Provenance.Parent} Parent instance + */ + Parent.create = function create(properties) { + return new Parent(properties); + }; + + /** + * Encodes the specified Parent message. Does not implicitly {@link google.cloud.documentai.v1.Document.Provenance.Parent.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.Provenance.Parent + * @static + * @param {google.cloud.documentai.v1.Document.Provenance.IParent} message Parent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Parent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.revision != null && Object.hasOwnProperty.call(message, "revision")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.revision); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.id); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.index); + return writer; + }; + + /** + * Encodes the specified Parent message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Provenance.Parent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.Provenance.Parent + * @static + * @param {google.cloud.documentai.v1.Document.Provenance.IParent} message Parent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Parent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Parent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.Provenance.Parent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.Provenance.Parent} Parent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Parent.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Provenance.Parent(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.revision = reader.int32(); + break; + } + case 3: { + message.index = reader.int32(); + break; + } + case 2: { + message.id = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Parent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.Provenance.Parent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.Provenance.Parent} Parent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Parent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Parent message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.Provenance.Parent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Parent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.revision != null && message.hasOwnProperty("revision")) + if (!$util.isInteger(message.revision)) + return "revision: integer expected"; + if (message.index != null && message.hasOwnProperty("index")) + if (!$util.isInteger(message.index)) + return "index: integer expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isInteger(message.id)) + return "id: integer expected"; + return null; + }; + + /** + * Creates a Parent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.Provenance.Parent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.Provenance.Parent} Parent + */ + Parent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.Provenance.Parent) + return object; + var message = new $root.google.cloud.documentai.v1.Document.Provenance.Parent(); + if (object.revision != null) + message.revision = object.revision | 0; + if (object.index != null) + message.index = object.index | 0; + if (object.id != null) + message.id = object.id | 0; + return message; + }; + + /** + * Creates a plain object from a Parent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.Provenance.Parent + * @static + * @param {google.cloud.documentai.v1.Document.Provenance.Parent} message Parent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Parent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.revision = 0; + object.id = 0; + object.index = 0; + } + if (message.revision != null && message.hasOwnProperty("revision")) + object.revision = message.revision; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.index != null && message.hasOwnProperty("index")) + object.index = message.index; + return object; + }; + + /** + * Converts this Parent to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.Provenance.Parent + * @instance + * @returns {Object.} JSON object + */ + Parent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Parent + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.Provenance.Parent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Parent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Provenance.Parent"; + }; + + return Parent; + })(); + + /** + * OperationType enum. + * @name google.cloud.documentai.v1.Document.Provenance.OperationType + * @enum {number} + * @property {number} OPERATION_TYPE_UNSPECIFIED=0 OPERATION_TYPE_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + * @property {number} UPDATE=7 UPDATE value + * @property {number} REPLACE=3 REPLACE value + * @property {number} EVAL_REQUESTED=4 EVAL_REQUESTED value + * @property {number} EVAL_APPROVED=5 EVAL_APPROVED value + * @property {number} EVAL_SKIPPED=6 EVAL_SKIPPED value + */ + Provenance.OperationType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OPERATION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + values[valuesById[7] = "UPDATE"] = 7; + values[valuesById[3] = "REPLACE"] = 3; + values[valuesById[4] = "EVAL_REQUESTED"] = 4; + values[valuesById[5] = "EVAL_APPROVED"] = 5; + values[valuesById[6] = "EVAL_SKIPPED"] = 6; + return values; + })(); + + return Provenance; + })(); + + Document.Revision = (function() { + + /** + * Properties of a Revision. + * @memberof google.cloud.documentai.v1.Document + * @interface IRevision + * @property {string|null} [agent] Revision agent + * @property {string|null} [processor] Revision processor + * @property {string|null} [id] Revision id + * @property {Array.|null} [parent] Revision parent + * @property {Array.|null} [parentIds] Revision parentIds + * @property {google.protobuf.ITimestamp|null} [createTime] Revision createTime + * @property {google.cloud.documentai.v1.Document.Revision.IHumanReview|null} [humanReview] Revision humanReview + */ + + /** + * Constructs a new Revision. + * @memberof google.cloud.documentai.v1.Document + * @classdesc Represents a Revision. + * @implements IRevision + * @constructor + * @param {google.cloud.documentai.v1.Document.IRevision=} [properties] Properties to set + */ + function Revision(properties) { + this.parent = []; + this.parentIds = []; + 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]]; + } + + /** + * Revision agent. + * @member {string|null|undefined} agent + * @memberof google.cloud.documentai.v1.Document.Revision + * @instance + */ + Revision.prototype.agent = null; + + /** + * Revision processor. + * @member {string|null|undefined} processor + * @memberof google.cloud.documentai.v1.Document.Revision + * @instance + */ + Revision.prototype.processor = null; + + /** + * Revision id. + * @member {string} id + * @memberof google.cloud.documentai.v1.Document.Revision + * @instance + */ + Revision.prototype.id = ""; + + /** + * Revision parent. + * @member {Array.} parent + * @memberof google.cloud.documentai.v1.Document.Revision + * @instance + */ + Revision.prototype.parent = $util.emptyArray; + + /** + * Revision parentIds. + * @member {Array.} parentIds + * @memberof google.cloud.documentai.v1.Document.Revision + * @instance + */ + Revision.prototype.parentIds = $util.emptyArray; + + /** + * Revision createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.documentai.v1.Document.Revision + * @instance + */ + Revision.prototype.createTime = null; + + /** + * Revision humanReview. + * @member {google.cloud.documentai.v1.Document.Revision.IHumanReview|null|undefined} humanReview + * @memberof google.cloud.documentai.v1.Document.Revision + * @instance + */ + Revision.prototype.humanReview = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Revision source. + * @member {"agent"|"processor"|undefined} source + * @memberof google.cloud.documentai.v1.Document.Revision + * @instance + */ + Object.defineProperty(Revision.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["agent", "processor"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Revision instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.Revision + * @static + * @param {google.cloud.documentai.v1.Document.IRevision=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.Revision} Revision instance + */ + Revision.create = function create(properties) { + return new Revision(properties); + }; + + /** + * Encodes the specified Revision message. Does not implicitly {@link google.cloud.documentai.v1.Document.Revision.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.Revision + * @static + * @param {google.cloud.documentai.v1.Document.IRevision} message Revision message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Revision.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.parent != null && message.parent.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.parent.length; ++i) + writer.int32(message.parent[i]); + writer.ldelim(); + } + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.agent != null && Object.hasOwnProperty.call(message, "agent")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.agent); + if (message.processor != null && Object.hasOwnProperty.call(message, "processor")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.processor); + if (message.humanReview != null && Object.hasOwnProperty.call(message, "humanReview")) + $root.google.cloud.documentai.v1.Document.Revision.HumanReview.encode(message.humanReview, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.parentIds != null && message.parentIds.length) + for (var i = 0; i < message.parentIds.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.parentIds[i]); + return writer; + }; + + /** + * Encodes the specified Revision message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Revision.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.Revision + * @static + * @param {google.cloud.documentai.v1.Document.IRevision} message Revision message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Revision.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Revision message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.Revision + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.Revision} Revision + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Revision.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Revision(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 4: { + message.agent = reader.string(); + break; + } + case 5: { + message.processor = reader.string(); + break; + } + case 1: { + message.id = reader.string(); + break; + } + case 2: { + if (!(message.parent && message.parent.length)) + message.parent = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.parent.push(reader.int32()); + } else + message.parent.push(reader.int32()); + break; + } + case 7: { + if (!(message.parentIds && message.parentIds.length)) + message.parentIds = []; + message.parentIds.push(reader.string()); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.humanReview = $root.google.cloud.documentai.v1.Document.Revision.HumanReview.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Revision message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.Revision + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.Revision} Revision + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Revision.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Revision message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.Revision + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Revision.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.agent != null && message.hasOwnProperty("agent")) { + properties.source = 1; + if (!$util.isString(message.agent)) + return "agent: string expected"; + } + if (message.processor != null && message.hasOwnProperty("processor")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + if (!$util.isString(message.processor)) + return "processor: string expected"; + } + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) { + if (!Array.isArray(message.parent)) + return "parent: array expected"; + for (var i = 0; i < message.parent.length; ++i) + if (!$util.isInteger(message.parent[i])) + return "parent: integer[] expected"; + } + if (message.parentIds != null && message.hasOwnProperty("parentIds")) { + if (!Array.isArray(message.parentIds)) + return "parentIds: array expected"; + for (var i = 0; i < message.parentIds.length; ++i) + if (!$util.isString(message.parentIds[i])) + return "parentIds: 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.humanReview != null && message.hasOwnProperty("humanReview")) { + var error = $root.google.cloud.documentai.v1.Document.Revision.HumanReview.verify(message.humanReview); + if (error) + return "humanReview." + error; + } + return null; + }; + + /** + * Creates a Revision message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.Revision + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.Revision} Revision + */ + Revision.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.Revision) + return object; + var message = new $root.google.cloud.documentai.v1.Document.Revision(); + if (object.agent != null) + message.agent = String(object.agent); + if (object.processor != null) + message.processor = String(object.processor); + if (object.id != null) + message.id = String(object.id); + if (object.parent) { + if (!Array.isArray(object.parent)) + throw TypeError(".google.cloud.documentai.v1.Document.Revision.parent: array expected"); + message.parent = []; + for (var i = 0; i < object.parent.length; ++i) + message.parent[i] = object.parent[i] | 0; + } + if (object.parentIds) { + if (!Array.isArray(object.parentIds)) + throw TypeError(".google.cloud.documentai.v1.Document.Revision.parentIds: array expected"); + message.parentIds = []; + for (var i = 0; i < object.parentIds.length; ++i) + message.parentIds[i] = String(object.parentIds[i]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Revision.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.humanReview != null) { + if (typeof object.humanReview !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Revision.humanReview: object expected"); + message.humanReview = $root.google.cloud.documentai.v1.Document.Revision.HumanReview.fromObject(object.humanReview); + } + return message; + }; + + /** + * Creates a plain object from a Revision message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.Revision + * @static + * @param {google.cloud.documentai.v1.Document.Revision} message Revision + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Revision.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.parent = []; + object.parentIds = []; + } + if (options.defaults) { + object.id = ""; + object.createTime = null; + object.humanReview = null; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.parent && message.parent.length) { + object.parent = []; + for (var j = 0; j < message.parent.length; ++j) + object.parent[j] = message.parent[j]; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.agent != null && message.hasOwnProperty("agent")) { + object.agent = message.agent; + if (options.oneofs) + object.source = "agent"; + } + if (message.processor != null && message.hasOwnProperty("processor")) { + object.processor = message.processor; + if (options.oneofs) + object.source = "processor"; + } + if (message.humanReview != null && message.hasOwnProperty("humanReview")) + object.humanReview = $root.google.cloud.documentai.v1.Document.Revision.HumanReview.toObject(message.humanReview, options); + if (message.parentIds && message.parentIds.length) { + object.parentIds = []; + for (var j = 0; j < message.parentIds.length; ++j) + object.parentIds[j] = message.parentIds[j]; + } + return object; + }; + + /** + * Converts this Revision to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.Revision + * @instance + * @returns {Object.} JSON object + */ + Revision.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Revision + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.Revision + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Revision.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Revision"; + }; + + Revision.HumanReview = (function() { + + /** + * Properties of a HumanReview. + * @memberof google.cloud.documentai.v1.Document.Revision + * @interface IHumanReview + * @property {string|null} [state] HumanReview state + * @property {string|null} [stateMessage] HumanReview stateMessage + */ + + /** + * Constructs a new HumanReview. + * @memberof google.cloud.documentai.v1.Document.Revision + * @classdesc Represents a HumanReview. + * @implements IHumanReview + * @constructor + * @param {google.cloud.documentai.v1.Document.Revision.IHumanReview=} [properties] Properties to set + */ + function HumanReview(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]]; + } + + /** + * HumanReview state. + * @member {string} state + * @memberof google.cloud.documentai.v1.Document.Revision.HumanReview + * @instance + */ + HumanReview.prototype.state = ""; + + /** + * HumanReview stateMessage. + * @member {string} stateMessage + * @memberof google.cloud.documentai.v1.Document.Revision.HumanReview + * @instance + */ + HumanReview.prototype.stateMessage = ""; + + /** + * Creates a new HumanReview instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.Revision.HumanReview + * @static + * @param {google.cloud.documentai.v1.Document.Revision.IHumanReview=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.Revision.HumanReview} HumanReview instance + */ + HumanReview.create = function create(properties) { + return new HumanReview(properties); + }; + + /** + * Encodes the specified HumanReview message. Does not implicitly {@link google.cloud.documentai.v1.Document.Revision.HumanReview.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.Revision.HumanReview + * @static + * @param {google.cloud.documentai.v1.Document.Revision.IHumanReview} message HumanReview message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HumanReview.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.state); + if (message.stateMessage != null && Object.hasOwnProperty.call(message, "stateMessage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.stateMessage); + return writer; + }; + + /** + * Encodes the specified HumanReview message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Revision.HumanReview.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.Revision.HumanReview + * @static + * @param {google.cloud.documentai.v1.Document.Revision.IHumanReview} message HumanReview message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HumanReview.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HumanReview message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.Revision.HumanReview + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.Revision.HumanReview} HumanReview + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HumanReview.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Revision.HumanReview(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.state = reader.string(); + break; + } + case 2: { + message.stateMessage = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HumanReview message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.Revision.HumanReview + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.Revision.HumanReview} HumanReview + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HumanReview.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HumanReview message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.Revision.HumanReview + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HumanReview.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + if (!$util.isString(message.state)) + return "state: string expected"; + if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) + if (!$util.isString(message.stateMessage)) + return "stateMessage: string expected"; + return null; + }; + + /** + * Creates a HumanReview message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.Revision.HumanReview + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.Revision.HumanReview} HumanReview + */ + HumanReview.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.Revision.HumanReview) + return object; + var message = new $root.google.cloud.documentai.v1.Document.Revision.HumanReview(); + if (object.state != null) + message.state = String(object.state); + if (object.stateMessage != null) + message.stateMessage = String(object.stateMessage); + return message; + }; + + /** + * Creates a plain object from a HumanReview message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.Revision.HumanReview + * @static + * @param {google.cloud.documentai.v1.Document.Revision.HumanReview} message HumanReview + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HumanReview.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = ""; + object.stateMessage = ""; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = message.state; + if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) + object.stateMessage = message.stateMessage; + return object; + }; + + /** + * Converts this HumanReview to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.Revision.HumanReview + * @instance + * @returns {Object.} JSON object + */ + HumanReview.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HumanReview + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.Revision.HumanReview + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HumanReview.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Revision.HumanReview"; + }; + + return HumanReview; + })(); + + return Revision; + })(); + + Document.TextChange = (function() { + + /** + * Properties of a TextChange. + * @memberof google.cloud.documentai.v1.Document + * @interface ITextChange + * @property {google.cloud.documentai.v1.Document.ITextAnchor|null} [textAnchor] TextChange textAnchor + * @property {string|null} [changedText] TextChange changedText + * @property {Array.|null} [provenance] TextChange provenance + */ + + /** + * Constructs a new TextChange. + * @memberof google.cloud.documentai.v1.Document + * @classdesc Represents a TextChange. + * @implements ITextChange + * @constructor + * @param {google.cloud.documentai.v1.Document.ITextChange=} [properties] Properties to set + */ + function TextChange(properties) { + this.provenance = []; + 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]]; + } + + /** + * TextChange textAnchor. + * @member {google.cloud.documentai.v1.Document.ITextAnchor|null|undefined} textAnchor + * @memberof google.cloud.documentai.v1.Document.TextChange + * @instance + */ + TextChange.prototype.textAnchor = null; + + /** + * TextChange changedText. + * @member {string} changedText + * @memberof google.cloud.documentai.v1.Document.TextChange + * @instance + */ + TextChange.prototype.changedText = ""; + + /** + * TextChange provenance. + * @member {Array.} provenance + * @memberof google.cloud.documentai.v1.Document.TextChange + * @instance + */ + TextChange.prototype.provenance = $util.emptyArray; + + /** + * Creates a new TextChange instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.TextChange + * @static + * @param {google.cloud.documentai.v1.Document.ITextChange=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.TextChange} TextChange instance + */ + TextChange.create = function create(properties) { + return new TextChange(properties); + }; + + /** + * Encodes the specified TextChange message. Does not implicitly {@link google.cloud.documentai.v1.Document.TextChange.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.TextChange + * @static + * @param {google.cloud.documentai.v1.Document.ITextChange} message TextChange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextChange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.textAnchor != null && Object.hasOwnProperty.call(message, "textAnchor")) + $root.google.cloud.documentai.v1.Document.TextAnchor.encode(message.textAnchor, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.changedText != null && Object.hasOwnProperty.call(message, "changedText")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.changedText); + if (message.provenance != null && message.provenance.length) + for (var i = 0; i < message.provenance.length; ++i) + $root.google.cloud.documentai.v1.Document.Provenance.encode(message.provenance[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TextChange message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.TextChange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.TextChange + * @static + * @param {google.cloud.documentai.v1.Document.ITextChange} message TextChange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextChange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextChange message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.TextChange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.TextChange} TextChange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextChange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.TextChange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.textAnchor = $root.google.cloud.documentai.v1.Document.TextAnchor.decode(reader, reader.uint32()); + break; + } + case 2: { + message.changedText = reader.string(); + break; + } + case 3: { + if (!(message.provenance && message.provenance.length)) + message.provenance = []; + message.provenance.push($root.google.cloud.documentai.v1.Document.Provenance.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextChange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.TextChange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.TextChange} TextChange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextChange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextChange message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.TextChange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextChange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.textAnchor != null && message.hasOwnProperty("textAnchor")) { + var error = $root.google.cloud.documentai.v1.Document.TextAnchor.verify(message.textAnchor); + if (error) + return "textAnchor." + error; + } + if (message.changedText != null && message.hasOwnProperty("changedText")) + if (!$util.isString(message.changedText)) + return "changedText: string expected"; + if (message.provenance != null && message.hasOwnProperty("provenance")) { + if (!Array.isArray(message.provenance)) + return "provenance: array expected"; + for (var i = 0; i < message.provenance.length; ++i) { + var error = $root.google.cloud.documentai.v1.Document.Provenance.verify(message.provenance[i]); + if (error) + return "provenance." + error; + } + } + return null; + }; + + /** + * Creates a TextChange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.TextChange + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.TextChange} TextChange + */ + TextChange.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.TextChange) + return object; + var message = new $root.google.cloud.documentai.v1.Document.TextChange(); + if (object.textAnchor != null) { + if (typeof object.textAnchor !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.TextChange.textAnchor: object expected"); + message.textAnchor = $root.google.cloud.documentai.v1.Document.TextAnchor.fromObject(object.textAnchor); + } + if (object.changedText != null) + message.changedText = String(object.changedText); + if (object.provenance) { + if (!Array.isArray(object.provenance)) + throw TypeError(".google.cloud.documentai.v1.Document.TextChange.provenance: array expected"); + message.provenance = []; + for (var i = 0; i < object.provenance.length; ++i) { + if (typeof object.provenance[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.TextChange.provenance: object expected"); + message.provenance[i] = $root.google.cloud.documentai.v1.Document.Provenance.fromObject(object.provenance[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TextChange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.TextChange + * @static + * @param {google.cloud.documentai.v1.Document.TextChange} message TextChange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextChange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.provenance = []; + if (options.defaults) { + object.textAnchor = null; + object.changedText = ""; + } + if (message.textAnchor != null && message.hasOwnProperty("textAnchor")) + object.textAnchor = $root.google.cloud.documentai.v1.Document.TextAnchor.toObject(message.textAnchor, options); + if (message.changedText != null && message.hasOwnProperty("changedText")) + object.changedText = message.changedText; + if (message.provenance && message.provenance.length) { + object.provenance = []; + for (var j = 0; j < message.provenance.length; ++j) + object.provenance[j] = $root.google.cloud.documentai.v1.Document.Provenance.toObject(message.provenance[j], options); + } + return object; + }; + + /** + * Converts this TextChange to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.TextChange + * @instance + * @returns {Object.} JSON object + */ + TextChange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextChange + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.TextChange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextChange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.TextChange"; + }; + + return TextChange; + })(); + + Document.DocumentLayout = (function() { + + /** + * Properties of a DocumentLayout. + * @memberof google.cloud.documentai.v1.Document + * @interface IDocumentLayout + * @property {Array.|null} [blocks] DocumentLayout blocks + */ + + /** + * Constructs a new DocumentLayout. + * @memberof google.cloud.documentai.v1.Document + * @classdesc Represents a DocumentLayout. + * @implements IDocumentLayout + * @constructor + * @param {google.cloud.documentai.v1.Document.IDocumentLayout=} [properties] Properties to set + */ + function DocumentLayout(properties) { + this.blocks = []; + 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]]; + } + + /** + * DocumentLayout blocks. + * @member {Array.} blocks + * @memberof google.cloud.documentai.v1.Document.DocumentLayout + * @instance + */ + DocumentLayout.prototype.blocks = $util.emptyArray; + + /** + * Creates a new DocumentLayout instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.DocumentLayout + * @static + * @param {google.cloud.documentai.v1.Document.IDocumentLayout=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.DocumentLayout} DocumentLayout instance + */ + DocumentLayout.create = function create(properties) { + return new DocumentLayout(properties); + }; + + /** + * Encodes the specified DocumentLayout message. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.DocumentLayout + * @static + * @param {google.cloud.documentai.v1.Document.IDocumentLayout} message DocumentLayout message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentLayout.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.blocks != null && message.blocks.length) + for (var i = 0; i < message.blocks.length; ++i) + $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.encode(message.blocks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DocumentLayout message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.DocumentLayout + * @static + * @param {google.cloud.documentai.v1.Document.IDocumentLayout} message DocumentLayout message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentLayout.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DocumentLayout message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.DocumentLayout + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.DocumentLayout} DocumentLayout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentLayout.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.DocumentLayout(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.blocks && message.blocks.length)) + message.blocks = []; + message.blocks.push($root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DocumentLayout message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.DocumentLayout + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.DocumentLayout} DocumentLayout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentLayout.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DocumentLayout message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.DocumentLayout + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DocumentLayout.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.blocks != null && message.hasOwnProperty("blocks")) { + if (!Array.isArray(message.blocks)) + return "blocks: array expected"; + for (var i = 0; i < message.blocks.length; ++i) { + var error = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.verify(message.blocks[i]); + if (error) + return "blocks." + error; + } + } + return null; + }; + + /** + * Creates a DocumentLayout message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.DocumentLayout + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.DocumentLayout} DocumentLayout + */ + DocumentLayout.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.DocumentLayout) + return object; + var message = new $root.google.cloud.documentai.v1.Document.DocumentLayout(); + if (object.blocks) { + if (!Array.isArray(object.blocks)) + throw TypeError(".google.cloud.documentai.v1.Document.DocumentLayout.blocks: array expected"); + message.blocks = []; + for (var i = 0; i < object.blocks.length; ++i) { + if (typeof object.blocks[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.DocumentLayout.blocks: object expected"); + message.blocks[i] = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.fromObject(object.blocks[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a DocumentLayout message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.DocumentLayout + * @static + * @param {google.cloud.documentai.v1.Document.DocumentLayout} message DocumentLayout + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DocumentLayout.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.blocks = []; + if (message.blocks && message.blocks.length) { + object.blocks = []; + for (var j = 0; j < message.blocks.length; ++j) + object.blocks[j] = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.toObject(message.blocks[j], options); + } + return object; + }; + + /** + * Converts this DocumentLayout to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.DocumentLayout + * @instance + * @returns {Object.} JSON object + */ + DocumentLayout.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DocumentLayout + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.DocumentLayout + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DocumentLayout.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.DocumentLayout"; + }; + + DocumentLayout.DocumentLayoutBlock = (function() { + + /** + * Properties of a DocumentLayoutBlock. + * @memberof google.cloud.documentai.v1.Document.DocumentLayout + * @interface IDocumentLayoutBlock + * @property {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTextBlock|null} [textBlock] DocumentLayoutBlock textBlock + * @property {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableBlock|null} [tableBlock] DocumentLayoutBlock tableBlock + * @property {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListBlock|null} [listBlock] DocumentLayoutBlock listBlock + * @property {string|null} [blockId] DocumentLayoutBlock blockId + * @property {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutPageSpan|null} [pageSpan] DocumentLayoutBlock pageSpan + * @property {google.cloud.documentai.v1.IBoundingPoly|null} [boundingBox] DocumentLayoutBlock boundingBox + */ + + /** + * Constructs a new DocumentLayoutBlock. + * @memberof google.cloud.documentai.v1.Document.DocumentLayout + * @classdesc Represents a DocumentLayoutBlock. + * @implements IDocumentLayoutBlock + * @constructor + * @param {google.cloud.documentai.v1.Document.DocumentLayout.IDocumentLayoutBlock=} [properties] Properties to set + */ + function DocumentLayoutBlock(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]]; + } + + /** + * DocumentLayoutBlock textBlock. + * @member {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTextBlock|null|undefined} textBlock + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock + * @instance + */ + DocumentLayoutBlock.prototype.textBlock = null; + + /** + * DocumentLayoutBlock tableBlock. + * @member {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableBlock|null|undefined} tableBlock + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock + * @instance + */ + DocumentLayoutBlock.prototype.tableBlock = null; + + /** + * DocumentLayoutBlock listBlock. + * @member {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListBlock|null|undefined} listBlock + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock + * @instance + */ + DocumentLayoutBlock.prototype.listBlock = null; + + /** + * DocumentLayoutBlock blockId. + * @member {string} blockId + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock + * @instance + */ + DocumentLayoutBlock.prototype.blockId = ""; + + /** + * DocumentLayoutBlock pageSpan. + * @member {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutPageSpan|null|undefined} pageSpan + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock + * @instance + */ + DocumentLayoutBlock.prototype.pageSpan = null; + + /** + * DocumentLayoutBlock boundingBox. + * @member {google.cloud.documentai.v1.IBoundingPoly|null|undefined} boundingBox + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock + * @instance + */ + DocumentLayoutBlock.prototype.boundingBox = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DocumentLayoutBlock block. + * @member {"textBlock"|"tableBlock"|"listBlock"|undefined} block + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock + * @instance + */ + Object.defineProperty(DocumentLayoutBlock.prototype, "block", { + get: $util.oneOfGetter($oneOfFields = ["textBlock", "tableBlock", "listBlock"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DocumentLayoutBlock instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock + * @static + * @param {google.cloud.documentai.v1.Document.DocumentLayout.IDocumentLayoutBlock=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock} DocumentLayoutBlock instance + */ + DocumentLayoutBlock.create = function create(properties) { + return new DocumentLayoutBlock(properties); + }; + + /** + * Encodes the specified DocumentLayoutBlock message. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock + * @static + * @param {google.cloud.documentai.v1.Document.DocumentLayout.IDocumentLayoutBlock} message DocumentLayoutBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentLayoutBlock.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.blockId != null && Object.hasOwnProperty.call(message, "blockId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.blockId); + if (message.textBlock != null && Object.hasOwnProperty.call(message, "textBlock")) + $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock.encode(message.textBlock, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.tableBlock != null && Object.hasOwnProperty.call(message, "tableBlock")) + $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock.encode(message.tableBlock, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.listBlock != null && Object.hasOwnProperty.call(message, "listBlock")) + $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock.encode(message.listBlock, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.pageSpan != null && Object.hasOwnProperty.call(message, "pageSpan")) + $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan.encode(message.pageSpan, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.boundingBox != null && Object.hasOwnProperty.call(message, "boundingBox")) + $root.google.cloud.documentai.v1.BoundingPoly.encode(message.boundingBox, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DocumentLayoutBlock message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock + * @static + * @param {google.cloud.documentai.v1.Document.DocumentLayout.IDocumentLayoutBlock} message DocumentLayoutBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentLayoutBlock.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DocumentLayoutBlock message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock} DocumentLayoutBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentLayoutBlock.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.textBlock = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock.decode(reader, reader.uint32()); + break; + } + case 3: { + message.tableBlock = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock.decode(reader, reader.uint32()); + break; + } + case 4: { + message.listBlock = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock.decode(reader, reader.uint32()); + break; + } + case 1: { + message.blockId = reader.string(); + break; + } + case 5: { + message.pageSpan = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan.decode(reader, reader.uint32()); + break; + } + case 6: { + message.boundingBox = $root.google.cloud.documentai.v1.BoundingPoly.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DocumentLayoutBlock message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock} DocumentLayoutBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentLayoutBlock.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DocumentLayoutBlock message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DocumentLayoutBlock.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.textBlock != null && message.hasOwnProperty("textBlock")) { + properties.block = 1; + { + var error = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock.verify(message.textBlock); + if (error) + return "textBlock." + error; + } + } + if (message.tableBlock != null && message.hasOwnProperty("tableBlock")) { + if (properties.block === 1) + return "block: multiple values"; + properties.block = 1; + { + var error = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock.verify(message.tableBlock); + if (error) + return "tableBlock." + error; + } + } + if (message.listBlock != null && message.hasOwnProperty("listBlock")) { + if (properties.block === 1) + return "block: multiple values"; + properties.block = 1; + { + var error = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock.verify(message.listBlock); + if (error) + return "listBlock." + error; + } + } + if (message.blockId != null && message.hasOwnProperty("blockId")) + if (!$util.isString(message.blockId)) + return "blockId: string expected"; + if (message.pageSpan != null && message.hasOwnProperty("pageSpan")) { + var error = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan.verify(message.pageSpan); + if (error) + return "pageSpan." + error; + } + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) { + var error = $root.google.cloud.documentai.v1.BoundingPoly.verify(message.boundingBox); + if (error) + return "boundingBox." + error; + } + return null; + }; + + /** + * Creates a DocumentLayoutBlock message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock} DocumentLayoutBlock + */ + DocumentLayoutBlock.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock) + return object; + var message = new $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock(); + if (object.textBlock != null) { + if (typeof object.textBlock !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.textBlock: object expected"); + message.textBlock = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock.fromObject(object.textBlock); + } + if (object.tableBlock != null) { + if (typeof object.tableBlock !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.tableBlock: object expected"); + message.tableBlock = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock.fromObject(object.tableBlock); + } + if (object.listBlock != null) { + if (typeof object.listBlock !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.listBlock: object expected"); + message.listBlock = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock.fromObject(object.listBlock); + } + if (object.blockId != null) + message.blockId = String(object.blockId); + if (object.pageSpan != null) { + if (typeof object.pageSpan !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.pageSpan: object expected"); + message.pageSpan = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan.fromObject(object.pageSpan); + } + if (object.boundingBox != null) { + if (typeof object.boundingBox !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.boundingBox: object expected"); + message.boundingBox = $root.google.cloud.documentai.v1.BoundingPoly.fromObject(object.boundingBox); + } + return message; + }; + + /** + * Creates a plain object from a DocumentLayoutBlock message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock + * @static + * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock} message DocumentLayoutBlock + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DocumentLayoutBlock.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.blockId = ""; + object.pageSpan = null; + object.boundingBox = null; + } + if (message.blockId != null && message.hasOwnProperty("blockId")) + object.blockId = message.blockId; + if (message.textBlock != null && message.hasOwnProperty("textBlock")) { + object.textBlock = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock.toObject(message.textBlock, options); + if (options.oneofs) + object.block = "textBlock"; + } + if (message.tableBlock != null && message.hasOwnProperty("tableBlock")) { + object.tableBlock = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock.toObject(message.tableBlock, options); + if (options.oneofs) + object.block = "tableBlock"; + } + if (message.listBlock != null && message.hasOwnProperty("listBlock")) { + object.listBlock = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock.toObject(message.listBlock, options); + if (options.oneofs) + object.block = "listBlock"; + } + if (message.pageSpan != null && message.hasOwnProperty("pageSpan")) + object.pageSpan = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan.toObject(message.pageSpan, options); + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) + object.boundingBox = $root.google.cloud.documentai.v1.BoundingPoly.toObject(message.boundingBox, options); + return object; + }; + + /** + * Converts this DocumentLayoutBlock to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock + * @instance + * @returns {Object.} JSON object + */ + DocumentLayoutBlock.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DocumentLayoutBlock + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DocumentLayoutBlock.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock"; + }; + + DocumentLayoutBlock.LayoutPageSpan = (function() { + + /** + * Properties of a LayoutPageSpan. + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock + * @interface ILayoutPageSpan + * @property {number|null} [pageStart] LayoutPageSpan pageStart + * @property {number|null} [pageEnd] LayoutPageSpan pageEnd + */ + + /** + * Constructs a new LayoutPageSpan. + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock + * @classdesc Represents a LayoutPageSpan. + * @implements ILayoutPageSpan + * @constructor + * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutPageSpan=} [properties] Properties to set + */ + function LayoutPageSpan(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]]; + } + + /** + * LayoutPageSpan pageStart. + * @member {number} pageStart + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan + * @instance + */ + LayoutPageSpan.prototype.pageStart = 0; + + /** + * LayoutPageSpan pageEnd. + * @member {number} pageEnd + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan + * @instance + */ + LayoutPageSpan.prototype.pageEnd = 0; + + /** + * Creates a new LayoutPageSpan instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan + * @static + * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutPageSpan=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan} LayoutPageSpan instance + */ + LayoutPageSpan.create = function create(properties) { + return new LayoutPageSpan(properties); + }; + + /** + * Encodes the specified LayoutPageSpan message. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan + * @static + * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutPageSpan} message LayoutPageSpan message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LayoutPageSpan.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageStart != null && Object.hasOwnProperty.call(message, "pageStart")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.pageStart); + if (message.pageEnd != null && Object.hasOwnProperty.call(message, "pageEnd")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageEnd); + return writer; + }; + + /** + * Encodes the specified LayoutPageSpan message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan + * @static + * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutPageSpan} message LayoutPageSpan message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LayoutPageSpan.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LayoutPageSpan message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan} LayoutPageSpan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LayoutPageSpan.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.pageStart = reader.int32(); + break; + } + case 2: { + message.pageEnd = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LayoutPageSpan message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan} LayoutPageSpan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LayoutPageSpan.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LayoutPageSpan message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LayoutPageSpan.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pageStart != null && message.hasOwnProperty("pageStart")) + if (!$util.isInteger(message.pageStart)) + return "pageStart: integer expected"; + if (message.pageEnd != null && message.hasOwnProperty("pageEnd")) + if (!$util.isInteger(message.pageEnd)) + return "pageEnd: integer expected"; + return null; + }; + + /** + * Creates a LayoutPageSpan message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan} LayoutPageSpan + */ + LayoutPageSpan.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan) + return object; + var message = new $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan(); + if (object.pageStart != null) + message.pageStart = object.pageStart | 0; + if (object.pageEnd != null) + message.pageEnd = object.pageEnd | 0; + return message; + }; + + /** + * Creates a plain object from a LayoutPageSpan message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan + * @static + * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan} message LayoutPageSpan + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LayoutPageSpan.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.pageStart = 0; + object.pageEnd = 0; + } + if (message.pageStart != null && message.hasOwnProperty("pageStart")) + object.pageStart = message.pageStart; + if (message.pageEnd != null && message.hasOwnProperty("pageEnd")) + object.pageEnd = message.pageEnd; + return object; + }; + + /** + * Converts this LayoutPageSpan to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan + * @instance + * @returns {Object.} JSON object + */ + LayoutPageSpan.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LayoutPageSpan + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LayoutPageSpan.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan"; + }; + + return LayoutPageSpan; + })(); + + DocumentLayoutBlock.LayoutTextBlock = (function() { + + /** + * Properties of a LayoutTextBlock. + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock + * @interface ILayoutTextBlock + * @property {string|null} [text] LayoutTextBlock text + * @property {string|null} [type] LayoutTextBlock type + * @property {Array.|null} [blocks] LayoutTextBlock blocks + */ + + /** + * Constructs a new LayoutTextBlock. + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock + * @classdesc Represents a LayoutTextBlock. + * @implements ILayoutTextBlock + * @constructor + * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTextBlock=} [properties] Properties to set + */ + function LayoutTextBlock(properties) { + this.blocks = []; + 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]]; + } + + /** + * LayoutTextBlock text. + * @member {string} text + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock + * @instance + */ + LayoutTextBlock.prototype.text = ""; + + /** + * LayoutTextBlock type. + * @member {string} type + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock + * @instance + */ + LayoutTextBlock.prototype.type = ""; + + /** + * LayoutTextBlock blocks. + * @member {Array.} blocks + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock + * @instance + */ + LayoutTextBlock.prototype.blocks = $util.emptyArray; + + /** + * Creates a new LayoutTextBlock instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock + * @static + * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTextBlock=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock} LayoutTextBlock instance + */ + LayoutTextBlock.create = function create(properties) { + return new LayoutTextBlock(properties); + }; + + /** + * Encodes the specified LayoutTextBlock message. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock + * @static + * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTextBlock} message LayoutTextBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LayoutTextBlock.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); + if (message.blocks != null && message.blocks.length) + for (var i = 0; i < message.blocks.length; ++i) + $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.encode(message.blocks[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LayoutTextBlock message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock + * @static + * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTextBlock} message LayoutTextBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LayoutTextBlock.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LayoutTextBlock message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock} LayoutTextBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LayoutTextBlock.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + case 2: { + message.type = reader.string(); + break; + } + case 3: { + if (!(message.blocks && message.blocks.length)) + message.blocks = []; + message.blocks.push($root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LayoutTextBlock message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock} LayoutTextBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LayoutTextBlock.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LayoutTextBlock message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LayoutTextBlock.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.blocks != null && message.hasOwnProperty("blocks")) { + if (!Array.isArray(message.blocks)) + return "blocks: array expected"; + for (var i = 0; i < message.blocks.length; ++i) { + var error = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.verify(message.blocks[i]); + if (error) + return "blocks." + error; + } + } + return null; + }; + + /** + * Creates a LayoutTextBlock message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock} LayoutTextBlock + */ + LayoutTextBlock.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock) + return object; + var message = new $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock(); + if (object.text != null) + message.text = String(object.text); + if (object.type != null) + message.type = String(object.type); + if (object.blocks) { + if (!Array.isArray(object.blocks)) + throw TypeError(".google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock.blocks: array expected"); + message.blocks = []; + for (var i = 0; i < object.blocks.length; ++i) { + if (typeof object.blocks[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock.blocks: object expected"); + message.blocks[i] = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.fromObject(object.blocks[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a LayoutTextBlock message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock + * @static + * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock} message LayoutTextBlock + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LayoutTextBlock.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.blocks = []; + if (options.defaults) { + object.text = ""; + object.type = ""; + } + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.blocks && message.blocks.length) { + object.blocks = []; + for (var j = 0; j < message.blocks.length; ++j) + object.blocks[j] = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.toObject(message.blocks[j], options); + } + return object; + }; + + /** + * Converts this LayoutTextBlock to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock + * @instance + * @returns {Object.} JSON object + */ + LayoutTextBlock.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LayoutTextBlock + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LayoutTextBlock.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock"; + }; + + return LayoutTextBlock; + })(); + + DocumentLayoutBlock.LayoutTableBlock = (function() { + + /** + * Properties of a LayoutTableBlock. + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock + * @interface ILayoutTableBlock + * @property {Array.|null} [headerRows] LayoutTableBlock headerRows + * @property {Array.|null} [bodyRows] LayoutTableBlock bodyRows + * @property {string|null} [caption] LayoutTableBlock caption + */ + + /** + * Constructs a new LayoutTableBlock. + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock + * @classdesc Represents a LayoutTableBlock. + * @implements ILayoutTableBlock + * @constructor + * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableBlock=} [properties] Properties to set + */ + function LayoutTableBlock(properties) { + this.headerRows = []; + this.bodyRows = []; + 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]]; + } + + /** + * LayoutTableBlock headerRows. + * @member {Array.} headerRows + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock + * @instance + */ + LayoutTableBlock.prototype.headerRows = $util.emptyArray; + + /** + * LayoutTableBlock bodyRows. + * @member {Array.} bodyRows + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock + * @instance + */ + LayoutTableBlock.prototype.bodyRows = $util.emptyArray; + + /** + * LayoutTableBlock caption. + * @member {string} caption + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock + * @instance + */ + LayoutTableBlock.prototype.caption = ""; + + /** + * Creates a new LayoutTableBlock instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock + * @static + * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableBlock=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock} LayoutTableBlock instance + */ + LayoutTableBlock.create = function create(properties) { + return new LayoutTableBlock(properties); + }; + + /** + * Encodes the specified LayoutTableBlock message. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock + * @static + * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableBlock} message LayoutTableBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LayoutTableBlock.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.headerRows != null && message.headerRows.length) + for (var i = 0; i < message.headerRows.length; ++i) + $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow.encode(message.headerRows[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.bodyRows != null && message.bodyRows.length) + for (var i = 0; i < message.bodyRows.length; ++i) + $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow.encode(message.bodyRows[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.caption != null && Object.hasOwnProperty.call(message, "caption")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.caption); + return writer; + }; + + /** + * Encodes the specified LayoutTableBlock message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock + * @static + * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableBlock} message LayoutTableBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LayoutTableBlock.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LayoutTableBlock message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock} LayoutTableBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LayoutTableBlock.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.headerRows && message.headerRows.length)) + message.headerRows = []; + message.headerRows.push($root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.bodyRows && message.bodyRows.length)) + message.bodyRows = []; + message.bodyRows.push($root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow.decode(reader, reader.uint32())); + break; + } + case 3: { + message.caption = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LayoutTableBlock message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock} LayoutTableBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LayoutTableBlock.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LayoutTableBlock message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LayoutTableBlock.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.headerRows != null && message.hasOwnProperty("headerRows")) { + if (!Array.isArray(message.headerRows)) + return "headerRows: array expected"; + for (var i = 0; i < message.headerRows.length; ++i) { + var error = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow.verify(message.headerRows[i]); + if (error) + return "headerRows." + error; + } + } + if (message.bodyRows != null && message.hasOwnProperty("bodyRows")) { + if (!Array.isArray(message.bodyRows)) + return "bodyRows: array expected"; + for (var i = 0; i < message.bodyRows.length; ++i) { + var error = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow.verify(message.bodyRows[i]); + if (error) + return "bodyRows." + error; + } + } + if (message.caption != null && message.hasOwnProperty("caption")) + if (!$util.isString(message.caption)) + return "caption: string expected"; + return null; + }; + + /** + * Creates a LayoutTableBlock message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock} LayoutTableBlock + */ + LayoutTableBlock.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock) + return object; + var message = new $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock(); + if (object.headerRows) { + if (!Array.isArray(object.headerRows)) + throw TypeError(".google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock.headerRows: array expected"); + message.headerRows = []; + for (var i = 0; i < object.headerRows.length; ++i) { + if (typeof object.headerRows[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock.headerRows: object expected"); + message.headerRows[i] = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow.fromObject(object.headerRows[i]); + } + } + if (object.bodyRows) { + if (!Array.isArray(object.bodyRows)) + throw TypeError(".google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock.bodyRows: array expected"); + message.bodyRows = []; + for (var i = 0; i < object.bodyRows.length; ++i) { + if (typeof object.bodyRows[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock.bodyRows: object expected"); + message.bodyRows[i] = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow.fromObject(object.bodyRows[i]); + } + } + if (object.caption != null) + message.caption = String(object.caption); + return message; + }; + + /** + * Creates a plain object from a LayoutTableBlock message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock + * @static + * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock} message LayoutTableBlock + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LayoutTableBlock.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.headerRows = []; + object.bodyRows = []; + } + if (options.defaults) + object.caption = ""; + if (message.headerRows && message.headerRows.length) { + object.headerRows = []; + for (var j = 0; j < message.headerRows.length; ++j) + object.headerRows[j] = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow.toObject(message.headerRows[j], options); + } + if (message.bodyRows && message.bodyRows.length) { + object.bodyRows = []; + for (var j = 0; j < message.bodyRows.length; ++j) + object.bodyRows[j] = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow.toObject(message.bodyRows[j], options); + } + if (message.caption != null && message.hasOwnProperty("caption")) + object.caption = message.caption; + return object; + }; + + /** + * Converts this LayoutTableBlock to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock + * @instance + * @returns {Object.} JSON object + */ + LayoutTableBlock.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LayoutTableBlock + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LayoutTableBlock.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock"; + }; + + return LayoutTableBlock; + })(); + + DocumentLayoutBlock.LayoutTableRow = (function() { + + /** + * Properties of a LayoutTableRow. + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock + * @interface ILayoutTableRow + * @property {Array.|null} [cells] LayoutTableRow cells + */ + + /** + * Constructs a new LayoutTableRow. + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock + * @classdesc Represents a LayoutTableRow. + * @implements ILayoutTableRow + * @constructor + * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableRow=} [properties] Properties to set + */ + function LayoutTableRow(properties) { + this.cells = []; + 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]]; + } + + /** + * LayoutTableRow cells. + * @member {Array.} cells + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow + * @instance + */ + LayoutTableRow.prototype.cells = $util.emptyArray; + + /** + * Creates a new LayoutTableRow instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow + * @static + * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableRow=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow} LayoutTableRow instance + */ + LayoutTableRow.create = function create(properties) { + return new LayoutTableRow(properties); + }; + + /** + * Encodes the specified LayoutTableRow message. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow + * @static + * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableRow} message LayoutTableRow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LayoutTableRow.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cells != null && message.cells.length) + for (var i = 0; i < message.cells.length; ++i) + $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell.encode(message.cells[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LayoutTableRow message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow + * @static + * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableRow} message LayoutTableRow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LayoutTableRow.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LayoutTableRow message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow} LayoutTableRow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LayoutTableRow.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.cells && message.cells.length)) + message.cells = []; + message.cells.push($root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LayoutTableRow message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow} LayoutTableRow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LayoutTableRow.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LayoutTableRow message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LayoutTableRow.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cells != null && message.hasOwnProperty("cells")) { + if (!Array.isArray(message.cells)) + return "cells: array expected"; + for (var i = 0; i < message.cells.length; ++i) { + var error = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell.verify(message.cells[i]); + if (error) + return "cells." + error; + } + } + return null; + }; + + /** + * Creates a LayoutTableRow message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow} LayoutTableRow + */ + LayoutTableRow.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow) + return object; + var message = new $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow(); + if (object.cells) { + if (!Array.isArray(object.cells)) + throw TypeError(".google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow.cells: array expected"); + message.cells = []; + for (var i = 0; i < object.cells.length; ++i) { + if (typeof object.cells[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow.cells: object expected"); + message.cells[i] = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell.fromObject(object.cells[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a LayoutTableRow message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow + * @static + * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow} message LayoutTableRow + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LayoutTableRow.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.cells = []; + if (message.cells && message.cells.length) { + object.cells = []; + for (var j = 0; j < message.cells.length; ++j) + object.cells[j] = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell.toObject(message.cells[j], options); + } + return object; + }; + + /** + * Converts this LayoutTableRow to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow + * @instance + * @returns {Object.} JSON object + */ + LayoutTableRow.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LayoutTableRow + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LayoutTableRow.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow"; + }; + + return LayoutTableRow; + })(); + + DocumentLayoutBlock.LayoutTableCell = (function() { + + /** + * Properties of a LayoutTableCell. + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock + * @interface ILayoutTableCell + * @property {Array.|null} [blocks] LayoutTableCell blocks + * @property {number|null} [rowSpan] LayoutTableCell rowSpan + * @property {number|null} [colSpan] LayoutTableCell colSpan + */ + + /** + * Constructs a new LayoutTableCell. + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock + * @classdesc Represents a LayoutTableCell. + * @implements ILayoutTableCell + * @constructor + * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableCell=} [properties] Properties to set + */ + function LayoutTableCell(properties) { + this.blocks = []; + 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]]; + } + + /** + * LayoutTableCell blocks. + * @member {Array.} blocks + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell + * @instance + */ + LayoutTableCell.prototype.blocks = $util.emptyArray; + + /** + * LayoutTableCell rowSpan. + * @member {number} rowSpan + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell + * @instance + */ + LayoutTableCell.prototype.rowSpan = 0; + + /** + * LayoutTableCell colSpan. + * @member {number} colSpan + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell + * @instance + */ + LayoutTableCell.prototype.colSpan = 0; + + /** + * Creates a new LayoutTableCell instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell + * @static + * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableCell=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell} LayoutTableCell instance + */ + LayoutTableCell.create = function create(properties) { + return new LayoutTableCell(properties); + }; + + /** + * Encodes the specified LayoutTableCell message. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell + * @static + * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableCell} message LayoutTableCell message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LayoutTableCell.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.blocks != null && message.blocks.length) + for (var i = 0; i < message.blocks.length; ++i) + $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.encode(message.blocks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.rowSpan != null && Object.hasOwnProperty.call(message, "rowSpan")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.rowSpan); + if (message.colSpan != null && Object.hasOwnProperty.call(message, "colSpan")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.colSpan); + return writer; + }; + + /** + * Encodes the specified LayoutTableCell message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell + * @static + * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableCell} message LayoutTableCell message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LayoutTableCell.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LayoutTableCell message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell} LayoutTableCell + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LayoutTableCell.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.blocks && message.blocks.length)) + message.blocks = []; + message.blocks.push($root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.decode(reader, reader.uint32())); + break; + } + case 2: { + message.rowSpan = reader.int32(); + break; + } + case 3: { + message.colSpan = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LayoutTableCell message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell} LayoutTableCell + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LayoutTableCell.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LayoutTableCell message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LayoutTableCell.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.blocks != null && message.hasOwnProperty("blocks")) { + if (!Array.isArray(message.blocks)) + return "blocks: array expected"; + for (var i = 0; i < message.blocks.length; ++i) { + var error = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.verify(message.blocks[i]); + if (error) + return "blocks." + error; + } + } + if (message.rowSpan != null && message.hasOwnProperty("rowSpan")) + if (!$util.isInteger(message.rowSpan)) + return "rowSpan: integer expected"; + if (message.colSpan != null && message.hasOwnProperty("colSpan")) + if (!$util.isInteger(message.colSpan)) + return "colSpan: integer expected"; + return null; + }; + + /** + * Creates a LayoutTableCell message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell} LayoutTableCell + */ + LayoutTableCell.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell) + return object; + var message = new $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell(); + if (object.blocks) { + if (!Array.isArray(object.blocks)) + throw TypeError(".google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell.blocks: array expected"); + message.blocks = []; + for (var i = 0; i < object.blocks.length; ++i) { + if (typeof object.blocks[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell.blocks: object expected"); + message.blocks[i] = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.fromObject(object.blocks[i]); + } + } + if (object.rowSpan != null) + message.rowSpan = object.rowSpan | 0; + if (object.colSpan != null) + message.colSpan = object.colSpan | 0; + return message; + }; + + /** + * Creates a plain object from a LayoutTableCell message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell + * @static + * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell} message LayoutTableCell + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LayoutTableCell.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.blocks = []; + if (options.defaults) { + object.rowSpan = 0; + object.colSpan = 0; + } + if (message.blocks && message.blocks.length) { + object.blocks = []; + for (var j = 0; j < message.blocks.length; ++j) + object.blocks[j] = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.toObject(message.blocks[j], options); + } + if (message.rowSpan != null && message.hasOwnProperty("rowSpan")) + object.rowSpan = message.rowSpan; + if (message.colSpan != null && message.hasOwnProperty("colSpan")) + object.colSpan = message.colSpan; + return object; + }; + + /** + * Converts this LayoutTableCell to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell + * @instance + * @returns {Object.} JSON object + */ + LayoutTableCell.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LayoutTableCell + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LayoutTableCell.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell"; + }; + + return LayoutTableCell; + })(); + + DocumentLayoutBlock.LayoutListBlock = (function() { + + /** + * Properties of a LayoutListBlock. + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock + * @interface ILayoutListBlock + * @property {Array.|null} [listEntries] LayoutListBlock listEntries + * @property {string|null} [type] LayoutListBlock type + */ + + /** + * Constructs a new LayoutListBlock. + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock + * @classdesc Represents a LayoutListBlock. + * @implements ILayoutListBlock + * @constructor + * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListBlock=} [properties] Properties to set + */ + function LayoutListBlock(properties) { + this.listEntries = []; + 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]]; + } + + /** + * LayoutListBlock listEntries. + * @member {Array.} listEntries + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock + * @instance + */ + LayoutListBlock.prototype.listEntries = $util.emptyArray; + + /** + * LayoutListBlock type. + * @member {string} type + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock + * @instance + */ + LayoutListBlock.prototype.type = ""; + + /** + * Creates a new LayoutListBlock instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock + * @static + * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListBlock=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock} LayoutListBlock instance + */ + LayoutListBlock.create = function create(properties) { + return new LayoutListBlock(properties); + }; + + /** + * Encodes the specified LayoutListBlock message. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock + * @static + * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListBlock} message LayoutListBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LayoutListBlock.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.listEntries != null && message.listEntries.length) + for (var i = 0; i < message.listEntries.length; ++i) + $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry.encode(message.listEntries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); + return writer; + }; + + /** + * Encodes the specified LayoutListBlock message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock + * @static + * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListBlock} message LayoutListBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LayoutListBlock.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LayoutListBlock message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock} LayoutListBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LayoutListBlock.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.listEntries && message.listEntries.length)) + message.listEntries = []; + message.listEntries.push($root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry.decode(reader, reader.uint32())); + break; + } + case 2: { + message.type = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LayoutListBlock message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock} LayoutListBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LayoutListBlock.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LayoutListBlock message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LayoutListBlock.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.listEntries != null && message.hasOwnProperty("listEntries")) { + if (!Array.isArray(message.listEntries)) + return "listEntries: array expected"; + for (var i = 0; i < message.listEntries.length; ++i) { + var error = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry.verify(message.listEntries[i]); + if (error) + return "listEntries." + error; + } + } + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + return null; + }; + + /** + * Creates a LayoutListBlock message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock} LayoutListBlock + */ + LayoutListBlock.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock) + return object; + var message = new $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock(); + if (object.listEntries) { + if (!Array.isArray(object.listEntries)) + throw TypeError(".google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock.listEntries: array expected"); + message.listEntries = []; + for (var i = 0; i < object.listEntries.length; ++i) { + if (typeof object.listEntries[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock.listEntries: object expected"); + message.listEntries[i] = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry.fromObject(object.listEntries[i]); + } + } + if (object.type != null) + message.type = String(object.type); + return message; + }; + + /** + * Creates a plain object from a LayoutListBlock message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock + * @static + * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock} message LayoutListBlock + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LayoutListBlock.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.listEntries = []; + if (options.defaults) + object.type = ""; + if (message.listEntries && message.listEntries.length) { + object.listEntries = []; + for (var j = 0; j < message.listEntries.length; ++j) + object.listEntries[j] = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry.toObject(message.listEntries[j], options); + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + return object; + }; + + /** + * Converts this LayoutListBlock to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock + * @instance + * @returns {Object.} JSON object + */ + LayoutListBlock.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LayoutListBlock + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LayoutListBlock.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock"; + }; + + return LayoutListBlock; + })(); + + DocumentLayoutBlock.LayoutListEntry = (function() { + + /** + * Properties of a LayoutListEntry. + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock + * @interface ILayoutListEntry + * @property {Array.|null} [blocks] LayoutListEntry blocks + */ + + /** + * Constructs a new LayoutListEntry. + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock + * @classdesc Represents a LayoutListEntry. + * @implements ILayoutListEntry + * @constructor + * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListEntry=} [properties] Properties to set + */ + function LayoutListEntry(properties) { + this.blocks = []; + 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]]; + } + + /** + * LayoutListEntry blocks. + * @member {Array.} blocks + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry + * @instance + */ + LayoutListEntry.prototype.blocks = $util.emptyArray; + + /** + * Creates a new LayoutListEntry instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry + * @static + * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListEntry=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry} LayoutListEntry instance + */ + LayoutListEntry.create = function create(properties) { + return new LayoutListEntry(properties); + }; + + /** + * Encodes the specified LayoutListEntry message. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry + * @static + * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListEntry} message LayoutListEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LayoutListEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.blocks != null && message.blocks.length) + for (var i = 0; i < message.blocks.length; ++i) + $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.encode(message.blocks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LayoutListEntry message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry + * @static + * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListEntry} message LayoutListEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LayoutListEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LayoutListEntry message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry} LayoutListEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LayoutListEntry.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.blocks && message.blocks.length)) + message.blocks = []; + message.blocks.push($root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LayoutListEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry} LayoutListEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LayoutListEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LayoutListEntry message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LayoutListEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.blocks != null && message.hasOwnProperty("blocks")) { + if (!Array.isArray(message.blocks)) + return "blocks: array expected"; + for (var i = 0; i < message.blocks.length; ++i) { + var error = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.verify(message.blocks[i]); + if (error) + return "blocks." + error; + } + } + return null; + }; + + /** + * Creates a LayoutListEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry} LayoutListEntry + */ + LayoutListEntry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry) + return object; + var message = new $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry(); + if (object.blocks) { + if (!Array.isArray(object.blocks)) + throw TypeError(".google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry.blocks: array expected"); + message.blocks = []; + for (var i = 0; i < object.blocks.length; ++i) { + if (typeof object.blocks[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry.blocks: object expected"); + message.blocks[i] = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.fromObject(object.blocks[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a LayoutListEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry + * @static + * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry} message LayoutListEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LayoutListEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.blocks = []; + if (message.blocks && message.blocks.length) { + object.blocks = []; + for (var j = 0; j < message.blocks.length; ++j) + object.blocks[j] = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.toObject(message.blocks[j], options); + } + return object; + }; + + /** + * Converts this LayoutListEntry to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry + * @instance + * @returns {Object.} JSON object + */ + LayoutListEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LayoutListEntry + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LayoutListEntry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry"; + }; + + return LayoutListEntry; + })(); + + return DocumentLayoutBlock; + })(); + + return DocumentLayout; + })(); + + Document.ChunkedDocument = (function() { + + /** + * Properties of a ChunkedDocument. + * @memberof google.cloud.documentai.v1.Document + * @interface IChunkedDocument + * @property {Array.|null} [chunks] ChunkedDocument chunks + */ + + /** + * Constructs a new ChunkedDocument. + * @memberof google.cloud.documentai.v1.Document + * @classdesc Represents a ChunkedDocument. + * @implements IChunkedDocument + * @constructor + * @param {google.cloud.documentai.v1.Document.IChunkedDocument=} [properties] Properties to set + */ + function ChunkedDocument(properties) { + this.chunks = []; + 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]]; + } + + /** + * ChunkedDocument chunks. + * @member {Array.} chunks + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument + * @instance + */ + ChunkedDocument.prototype.chunks = $util.emptyArray; + + /** + * Creates a new ChunkedDocument instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument + * @static + * @param {google.cloud.documentai.v1.Document.IChunkedDocument=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.ChunkedDocument} ChunkedDocument instance + */ + ChunkedDocument.create = function create(properties) { + return new ChunkedDocument(properties); + }; + + /** + * Encodes the specified ChunkedDocument message. Does not implicitly {@link google.cloud.documentai.v1.Document.ChunkedDocument.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument + * @static + * @param {google.cloud.documentai.v1.Document.IChunkedDocument} message ChunkedDocument message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChunkedDocument.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.chunks != null && message.chunks.length) + for (var i = 0; i < message.chunks.length; ++i) + $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.encode(message.chunks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ChunkedDocument message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.ChunkedDocument.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument + * @static + * @param {google.cloud.documentai.v1.Document.IChunkedDocument} message ChunkedDocument message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChunkedDocument.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ChunkedDocument message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.ChunkedDocument} ChunkedDocument + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChunkedDocument.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.ChunkedDocument(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.chunks && message.chunks.length)) + message.chunks = []; + message.chunks.push($root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ChunkedDocument message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.ChunkedDocument} ChunkedDocument + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChunkedDocument.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ChunkedDocument message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ChunkedDocument.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.chunks != null && message.hasOwnProperty("chunks")) { + if (!Array.isArray(message.chunks)) + return "chunks: array expected"; + for (var i = 0; i < message.chunks.length; ++i) { + var error = $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.verify(message.chunks[i]); + if (error) + return "chunks." + error; + } + } + return null; + }; + + /** + * Creates a ChunkedDocument message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.ChunkedDocument} ChunkedDocument + */ + ChunkedDocument.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.ChunkedDocument) + return object; + var message = new $root.google.cloud.documentai.v1.Document.ChunkedDocument(); + if (object.chunks) { + if (!Array.isArray(object.chunks)) + throw TypeError(".google.cloud.documentai.v1.Document.ChunkedDocument.chunks: array expected"); + message.chunks = []; + for (var i = 0; i < object.chunks.length; ++i) { + if (typeof object.chunks[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.ChunkedDocument.chunks: object expected"); + message.chunks[i] = $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.fromObject(object.chunks[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ChunkedDocument message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument + * @static + * @param {google.cloud.documentai.v1.Document.ChunkedDocument} message ChunkedDocument + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ChunkedDocument.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.chunks = []; + if (message.chunks && message.chunks.length) { + object.chunks = []; + for (var j = 0; j < message.chunks.length; ++j) + object.chunks[j] = $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.toObject(message.chunks[j], options); + } + return object; + }; + + /** + * Converts this ChunkedDocument to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument + * @instance + * @returns {Object.} JSON object + */ + ChunkedDocument.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ChunkedDocument + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ChunkedDocument.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.ChunkedDocument"; + }; + + ChunkedDocument.Chunk = (function() { + + /** + * Properties of a Chunk. + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument + * @interface IChunk + * @property {string|null} [chunkId] Chunk chunkId + * @property {Array.|null} [sourceBlockIds] Chunk sourceBlockIds + * @property {string|null} [content] Chunk content + * @property {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageSpan|null} [pageSpan] Chunk pageSpan + * @property {Array.|null} [pageHeaders] Chunk pageHeaders + * @property {Array.|null} [pageFooters] Chunk pageFooters + */ + + /** + * Constructs a new Chunk. + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument + * @classdesc Represents a Chunk. + * @implements IChunk + * @constructor + * @param {google.cloud.documentai.v1.Document.ChunkedDocument.IChunk=} [properties] Properties to set + */ + function Chunk(properties) { + this.sourceBlockIds = []; + this.pageHeaders = []; + this.pageFooters = []; + 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]]; + } + + /** + * Chunk chunkId. + * @member {string} chunkId + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk + * @instance + */ + Chunk.prototype.chunkId = ""; + + /** + * Chunk sourceBlockIds. + * @member {Array.} sourceBlockIds + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk + * @instance + */ + Chunk.prototype.sourceBlockIds = $util.emptyArray; + + /** + * Chunk content. + * @member {string} content + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk + * @instance + */ + Chunk.prototype.content = ""; + + /** + * Chunk pageSpan. + * @member {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageSpan|null|undefined} pageSpan + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk + * @instance + */ + Chunk.prototype.pageSpan = null; + + /** + * Chunk pageHeaders. + * @member {Array.} pageHeaders + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk + * @instance + */ + Chunk.prototype.pageHeaders = $util.emptyArray; + + /** + * Chunk pageFooters. + * @member {Array.} pageFooters + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk + * @instance + */ + Chunk.prototype.pageFooters = $util.emptyArray; + + /** + * Creates a new Chunk instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk + * @static + * @param {google.cloud.documentai.v1.Document.ChunkedDocument.IChunk=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk} Chunk instance + */ + Chunk.create = function create(properties) { + return new Chunk(properties); + }; + + /** + * Encodes the specified Chunk message. Does not implicitly {@link google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk + * @static + * @param {google.cloud.documentai.v1.Document.ChunkedDocument.IChunk} message Chunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Chunk.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.chunkId != null && Object.hasOwnProperty.call(message, "chunkId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.chunkId); + if (message.sourceBlockIds != null && message.sourceBlockIds.length) + for (var i = 0; i < message.sourceBlockIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceBlockIds[i]); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.content); + if (message.pageSpan != null && Object.hasOwnProperty.call(message, "pageSpan")) + $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan.encode(message.pageSpan, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.pageHeaders != null && message.pageHeaders.length) + for (var i = 0; i < message.pageHeaders.length; ++i) + $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader.encode(message.pageHeaders[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.pageFooters != null && message.pageFooters.length) + for (var i = 0; i < message.pageFooters.length; ++i) + $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter.encode(message.pageFooters[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Chunk message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk + * @static + * @param {google.cloud.documentai.v1.Document.ChunkedDocument.IChunk} message Chunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Chunk.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Chunk message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk} Chunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Chunk.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.chunkId = reader.string(); + break; + } + case 2: { + if (!(message.sourceBlockIds && message.sourceBlockIds.length)) + message.sourceBlockIds = []; + message.sourceBlockIds.push(reader.string()); + break; + } + case 3: { + message.content = reader.string(); + break; + } + case 4: { + message.pageSpan = $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan.decode(reader, reader.uint32()); + break; + } + case 5: { + if (!(message.pageHeaders && message.pageHeaders.length)) + message.pageHeaders = []; + message.pageHeaders.push($root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.pageFooters && message.pageFooters.length)) + message.pageFooters = []; + message.pageFooters.push($root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Chunk message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk} Chunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Chunk.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Chunk message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Chunk.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.chunkId != null && message.hasOwnProperty("chunkId")) + if (!$util.isString(message.chunkId)) + return "chunkId: string expected"; + if (message.sourceBlockIds != null && message.hasOwnProperty("sourceBlockIds")) { + if (!Array.isArray(message.sourceBlockIds)) + return "sourceBlockIds: array expected"; + for (var i = 0; i < message.sourceBlockIds.length; ++i) + if (!$util.isString(message.sourceBlockIds[i])) + return "sourceBlockIds: string[] expected"; + } + if (message.content != null && message.hasOwnProperty("content")) + if (!$util.isString(message.content)) + return "content: string expected"; + if (message.pageSpan != null && message.hasOwnProperty("pageSpan")) { + var error = $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan.verify(message.pageSpan); + if (error) + return "pageSpan." + error; + } + if (message.pageHeaders != null && message.hasOwnProperty("pageHeaders")) { + if (!Array.isArray(message.pageHeaders)) + return "pageHeaders: array expected"; + for (var i = 0; i < message.pageHeaders.length; ++i) { + var error = $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader.verify(message.pageHeaders[i]); + if (error) + return "pageHeaders." + error; + } + } + if (message.pageFooters != null && message.hasOwnProperty("pageFooters")) { + if (!Array.isArray(message.pageFooters)) + return "pageFooters: array expected"; + for (var i = 0; i < message.pageFooters.length; ++i) { + var error = $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter.verify(message.pageFooters[i]); + if (error) + return "pageFooters." + error; + } + } + return null; + }; + + /** + * Creates a Chunk message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk} Chunk + */ + Chunk.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk) + return object; + var message = new $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk(); + if (object.chunkId != null) + message.chunkId = String(object.chunkId); + if (object.sourceBlockIds) { + if (!Array.isArray(object.sourceBlockIds)) + throw TypeError(".google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.sourceBlockIds: array expected"); + message.sourceBlockIds = []; + for (var i = 0; i < object.sourceBlockIds.length; ++i) + message.sourceBlockIds[i] = String(object.sourceBlockIds[i]); + } + if (object.content != null) + message.content = String(object.content); + if (object.pageSpan != null) { + if (typeof object.pageSpan !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.pageSpan: object expected"); + message.pageSpan = $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan.fromObject(object.pageSpan); + } + if (object.pageHeaders) { + if (!Array.isArray(object.pageHeaders)) + throw TypeError(".google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.pageHeaders: array expected"); + message.pageHeaders = []; + for (var i = 0; i < object.pageHeaders.length; ++i) { + if (typeof object.pageHeaders[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.pageHeaders: object expected"); + message.pageHeaders[i] = $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader.fromObject(object.pageHeaders[i]); + } + } + if (object.pageFooters) { + if (!Array.isArray(object.pageFooters)) + throw TypeError(".google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.pageFooters: array expected"); + message.pageFooters = []; + for (var i = 0; i < object.pageFooters.length; ++i) { + if (typeof object.pageFooters[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.pageFooters: object expected"); + message.pageFooters[i] = $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter.fromObject(object.pageFooters[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Chunk message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk + * @static + * @param {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk} message Chunk + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Chunk.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.sourceBlockIds = []; + object.pageHeaders = []; + object.pageFooters = []; + } + if (options.defaults) { + object.chunkId = ""; + object.content = ""; + object.pageSpan = null; + } + if (message.chunkId != null && message.hasOwnProperty("chunkId")) + object.chunkId = message.chunkId; + if (message.sourceBlockIds && message.sourceBlockIds.length) { + object.sourceBlockIds = []; + for (var j = 0; j < message.sourceBlockIds.length; ++j) + object.sourceBlockIds[j] = message.sourceBlockIds[j]; + } + if (message.content != null && message.hasOwnProperty("content")) + object.content = message.content; + if (message.pageSpan != null && message.hasOwnProperty("pageSpan")) + object.pageSpan = $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan.toObject(message.pageSpan, options); + if (message.pageHeaders && message.pageHeaders.length) { + object.pageHeaders = []; + for (var j = 0; j < message.pageHeaders.length; ++j) + object.pageHeaders[j] = $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader.toObject(message.pageHeaders[j], options); + } + if (message.pageFooters && message.pageFooters.length) { + object.pageFooters = []; + for (var j = 0; j < message.pageFooters.length; ++j) + object.pageFooters[j] = $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter.toObject(message.pageFooters[j], options); + } + return object; + }; + + /** + * Converts this Chunk to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk + * @instance + * @returns {Object.} JSON object + */ + Chunk.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Chunk + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Chunk.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.ChunkedDocument.Chunk"; + }; + + Chunk.ChunkPageSpan = (function() { + + /** + * Properties of a ChunkPageSpan. + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk + * @interface IChunkPageSpan + * @property {number|null} [pageStart] ChunkPageSpan pageStart + * @property {number|null} [pageEnd] ChunkPageSpan pageEnd + */ + + /** + * Constructs a new ChunkPageSpan. + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk + * @classdesc Represents a ChunkPageSpan. + * @implements IChunkPageSpan + * @constructor + * @param {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageSpan=} [properties] Properties to set + */ + function ChunkPageSpan(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]]; + } + + /** + * ChunkPageSpan pageStart. + * @member {number} pageStart + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan + * @instance + */ + ChunkPageSpan.prototype.pageStart = 0; + + /** + * ChunkPageSpan pageEnd. + * @member {number} pageEnd + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan + * @instance + */ + ChunkPageSpan.prototype.pageEnd = 0; + + /** + * Creates a new ChunkPageSpan instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan + * @static + * @param {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageSpan=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan} ChunkPageSpan instance + */ + ChunkPageSpan.create = function create(properties) { + return new ChunkPageSpan(properties); + }; + + /** + * Encodes the specified ChunkPageSpan message. Does not implicitly {@link google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan + * @static + * @param {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageSpan} message ChunkPageSpan message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChunkPageSpan.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageStart != null && Object.hasOwnProperty.call(message, "pageStart")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.pageStart); + if (message.pageEnd != null && Object.hasOwnProperty.call(message, "pageEnd")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageEnd); + return writer; + }; + + /** + * Encodes the specified ChunkPageSpan message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan + * @static + * @param {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageSpan} message ChunkPageSpan message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChunkPageSpan.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ChunkPageSpan message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan} ChunkPageSpan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChunkPageSpan.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.pageStart = reader.int32(); + break; + } + case 2: { + message.pageEnd = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ChunkPageSpan message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan} ChunkPageSpan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChunkPageSpan.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ChunkPageSpan message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ChunkPageSpan.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pageStart != null && message.hasOwnProperty("pageStart")) + if (!$util.isInteger(message.pageStart)) + return "pageStart: integer expected"; + if (message.pageEnd != null && message.hasOwnProperty("pageEnd")) + if (!$util.isInteger(message.pageEnd)) + return "pageEnd: integer expected"; + return null; + }; + + /** + * Creates a ChunkPageSpan message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan} ChunkPageSpan + */ + ChunkPageSpan.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan) + return object; + var message = new $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan(); + if (object.pageStart != null) + message.pageStart = object.pageStart | 0; + if (object.pageEnd != null) + message.pageEnd = object.pageEnd | 0; + return message; + }; + + /** + * Creates a plain object from a ChunkPageSpan message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan + * @static + * @param {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan} message ChunkPageSpan + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ChunkPageSpan.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.pageStart = 0; + object.pageEnd = 0; + } + if (message.pageStart != null && message.hasOwnProperty("pageStart")) + object.pageStart = message.pageStart; + if (message.pageEnd != null && message.hasOwnProperty("pageEnd")) + object.pageEnd = message.pageEnd; + return object; + }; + + /** + * Converts this ChunkPageSpan to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan + * @instance + * @returns {Object.} JSON object + */ + ChunkPageSpan.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ChunkPageSpan + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ChunkPageSpan.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan"; + }; + + return ChunkPageSpan; + })(); + + Chunk.ChunkPageHeader = (function() { + + /** + * Properties of a ChunkPageHeader. + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk + * @interface IChunkPageHeader + * @property {string|null} [text] ChunkPageHeader text + * @property {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageSpan|null} [pageSpan] ChunkPageHeader pageSpan + */ + + /** + * Constructs a new ChunkPageHeader. + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk + * @classdesc Represents a ChunkPageHeader. + * @implements IChunkPageHeader + * @constructor + * @param {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageHeader=} [properties] Properties to set + */ + function ChunkPageHeader(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]]; + } + + /** + * ChunkPageHeader text. + * @member {string} text + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader + * @instance + */ + ChunkPageHeader.prototype.text = ""; + + /** + * ChunkPageHeader pageSpan. + * @member {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageSpan|null|undefined} pageSpan + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader + * @instance + */ + ChunkPageHeader.prototype.pageSpan = null; + + /** + * Creates a new ChunkPageHeader instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader + * @static + * @param {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageHeader=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader} ChunkPageHeader instance + */ + ChunkPageHeader.create = function create(properties) { + return new ChunkPageHeader(properties); + }; + + /** + * Encodes the specified ChunkPageHeader message. Does not implicitly {@link google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader + * @static + * @param {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageHeader} message ChunkPageHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChunkPageHeader.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.pageSpan != null && Object.hasOwnProperty.call(message, "pageSpan")) + $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan.encode(message.pageSpan, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ChunkPageHeader message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader + * @static + * @param {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageHeader} message ChunkPageHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChunkPageHeader.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ChunkPageHeader message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader} ChunkPageHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChunkPageHeader.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + case 2: { + message.pageSpan = $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ChunkPageHeader message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader} ChunkPageHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChunkPageHeader.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ChunkPageHeader message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ChunkPageHeader.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.pageSpan != null && message.hasOwnProperty("pageSpan")) { + var error = $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan.verify(message.pageSpan); + if (error) + return "pageSpan." + error; + } + return null; + }; + + /** + * Creates a ChunkPageHeader message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader} ChunkPageHeader + */ + ChunkPageHeader.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader) + return object; + var message = new $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader(); + if (object.text != null) + message.text = String(object.text); + if (object.pageSpan != null) { + if (typeof object.pageSpan !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader.pageSpan: object expected"); + message.pageSpan = $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan.fromObject(object.pageSpan); + } + return message; + }; + + /** + * Creates a plain object from a ChunkPageHeader message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader + * @static + * @param {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader} message ChunkPageHeader + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ChunkPageHeader.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.text = ""; + object.pageSpan = null; + } + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.pageSpan != null && message.hasOwnProperty("pageSpan")) + object.pageSpan = $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan.toObject(message.pageSpan, options); + return object; + }; + + /** + * Converts this ChunkPageHeader to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader + * @instance + * @returns {Object.} JSON object + */ + ChunkPageHeader.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ChunkPageHeader + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ChunkPageHeader.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader"; + }; + + return ChunkPageHeader; + })(); + + Chunk.ChunkPageFooter = (function() { + + /** + * Properties of a ChunkPageFooter. + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk + * @interface IChunkPageFooter + * @property {string|null} [text] ChunkPageFooter text + * @property {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageSpan|null} [pageSpan] ChunkPageFooter pageSpan + */ + + /** + * Constructs a new ChunkPageFooter. + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk + * @classdesc Represents a ChunkPageFooter. + * @implements IChunkPageFooter + * @constructor + * @param {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageFooter=} [properties] Properties to set + */ + function ChunkPageFooter(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]]; + } + + /** + * ChunkPageFooter text. + * @member {string} text + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter + * @instance + */ + ChunkPageFooter.prototype.text = ""; + + /** + * ChunkPageFooter pageSpan. + * @member {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageSpan|null|undefined} pageSpan + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter + * @instance + */ + ChunkPageFooter.prototype.pageSpan = null; + + /** + * Creates a new ChunkPageFooter instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter + * @static + * @param {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageFooter=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter} ChunkPageFooter instance + */ + ChunkPageFooter.create = function create(properties) { + return new ChunkPageFooter(properties); + }; + + /** + * Encodes the specified ChunkPageFooter message. Does not implicitly {@link google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter + * @static + * @param {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageFooter} message ChunkPageFooter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChunkPageFooter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.pageSpan != null && Object.hasOwnProperty.call(message, "pageSpan")) + $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan.encode(message.pageSpan, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ChunkPageFooter message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter + * @static + * @param {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageFooter} message ChunkPageFooter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChunkPageFooter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ChunkPageFooter message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter} ChunkPageFooter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChunkPageFooter.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + case 2: { + message.pageSpan = $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ChunkPageFooter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter} ChunkPageFooter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChunkPageFooter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ChunkPageFooter message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ChunkPageFooter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.pageSpan != null && message.hasOwnProperty("pageSpan")) { + var error = $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan.verify(message.pageSpan); + if (error) + return "pageSpan." + error; + } + return null; + }; + + /** + * Creates a ChunkPageFooter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter} ChunkPageFooter + */ + ChunkPageFooter.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter) + return object; + var message = new $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter(); + if (object.text != null) + message.text = String(object.text); + if (object.pageSpan != null) { + if (typeof object.pageSpan !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter.pageSpan: object expected"); + message.pageSpan = $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan.fromObject(object.pageSpan); + } + return message; + }; + + /** + * Creates a plain object from a ChunkPageFooter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter + * @static + * @param {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter} message ChunkPageFooter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ChunkPageFooter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.text = ""; + object.pageSpan = null; + } + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.pageSpan != null && message.hasOwnProperty("pageSpan")) + object.pageSpan = $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan.toObject(message.pageSpan, options); + return object; + }; + + /** + * Converts this ChunkPageFooter to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter + * @instance + * @returns {Object.} JSON object + */ + ChunkPageFooter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ChunkPageFooter + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ChunkPageFooter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter"; + }; + + return ChunkPageFooter; + })(); + + return Chunk; + })(); + + return ChunkedDocument; + })(); + + Document.EntityValidationOutput = (function() { + + /** + * Properties of an EntityValidationOutput. + * @memberof google.cloud.documentai.v1.Document + * @interface IEntityValidationOutput + * @property {Array.|null} [validationResults] EntityValidationOutput validationResults + * @property {boolean|null} [passAllRules] EntityValidationOutput passAllRules + */ + + /** + * Constructs a new EntityValidationOutput. + * @memberof google.cloud.documentai.v1.Document + * @classdesc Represents an EntityValidationOutput. + * @implements IEntityValidationOutput + * @constructor + * @param {google.cloud.documentai.v1.Document.IEntityValidationOutput=} [properties] Properties to set + */ + function EntityValidationOutput(properties) { + this.validationResults = []; + 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]]; + } + + /** + * EntityValidationOutput validationResults. + * @member {Array.} validationResults + * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput + * @instance + */ + EntityValidationOutput.prototype.validationResults = $util.emptyArray; + + /** + * EntityValidationOutput passAllRules. + * @member {boolean} passAllRules + * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput + * @instance + */ + EntityValidationOutput.prototype.passAllRules = false; + + /** + * Creates a new EntityValidationOutput instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput + * @static + * @param {google.cloud.documentai.v1.Document.IEntityValidationOutput=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.EntityValidationOutput} EntityValidationOutput instance + */ + EntityValidationOutput.create = function create(properties) { + return new EntityValidationOutput(properties); + }; + + /** + * Encodes the specified EntityValidationOutput message. Does not implicitly {@link google.cloud.documentai.v1.Document.EntityValidationOutput.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput + * @static + * @param {google.cloud.documentai.v1.Document.IEntityValidationOutput} message EntityValidationOutput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityValidationOutput.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.validationResults != null && message.validationResults.length) + for (var i = 0; i < message.validationResults.length; ++i) + $root.google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult.encode(message.validationResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.passAllRules != null && Object.hasOwnProperty.call(message, "passAllRules")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.passAllRules); + return writer; + }; + + /** + * Encodes the specified EntityValidationOutput message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.EntityValidationOutput.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput + * @static + * @param {google.cloud.documentai.v1.Document.IEntityValidationOutput} message EntityValidationOutput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityValidationOutput.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EntityValidationOutput message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.EntityValidationOutput} EntityValidationOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityValidationOutput.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.EntityValidationOutput(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.validationResults && message.validationResults.length)) + message.validationResults = []; + message.validationResults.push($root.google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult.decode(reader, reader.uint32())); + break; + } + case 2: { + message.passAllRules = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EntityValidationOutput message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.EntityValidationOutput} EntityValidationOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityValidationOutput.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EntityValidationOutput message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EntityValidationOutput.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.validationResults != null && message.hasOwnProperty("validationResults")) { + if (!Array.isArray(message.validationResults)) + return "validationResults: array expected"; + for (var i = 0; i < message.validationResults.length; ++i) { + var error = $root.google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult.verify(message.validationResults[i]); + if (error) + return "validationResults." + error; + } + } + if (message.passAllRules != null && message.hasOwnProperty("passAllRules")) + if (typeof message.passAllRules !== "boolean") + return "passAllRules: boolean expected"; + return null; + }; + + /** + * Creates an EntityValidationOutput message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.EntityValidationOutput} EntityValidationOutput + */ + EntityValidationOutput.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.EntityValidationOutput) + return object; + var message = new $root.google.cloud.documentai.v1.Document.EntityValidationOutput(); + if (object.validationResults) { + if (!Array.isArray(object.validationResults)) + throw TypeError(".google.cloud.documentai.v1.Document.EntityValidationOutput.validationResults: array expected"); + message.validationResults = []; + for (var i = 0; i < object.validationResults.length; ++i) { + if (typeof object.validationResults[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.EntityValidationOutput.validationResults: object expected"); + message.validationResults[i] = $root.google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult.fromObject(object.validationResults[i]); + } + } + if (object.passAllRules != null) + message.passAllRules = Boolean(object.passAllRules); + return message; + }; + + /** + * Creates a plain object from an EntityValidationOutput message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput + * @static + * @param {google.cloud.documentai.v1.Document.EntityValidationOutput} message EntityValidationOutput + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EntityValidationOutput.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.validationResults = []; + if (options.defaults) + object.passAllRules = false; + if (message.validationResults && message.validationResults.length) { + object.validationResults = []; + for (var j = 0; j < message.validationResults.length; ++j) + object.validationResults[j] = $root.google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult.toObject(message.validationResults[j], options); + } + if (message.passAllRules != null && message.hasOwnProperty("passAllRules")) + object.passAllRules = message.passAllRules; + return object; + }; + + /** + * Converts this EntityValidationOutput to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput + * @instance + * @returns {Object.} JSON object + */ + EntityValidationOutput.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EntityValidationOutput + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EntityValidationOutput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.EntityValidationOutput"; + }; + + EntityValidationOutput.ValidationResult = (function() { + + /** + * Properties of a ValidationResult. + * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput + * @interface IValidationResult + * @property {string|null} [ruleName] ValidationResult ruleName + * @property {string|null} [ruleDescription] ValidationResult ruleDescription + * @property {google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult.ValidationResultType|null} [validationResultType] ValidationResult validationResultType + * @property {string|null} [validationDetails] ValidationResult validationDetails + */ + + /** + * Constructs a new ValidationResult. + * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput + * @classdesc Represents a ValidationResult. + * @implements IValidationResult + * @constructor + * @param {google.cloud.documentai.v1.Document.EntityValidationOutput.IValidationResult=} [properties] Properties to set + */ + function ValidationResult(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]]; + } + + /** + * ValidationResult ruleName. + * @member {string} ruleName + * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult + * @instance + */ + ValidationResult.prototype.ruleName = ""; + + /** + * ValidationResult ruleDescription. + * @member {string} ruleDescription + * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult + * @instance + */ + ValidationResult.prototype.ruleDescription = ""; + + /** + * ValidationResult validationResultType. + * @member {google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult.ValidationResultType} validationResultType + * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult + * @instance + */ + ValidationResult.prototype.validationResultType = 0; + + /** + * ValidationResult validationDetails. + * @member {string} validationDetails + * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult + * @instance + */ + ValidationResult.prototype.validationDetails = ""; + + /** + * Creates a new ValidationResult instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult + * @static + * @param {google.cloud.documentai.v1.Document.EntityValidationOutput.IValidationResult=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult} ValidationResult instance + */ + ValidationResult.create = function create(properties) { + return new ValidationResult(properties); + }; + + /** + * Encodes the specified ValidationResult message. Does not implicitly {@link google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult + * @static + * @param {google.cloud.documentai.v1.Document.EntityValidationOutput.IValidationResult} message ValidationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidationResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ruleName != null && Object.hasOwnProperty.call(message, "ruleName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ruleName); + if (message.ruleDescription != null && Object.hasOwnProperty.call(message, "ruleDescription")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.ruleDescription); + if (message.validationResultType != null && Object.hasOwnProperty.call(message, "validationResultType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.validationResultType); + if (message.validationDetails != null && Object.hasOwnProperty.call(message, "validationDetails")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.validationDetails); + return writer; + }; + + /** + * Encodes the specified ValidationResult message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult + * @static + * @param {google.cloud.documentai.v1.Document.EntityValidationOutput.IValidationResult} message ValidationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidationResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValidationResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult} ValidationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidationResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.ruleName = reader.string(); + break; + } + case 2: { + message.ruleDescription = reader.string(); + break; + } + case 3: { + message.validationResultType = reader.int32(); + break; + } + case 4: { + message.validationDetails = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValidationResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult} ValidationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidationResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValidationResult message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValidationResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ruleName != null && message.hasOwnProperty("ruleName")) + if (!$util.isString(message.ruleName)) + return "ruleName: string expected"; + if (message.ruleDescription != null && message.hasOwnProperty("ruleDescription")) + if (!$util.isString(message.ruleDescription)) + return "ruleDescription: string expected"; + if (message.validationResultType != null && message.hasOwnProperty("validationResultType")) + switch (message.validationResultType) { + default: + return "validationResultType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.validationDetails != null && message.hasOwnProperty("validationDetails")) + if (!$util.isString(message.validationDetails)) + return "validationDetails: string expected"; + return null; + }; + + /** + * Creates a ValidationResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult} ValidationResult + */ + ValidationResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult) + return object; + var message = new $root.google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult(); + if (object.ruleName != null) + message.ruleName = String(object.ruleName); + if (object.ruleDescription != null) + message.ruleDescription = String(object.ruleDescription); + switch (object.validationResultType) { + default: + if (typeof object.validationResultType === "number") { + message.validationResultType = object.validationResultType; + break; + } + break; + case "VALIDATION_RESULT_TYPE_UNSPECIFIED": + case 0: + message.validationResultType = 0; + break; + case "VALIDATION_RESULT_TYPE_VALID": + case 1: + message.validationResultType = 1; + break; + case "VALIDATION_RESULT_TYPE_INVALID": + case 2: + message.validationResultType = 2; + break; + case "VALIDATION_RESULT_TYPE_SKIPPED": + case 3: + message.validationResultType = 3; + break; + case "VALIDATION_RESULT_TYPE_NOT_APPLICABLE": + case 4: + message.validationResultType = 4; + break; + } + if (object.validationDetails != null) + message.validationDetails = String(object.validationDetails); + return message; + }; + + /** + * Creates a plain object from a ValidationResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult + * @static + * @param {google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult} message ValidationResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValidationResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.ruleName = ""; + object.ruleDescription = ""; + object.validationResultType = options.enums === String ? "VALIDATION_RESULT_TYPE_UNSPECIFIED" : 0; + object.validationDetails = ""; + } + if (message.ruleName != null && message.hasOwnProperty("ruleName")) + object.ruleName = message.ruleName; + if (message.ruleDescription != null && message.hasOwnProperty("ruleDescription")) + object.ruleDescription = message.ruleDescription; + if (message.validationResultType != null && message.hasOwnProperty("validationResultType")) + object.validationResultType = options.enums === String ? $root.google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult.ValidationResultType[message.validationResultType] === undefined ? message.validationResultType : $root.google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult.ValidationResultType[message.validationResultType] : message.validationResultType; + if (message.validationDetails != null && message.hasOwnProperty("validationDetails")) + object.validationDetails = message.validationDetails; + return object; + }; + + /** + * Converts this ValidationResult to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult + * @instance + * @returns {Object.} JSON object + */ + ValidationResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ValidationResult + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ValidationResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult"; + }; + + /** + * ValidationResultType enum. + * @name google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult.ValidationResultType + * @enum {number} + * @property {number} VALIDATION_RESULT_TYPE_UNSPECIFIED=0 VALIDATION_RESULT_TYPE_UNSPECIFIED value + * @property {number} VALIDATION_RESULT_TYPE_VALID=1 VALIDATION_RESULT_TYPE_VALID value + * @property {number} VALIDATION_RESULT_TYPE_INVALID=2 VALIDATION_RESULT_TYPE_INVALID value + * @property {number} VALIDATION_RESULT_TYPE_SKIPPED=3 VALIDATION_RESULT_TYPE_SKIPPED value + * @property {number} VALIDATION_RESULT_TYPE_NOT_APPLICABLE=4 VALIDATION_RESULT_TYPE_NOT_APPLICABLE value + */ + ValidationResult.ValidationResultType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VALIDATION_RESULT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "VALIDATION_RESULT_TYPE_VALID"] = 1; + values[valuesById[2] = "VALIDATION_RESULT_TYPE_INVALID"] = 2; + values[valuesById[3] = "VALIDATION_RESULT_TYPE_SKIPPED"] = 3; + values[valuesById[4] = "VALIDATION_RESULT_TYPE_NOT_APPLICABLE"] = 4; + return values; + })(); + + return ValidationResult; + })(); + + return EntityValidationOutput; + })(); + + Document.EntitiesRevision = (function() { + + /** + * Properties of an EntitiesRevision. + * @memberof google.cloud.documentai.v1.Document + * @interface IEntitiesRevision + * @property {string|null} [revisionId] EntitiesRevision revisionId + * @property {Array.|null} [entities] EntitiesRevision entities + * @property {google.cloud.documentai.v1.Document.IEntityValidationOutput|null} [entityValidationOutput] EntitiesRevision entityValidationOutput + */ + + /** + * Constructs a new EntitiesRevision. + * @memberof google.cloud.documentai.v1.Document + * @classdesc Represents an EntitiesRevision. + * @implements IEntitiesRevision + * @constructor + * @param {google.cloud.documentai.v1.Document.IEntitiesRevision=} [properties] Properties to set + */ + function EntitiesRevision(properties) { + this.entities = []; + 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]]; + } + + /** + * EntitiesRevision revisionId. + * @member {string} revisionId + * @memberof google.cloud.documentai.v1.Document.EntitiesRevision + * @instance + */ + EntitiesRevision.prototype.revisionId = ""; + + /** + * EntitiesRevision entities. + * @member {Array.} entities + * @memberof google.cloud.documentai.v1.Document.EntitiesRevision + * @instance + */ + EntitiesRevision.prototype.entities = $util.emptyArray; + + /** + * EntitiesRevision entityValidationOutput. + * @member {google.cloud.documentai.v1.Document.IEntityValidationOutput|null|undefined} entityValidationOutput + * @memberof google.cloud.documentai.v1.Document.EntitiesRevision + * @instance + */ + EntitiesRevision.prototype.entityValidationOutput = null; + + /** + * Creates a new EntitiesRevision instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.EntitiesRevision + * @static + * @param {google.cloud.documentai.v1.Document.IEntitiesRevision=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.EntitiesRevision} EntitiesRevision instance + */ + EntitiesRevision.create = function create(properties) { + return new EntitiesRevision(properties); + }; + + /** + * Encodes the specified EntitiesRevision message. Does not implicitly {@link google.cloud.documentai.v1.Document.EntitiesRevision.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.EntitiesRevision + * @static + * @param {google.cloud.documentai.v1.Document.IEntitiesRevision} message EntitiesRevision message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntitiesRevision.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.revisionId != null && Object.hasOwnProperty.call(message, "revisionId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.revisionId); + if (message.entities != null && message.entities.length) + for (var i = 0; i < message.entities.length; ++i) + $root.google.cloud.documentai.v1.Document.Entity.encode(message.entities[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.entityValidationOutput != null && Object.hasOwnProperty.call(message, "entityValidationOutput")) + $root.google.cloud.documentai.v1.Document.EntityValidationOutput.encode(message.entityValidationOutput, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EntitiesRevision message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.EntitiesRevision.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.EntitiesRevision + * @static + * @param {google.cloud.documentai.v1.Document.IEntitiesRevision} message EntitiesRevision message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntitiesRevision.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EntitiesRevision message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.EntitiesRevision + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Document.EntitiesRevision} EntitiesRevision + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntitiesRevision.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.EntitiesRevision(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.revisionId = reader.string(); + break; + } + case 2: { + if (!(message.entities && message.entities.length)) + message.entities = []; + message.entities.push($root.google.cloud.documentai.v1.Document.Entity.decode(reader, reader.uint32())); + break; + } + case 3: { + message.entityValidationOutput = $root.google.cloud.documentai.v1.Document.EntityValidationOutput.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EntitiesRevision message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.EntitiesRevision + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.EntitiesRevision} EntitiesRevision + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntitiesRevision.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EntitiesRevision message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.EntitiesRevision + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EntitiesRevision.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.revisionId != null && message.hasOwnProperty("revisionId")) + if (!$util.isString(message.revisionId)) + return "revisionId: string expected"; + if (message.entities != null && message.hasOwnProperty("entities")) { + if (!Array.isArray(message.entities)) + return "entities: array expected"; + for (var i = 0; i < message.entities.length; ++i) { + var error = $root.google.cloud.documentai.v1.Document.Entity.verify(message.entities[i]); + if (error) + return "entities." + error; + } + } + if (message.entityValidationOutput != null && message.hasOwnProperty("entityValidationOutput")) { + var error = $root.google.cloud.documentai.v1.Document.EntityValidationOutput.verify(message.entityValidationOutput); + if (error) + return "entityValidationOutput." + error; + } + return null; + }; + + /** + * Creates an EntitiesRevision message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.EntitiesRevision + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.EntitiesRevision} EntitiesRevision + */ + EntitiesRevision.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.EntitiesRevision) + return object; + var message = new $root.google.cloud.documentai.v1.Document.EntitiesRevision(); + if (object.revisionId != null) + message.revisionId = String(object.revisionId); + if (object.entities) { + if (!Array.isArray(object.entities)) + throw TypeError(".google.cloud.documentai.v1.Document.EntitiesRevision.entities: array expected"); + message.entities = []; + for (var i = 0; i < object.entities.length; ++i) { + if (typeof object.entities[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.EntitiesRevision.entities: object expected"); + message.entities[i] = $root.google.cloud.documentai.v1.Document.Entity.fromObject(object.entities[i]); + } + } + if (object.entityValidationOutput != null) { + if (typeof object.entityValidationOutput !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.EntitiesRevision.entityValidationOutput: object expected"); + message.entityValidationOutput = $root.google.cloud.documentai.v1.Document.EntityValidationOutput.fromObject(object.entityValidationOutput); + } + return message; + }; + + /** + * Creates a plain object from an EntitiesRevision message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.EntitiesRevision + * @static + * @param {google.cloud.documentai.v1.Document.EntitiesRevision} message EntitiesRevision + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EntitiesRevision.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entities = []; + if (options.defaults) { + object.revisionId = ""; + object.entityValidationOutput = null; + } + if (message.revisionId != null && message.hasOwnProperty("revisionId")) + object.revisionId = message.revisionId; + if (message.entities && message.entities.length) { + object.entities = []; + for (var j = 0; j < message.entities.length; ++j) + object.entities[j] = $root.google.cloud.documentai.v1.Document.Entity.toObject(message.entities[j], options); + } + if (message.entityValidationOutput != null && message.hasOwnProperty("entityValidationOutput")) + object.entityValidationOutput = $root.google.cloud.documentai.v1.Document.EntityValidationOutput.toObject(message.entityValidationOutput, options); + return object; + }; + + /** + * Converts this EntitiesRevision to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.EntitiesRevision + * @instance + * @returns {Object.} JSON object + */ + EntitiesRevision.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EntitiesRevision + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.EntitiesRevision + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EntitiesRevision.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.EntitiesRevision"; + }; + + return EntitiesRevision; + })(); + + return Document; + })(); + + v1.Barcode = (function() { + + /** + * Properties of a Barcode. + * @memberof google.cloud.documentai.v1 + * @interface IBarcode + * @property {string|null} [format] Barcode format + * @property {string|null} [valueFormat] Barcode valueFormat + * @property {string|null} [rawValue] Barcode rawValue + */ + + /** + * Constructs a new Barcode. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a Barcode. + * @implements IBarcode + * @constructor + * @param {google.cloud.documentai.v1.IBarcode=} [properties] Properties to set + */ + function Barcode(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]]; + } + + /** + * Barcode format. + * @member {string} format + * @memberof google.cloud.documentai.v1.Barcode + * @instance + */ + Barcode.prototype.format = ""; + + /** + * Barcode valueFormat. + * @member {string} valueFormat + * @memberof google.cloud.documentai.v1.Barcode + * @instance + */ + Barcode.prototype.valueFormat = ""; + + /** + * Barcode rawValue. + * @member {string} rawValue + * @memberof google.cloud.documentai.v1.Barcode + * @instance + */ + Barcode.prototype.rawValue = ""; + + /** + * Creates a new Barcode instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Barcode + * @static + * @param {google.cloud.documentai.v1.IBarcode=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Barcode} Barcode instance + */ + Barcode.create = function create(properties) { + return new Barcode(properties); + }; + + /** + * Encodes the specified Barcode message. Does not implicitly {@link google.cloud.documentai.v1.Barcode.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Barcode + * @static + * @param {google.cloud.documentai.v1.IBarcode} message Barcode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Barcode.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.format != null && Object.hasOwnProperty.call(message, "format")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.format); + if (message.valueFormat != null && Object.hasOwnProperty.call(message, "valueFormat")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.valueFormat); + if (message.rawValue != null && Object.hasOwnProperty.call(message, "rawValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.rawValue); + return writer; + }; + + /** + * Encodes the specified Barcode message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Barcode.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Barcode + * @static + * @param {google.cloud.documentai.v1.IBarcode} message Barcode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Barcode.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Barcode message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Barcode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Barcode} Barcode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Barcode.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Barcode(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.format = reader.string(); + break; + } + case 2: { + message.valueFormat = reader.string(); + break; + } + case 3: { + message.rawValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Barcode message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Barcode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Barcode} Barcode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Barcode.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Barcode message. + * @function verify + * @memberof google.cloud.documentai.v1.Barcode + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Barcode.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.format != null && message.hasOwnProperty("format")) + if (!$util.isString(message.format)) + return "format: string expected"; + if (message.valueFormat != null && message.hasOwnProperty("valueFormat")) + if (!$util.isString(message.valueFormat)) + return "valueFormat: string expected"; + if (message.rawValue != null && message.hasOwnProperty("rawValue")) + if (!$util.isString(message.rawValue)) + return "rawValue: string expected"; + return null; + }; + + /** + * Creates a Barcode message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Barcode + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Barcode} Barcode + */ + Barcode.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Barcode) + return object; + var message = new $root.google.cloud.documentai.v1.Barcode(); + if (object.format != null) + message.format = String(object.format); + if (object.valueFormat != null) + message.valueFormat = String(object.valueFormat); + if (object.rawValue != null) + message.rawValue = String(object.rawValue); + return message; + }; + + /** + * Creates a plain object from a Barcode message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Barcode + * @static + * @param {google.cloud.documentai.v1.Barcode} message Barcode + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Barcode.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.format = ""; + object.valueFormat = ""; + object.rawValue = ""; + } + if (message.format != null && message.hasOwnProperty("format")) + object.format = message.format; + if (message.valueFormat != null && message.hasOwnProperty("valueFormat")) + object.valueFormat = message.valueFormat; + if (message.rawValue != null && message.hasOwnProperty("rawValue")) + object.rawValue = message.rawValue; + return object; + }; + + /** + * Converts this Barcode to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Barcode + * @instance + * @returns {Object.} JSON object + */ + Barcode.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Barcode + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Barcode + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Barcode.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Barcode"; + }; + + return Barcode; + })(); + + v1.Vertex = (function() { + + /** + * Properties of a Vertex. + * @memberof google.cloud.documentai.v1 + * @interface IVertex + * @property {number|null} [x] Vertex x + * @property {number|null} [y] Vertex y + */ + + /** + * Constructs a new Vertex. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a Vertex. + * @implements IVertex + * @constructor + * @param {google.cloud.documentai.v1.IVertex=} [properties] Properties to set + */ + function Vertex(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]]; + } + + /** + * Vertex x. + * @member {number} x + * @memberof google.cloud.documentai.v1.Vertex + * @instance + */ + Vertex.prototype.x = 0; + + /** + * Vertex y. + * @member {number} y + * @memberof google.cloud.documentai.v1.Vertex + * @instance + */ + Vertex.prototype.y = 0; + + /** + * Creates a new Vertex instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Vertex + * @static + * @param {google.cloud.documentai.v1.IVertex=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Vertex} Vertex instance + */ + Vertex.create = function create(properties) { + return new Vertex(properties); + }; + + /** + * Encodes the specified Vertex message. Does not implicitly {@link google.cloud.documentai.v1.Vertex.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Vertex + * @static + * @param {google.cloud.documentai.v1.IVertex} message Vertex message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Vertex.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.x != null && Object.hasOwnProperty.call(message, "x")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.x); + if (message.y != null && Object.hasOwnProperty.call(message, "y")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.y); + return writer; + }; + + /** + * Encodes the specified Vertex message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Vertex.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Vertex + * @static + * @param {google.cloud.documentai.v1.IVertex} message Vertex message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Vertex.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Vertex message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Vertex + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.Vertex} Vertex + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Vertex.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Vertex(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.x = reader.int32(); + break; + } + case 2: { + message.y = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Vertex message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Vertex + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Vertex} Vertex + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Vertex.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Vertex message. + * @function verify + * @memberof google.cloud.documentai.v1.Vertex + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Vertex.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.x != null && message.hasOwnProperty("x")) + if (!$util.isInteger(message.x)) + return "x: integer expected"; + if (message.y != null && message.hasOwnProperty("y")) + if (!$util.isInteger(message.y)) + return "y: integer expected"; + return null; + }; + + /** + * Creates a Vertex message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Vertex + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Vertex} Vertex + */ + Vertex.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Vertex) + return object; + var message = new $root.google.cloud.documentai.v1.Vertex(); + if (object.x != null) + message.x = object.x | 0; + if (object.y != null) + message.y = object.y | 0; + return message; + }; + + /** + * Creates a plain object from a Vertex message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Vertex + * @static + * @param {google.cloud.documentai.v1.Vertex} message Vertex + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Vertex.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.x = 0; + object.y = 0; + } + if (message.x != null && message.hasOwnProperty("x")) + object.x = message.x; + if (message.y != null && message.hasOwnProperty("y")) + object.y = message.y; + return object; + }; + + /** + * Converts this Vertex to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Vertex + * @instance + * @returns {Object.} JSON object + */ + Vertex.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Vertex + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Vertex + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Vertex.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Vertex"; + }; + + return Vertex; + })(); + + v1.NormalizedVertex = (function() { + + /** + * Properties of a NormalizedVertex. + * @memberof google.cloud.documentai.v1 + * @interface INormalizedVertex + * @property {number|null} [x] NormalizedVertex x + * @property {number|null} [y] NormalizedVertex y + */ + + /** + * Constructs a new NormalizedVertex. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a NormalizedVertex. + * @implements INormalizedVertex + * @constructor + * @param {google.cloud.documentai.v1.INormalizedVertex=} [properties] Properties to set + */ + function NormalizedVertex(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]]; + } + + /** + * NormalizedVertex x. + * @member {number} x + * @memberof google.cloud.documentai.v1.NormalizedVertex + * @instance + */ + NormalizedVertex.prototype.x = 0; + + /** + * NormalizedVertex y. + * @member {number} y + * @memberof google.cloud.documentai.v1.NormalizedVertex + * @instance + */ + NormalizedVertex.prototype.y = 0; + + /** + * Creates a new NormalizedVertex instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.NormalizedVertex + * @static + * @param {google.cloud.documentai.v1.INormalizedVertex=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.NormalizedVertex} NormalizedVertex instance + */ + NormalizedVertex.create = function create(properties) { + return new NormalizedVertex(properties); + }; + + /** + * Encodes the specified NormalizedVertex message. Does not implicitly {@link google.cloud.documentai.v1.NormalizedVertex.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.NormalizedVertex + * @static + * @param {google.cloud.documentai.v1.INormalizedVertex} message NormalizedVertex message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NormalizedVertex.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.x != null && Object.hasOwnProperty.call(message, "x")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.x); + if (message.y != null && Object.hasOwnProperty.call(message, "y")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.y); + return writer; + }; + + /** + * Encodes the specified NormalizedVertex message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.NormalizedVertex.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.NormalizedVertex + * @static + * @param {google.cloud.documentai.v1.INormalizedVertex} message NormalizedVertex message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NormalizedVertex.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NormalizedVertex message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.NormalizedVertex + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.NormalizedVertex} NormalizedVertex + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NormalizedVertex.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.NormalizedVertex(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.x = reader.float(); + break; + } + case 2: { + message.y = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NormalizedVertex message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.NormalizedVertex + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.NormalizedVertex} NormalizedVertex + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NormalizedVertex.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NormalizedVertex message. + * @function verify + * @memberof google.cloud.documentai.v1.NormalizedVertex + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NormalizedVertex.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.x != null && message.hasOwnProperty("x")) + if (typeof message.x !== "number") + return "x: number expected"; + if (message.y != null && message.hasOwnProperty("y")) + if (typeof message.y !== "number") + return "y: number expected"; + return null; + }; + + /** + * Creates a NormalizedVertex message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.NormalizedVertex + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.NormalizedVertex} NormalizedVertex + */ + NormalizedVertex.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.NormalizedVertex) + return object; + var message = new $root.google.cloud.documentai.v1.NormalizedVertex(); + if (object.x != null) + message.x = Number(object.x); + if (object.y != null) + message.y = Number(object.y); + return message; + }; + + /** + * Creates a plain object from a NormalizedVertex message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.NormalizedVertex + * @static + * @param {google.cloud.documentai.v1.NormalizedVertex} message NormalizedVertex + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NormalizedVertex.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.x = 0; + object.y = 0; + } + if (message.x != null && message.hasOwnProperty("x")) + object.x = options.json && !isFinite(message.x) ? String(message.x) : message.x; + if (message.y != null && message.hasOwnProperty("y")) + object.y = options.json && !isFinite(message.y) ? String(message.y) : message.y; + return object; + }; + + /** + * Converts this NormalizedVertex to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.NormalizedVertex + * @instance + * @returns {Object.} JSON object + */ + NormalizedVertex.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NormalizedVertex + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.NormalizedVertex + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NormalizedVertex.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.NormalizedVertex"; + }; + + return NormalizedVertex; + })(); + + v1.BoundingPoly = (function() { + + /** + * Properties of a BoundingPoly. + * @memberof google.cloud.documentai.v1 + * @interface IBoundingPoly + * @property {Array.|null} [vertices] BoundingPoly vertices + * @property {Array.|null} [normalizedVertices] BoundingPoly normalizedVertices + */ + + /** + * Constructs a new BoundingPoly. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a BoundingPoly. + * @implements IBoundingPoly + * @constructor + * @param {google.cloud.documentai.v1.IBoundingPoly=} [properties] Properties to set + */ + function BoundingPoly(properties) { + this.vertices = []; + this.normalizedVertices = []; + 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]]; + } + + /** + * BoundingPoly vertices. + * @member {Array.} vertices + * @memberof google.cloud.documentai.v1.BoundingPoly + * @instance + */ + BoundingPoly.prototype.vertices = $util.emptyArray; + + /** + * BoundingPoly normalizedVertices. + * @member {Array.} normalizedVertices + * @memberof google.cloud.documentai.v1.BoundingPoly + * @instance + */ + BoundingPoly.prototype.normalizedVertices = $util.emptyArray; + + /** + * Creates a new BoundingPoly instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.BoundingPoly + * @static + * @param {google.cloud.documentai.v1.IBoundingPoly=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.BoundingPoly} BoundingPoly instance + */ + BoundingPoly.create = function create(properties) { + return new BoundingPoly(properties); + }; + + /** + * Encodes the specified BoundingPoly message. Does not implicitly {@link google.cloud.documentai.v1.BoundingPoly.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.BoundingPoly + * @static + * @param {google.cloud.documentai.v1.IBoundingPoly} message BoundingPoly message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoundingPoly.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.vertices != null && message.vertices.length) + for (var i = 0; i < message.vertices.length; ++i) + $root.google.cloud.documentai.v1.Vertex.encode(message.vertices[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.normalizedVertices != null && message.normalizedVertices.length) + for (var i = 0; i < message.normalizedVertices.length; ++i) + $root.google.cloud.documentai.v1.NormalizedVertex.encode(message.normalizedVertices[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BoundingPoly message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.BoundingPoly.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.BoundingPoly + * @static + * @param {google.cloud.documentai.v1.IBoundingPoly} message BoundingPoly message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoundingPoly.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoundingPoly message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.BoundingPoly + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.BoundingPoly} BoundingPoly + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoundingPoly.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.BoundingPoly(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.vertices && message.vertices.length)) + message.vertices = []; + message.vertices.push($root.google.cloud.documentai.v1.Vertex.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.normalizedVertices && message.normalizedVertices.length)) + message.normalizedVertices = []; + message.normalizedVertices.push($root.google.cloud.documentai.v1.NormalizedVertex.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoundingPoly message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.BoundingPoly + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.BoundingPoly} BoundingPoly + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoundingPoly.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoundingPoly message. + * @function verify + * @memberof google.cloud.documentai.v1.BoundingPoly + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoundingPoly.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.vertices != null && message.hasOwnProperty("vertices")) { + if (!Array.isArray(message.vertices)) + return "vertices: array expected"; + for (var i = 0; i < message.vertices.length; ++i) { + var error = $root.google.cloud.documentai.v1.Vertex.verify(message.vertices[i]); + if (error) + return "vertices." + error; + } + } + if (message.normalizedVertices != null && message.hasOwnProperty("normalizedVertices")) { + if (!Array.isArray(message.normalizedVertices)) + return "normalizedVertices: array expected"; + for (var i = 0; i < message.normalizedVertices.length; ++i) { + var error = $root.google.cloud.documentai.v1.NormalizedVertex.verify(message.normalizedVertices[i]); + if (error) + return "normalizedVertices." + error; + } + } + return null; + }; + + /** + * Creates a BoundingPoly message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.BoundingPoly + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.BoundingPoly} BoundingPoly + */ + BoundingPoly.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.BoundingPoly) + return object; + var message = new $root.google.cloud.documentai.v1.BoundingPoly(); + if (object.vertices) { + if (!Array.isArray(object.vertices)) + throw TypeError(".google.cloud.documentai.v1.BoundingPoly.vertices: array expected"); + message.vertices = []; + for (var i = 0; i < object.vertices.length; ++i) { + if (typeof object.vertices[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.BoundingPoly.vertices: object expected"); + message.vertices[i] = $root.google.cloud.documentai.v1.Vertex.fromObject(object.vertices[i]); + } + } + if (object.normalizedVertices) { + if (!Array.isArray(object.normalizedVertices)) + throw TypeError(".google.cloud.documentai.v1.BoundingPoly.normalizedVertices: array expected"); + message.normalizedVertices = []; + for (var i = 0; i < object.normalizedVertices.length; ++i) { + if (typeof object.normalizedVertices[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.BoundingPoly.normalizedVertices: object expected"); + message.normalizedVertices[i] = $root.google.cloud.documentai.v1.NormalizedVertex.fromObject(object.normalizedVertices[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BoundingPoly message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.BoundingPoly + * @static + * @param {google.cloud.documentai.v1.BoundingPoly} message BoundingPoly + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoundingPoly.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.vertices = []; + object.normalizedVertices = []; + } + if (message.vertices && message.vertices.length) { + object.vertices = []; + for (var j = 0; j < message.vertices.length; ++j) + object.vertices[j] = $root.google.cloud.documentai.v1.Vertex.toObject(message.vertices[j], options); + } + if (message.normalizedVertices && message.normalizedVertices.length) { + object.normalizedVertices = []; + for (var j = 0; j < message.normalizedVertices.length; ++j) + object.normalizedVertices[j] = $root.google.cloud.documentai.v1.NormalizedVertex.toObject(message.normalizedVertices[j], options); + } + return object; + }; + + /** + * Converts this BoundingPoly to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.BoundingPoly + * @instance + * @returns {Object.} JSON object + */ + BoundingPoly.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoundingPoly + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.BoundingPoly + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoundingPoly.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.BoundingPoly"; + }; + + return BoundingPoly; + })(); + + return v1; + })(); + + return documentai; + })(); + + return cloud; + })(); + + 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 + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value + * @property {number} IDENTIFIER=8 IDENTIFIER value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; + values[valuesById[8] = "IDENTIFIER"] = 8; + 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, error) { + 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(); + if (tag === error) + break; + 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) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; + 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: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } + 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] === undefined ? message.history : $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]] === undefined ? message.style[j] : $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); + }; + + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for ResourceReference + * @function getTypeUrl + * @memberof google.api.ResourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceReference"; + }; + + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + 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|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + api.CommonLanguageSettings = (function() { + + /** + * Properties of a CommonLanguageSettings. + * @memberof google.api + * @interface ICommonLanguageSettings + * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri + * @property {Array.|null} [destinations] CommonLanguageSettings destinations + */ + + /** + * Constructs a new CommonLanguageSettings. + * @memberof google.api + * @classdesc Represents a CommonLanguageSettings. + * @implements ICommonLanguageSettings + * @constructor + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + */ + function CommonLanguageSettings(properties) { + this.destinations = []; + 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]]; + } + + /** + * CommonLanguageSettings referenceDocsUri. + * @member {string} referenceDocsUri + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.referenceDocsUri = ""; + + /** + * CommonLanguageSettings destinations. + * @member {Array.} destinations + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.destinations = $util.emptyArray; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @function create + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance + */ + CommonLanguageSettings.create = function create(properties) { + return new CommonLanguageSettings(properties); + }; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); + if (message.destinations != null && message.destinations.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.destinations.length; ++i) + writer.int32(message.destinations[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.referenceDocsUri = reader.string(); + break; + } + case 2: { + if (!(message.destinations && message.destinations.length)) + message.destinations = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.destinations.push(reader.int32()); + } else + message.destinations.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommonLanguageSettings message. + * @function verify + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommonLanguageSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + if (!$util.isString(message.referenceDocsUri)) + return "referenceDocsUri: string expected"; + if (message.destinations != null && message.hasOwnProperty("destinations")) { + if (!Array.isArray(message.destinations)) + return "destinations: array expected"; + for (var i = 0; i < message.destinations.length; ++i) + switch (message.destinations[i]) { + default: + return "destinations: enum value[] expected"; + case 0: + case 10: + case 20: + break; + } + } + return null; + }; + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + */ + CommonLanguageSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CommonLanguageSettings) + return object; + var message = new $root.google.api.CommonLanguageSettings(); + if (object.referenceDocsUri != null) + message.referenceDocsUri = String(object.referenceDocsUri); + if (object.destinations) { + if (!Array.isArray(object.destinations)) + throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); + message.destinations = []; + for (var i = 0; i < object.destinations.length; ++i) + switch (object.destinations[i]) { + default: + if (typeof object.destinations[i] === "number") { + message.destinations[i] = object.destinations[i]; + break; + } + case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": + case 0: + message.destinations[i] = 0; + break; + case "GITHUB": + case 10: + message.destinations[i] = 10; + break; + case "PACKAGE_MANAGER": + case 20: + message.destinations[i] = 20; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommonLanguageSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.destinations = []; + if (options.defaults) + object.referenceDocsUri = ""; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + object.referenceDocsUri = message.referenceDocsUri; + if (message.destinations && message.destinations.length) { + object.destinations = []; + for (var j = 0; j < message.destinations.length; ++j) + object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; + } + return object; + }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @function toJSON + * @memberof google.api.CommonLanguageSettings + * @instance + * @returns {Object.} JSON object + */ + CommonLanguageSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommonLanguageSettings + * @function getTypeUrl + * @memberof google.api.CommonLanguageSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CommonLanguageSettings"; + }; + + return CommonLanguageSettings; + })(); + + api.ClientLibrarySettings = (function() { + + /** + * Properties of a ClientLibrarySettings. + * @memberof google.api + * @interface IClientLibrarySettings + * @property {string|null} [version] ClientLibrarySettings version + * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage + * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums + * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings + * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings + * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings + * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings + * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings + * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings + * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings + * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings + */ + + /** + * Constructs a new ClientLibrarySettings. + * @memberof google.api + * @classdesc Represents a ClientLibrarySettings. + * @implements IClientLibrarySettings + * @constructor + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + */ + function ClientLibrarySettings(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]]; + } + + /** + * ClientLibrarySettings version. + * @member {string} version + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.version = ""; + + /** + * ClientLibrarySettings launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.launchStage = 0; + + /** + * ClientLibrarySettings restNumericEnums. + * @member {boolean} restNumericEnums + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.restNumericEnums = false; + + /** + * ClientLibrarySettings javaSettings. + * @member {google.api.IJavaSettings|null|undefined} javaSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.javaSettings = null; + + /** + * ClientLibrarySettings cppSettings. + * @member {google.api.ICppSettings|null|undefined} cppSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.cppSettings = null; + + /** + * ClientLibrarySettings phpSettings. + * @member {google.api.IPhpSettings|null|undefined} phpSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.phpSettings = null; + + /** + * ClientLibrarySettings pythonSettings. + * @member {google.api.IPythonSettings|null|undefined} pythonSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.pythonSettings = null; + + /** + * ClientLibrarySettings nodeSettings. + * @member {google.api.INodeSettings|null|undefined} nodeSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.nodeSettings = null; + + /** + * ClientLibrarySettings dotnetSettings. + * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.dotnetSettings = null; + + /** + * ClientLibrarySettings rubySettings. + * @member {google.api.IRubySettings|null|undefined} rubySettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.rubySettings = null; + + /** + * ClientLibrarySettings goSettings. + * @member {google.api.IGoSettings|null|undefined} goSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.goSettings = null; + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @function create + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance + */ + ClientLibrarySettings.create = function create(properties) { + return new ClientLibrarySettings(properties); + }; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); + if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); + if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) + $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) + $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) + $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) + $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) + $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) + $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) + $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) + $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.launchStage = reader.int32(); + break; + } + case 3: { + message.restNumericEnums = reader.bool(); + break; + } + case 21: { + message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32()); + break; + } + case 22: { + message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); + break; + } + case 23: { + message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); + break; + } + case 24: { + message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); + break; + } + case 25: { + message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); + break; + } + case 26: { + message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); + break; + } + case 27: { + message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); + break; + } + case 28: { + message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientLibrarySettings message. + * @function verify + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientLibrarySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + switch (message.launchStage) { + default: + return "launchStage: enum value expected"; + case 0: + case 6: + case 7: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + if (typeof message.restNumericEnums !== "boolean") + return "restNumericEnums: boolean expected"; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { + var error = $root.google.api.JavaSettings.verify(message.javaSettings); + if (error) + return "javaSettings." + error; + } + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { + var error = $root.google.api.CppSettings.verify(message.cppSettings); + if (error) + return "cppSettings." + error; + } + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { + var error = $root.google.api.PhpSettings.verify(message.phpSettings); + if (error) + return "phpSettings." + error; + } + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { + var error = $root.google.api.PythonSettings.verify(message.pythonSettings); + if (error) + return "pythonSettings." + error; + } + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { + var error = $root.google.api.NodeSettings.verify(message.nodeSettings); + if (error) + return "nodeSettings." + error; + } + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { + var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings); + if (error) + return "dotnetSettings." + error; + } + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { + var error = $root.google.api.RubySettings.verify(message.rubySettings); + if (error) + return "rubySettings." + error; + } + if (message.goSettings != null && message.hasOwnProperty("goSettings")) { + var error = $root.google.api.GoSettings.verify(message.goSettings); + if (error) + return "goSettings." + error; + } + return null; + }; + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + */ + ClientLibrarySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ClientLibrarySettings) + return object; + var message = new $root.google.api.ClientLibrarySettings(); + if (object.version != null) + message.version = String(object.version); + switch (object.launchStage) { + default: + if (typeof object.launchStage === "number") { + message.launchStage = object.launchStage; + break; + } + break; + case "LAUNCH_STAGE_UNSPECIFIED": + case 0: + message.launchStage = 0; + break; + case "UNIMPLEMENTED": + case 6: + message.launchStage = 6; + break; + case "PRELAUNCH": + case 7: + message.launchStage = 7; + break; + case "EARLY_ACCESS": + case 1: + message.launchStage = 1; + break; + case "ALPHA": + case 2: + message.launchStage = 2; + break; + case "BETA": + case 3: + message.launchStage = 3; + break; + case "GA": + case 4: + message.launchStage = 4; + break; + case "DEPRECATED": + case 5: + message.launchStage = 5; + break; + } + if (object.restNumericEnums != null) + message.restNumericEnums = Boolean(object.restNumericEnums); + if (object.javaSettings != null) { + if (typeof object.javaSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); + message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); + } + if (object.cppSettings != null) { + if (typeof object.cppSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); + message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); + } + if (object.phpSettings != null) { + if (typeof object.phpSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); + message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); + } + if (object.pythonSettings != null) { + if (typeof object.pythonSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); + message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); + } + if (object.nodeSettings != null) { + if (typeof object.nodeSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); + message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); + } + if (object.dotnetSettings != null) { + if (typeof object.dotnetSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); + message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); + } + if (object.rubySettings != null) { + if (typeof object.rubySettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); + message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); + } + if (object.goSettings != null) { + if (typeof object.goSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); + message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); + } + return message; + }; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientLibrarySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.restNumericEnums = false; + object.javaSettings = null; + object.cppSettings = null; + object.phpSettings = null; + object.pythonSettings = null; + object.nodeSettings = null; + object.dotnetSettings = null; + object.rubySettings = null; + object.goSettings = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + object.restNumericEnums = message.restNumericEnums; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) + object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) + object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) + object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) + object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) + object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) + object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) + object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); + if (message.goSettings != null && message.hasOwnProperty("goSettings")) + object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); + return object; + }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @function toJSON + * @memberof google.api.ClientLibrarySettings + * @instance + * @returns {Object.} JSON object + */ + ClientLibrarySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientLibrarySettings + * @function getTypeUrl + * @memberof google.api.ClientLibrarySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ClientLibrarySettings"; + }; + + return ClientLibrarySettings; + })(); + + api.Publishing = (function() { + + /** + * Properties of a Publishing. + * @memberof google.api + * @interface IPublishing + * @property {Array.|null} [methodSettings] Publishing methodSettings + * @property {string|null} [newIssueUri] Publishing newIssueUri + * @property {string|null} [documentationUri] Publishing documentationUri + * @property {string|null} [apiShortName] Publishing apiShortName + * @property {string|null} [githubLabel] Publishing githubLabel + * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams + * @property {string|null} [docTagPrefix] Publishing docTagPrefix + * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization + * @property {Array.|null} [librarySettings] Publishing librarySettings + * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri + * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri + */ + + /** + * Constructs a new Publishing. + * @memberof google.api + * @classdesc Represents a Publishing. + * @implements IPublishing + * @constructor + * @param {google.api.IPublishing=} [properties] Properties to set + */ + function Publishing(properties) { + this.methodSettings = []; + this.codeownerGithubTeams = []; + this.librarySettings = []; + 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]]; + } + + /** + * Publishing methodSettings. + * @member {Array.} methodSettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.methodSettings = $util.emptyArray; + + /** + * Publishing newIssueUri. + * @member {string} newIssueUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.newIssueUri = ""; + + /** + * Publishing documentationUri. + * @member {string} documentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.documentationUri = ""; + + /** + * Publishing apiShortName. + * @member {string} apiShortName + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.apiShortName = ""; + + /** + * Publishing githubLabel. + * @member {string} githubLabel + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.githubLabel = ""; + + /** + * Publishing codeownerGithubTeams. + * @member {Array.} codeownerGithubTeams + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.codeownerGithubTeams = $util.emptyArray; + + /** + * Publishing docTagPrefix. + * @member {string} docTagPrefix + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.docTagPrefix = ""; + + /** + * Publishing organization. + * @member {google.api.ClientLibraryOrganization} organization + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.organization = 0; + + /** + * Publishing librarySettings. + * @member {Array.} librarySettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.librarySettings = $util.emptyArray; + + /** + * Publishing protoReferenceDocumentationUri. + * @member {string} protoReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.protoReferenceDocumentationUri = ""; + + /** + * Publishing restReferenceDocumentationUri. + * @member {string} restReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.restReferenceDocumentationUri = ""; + + /** + * Creates a new Publishing instance using the specified properties. + * @function create + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing=} [properties] Properties to set + * @returns {google.api.Publishing} Publishing instance + */ + Publishing.create = function create(properties) { + return new Publishing(properties); + }; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encode + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methodSettings != null && message.methodSettings.length) + for (var i = 0; i < message.methodSettings.length; ++i) + $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) + writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); + if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) + writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); + if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) + writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); + if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) + writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); + if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); + if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) + writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); + if (message.librarySettings != null && message.librarySettings.length) + for (var i = 0; i < message.librarySettings.length; ++i) + $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); + if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) + writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); + if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) + writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); + return writer; + }; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @function decode + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.methodSettings && message.methodSettings.length)) + message.methodSettings = []; + message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); + break; + } + case 101: { + message.newIssueUri = reader.string(); + break; + } + case 102: { + message.documentationUri = reader.string(); + break; + } + case 103: { + message.apiShortName = reader.string(); + break; + } + case 104: { + message.githubLabel = reader.string(); + break; + } + case 105: { + if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) + message.codeownerGithubTeams = []; + message.codeownerGithubTeams.push(reader.string()); + break; + } + case 106: { + message.docTagPrefix = reader.string(); + break; + } + case 107: { + message.organization = reader.int32(); + break; + } + case 109: { + if (!(message.librarySettings && message.librarySettings.length)) + message.librarySettings = []; + message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); + break; + } + case 110: { + message.protoReferenceDocumentationUri = reader.string(); + break; + } + case 111: { + message.restReferenceDocumentationUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Publishing message. + * @function verify + * @memberof google.api.Publishing + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Publishing.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { + if (!Array.isArray(message.methodSettings)) + return "methodSettings: array expected"; + for (var i = 0; i < message.methodSettings.length; ++i) { + var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); + if (error) + return "methodSettings." + error; + } + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + if (!$util.isString(message.newIssueUri)) + return "newIssueUri: string expected"; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + if (!$util.isString(message.documentationUri)) + return "documentationUri: string expected"; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + if (!$util.isString(message.apiShortName)) + return "apiShortName: string expected"; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + if (!$util.isString(message.githubLabel)) + return "githubLabel: string expected"; + if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { + if (!Array.isArray(message.codeownerGithubTeams)) + return "codeownerGithubTeams: array expected"; + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + if (!$util.isString(message.codeownerGithubTeams[i])) + return "codeownerGithubTeams: string[] expected"; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + if (!$util.isString(message.docTagPrefix)) + return "docTagPrefix: string expected"; + if (message.organization != null && message.hasOwnProperty("organization")) + switch (message.organization) { + default: + return "organization: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { + if (!Array.isArray(message.librarySettings)) + return "librarySettings: array expected"; + for (var i = 0; i < message.librarySettings.length; ++i) { + var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); + if (error) + return "librarySettings." + error; + } + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + if (!$util.isString(message.protoReferenceDocumentationUri)) + return "protoReferenceDocumentationUri: string expected"; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + if (!$util.isString(message.restReferenceDocumentationUri)) + return "restReferenceDocumentationUri: string expected"; + return null; + }; + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Publishing + * @static + * @param {Object.} object Plain object + * @returns {google.api.Publishing} Publishing + */ + Publishing.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Publishing) + return object; + var message = new $root.google.api.Publishing(); + if (object.methodSettings) { + if (!Array.isArray(object.methodSettings)) + throw TypeError(".google.api.Publishing.methodSettings: array expected"); + message.methodSettings = []; + for (var i = 0; i < object.methodSettings.length; ++i) { + if (typeof object.methodSettings[i] !== "object") + throw TypeError(".google.api.Publishing.methodSettings: object expected"); + message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); + } + } + if (object.newIssueUri != null) + message.newIssueUri = String(object.newIssueUri); + if (object.documentationUri != null) + message.documentationUri = String(object.documentationUri); + if (object.apiShortName != null) + message.apiShortName = String(object.apiShortName); + if (object.githubLabel != null) + message.githubLabel = String(object.githubLabel); + if (object.codeownerGithubTeams) { + if (!Array.isArray(object.codeownerGithubTeams)) + throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); + message.codeownerGithubTeams = []; + for (var i = 0; i < object.codeownerGithubTeams.length; ++i) + message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); + } + if (object.docTagPrefix != null) + message.docTagPrefix = String(object.docTagPrefix); + switch (object.organization) { + default: + if (typeof object.organization === "number") { + message.organization = object.organization; + break; + } + break; + case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": + case 0: + message.organization = 0; + break; + case "CLOUD": + case 1: + message.organization = 1; + break; + case "ADS": + case 2: + message.organization = 2; + break; + case "PHOTOS": + case 3: + message.organization = 3; + break; + case "STREET_VIEW": + case 4: + message.organization = 4; + break; + case "SHOPPING": + case 5: + message.organization = 5; + break; + case "GEO": + case 6: + message.organization = 6; + break; + case "GENERATIVE_AI": + case 7: + message.organization = 7; + break; + } + if (object.librarySettings) { + if (!Array.isArray(object.librarySettings)) + throw TypeError(".google.api.Publishing.librarySettings: array expected"); + message.librarySettings = []; + for (var i = 0; i < object.librarySettings.length; ++i) { + if (typeof object.librarySettings[i] !== "object") + throw TypeError(".google.api.Publishing.librarySettings: object expected"); + message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); + } + } + if (object.protoReferenceDocumentationUri != null) + message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); + if (object.restReferenceDocumentationUri != null) + message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); + return message; + }; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Publishing + * @static + * @param {google.api.Publishing} message Publishing + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Publishing.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.methodSettings = []; + object.codeownerGithubTeams = []; + object.librarySettings = []; + } + if (options.defaults) { + object.newIssueUri = ""; + object.documentationUri = ""; + object.apiShortName = ""; + object.githubLabel = ""; + object.docTagPrefix = ""; + object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; + object.protoReferenceDocumentationUri = ""; + object.restReferenceDocumentationUri = ""; + } + if (message.methodSettings && message.methodSettings.length) { + object.methodSettings = []; + for (var j = 0; j < message.methodSettings.length; ++j) + object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + object.newIssueUri = message.newIssueUri; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + object.documentationUri = message.documentationUri; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + object.apiShortName = message.apiShortName; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + object.githubLabel = message.githubLabel; + if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { + object.codeownerGithubTeams = []; + for (var j = 0; j < message.codeownerGithubTeams.length; ++j) + object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + object.docTagPrefix = message.docTagPrefix; + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; + if (message.librarySettings && message.librarySettings.length) { + object.librarySettings = []; + for (var j = 0; j < message.librarySettings.length; ++j) + object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; + return object; + }; + + /** + * Converts this Publishing to JSON. + * @function toJSON + * @memberof google.api.Publishing + * @instance + * @returns {Object.} JSON object + */ + Publishing.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Publishing + * @function getTypeUrl + * @memberof google.api.Publishing + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Publishing"; + }; + + return Publishing; + })(); + + api.JavaSettings = (function() { + + /** + * Properties of a JavaSettings. + * @memberof google.api + * @interface IJavaSettings + * @property {string|null} [libraryPackage] JavaSettings libraryPackage + * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames + * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common + */ + + /** + * Constructs a new JavaSettings. + * @memberof google.api + * @classdesc Represents a JavaSettings. + * @implements IJavaSettings + * @constructor + * @param {google.api.IJavaSettings=} [properties] Properties to set + */ + function JavaSettings(properties) { + this.serviceClassNames = {}; + 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]]; + } + + /** + * JavaSettings libraryPackage. + * @member {string} libraryPackage + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.libraryPackage = ""; + + /** + * JavaSettings serviceClassNames. + * @member {Object.} serviceClassNames + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.serviceClassNames = $util.emptyObject; + + /** + * JavaSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.common = null; + + /** + * Creates a new JavaSettings instance using the specified properties. + * @function create + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings=} [properties] Properties to set + * @returns {google.api.JavaSettings} JavaSettings instance + */ + JavaSettings.create = function create(properties) { + return new JavaSettings(properties); + }; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encode + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); + if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) + for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.libraryPackage = reader.string(); + break; + } + case 2: { + if (message.serviceClassNames === $util.emptyObject) + message.serviceClassNames = {}; + 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.serviceClassNames[key] = value; + break; + } + case 3: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JavaSettings message. + * @function verify + * @memberof google.api.JavaSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JavaSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + if (!$util.isString(message.libraryPackage)) + return "libraryPackage: string expected"; + if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { + if (!$util.isObject(message.serviceClassNames)) + return "serviceClassNames: object expected"; + var key = Object.keys(message.serviceClassNames); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.serviceClassNames[key[i]])) + return "serviceClassNames: string{k:string} expected"; + } + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.JavaSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.JavaSettings} JavaSettings + */ + JavaSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.JavaSettings) + return object; + var message = new $root.google.api.JavaSettings(); + if (object.libraryPackage != null) + message.libraryPackage = String(object.libraryPackage); + if (object.serviceClassNames) { + if (typeof object.serviceClassNames !== "object") + throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); + message.serviceClassNames = {}; + for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) + message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); + } + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.JavaSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.JavaSettings + * @static + * @param {google.api.JavaSettings} message JavaSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JavaSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.serviceClassNames = {}; + if (options.defaults) { + object.libraryPackage = ""; + object.common = null; + } + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + object.libraryPackage = message.libraryPackage; + var keys2; + if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { + object.serviceClassNames = {}; + for (var j = 0; j < keys2.length; ++j) + object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; + } + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this JavaSettings to JSON. + * @function toJSON + * @memberof google.api.JavaSettings + * @instance + * @returns {Object.} JSON object + */ + JavaSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JavaSettings + * @function getTypeUrl + * @memberof google.api.JavaSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.JavaSettings"; + }; + + return JavaSettings; + })(); + + api.CppSettings = (function() { + + /** + * Properties of a CppSettings. + * @memberof google.api + * @interface ICppSettings + * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common + */ + + /** + * Constructs a new CppSettings. + * @memberof google.api + * @classdesc Represents a CppSettings. + * @implements ICppSettings + * @constructor + * @param {google.api.ICppSettings=} [properties] Properties to set + */ + function CppSettings(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]]; + } + + /** + * CppSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.CppSettings + * @instance + */ + CppSettings.prototype.common = null; + + /** + * Creates a new CppSettings instance using the specified properties. + * @function create + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings=} [properties] Properties to set + * @returns {google.api.CppSettings} CppSettings instance + */ + CppSettings.create = function create(properties) { + return new CppSettings(properties); + }; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CppSettings message. + * @function verify + * @memberof google.api.CppSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CppSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CppSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CppSettings} CppSettings + */ + CppSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CppSettings) + return object; + var message = new $root.google.api.CppSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.CppSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CppSettings + * @static + * @param {google.api.CppSettings} message CppSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CppSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this CppSettings to JSON. + * @function toJSON + * @memberof google.api.CppSettings + * @instance + * @returns {Object.} JSON object + */ + CppSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CppSettings + * @function getTypeUrl + * @memberof google.api.CppSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CppSettings"; + }; + + return CppSettings; + })(); + + api.PhpSettings = (function() { + + /** + * Properties of a PhpSettings. + * @memberof google.api + * @interface IPhpSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common + */ + + /** + * Constructs a new PhpSettings. + * @memberof google.api + * @classdesc Represents a PhpSettings. + * @implements IPhpSettings + * @constructor + * @param {google.api.IPhpSettings=} [properties] Properties to set + */ + function PhpSettings(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]]; + } + + /** + * PhpSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PhpSettings + * @instance + */ + PhpSettings.prototype.common = null; + + /** + * Creates a new PhpSettings instance using the specified properties. + * @function create + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings=} [properties] Properties to set + * @returns {google.api.PhpSettings} PhpSettings instance + */ + PhpSettings.create = function create(properties) { + return new PhpSettings(properties); + }; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PhpSettings message. + * @function verify + * @memberof google.api.PhpSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PhpSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PhpSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PhpSettings} PhpSettings + */ + PhpSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PhpSettings) + return object; + var message = new $root.google.api.PhpSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PhpSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PhpSettings + * @static + * @param {google.api.PhpSettings} message PhpSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PhpSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PhpSettings to JSON. + * @function toJSON + * @memberof google.api.PhpSettings + * @instance + * @returns {Object.} JSON object + */ + PhpSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PhpSettings + * @function getTypeUrl + * @memberof google.api.PhpSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PhpSettings"; + }; + + return PhpSettings; + })(); + + api.PythonSettings = (function() { + + /** + * Properties of a PythonSettings. + * @memberof google.api + * @interface IPythonSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + */ + + /** + * Constructs a new PythonSettings. + * @memberof google.api + * @classdesc Represents a PythonSettings. + * @implements IPythonSettings + * @constructor + * @param {google.api.IPythonSettings=} [properties] Properties to set + */ + function PythonSettings(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]]; + } + + /** + * PythonSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.common = null; + + /** + * Creates a new PythonSettings instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings=} [properties] Properties to set + * @returns {google.api.PythonSettings} PythonSettings instance + */ + PythonSettings.create = function create(properties) { + return new PythonSettings(properties); + }; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PythonSettings message. + * @function verify + * @memberof google.api.PythonSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PythonSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings} PythonSettings + */ + PythonSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings) + return object; + var message = new $root.google.api.PythonSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PythonSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings + * @static + * @param {google.api.PythonSettings} message PythonSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PythonSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PythonSettings to JSON. + * @function toJSON + * @memberof google.api.PythonSettings + * @instance + * @returns {Object.} JSON object + */ + PythonSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PythonSettings + * @function getTypeUrl + * @memberof google.api.PythonSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings"; + }; + + return PythonSettings; + })(); + + api.NodeSettings = (function() { + + /** + * Properties of a NodeSettings. + * @memberof google.api + * @interface INodeSettings + * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common + */ + + /** + * Constructs a new NodeSettings. + * @memberof google.api + * @classdesc Represents a NodeSettings. + * @implements INodeSettings + * @constructor + * @param {google.api.INodeSettings=} [properties] Properties to set + */ + function NodeSettings(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]]; + } + + /** + * NodeSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.NodeSettings + * @instance + */ + NodeSettings.prototype.common = null; + + /** + * Creates a new NodeSettings instance using the specified properties. + * @function create + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings=} [properties] Properties to set + * @returns {google.api.NodeSettings} NodeSettings instance + */ + NodeSettings.create = function create(properties) { + return new NodeSettings(properties); + }; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encode + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeSettings message. + * @function verify + * @memberof google.api.NodeSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.NodeSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.NodeSettings} NodeSettings + */ + NodeSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.NodeSettings) + return object; + var message = new $root.google.api.NodeSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.NodeSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.NodeSettings + * @static + * @param {google.api.NodeSettings} message NodeSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this NodeSettings to JSON. + * @function toJSON + * @memberof google.api.NodeSettings + * @instance + * @returns {Object.} JSON object + */ + NodeSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeSettings + * @function getTypeUrl + * @memberof google.api.NodeSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.NodeSettings"; + }; + + return NodeSettings; + })(); + + api.DotnetSettings = (function() { + + /** + * Properties of a DotnetSettings. + * @memberof google.api + * @interface IDotnetSettings + * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common + * @property {Object.|null} [renamedServices] DotnetSettings renamedServices + * @property {Object.|null} [renamedResources] DotnetSettings renamedResources + * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources + * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases + * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures + */ + + /** + * Constructs a new DotnetSettings. + * @memberof google.api + * @classdesc Represents a DotnetSettings. + * @implements IDotnetSettings + * @constructor + * @param {google.api.IDotnetSettings=} [properties] Properties to set + */ + function DotnetSettings(properties) { + this.renamedServices = {}; + this.renamedResources = {}; + this.ignoredResources = []; + this.forcedNamespaceAliases = []; + this.handwrittenSignatures = []; + 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]]; + } + + /** + * DotnetSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.common = null; + + /** + * DotnetSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedServices = $util.emptyObject; + + /** + * DotnetSettings renamedResources. + * @member {Object.} renamedResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedResources = $util.emptyObject; + + /** + * DotnetSettings ignoredResources. + * @member {Array.} ignoredResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.ignoredResources = $util.emptyArray; + + /** + * DotnetSettings forcedNamespaceAliases. + * @member {Array.} forcedNamespaceAliases + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; + + /** + * DotnetSettings handwrittenSignatures. + * @member {Array.} handwrittenSignatures + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @function create + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings=} [properties] Properties to set + * @returns {google.api.DotnetSettings} DotnetSettings instance + */ + DotnetSettings.create = function create(properties) { + return new DotnetSettings(properties); + }; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encode + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); + if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) + for (var keys = Object.keys(message.renamedResources), 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.renamedResources[keys[i]]).ldelim(); + if (message.ignoredResources != null && message.ignoredResources.length) + for (var i = 0; i < message.ignoredResources.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); + if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); + if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); + return writer; + }; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + 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.renamedServices[key] = value; + break; + } + case 3: { + if (message.renamedResources === $util.emptyObject) + message.renamedResources = {}; + 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.renamedResources[key] = value; + break; + } + case 4: { + if (!(message.ignoredResources && message.ignoredResources.length)) + message.ignoredResources = []; + message.ignoredResources.push(reader.string()); + break; + } + case 5: { + if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) + message.forcedNamespaceAliases = []; + message.forcedNamespaceAliases.push(reader.string()); + break; + } + case 6: { + if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) + message.handwrittenSignatures = []; + message.handwrittenSignatures.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DotnetSettings message. + * @function verify + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DotnetSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } + if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { + if (!$util.isObject(message.renamedResources)) + return "renamedResources: object expected"; + var key = Object.keys(message.renamedResources); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedResources[key[i]])) + return "renamedResources: string{k:string} expected"; + } + if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { + if (!Array.isArray(message.ignoredResources)) + return "ignoredResources: array expected"; + for (var i = 0; i < message.ignoredResources.length; ++i) + if (!$util.isString(message.ignoredResources[i])) + return "ignoredResources: string[] expected"; + } + if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { + if (!Array.isArray(message.forcedNamespaceAliases)) + return "forcedNamespaceAliases: array expected"; + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + if (!$util.isString(message.forcedNamespaceAliases[i])) + return "forcedNamespaceAliases: string[] expected"; + } + if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { + if (!Array.isArray(message.handwrittenSignatures)) + return "handwrittenSignatures: array expected"; + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + if (!$util.isString(message.handwrittenSignatures[i])) + return "handwrittenSignatures: string[] expected"; + } + return null; + }; + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.DotnetSettings} DotnetSettings + */ + DotnetSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.DotnetSettings) + return object; + var message = new $root.google.api.DotnetSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.DotnetSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } + if (object.renamedResources) { + if (typeof object.renamedResources !== "object") + throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); + message.renamedResources = {}; + for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) + message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); + } + if (object.ignoredResources) { + if (!Array.isArray(object.ignoredResources)) + throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); + message.ignoredResources = []; + for (var i = 0; i < object.ignoredResources.length; ++i) + message.ignoredResources[i] = String(object.ignoredResources[i]); + } + if (object.forcedNamespaceAliases) { + if (!Array.isArray(object.forcedNamespaceAliases)) + throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); + message.forcedNamespaceAliases = []; + for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) + message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); + } + if (object.handwrittenSignatures) { + if (!Array.isArray(object.handwrittenSignatures)) + throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); + message.handwrittenSignatures = []; + for (var i = 0; i < object.handwrittenSignatures.length; ++i) + message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); + } + return message; + }; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.DotnetSettings} message DotnetSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DotnetSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ignoredResources = []; + object.forcedNamespaceAliases = []; + object.handwrittenSignatures = []; + } + if (options.objects || options.defaults) { + object.renamedServices = {}; + object.renamedResources = {}; + } + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } + if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { + object.renamedResources = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; + } + if (message.ignoredResources && message.ignoredResources.length) { + object.ignoredResources = []; + for (var j = 0; j < message.ignoredResources.length; ++j) + object.ignoredResources[j] = message.ignoredResources[j]; + } + if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { + object.forcedNamespaceAliases = []; + for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) + object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; + } + if (message.handwrittenSignatures && message.handwrittenSignatures.length) { + object.handwrittenSignatures = []; + for (var j = 0; j < message.handwrittenSignatures.length; ++j) + object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; + } + return object; + }; + + /** + * Converts this DotnetSettings to JSON. + * @function toJSON + * @memberof google.api.DotnetSettings + * @instance + * @returns {Object.} JSON object + */ + DotnetSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DotnetSettings + * @function getTypeUrl + * @memberof google.api.DotnetSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.DotnetSettings"; + }; + + return DotnetSettings; + })(); + + api.RubySettings = (function() { + + /** + * Properties of a RubySettings. + * @memberof google.api + * @interface IRubySettings + * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common + */ + + /** + * Constructs a new RubySettings. + * @memberof google.api + * @classdesc Represents a RubySettings. + * @implements IRubySettings + * @constructor + * @param {google.api.IRubySettings=} [properties] Properties to set + */ + function RubySettings(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]]; + } + + /** + * RubySettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.RubySettings + * @instance + */ + RubySettings.prototype.common = null; + + /** + * Creates a new RubySettings instance using the specified properties. + * @function create + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings=} [properties] Properties to set + * @returns {google.api.RubySettings} RubySettings instance + */ + RubySettings.create = function create(properties) { + return new RubySettings(properties); + }; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encode + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RubySettings message. + * @function verify + * @memberof google.api.RubySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RubySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.RubySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.RubySettings} RubySettings + */ + RubySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.RubySettings) + return object; + var message = new $root.google.api.RubySettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.RubySettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.RubySettings + * @static + * @param {google.api.RubySettings} message RubySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RubySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this RubySettings to JSON. + * @function toJSON + * @memberof google.api.RubySettings + * @instance + * @returns {Object.} JSON object + */ + RubySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RubySettings + * @function getTypeUrl + * @memberof google.api.RubySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.RubySettings"; + }; + + return RubySettings; + })(); + + api.GoSettings = (function() { + + /** + * Properties of a GoSettings. + * @memberof google.api + * @interface IGoSettings + * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + */ + + /** + * Constructs a new GoSettings. + * @memberof google.api + * @classdesc Represents a GoSettings. + * @implements IGoSettings + * @constructor + * @param {google.api.IGoSettings=} [properties] Properties to set + */ + function GoSettings(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]]; + } + + /** + * GoSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.common = null; + + /** + * Creates a new GoSettings instance using the specified properties. + * @function create + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings=} [properties] Properties to set + * @returns {google.api.GoSettings} GoSettings instance + */ + GoSettings.create = function create(properties) { + return new GoSettings(properties); + }; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encode + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoSettings message. + * @function verify + * @memberof google.api.GoSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.GoSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.GoSettings} GoSettings + */ + GoSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.GoSettings) + return object; + var message = new $root.google.api.GoSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.GoSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.GoSettings + * @static + * @param {google.api.GoSettings} message GoSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this GoSettings to JSON. + * @function toJSON + * @memberof google.api.GoSettings + * @instance + * @returns {Object.} JSON object + */ + GoSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoSettings + * @function getTypeUrl + * @memberof google.api.GoSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.GoSettings"; + }; + + return GoSettings; + })(); + + api.MethodSettings = (function() { + + /** + * Properties of a MethodSettings. + * @memberof google.api + * @interface IMethodSettings + * @property {string|null} [selector] MethodSettings selector + * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning + * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields + */ + + /** + * Constructs a new MethodSettings. + * @memberof google.api + * @classdesc Represents a MethodSettings. + * @implements IMethodSettings + * @constructor + * @param {google.api.IMethodSettings=} [properties] Properties to set + */ + function MethodSettings(properties) { + this.autoPopulatedFields = []; + 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]]; + } + + /** + * MethodSettings selector. + * @member {string} selector + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.selector = ""; + + /** + * MethodSettings longRunning. + * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.longRunning = null; + + /** + * MethodSettings autoPopulatedFields. + * @member {Array.} autoPopulatedFields + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings=} [properties] Properties to set + * @returns {google.api.MethodSettings} MethodSettings instance + */ + MethodSettings.create = function create(properties) { + return new MethodSettings(properties); + }; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.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.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) + $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); + return writer; + }; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) + message.autoPopulatedFields = []; + message.autoPopulatedFields.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodSettings message. + * @function verify + * @memberof google.api.MethodSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) { + var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); + if (error) + return "longRunning." + error; + } + if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { + if (!Array.isArray(message.autoPopulatedFields)) + return "autoPopulatedFields: array expected"; + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + if (!$util.isString(message.autoPopulatedFields[i])) + return "autoPopulatedFields: string[] expected"; + } + return null; + }; + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings} MethodSettings + */ + MethodSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings) + return object; + var message = new $root.google.api.MethodSettings(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.longRunning != null) { + if (typeof object.longRunning !== "object") + throw TypeError(".google.api.MethodSettings.longRunning: object expected"); + message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); + } + if (object.autoPopulatedFields) { + if (!Array.isArray(object.autoPopulatedFields)) + throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); + message.autoPopulatedFields = []; + for (var i = 0; i < object.autoPopulatedFields.length; ++i) + message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); + } + return message; + }; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings + * @static + * @param {google.api.MethodSettings} message MethodSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.autoPopulatedFields = []; + if (options.defaults) { + object.selector = ""; + object.longRunning = null; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) + object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); + if (message.autoPopulatedFields && message.autoPopulatedFields.length) { + object.autoPopulatedFields = []; + for (var j = 0; j < message.autoPopulatedFields.length; ++j) + object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; + } + return object; + }; + + /** + * Converts this MethodSettings to JSON. + * @function toJSON + * @memberof google.api.MethodSettings + * @instance + * @returns {Object.} JSON object + */ + MethodSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodSettings + * @function getTypeUrl + * @memberof google.api.MethodSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings"; + }; + + MethodSettings.LongRunning = (function() { + + /** + * Properties of a LongRunning. + * @memberof google.api.MethodSettings + * @interface ILongRunning + * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay + * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier + * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay + * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout + */ + + /** + * Constructs a new LongRunning. + * @memberof google.api.MethodSettings + * @classdesc Represents a LongRunning. + * @implements ILongRunning + * @constructor + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + */ + function LongRunning(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]]; + } + + /** + * LongRunning initialPollDelay. + * @member {google.protobuf.IDuration|null|undefined} initialPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.initialPollDelay = null; + + /** + * LongRunning pollDelayMultiplier. + * @member {number} pollDelayMultiplier + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.pollDelayMultiplier = 0; + + /** + * LongRunning maxPollDelay. + * @member {google.protobuf.IDuration|null|undefined} maxPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.maxPollDelay = null; + + /** + * LongRunning totalPollTimeout. + * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.totalPollTimeout = null; + + /** + * Creates a new LongRunning instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + * @returns {google.api.MethodSettings.LongRunning} LongRunning instance + */ + LongRunning.create = function create(properties) { + return new LongRunning(properties); + }; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) + $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); + if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) + $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) + $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pollDelayMultiplier = reader.float(); + break; + } + case 3: { + message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LongRunning message. + * @function verify + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LongRunning.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); + if (error) + return "initialPollDelay." + error; + } + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + if (typeof message.pollDelayMultiplier !== "number") + return "pollDelayMultiplier: number expected"; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); + if (error) + return "maxPollDelay." + error; + } + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); + if (error) + return "totalPollTimeout." + error; + } + return null; + }; + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings.LongRunning} LongRunning + */ + LongRunning.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings.LongRunning) + return object; + var message = new $root.google.api.MethodSettings.LongRunning(); + if (object.initialPollDelay != null) { + if (typeof object.initialPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); + message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); + } + if (object.pollDelayMultiplier != null) + message.pollDelayMultiplier = Number(object.pollDelayMultiplier); + if (object.maxPollDelay != null) { + if (typeof object.maxPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); + message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); + } + if (object.totalPollTimeout != null) { + if (typeof object.totalPollTimeout !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); + message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); + } + return message; + }; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.LongRunning} message LongRunning + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LongRunning.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.initialPollDelay = null; + object.pollDelayMultiplier = 0; + object.maxPollDelay = null; + object.totalPollTimeout = null; + } + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) + object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) + object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) + object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); + return object; + }; + + /** + * Converts this LongRunning to JSON. + * @function toJSON + * @memberof google.api.MethodSettings.LongRunning + * @instance + * @returns {Object.} JSON object + */ + LongRunning.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LongRunning + * @function getTypeUrl + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; + }; + + return LongRunning; + })(); + + return MethodSettings; + })(); + + /** + * ClientLibraryOrganization enum. + * @name google.api.ClientLibraryOrganization + * @enum {number} + * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value + * @property {number} CLOUD=1 CLOUD value + * @property {number} ADS=2 ADS value + * @property {number} PHOTOS=3 PHOTOS value + * @property {number} STREET_VIEW=4 STREET_VIEW value + * @property {number} SHOPPING=5 SHOPPING value + * @property {number} GEO=6 GEO value + * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value + */ + api.ClientLibraryOrganization = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD"] = 1; + values[valuesById[2] = "ADS"] = 2; + values[valuesById[3] = "PHOTOS"] = 3; + values[valuesById[4] = "STREET_VIEW"] = 4; + values[valuesById[5] = "SHOPPING"] = 5; + values[valuesById[6] = "GEO"] = 6; + values[valuesById[7] = "GENERATIVE_AI"] = 7; + return values; + })(); + + /** + * ClientLibraryDestination enum. + * @name google.api.ClientLibraryDestination + * @enum {number} + * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value + * @property {number} GITHUB=10 GITHUB value + * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value + */ + api.ClientLibraryDestination = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; + values[valuesById[10] = "GITHUB"] = 10; + values[valuesById[20] = "PACKAGE_MANAGER"] = 20; + return values; + })(); + + /** + * LaunchStage enum. + * @name google.api.LaunchStage + * @enum {number} + * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value + * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value + * @property {number} PRELAUNCH=7 PRELAUNCH value + * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value + * @property {number} ALPHA=2 ALPHA value + * @property {number} BETA=3 BETA value + * @property {number} GA=4 GA value + * @property {number} DEPRECATED=5 DEPRECATED value + */ + api.LaunchStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; + values[valuesById[6] = "UNIMPLEMENTED"] = 6; + values[valuesById[7] = "PRELAUNCH"] = 7; + values[valuesById[1] = "EARLY_ACCESS"] = 1; + values[valuesById[2] = "ALPHA"] = 2; + values[valuesById[3] = "BETA"] = 3; + values[valuesById[4] = "GA"] = 4; + values[valuesById[5] = "DEPRECATED"] = 5; + return values; + })(); + + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); + + /** + * Edition enum. + * @name google.protobuf.Edition + * @enum {number} + * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value + * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value + * @property {number} EDITION_2023=1000 EDITION_2023 value + * @property {number} EDITION_2024=1001 EDITION_2024 value + * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value + * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value + * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value + * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value + * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value + * @property {number} EDITION_MAX=2147483647 EDITION_MAX value + */ + protobuf.Edition = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EDITION_UNKNOWN"] = 0; + values[valuesById[998] = "EDITION_PROTO2"] = 998; + values[valuesById[999] = "EDITION_PROTO3"] = 999; + values[valuesById[1000] = "EDITION_2023"] = 1000; + values[valuesById[1001] = "EDITION_2024"] = 1001; + values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; + values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; + values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; + values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; + values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; + values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; + return values; + })(); + + 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 + * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition + */ + + /** + * 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 = ""; + + /** + * FileDescriptorProto edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = 0; + + /** + * 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); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); + 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, error) { + 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(); + if (tag === error) + break; + 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; + } + case 14: { + message.edition = reader.int32(); + 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"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + 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); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + 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 = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + 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; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + 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); + }; + + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + }; + + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for ExtensionRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; + + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + * @property {Array.|null} [declaration] ExtensionRangeOptions declaration + * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features + * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification + */ + + /** + * 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 = []; + this.declaration = []; + 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; + + /** + * ExtensionRangeOptions declaration. + * @member {Array.} declaration + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.declaration = $util.emptyArray; + + /** + * ExtensionRangeOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.features = null; + + /** + * ExtensionRangeOptions verification. + * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.verification = 1; + + /** + * 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.declaration != null && message.declaration.length) + for (var i = 0; i < message.declaration.length; ++i) + $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + 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, error) { + 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(); + if (tag === error) + break; + 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; + } + case 2: { + if (!(message.declaration && message.declaration.length)) + message.declaration = []; + message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.verification = reader.int32(); + 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; + } + } + if (message.declaration != null && message.hasOwnProperty("declaration")) { + if (!Array.isArray(message.declaration)) + return "declaration: array expected"; + for (var i = 0; i < message.declaration.length; ++i) { + var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); + if (error) + return "declaration." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.verification != null && message.hasOwnProperty("verification")) + switch (message.verification) { + default: + return "verification: enum value expected"; + case 0: + case 1: + break; + } + 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]); + } + } + if (object.declaration) { + if (!Array.isArray(object.declaration)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); + message.declaration = []; + for (var i = 0; i < object.declaration.length; ++i) { + if (typeof object.declaration[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); + message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + switch (object.verification) { + case "DECLARATION": + case 0: + message.verification = 0; + break; + default: + if (typeof object.verification === "number") { + message.verification = object.verification; + break; + } + break; + case "UNVERIFIED": + case 1: + message.verification = 1; + break; + } + 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.declaration = []; + object.uninterpretedOption = []; + } + if (options.defaults) { + object.verification = options.enums === String ? "UNVERIFIED" : 1; + object.features = null; + } + if (message.declaration && message.declaration.length) { + object.declaration = []; + for (var j = 0; j < message.declaration.length; ++j) + object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); + } + if (message.verification != null && message.hasOwnProperty("verification")) + object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + 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); + }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + }; + + ExtensionRangeOptions.Declaration = (function() { + + /** + * Properties of a Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @interface IDeclaration + * @property {number|null} [number] Declaration number + * @property {string|null} [fullName] Declaration fullName + * @property {string|null} [type] Declaration type + * @property {boolean|null} [reserved] Declaration reserved + * @property {boolean|null} [repeated] Declaration repeated + */ + + /** + * Constructs a new Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @classdesc Represents a Declaration. + * @implements IDeclaration + * @constructor + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + */ + function Declaration(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]]; + } + + /** + * Declaration number. + * @member {number} number + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.number = 0; + + /** + * Declaration fullName. + * @member {string} fullName + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.fullName = ""; + + /** + * Declaration type. + * @member {string} type + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.type = ""; + + /** + * Declaration reserved. + * @member {boolean} reserved + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.reserved = false; + + /** + * Declaration repeated. + * @member {boolean} repeated + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.repeated = false; + + /** + * Creates a new Declaration instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance + */ + Declaration.create = function create(properties) { + return new Declaration(properties); + }; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); + if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); + if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); + return writer; + }; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.number = reader.int32(); + break; + } + case 2: { + message.fullName = reader.string(); + break; + } + case 3: { + message.type = reader.string(); + break; + } + case 5: { + message.reserved = reader.bool(); + break; + } + case 6: { + message.repeated = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Declaration message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Declaration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.fullName != null && message.hasOwnProperty("fullName")) + if (!$util.isString(message.fullName)) + return "fullName: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.reserved != null && message.hasOwnProperty("reserved")) + if (typeof message.reserved !== "boolean") + return "reserved: boolean expected"; + if (message.repeated != null && message.hasOwnProperty("repeated")) + if (typeof message.repeated !== "boolean") + return "repeated: boolean expected"; + return null; + }; + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + */ + Declaration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + if (object.number != null) + message.number = object.number | 0; + if (object.fullName != null) + message.fullName = String(object.fullName); + if (object.type != null) + message.type = String(object.type); + if (object.reserved != null) + message.reserved = Boolean(object.reserved); + if (object.repeated != null) + message.repeated = Boolean(object.repeated); + return message; + }; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Declaration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.number = 0; + object.fullName = ""; + object.type = ""; + object.reserved = false; + object.repeated = false; + } + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.fullName != null && message.hasOwnProperty("fullName")) + object.fullName = message.fullName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.reserved != null && message.hasOwnProperty("reserved")) + object.reserved = message.reserved; + if (message.repeated != null && message.hasOwnProperty("repeated")) + object.repeated = message.repeated; + return object; + }; + + /** + * Converts this Declaration to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + * @returns {Object.} JSON object + */ + Declaration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Declaration + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; + }; + + return Declaration; + })(); + + /** + * VerificationState enum. + * @name google.protobuf.ExtensionRangeOptions.VerificationState + * @enum {number} + * @property {number} DECLARATION=0 DECLARATION value + * @property {number} UNVERIFIED=1 UNVERIFIED value + */ + ExtensionRangeOptions.VerificationState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DECLARATION"] = 0; + values[valuesById[1] = "UNVERIFIED"] = 1; + return values; + })(); + + 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, error) { + 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(); + if (tag === error) + break; + 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 3: + case 2: + 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) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + 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] === undefined ? message.label : $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] === undefined ? message.type : $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); + }; + + /** + * Gets the default type url for FieldDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + }; + + /** + * 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_REPEATED=3 LABEL_REPEATED value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for OneofDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; + + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + }; + + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for EnumReservedRange + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; + }; + + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + }; + + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for MethodDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + + 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} [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 {google.protobuf.IFeatureSet|null} [features] FileOptions features + * @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 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 features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.features = null; + + /** + * 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.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.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + 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, error) { + 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(); + if (tag === error) + break; + 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 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 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + 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.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.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + 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) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; + 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.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.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FileOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + 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.phpMetadataNamespace = ""; + object.rubyPackage = ""; + object.features = null; + } + 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] === undefined ? message.optimizeFor : $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.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + 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); + }; + + /** + * Gets the default type url for FileOptions + * @function getTypeUrl + * @memberof google.protobuf.FileOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileOptions"; + }; + + /** + * 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 {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features + * @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 deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * MessageOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.features = null; + + /** + * 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.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + 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, error) { + 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(); + if (tag === error) + break; + 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 11: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 12: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + 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.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + 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.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MessageOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + 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.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + 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.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + 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); + }; + + /** + * Gets the default type url for MessageOptions + * @function getTypeUrl + * @memberof google.protobuf.MessageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MessageOptions"; + }; + + 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} [unverifiedLazy] FieldOptions unverifiedLazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {boolean|null} [debugRedact] FieldOptions debugRedact + * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention + * @property {Array.|null} [targets] FieldOptions targets + * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults + * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features + * @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.targets = []; + this.editionDefaults = []; + 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 unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = 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 debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.debugRedact = false; + + /** + * FieldOptions retention. + * @member {google.protobuf.FieldOptions.OptionRetention} retention + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.retention = 0; + + /** + * FieldOptions targets. + * @member {Array.} targets + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.targets = $util.emptyArray; + + /** + * FieldOptions editionDefaults. + * @member {Array.} editionDefaults + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.editionDefaults = $util.emptyArray; + + /** + * FieldOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.features = null; + + /** + * 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.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); + if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); + if (message.targets != null && message.targets.length) + for (var i = 0; i < message.targets.length; ++i) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); + if (message.editionDefaults != null && message.editionDefaults.length) + for (var i = 0; i < message.editionDefaults.length; ++i) + $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + 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) + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); + 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, error) { + 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(); + if (tag === error) + break; + 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 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 16: { + message.debugRedact = reader.bool(); + break; + } + case 17: { + message.retention = reader.int32(); + break; + } + case 19: { + if (!(message.targets && message.targets.length)) + message.targets = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.targets.push(reader.int32()); + } else + message.targets.push(reader.int32()); + break; + } + case 20: { + if (!(message.editionDefaults && message.editionDefaults.length)) + message.editionDefaults = []; + message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); + break; + } + case 21: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + 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.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + if (typeof message.unverifiedLazy !== "boolean") + return "unverifiedLazy: 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.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.retention != null && message.hasOwnProperty("retention")) + switch (message.retention) { + default: + return "retention: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.targets != null && message.hasOwnProperty("targets")) { + if (!Array.isArray(message.targets)) + return "targets: array expected"; + for (var i = 0; i < message.targets.length; ++i) + switch (message.targets[i]) { + default: + return "targets: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + } + if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { + if (!Array.isArray(message.editionDefaults)) + return "editionDefaults: array expected"; + for (var i = 0; i < message.editionDefaults.length; ++i) { + var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]); + if (error) + return "editionDefaults." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + 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: + case 7: + case 8: + 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) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; + 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) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; + 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.unverifiedLazy != null) + message.unverifiedLazy = Boolean(object.unverifiedLazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + switch (object.retention) { + default: + if (typeof object.retention === "number") { + message.retention = object.retention; + break; + } + break; + case "RETENTION_UNKNOWN": + case 0: + message.retention = 0; + break; + case "RETENTION_RUNTIME": + case 1: + message.retention = 1; + break; + case "RETENTION_SOURCE": + case 2: + message.retention = 2; + break; + } + if (object.targets) { + if (!Array.isArray(object.targets)) + throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); + message.targets = []; + for (var i = 0; i < object.targets.length; ++i) + switch (object.targets[i]) { + default: + if (typeof object.targets[i] === "number") { + message.targets[i] = object.targets[i]; + break; + } + case "TARGET_TYPE_UNKNOWN": + case 0: + message.targets[i] = 0; + break; + case "TARGET_TYPE_FILE": + case 1: + message.targets[i] = 1; + break; + case "TARGET_TYPE_EXTENSION_RANGE": + case 2: + message.targets[i] = 2; + break; + case "TARGET_TYPE_MESSAGE": + case 3: + message.targets[i] = 3; + break; + case "TARGET_TYPE_FIELD": + case 4: + message.targets[i] = 4; + break; + case "TARGET_TYPE_ONEOF": + case 5: + message.targets[i] = 5; + break; + case "TARGET_TYPE_ENUM": + case 6: + message.targets[i] = 6; + break; + case "TARGET_TYPE_ENUM_ENTRY": + case 7: + message.targets[i] = 7; + break; + case "TARGET_TYPE_SERVICE": + case 8: + message.targets[i] = 8; + break; + case "TARGET_TYPE_METHOD": + case 9: + message.targets[i] = 9; + break; + } + } + if (object.editionDefaults) { + if (!Array.isArray(object.editionDefaults)) + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); + message.editionDefaults = []; + for (var i = 0; i < object.editionDefaults.length; ++i) { + if (typeof object.editionDefaults[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); + message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FieldOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + 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: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } + 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; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + case "IDENTIFIER": + case 8: + message[".google.api.fieldBehavior"][i] = 8; + 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.targets = []; + object.editionDefaults = []; + 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.unverifiedLazy = false; + object.debugRedact = false; + object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; + object.features = null; + object[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $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] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + object.unverifiedLazy = message.unverifiedLazy; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.retention != null && message.hasOwnProperty("retention")) + object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; + if (message.targets && message.targets.length) { + object.targets = []; + for (var j = 0; j < message.targets.length; ++j) + object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; + } + if (message.editionDefaults && message.editionDefaults.length) { + object.editionDefaults = []; + for (var j = 0; j < message.editionDefaults.length; ++j) + object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options); + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + 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]] === undefined ? message[".google.api.fieldBehavior"][j] : $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); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + + /** + * 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; + })(); + + /** + * OptionRetention enum. + * @name google.protobuf.FieldOptions.OptionRetention + * @enum {number} + * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value + * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value + * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value + */ + FieldOptions.OptionRetention = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; + values[valuesById[1] = "RETENTION_RUNTIME"] = 1; + values[valuesById[2] = "RETENTION_SOURCE"] = 2; + return values; + })(); + + /** + * OptionTargetType enum. + * @name google.protobuf.FieldOptions.OptionTargetType + * @enum {number} + * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value + * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value + * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value + * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value + * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value + * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value + * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value + * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value + * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value + * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value + */ + FieldOptions.OptionTargetType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; + values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; + values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; + values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; + values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; + values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; + values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; + values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; + values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; + return values; + })(); + + FieldOptions.EditionDefault = (function() { + + /** + * Properties of an EditionDefault. + * @memberof google.protobuf.FieldOptions + * @interface IEditionDefault + * @property {google.protobuf.Edition|null} [edition] EditionDefault edition + * @property {string|null} [value] EditionDefault value + */ + + /** + * Constructs a new EditionDefault. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents an EditionDefault. + * @implements IEditionDefault + * @constructor + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + */ + function EditionDefault(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]]; + } + + /** + * EditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.edition = 0; + + /** + * EditionDefault value. + * @member {string} value + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.value = ""; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance + */ + EditionDefault.create = function create(properties) { + return new EditionDefault(properties); + }; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EditionDefault message. + * @function verify + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + */ + EditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) + return object; + var message = new $root.google.protobuf.FieldOptions.EditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this EditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + * @returns {Object.} JSON object + */ + EditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + }; + + return EditionDefault; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features + * @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 features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.features = null; + + /** + * 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.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + 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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + 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 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.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + 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.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.OneofOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + 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 (options.defaults) + object.features = null; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + 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); + }; + + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + + 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 {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features + * @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 deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * EnumOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.features = null; + + /** + * 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.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + 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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 6: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 7: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + 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.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + 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.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + 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; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + 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); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features + * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @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 features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.features = null; + + /** + * EnumValueOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.debugRedact = 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.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); + 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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.debugRedact = 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.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: 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.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + 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; + object.features = null; + object.debugRedact = false; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + 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); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features + * @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 + * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion + */ + + /** + * 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 features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.features = null; + + /** + * 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"] = ""; + + /** + * ServiceOptions .google.api.apiVersion. + * @member {string} .google.api.apiVersion + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.apiVersion"] = ""; + + /** + * 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.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); + 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"]); + if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) + writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); + 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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 34: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + 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; + } + case 525000001: { + message[".google.api.apiVersion"] = 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.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + 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"; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + if (!$util.isString(message[".google.api.apiVersion"])) + return ".google.api.apiVersion: 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.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + 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"]); + if (object[".google.api.apiVersion"] != null) + message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); + 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.features = null; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + object[".google.api.apiVersion"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + 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"]; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; + 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); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + 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 {google.protobuf.IFeatureSet|null} [features] MethodOptions features + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + */ + + /** + * 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 features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.features = null; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $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; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = 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.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); + 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.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 35: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + case 1049: { + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.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.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + 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.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + 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.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); + if (error) + return ".google.longrunning.operationInfo." + 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) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + 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.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MethodOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + 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.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + 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.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); + } + 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.features = null; + object[".google.longrunning.operationInfo"] = null; + 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] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + 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.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], 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); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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 >= 0) + 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); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.FeatureSet = (function() { + + /** + * Properties of a FeatureSet. + * @memberof google.protobuf + * @interface IFeatureSet + * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence + * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType + * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding + * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation + * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding + * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + */ + + /** + * Constructs a new FeatureSet. + * @memberof google.protobuf + * @classdesc Represents a FeatureSet. + * @implements IFeatureSet + * @constructor + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + */ + function FeatureSet(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]]; + } + + /** + * FeatureSet fieldPresence. + * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.fieldPresence = 0; + + /** + * FeatureSet enumType. + * @member {google.protobuf.FeatureSet.EnumType} enumType + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enumType = 0; + + /** + * FeatureSet repeatedFieldEncoding. + * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.repeatedFieldEncoding = 0; + + /** + * FeatureSet utf8Validation. + * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.utf8Validation = 0; + + /** + * FeatureSet messageEncoding. + * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.messageEncoding = 0; + + /** + * FeatureSet jsonFormat. + * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.jsonFormat = 0; + + /** + * Creates a new FeatureSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet} FeatureSet instance + */ + FeatureSet.create = function create(properties) { + return new FeatureSet(properties); + }; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); + if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); + if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); + if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); + if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); + if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); + return writer; + }; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.fieldPresence = reader.int32(); + break; + } + case 2: { + message.enumType = reader.int32(); + break; + } + case 3: { + message.repeatedFieldEncoding = reader.int32(); + break; + } + case 4: { + message.utf8Validation = reader.int32(); + break; + } + case 5: { + message.messageEncoding = reader.int32(); + break; + } + case 6: { + message.jsonFormat = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSet message. + * @function verify + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + switch (message.fieldPresence) { + default: + return "fieldPresence: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.enumType != null && message.hasOwnProperty("enumType")) + switch (message.enumType) { + default: + return "enumType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + switch (message.repeatedFieldEncoding) { + default: + return "repeatedFieldEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + switch (message.utf8Validation) { + default: + return "utf8Validation: enum value expected"; + case 0: + case 2: + case 3: + break; + } + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + switch (message.messageEncoding) { + default: + return "messageEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + switch (message.jsonFormat) { + default: + return "jsonFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet} FeatureSet + */ + FeatureSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet) + return object; + var message = new $root.google.protobuf.FeatureSet(); + switch (object.fieldPresence) { + default: + if (typeof object.fieldPresence === "number") { + message.fieldPresence = object.fieldPresence; + break; + } + break; + case "FIELD_PRESENCE_UNKNOWN": + case 0: + message.fieldPresence = 0; + break; + case "EXPLICIT": + case 1: + message.fieldPresence = 1; + break; + case "IMPLICIT": + case 2: + message.fieldPresence = 2; + break; + case "LEGACY_REQUIRED": + case 3: + message.fieldPresence = 3; + break; + } + switch (object.enumType) { + default: + if (typeof object.enumType === "number") { + message.enumType = object.enumType; + break; + } + break; + case "ENUM_TYPE_UNKNOWN": + case 0: + message.enumType = 0; + break; + case "OPEN": + case 1: + message.enumType = 1; + break; + case "CLOSED": + case 2: + message.enumType = 2; + break; + } + switch (object.repeatedFieldEncoding) { + default: + if (typeof object.repeatedFieldEncoding === "number") { + message.repeatedFieldEncoding = object.repeatedFieldEncoding; + break; + } + break; + case "REPEATED_FIELD_ENCODING_UNKNOWN": + case 0: + message.repeatedFieldEncoding = 0; + break; + case "PACKED": + case 1: + message.repeatedFieldEncoding = 1; + break; + case "EXPANDED": + case 2: + message.repeatedFieldEncoding = 2; + break; + } + switch (object.utf8Validation) { + default: + if (typeof object.utf8Validation === "number") { + message.utf8Validation = object.utf8Validation; + break; + } + break; + case "UTF8_VALIDATION_UNKNOWN": + case 0: + message.utf8Validation = 0; + break; + case "VERIFY": + case 2: + message.utf8Validation = 2; + break; + case "NONE": + case 3: + message.utf8Validation = 3; + break; + } + switch (object.messageEncoding) { + default: + if (typeof object.messageEncoding === "number") { + message.messageEncoding = object.messageEncoding; + break; + } + break; + case "MESSAGE_ENCODING_UNKNOWN": + case 0: + message.messageEncoding = 0; + break; + case "LENGTH_PREFIXED": + case 1: + message.messageEncoding = 1; + break; + case "DELIMITED": + case 2: + message.messageEncoding = 2; + break; + } + switch (object.jsonFormat) { + default: + if (typeof object.jsonFormat === "number") { + message.jsonFormat = object.jsonFormat; + break; + } + break; + case "JSON_FORMAT_UNKNOWN": + case 0: + message.jsonFormat = 0; + break; + case "ALLOW": + case 1: + message.jsonFormat = 1; + break; + case "LEGACY_BEST_EFFORT": + case 2: + message.jsonFormat = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.FeatureSet} message FeatureSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; + object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; + object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; + object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; + object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; + object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + } + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; + if (message.enumType != null && message.hasOwnProperty("enumType")) + object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; + return object; + }; + + /** + * Converts this FeatureSet to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet + * @instance + * @returns {Object.} JSON object + */ + FeatureSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSet + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet"; + }; + + /** + * FieldPresence enum. + * @name google.protobuf.FeatureSet.FieldPresence + * @enum {number} + * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value + * @property {number} EXPLICIT=1 EXPLICIT value + * @property {number} IMPLICIT=2 IMPLICIT value + * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value + */ + FeatureSet.FieldPresence = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; + values[valuesById[1] = "EXPLICIT"] = 1; + values[valuesById[2] = "IMPLICIT"] = 2; + values[valuesById[3] = "LEGACY_REQUIRED"] = 3; + return values; + })(); + + /** + * EnumType enum. + * @name google.protobuf.FeatureSet.EnumType + * @enum {number} + * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value + * @property {number} OPEN=1 OPEN value + * @property {number} CLOSED=2 CLOSED value + */ + FeatureSet.EnumType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "OPEN"] = 1; + values[valuesById[2] = "CLOSED"] = 2; + return values; + })(); + + /** + * RepeatedFieldEncoding enum. + * @name google.protobuf.FeatureSet.RepeatedFieldEncoding + * @enum {number} + * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value + * @property {number} PACKED=1 PACKED value + * @property {number} EXPANDED=2 EXPANDED value + */ + FeatureSet.RepeatedFieldEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "PACKED"] = 1; + values[valuesById[2] = "EXPANDED"] = 2; + return values; + })(); + + /** + * Utf8Validation enum. + * @name google.protobuf.FeatureSet.Utf8Validation + * @enum {number} + * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value + * @property {number} VERIFY=2 VERIFY value + * @property {number} NONE=3 NONE value + */ + FeatureSet.Utf8Validation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; + values[valuesById[2] = "VERIFY"] = 2; + values[valuesById[3] = "NONE"] = 3; + return values; + })(); + + /** + * MessageEncoding enum. + * @name google.protobuf.FeatureSet.MessageEncoding + * @enum {number} + * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value + * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value + * @property {number} DELIMITED=2 DELIMITED value + */ + FeatureSet.MessageEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "LENGTH_PREFIXED"] = 1; + values[valuesById[2] = "DELIMITED"] = 2; + return values; + })(); + + /** + * JsonFormat enum. + * @name google.protobuf.FeatureSet.JsonFormat + * @enum {number} + * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value + * @property {number} ALLOW=1 ALLOW value + * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value + */ + FeatureSet.JsonFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; + values[valuesById[1] = "ALLOW"] = 1; + values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; + return values; + })(); + + return FeatureSet; + })(); + + protobuf.FeatureSetDefaults = (function() { + + /** + * Properties of a FeatureSetDefaults. + * @memberof google.protobuf + * @interface IFeatureSetDefaults + * @property {Array.|null} [defaults] FeatureSetDefaults defaults + * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition + * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition + */ + + /** + * Constructs a new FeatureSetDefaults. + * @memberof google.protobuf + * @classdesc Represents a FeatureSetDefaults. + * @implements IFeatureSetDefaults + * @constructor + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + */ + function FeatureSetDefaults(properties) { + this.defaults = []; + 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]]; + } + + /** + * FeatureSetDefaults defaults. + * @member {Array.} defaults + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.defaults = $util.emptyArray; + + /** + * FeatureSetDefaults minimumEdition. + * @member {google.protobuf.Edition} minimumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.minimumEdition = 0; + + /** + * FeatureSetDefaults maximumEdition. + * @member {google.protobuf.Edition} maximumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.maximumEdition = 0; + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance + */ + FeatureSetDefaults.create = function create(properties) { + return new FeatureSetDefaults(properties); + }; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.defaults != null && message.defaults.length) + for (var i = 0; i < message.defaults.length; ++i) + $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); + if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); + return writer; + }; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.defaults && message.defaults.length)) + message.defaults = []; + message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); + break; + } + case 4: { + message.minimumEdition = reader.int32(); + break; + } + case 5: { + message.maximumEdition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetDefaults message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetDefaults.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.defaults != null && message.hasOwnProperty("defaults")) { + if (!Array.isArray(message.defaults)) + return "defaults: array expected"; + for (var i = 0; i < message.defaults.length; ++i) { + var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); + if (error) + return "defaults." + error; + } + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + switch (message.minimumEdition) { + default: + return "minimumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + switch (message.maximumEdition) { + default: + return "maximumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + */ + FeatureSetDefaults.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults(); + if (object.defaults) { + if (!Array.isArray(object.defaults)) + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); + message.defaults = []; + for (var i = 0; i < object.defaults.length; ++i) { + if (typeof object.defaults[i] !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); + message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]); + } + } + switch (object.minimumEdition) { + default: + if (typeof object.minimumEdition === "number") { + message.minimumEdition = object.minimumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.minimumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.minimumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.minimumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.minimumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.minimumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.minimumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.minimumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.minimumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.minimumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.minimumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.minimumEdition = 2147483647; + break; + } + switch (object.maximumEdition) { + default: + if (typeof object.maximumEdition === "number") { + message.maximumEdition = object.maximumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.maximumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.maximumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.maximumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.maximumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.maximumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.maximumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.maximumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.maximumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.maximumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.maximumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.maximumEdition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetDefaults.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.defaults = []; + if (options.defaults) { + object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.defaults && message.defaults.length) { + object.defaults = []; + for (var j = 0; j < message.defaults.length; ++j) + object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; + return object; + }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults + * @instance + * @returns {Object.} JSON object + */ + FeatureSetDefaults.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetDefaults + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; + }; + + FeatureSetDefaults.FeatureSetEditionDefault = (function() { + + /** + * Properties of a FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @interface IFeatureSetEditionDefault + * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition + * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features + */ + + /** + * Constructs a new FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @classdesc Represents a FeatureSetEditionDefault. + * @implements IFeatureSetEditionDefault + * @constructor + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + */ + function FeatureSetEditionDefault(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]]; + } + + /** + * FeatureSetEditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.edition = 0; + + /** + * FeatureSetEditionDefault features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.features = null; + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance + */ + FeatureSetEditionDefault.create = function create(properties) { + return new FeatureSetEditionDefault(properties); + }; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetEditionDefault message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetEditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + return null; + }; + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + */ + FeatureSetEditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetEditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.features = null; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + * @returns {Object.} JSON object + */ + FeatureSetEditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; + }; + + return FeatureSetEditionDefault; + })(); + + return FeatureSetDefaults; + })(); + + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + 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 + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * 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; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 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); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + 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, error) { + 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(); + if (tag === error) + break; + 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; + } + case 5: { + message.semantic = 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"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + 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; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + 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; + object.semantic = options.enums === String ? "NONE" : 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; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + 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); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for FieldMask + * @function getTypeUrl + * @memberof google.protobuf.FieldMask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldMask"; + }; + + return FieldMask; + })(); + + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + + return Timestamp; + })(); + + 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, error) { + 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(); + if (tag === error) + break; + 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 >= 0) + 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); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] DoubleValue value + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Represents a DoubleValue. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + */ + function DoubleValue(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]]; + } + + /** + * DoubleValue value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.value); + return writer; + }; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DoubleValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DoubleValue message. + * @function verify + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DoubleValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DoubleValue} DoubleValue + */ + DoubleValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DoubleValue) + return object; + var message = new $root.google.protobuf.DoubleValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.DoubleValue} message DoubleValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DoubleValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this DoubleValue to JSON. + * @function toJSON + * @memberof google.protobuf.DoubleValue + * @instance + * @returns {Object.} JSON object + */ + DoubleValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] FloatValue value + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Represents a FloatValue. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + */ + function FloatValue(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]]; + } + + /** + * FloatValue value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.value); + return writer; + }; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FloatValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FloatValue message. + * @function verify + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FloatValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FloatValue} FloatValue + */ + FloatValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FloatValue) + return object; + var message = new $root.google.protobuf.FloatValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.FloatValue} message FloatValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FloatValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this FloatValue to JSON. + * @function toJSON + * @memberof google.protobuf.FloatValue + * @instance + * @returns {Object.} JSON object + */ + FloatValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {number|Long|null} [value] Int64Value value + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Represents an Int64Value. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + */ + function Int64Value(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]]; + } + + /** + * Int64Value value. + * @member {number|Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value); + return writer; + }; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int64Value message. + * @function verify + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int64Value} Int64Value + */ + Int64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int64Value) + return object; + var message = new $root.google.protobuf.Int64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = false; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.Int64Value} message Int64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int64Value.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.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value; + return object; + }; + + /** + * Converts this Int64Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int64Value + * @instance + * @returns {Object.} JSON object + */ + Int64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {number|Long|null} [value] UInt64Value value + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Represents a UInt64Value. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + */ + function UInt64Value(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]]; + } + + /** + * UInt64Value value. + * @member {number|Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.value); + return writer; + }; + + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.uint64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt64Value message. + * @function verify + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt64Value} UInt64Value + */ + UInt64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt64Value) + return object; + var message = new $root.google.protobuf.UInt64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = true; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.UInt64Value} message UInt64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt64Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber(true) : message.value; + return object; + }; + + /** + * Converts this UInt64Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt64Value + * @instance + * @returns {Object.} JSON object + */ + UInt64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] Int32Value value + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Represents an Int32Value. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + */ + function Int32Value(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]]; + } + + /** + * Int32Value value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.value); + return writer; + }; + + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int32Value message. + * @function verify + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int32Value} Int32Value + */ + Int32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int32Value) + return object; + var message = new $root.google.protobuf.Int32Value(); + if (object.value != null) + message.value = object.value | 0; + return message; + }; + + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.Int32Value} message Int32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this Int32Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int32Value + * @instance + * @returns {Object.} JSON object + */ + Int32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] UInt32Value value + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Represents a UInt32Value. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + */ + function UInt32Value(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]]; + } + + /** + * UInt32Value value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.value); + return writer; + }; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.uint32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt32Value message. + * @function verify + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt32Value} UInt32Value + */ + UInt32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt32Value) + return object; + var message = new $root.google.protobuf.UInt32Value(); + if (object.value != null) + message.value = object.value >>> 0; + return message; + }; + + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.UInt32Value} message UInt32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this UInt32Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt32Value + * @instance + * @returns {Object.} JSON object + */ + UInt32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] BoolValue value + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Represents a BoolValue. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + */ + function BoolValue(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]]; + } + + /** + * BoolValue value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.value); + return writer; + }; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BoolValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoolValue message. + * @function verify + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoolValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "boolean") + return "value: boolean expected"; + return null; + }; + + /** + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BoolValue} BoolValue + */ + BoolValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BoolValue) + return object; + var message = new $root.google.protobuf.BoolValue(); + if (object.value != null) + message.value = Boolean(object.value); + return message; + }; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.BoolValue} message BoolValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoolValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = false; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this BoolValue to JSON. + * @function toJSON + * @memberof google.protobuf.BoolValue + * @instance + * @returns {Object.} JSON object + */ + BoolValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] StringValue value + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Represents a StringValue. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [properties] Properties to set + */ + function StringValue(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]]; + } + + /** + * StringValue value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + return writer; + }; + + /** + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.StringValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StringValue message. + * @function verify + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StringValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.StringValue} StringValue + */ + StringValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.StringValue) + return object; + var message = new $root.google.protobuf.StringValue(); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.StringValue} message StringValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StringValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = ""; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this StringValue to JSON. + * @function toJSON + * @memberof google.protobuf.StringValue + * @instance + * @returns {Object.} JSON object + */ + StringValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] BytesValue value + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Represents a BytesValue. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + */ + function BytesValue(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]]; + } + + /** + * BytesValue value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BytesValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BytesValue message. + * @function verify + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BytesValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object 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 a BytesValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BytesValue} BytesValue + */ + BytesValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BytesValue) + return object; + var message = new $root.google.protobuf.BytesValue(); + 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 >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.BytesValue} message BytesValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BytesValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + 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 BytesValue to JSON. + * @function toJSON + * @memberof google.protobuf.BytesValue + * @instance + * @returns {Object.} JSON object + */ + BytesValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + return rpc; + })(); + + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + type.Color = (function() { + + /** + * Properties of a Color. + * @memberof google.type + * @interface IColor + * @property {number|null} [red] Color red + * @property {number|null} [green] Color green + * @property {number|null} [blue] Color blue + * @property {google.protobuf.IFloatValue|null} [alpha] Color alpha + */ + + /** + * Constructs a new Color. + * @memberof google.type + * @classdesc Represents a Color. + * @implements IColor + * @constructor + * @param {google.type.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.type.Color + * @instance + */ + Color.prototype.red = 0; + + /** + * Color green. + * @member {number} green + * @memberof google.type.Color + * @instance + */ + Color.prototype.green = 0; + + /** + * Color blue. + * @member {number} blue + * @memberof google.type.Color + * @instance + */ + Color.prototype.blue = 0; + + /** + * Color alpha. + * @member {google.protobuf.IFloatValue|null|undefined} alpha + * @memberof google.type.Color + * @instance + */ + Color.prototype.alpha = null; + + /** + * Creates a new Color instance using the specified properties. + * @function create + * @memberof google.type.Color + * @static + * @param {google.type.IColor=} [properties] Properties to set + * @returns {google.type.Color} Color instance + */ + Color.create = function create(properties) { + return new Color(properties); + }; + + /** + * Encodes the specified Color message. Does not implicitly {@link google.type.Color.verify|verify} messages. + * @function encode + * @memberof google.type.Color + * @static + * @param {google.type.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); + if (message.alpha != null && Object.hasOwnProperty.call(message, "alpha")) + $root.google.protobuf.FloatValue.encode(message.alpha, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Color message, length delimited. Does not implicitly {@link google.type.Color.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Color + * @static + * @param {google.type.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.type.Color + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Color(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.red = reader.float(); + break; + } + case 2: { + message.green = reader.float(); + break; + } + case 3: { + message.blue = reader.float(); + break; + } + case 4: { + message.alpha = $root.google.protobuf.FloatValue.decode(reader, reader.uint32()); + 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.type.Color + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.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.type.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"; + if (message.alpha != null && message.hasOwnProperty("alpha")) { + var error = $root.google.protobuf.FloatValue.verify(message.alpha); + if (error) + return "alpha." + error; + } + return null; + }; + + /** + * Creates a Color message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Color + * @static + * @param {Object.} object Plain object + * @returns {google.type.Color} Color + */ + Color.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Color) + return object; + var message = new $root.google.type.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); + if (object.alpha != null) { + if (typeof object.alpha !== "object") + throw TypeError(".google.type.Color.alpha: object expected"); + message.alpha = $root.google.protobuf.FloatValue.fromObject(object.alpha); + } + return message; + }; + + /** + * Creates a plain object from a Color message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Color + * @static + * @param {google.type.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; + object.alpha = null; + } + 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; + if (message.alpha != null && message.hasOwnProperty("alpha")) + object.alpha = $root.google.protobuf.FloatValue.toObject(message.alpha, options); + return object; + }; + + /** + * Converts this Color to JSON. + * @function toJSON + * @memberof google.type.Color + * @instance + * @returns {Object.} JSON object + */ + Color.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Color + * @function getTypeUrl + * @memberof google.type.Color + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Color.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Color"; + }; + + return Color; + })(); + + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for Date + * @function getTypeUrl + * @memberof google.type.Date + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Date.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Date"; + }; + + return Date; + })(); + + type.DateTime = (function() { + + /** + * Properties of a DateTime. + * @memberof google.type + * @interface IDateTime + * @property {number|null} [year] DateTime year + * @property {number|null} [month] DateTime month + * @property {number|null} [day] DateTime day + * @property {number|null} [hours] DateTime hours + * @property {number|null} [minutes] DateTime minutes + * @property {number|null} [seconds] DateTime seconds + * @property {number|null} [nanos] DateTime nanos + * @property {google.protobuf.IDuration|null} [utcOffset] DateTime utcOffset + * @property {google.type.ITimeZone|null} [timeZone] DateTime timeZone + */ + + /** + * Constructs a new DateTime. + * @memberof google.type + * @classdesc Represents a DateTime. + * @implements IDateTime + * @constructor + * @param {google.type.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 year. + * @member {number} year + * @memberof google.type.DateTime + * @instance + */ + DateTime.prototype.year = 0; + + /** + * DateTime month. + * @member {number} month + * @memberof google.type.DateTime + * @instance + */ + DateTime.prototype.month = 0; + + /** + * DateTime day. + * @member {number} day + * @memberof google.type.DateTime + * @instance + */ + DateTime.prototype.day = 0; + + /** + * DateTime hours. + * @member {number} hours + * @memberof google.type.DateTime + * @instance + */ + DateTime.prototype.hours = 0; + + /** + * DateTime minutes. + * @member {number} minutes + * @memberof google.type.DateTime + * @instance + */ + DateTime.prototype.minutes = 0; + + /** + * DateTime seconds. + * @member {number} seconds + * @memberof google.type.DateTime + * @instance + */ + DateTime.prototype.seconds = 0; + + /** + * DateTime nanos. + * @member {number} nanos + * @memberof google.type.DateTime + * @instance + */ + DateTime.prototype.nanos = 0; + + /** + * DateTime utcOffset. + * @member {google.protobuf.IDuration|null|undefined} utcOffset + * @memberof google.type.DateTime + * @instance + */ + DateTime.prototype.utcOffset = null; + + /** + * DateTime timeZone. + * @member {google.type.ITimeZone|null|undefined} timeZone + * @memberof google.type.DateTime + * @instance + */ + DateTime.prototype.timeZone = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DateTime timeOffset. + * @member {"utcOffset"|"timeZone"|undefined} timeOffset + * @memberof google.type.DateTime + * @instance + */ + Object.defineProperty(DateTime.prototype, "timeOffset", { + get: $util.oneOfGetter($oneOfFields = ["utcOffset", "timeZone"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DateTime instance using the specified properties. + * @function create + * @memberof google.type.DateTime + * @static + * @param {google.type.IDateTime=} [properties] Properties to set + * @returns {google.type.DateTime} DateTime instance + */ + DateTime.create = function create(properties) { + return new DateTime(properties); + }; + + /** + * Encodes the specified DateTime message. Does not implicitly {@link google.type.DateTime.verify|verify} messages. + * @function encode + * @memberof google.type.DateTime + * @static + * @param {google.type.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.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); + if (message.hours != null && Object.hasOwnProperty.call(message, "hours")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.hours); + if (message.minutes != null && Object.hasOwnProperty.call(message, "minutes")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.minutes); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.nanos); + if (message.utcOffset != null && Object.hasOwnProperty.call(message, "utcOffset")) + $root.google.protobuf.Duration.encode(message.utcOffset, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) + $root.google.type.TimeZone.encode(message.timeZone, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DateTime message, length delimited. Does not implicitly {@link google.type.DateTime.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.DateTime + * @static + * @param {google.type.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.type.DateTime + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.DateTime(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.year = reader.int32(); + break; + } + case 2: { + message.month = reader.int32(); + break; + } + case 3: { + message.day = reader.int32(); + break; + } + case 4: { + message.hours = reader.int32(); + break; + } + case 5: { + message.minutes = reader.int32(); + break; + } + case 6: { + message.seconds = reader.int32(); + break; + } + case 7: { + message.nanos = reader.int32(); + break; + } + case 8: { + message.utcOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 9: { + message.timeZone = $root.google.type.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.type.DateTime + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.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.type.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"; + var properties = {}; + 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"; + 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"; + if (message.utcOffset != null && message.hasOwnProperty("utcOffset")) { + properties.timeOffset = 1; + { + var error = $root.google.protobuf.Duration.verify(message.utcOffset); + if (error) + return "utcOffset." + error; + } + } + if (message.timeZone != null && message.hasOwnProperty("timeZone")) { + if (properties.timeOffset === 1) + return "timeOffset: multiple values"; + properties.timeOffset = 1; + { + var error = $root.google.type.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.type.DateTime + * @static + * @param {Object.} object Plain object + * @returns {google.type.DateTime} DateTime + */ + DateTime.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.DateTime) + return object; + var message = new $root.google.type.DateTime(); + 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; + 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; + if (object.utcOffset != null) { + if (typeof object.utcOffset !== "object") + throw TypeError(".google.type.DateTime.utcOffset: object expected"); + message.utcOffset = $root.google.protobuf.Duration.fromObject(object.utcOffset); + } + if (object.timeZone != null) { + if (typeof object.timeZone !== "object") + throw TypeError(".google.type.DateTime.timeZone: object expected"); + message.timeZone = $root.google.type.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.type.DateTime + * @static + * @param {google.type.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.year = 0; + object.month = 0; + object.day = 0; + object.hours = 0; + object.minutes = 0; + object.seconds = 0; + object.nanos = 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; + 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; + if (message.utcOffset != null && message.hasOwnProperty("utcOffset")) { + object.utcOffset = $root.google.protobuf.Duration.toObject(message.utcOffset, options); + if (options.oneofs) + object.timeOffset = "utcOffset"; + } + if (message.timeZone != null && message.hasOwnProperty("timeZone")) { + object.timeZone = $root.google.type.TimeZone.toObject(message.timeZone, options); + if (options.oneofs) + object.timeOffset = "timeZone"; + } + return object; + }; + + /** + * Converts this DateTime to JSON. + * @function toJSON + * @memberof google.type.DateTime + * @instance + * @returns {Object.} JSON object + */ + DateTime.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DateTime + * @function getTypeUrl + * @memberof google.type.DateTime + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DateTime.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.DateTime"; + }; + + return DateTime; + })(); + + type.TimeZone = (function() { + + /** + * Properties of a TimeZone. + * @memberof google.type + * @interface ITimeZone + * @property {string|null} [id] TimeZone id + * @property {string|null} [version] TimeZone version + */ + + /** + * Constructs a new TimeZone. + * @memberof google.type + * @classdesc Represents a TimeZone. + * @implements ITimeZone + * @constructor + * @param {google.type.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 id. + * @member {string} id + * @memberof google.type.TimeZone + * @instance + */ + TimeZone.prototype.id = ""; + + /** + * TimeZone version. + * @member {string} version + * @memberof google.type.TimeZone + * @instance + */ + TimeZone.prototype.version = ""; + + /** + * Creates a new TimeZone instance using the specified properties. + * @function create + * @memberof google.type.TimeZone + * @static + * @param {google.type.ITimeZone=} [properties] Properties to set + * @returns {google.type.TimeZone} TimeZone instance + */ + TimeZone.create = function create(properties) { + return new TimeZone(properties); + }; + + /** + * Encodes the specified TimeZone message. Does not implicitly {@link google.type.TimeZone.verify|verify} messages. + * @function encode + * @memberof google.type.TimeZone + * @static + * @param {google.type.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.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.version); + return writer; + }; + + /** + * Encodes the specified TimeZone message, length delimited. Does not implicitly {@link google.type.TimeZone.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.TimeZone + * @static + * @param {google.type.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.type.TimeZone + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.TimeZone(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.version = reader.string(); + 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.type.TimeZone + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.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.type.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.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + return null; + }; + + /** + * Creates a TimeZone message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.TimeZone + * @static + * @param {Object.} object Plain object + * @returns {google.type.TimeZone} TimeZone + */ + TimeZone.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.TimeZone) + return object; + var message = new $root.google.type.TimeZone(); + if (object.id != null) + message.id = String(object.id); + if (object.version != null) + message.version = String(object.version); + return message; + }; + + /** + * Creates a plain object from a TimeZone message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.TimeZone + * @static + * @param {google.type.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.id = ""; + object.version = ""; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + return object; + }; + + /** + * Converts this TimeZone to JSON. + * @function toJSON + * @memberof google.type.TimeZone + * @instance + * @returns {Object.} JSON object + */ + TimeZone.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimeZone + * @function getTypeUrl + * @memberof google.type.TimeZone + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimeZone.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.TimeZone"; + }; + + return TimeZone; + })(); + + type.Money = (function() { + + /** + * Properties of a Money. + * @memberof google.type + * @interface IMoney + * @property {string|null} [currencyCode] Money currencyCode + * @property {number|Long|null} [units] Money units + * @property {number|null} [nanos] Money nanos + */ + + /** + * Constructs a new Money. + * @memberof google.type + * @classdesc Represents a Money. + * @implements IMoney + * @constructor + * @param {google.type.IMoney=} [properties] Properties to set + */ + function Money(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]]; + } + + /** + * Money currencyCode. + * @member {string} currencyCode + * @memberof google.type.Money + * @instance + */ + Money.prototype.currencyCode = ""; + + /** + * Money units. + * @member {number|Long} units + * @memberof google.type.Money + * @instance + */ + Money.prototype.units = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Money nanos. + * @member {number} nanos + * @memberof google.type.Money + * @instance + */ + Money.prototype.nanos = 0; + + /** + * Creates a new Money instance using the specified properties. + * @function create + * @memberof google.type.Money + * @static + * @param {google.type.IMoney=} [properties] Properties to set + * @returns {google.type.Money} Money instance + */ + Money.create = function create(properties) { + return new Money(properties); + }; + + /** + * Encodes the specified Money message. Does not implicitly {@link google.type.Money.verify|verify} messages. + * @function encode + * @memberof google.type.Money + * @static + * @param {google.type.IMoney} message Money message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Money.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.currencyCode != null && Object.hasOwnProperty.call(message, "currencyCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.currencyCode); + if (message.units != null && Object.hasOwnProperty.call(message, "units")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.units); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Money message, length delimited. Does not implicitly {@link google.type.Money.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Money + * @static + * @param {google.type.IMoney} message Money message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Money.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Money message from the specified reader or buffer. + * @function decode + * @memberof google.type.Money + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Money} Money + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Money.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Money(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.currencyCode = reader.string(); + break; + } + case 2: { + message.units = reader.int64(); + break; + } + case 3: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Money message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Money + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Money} Money + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Money.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Money message. + * @function verify + * @memberof google.type.Money + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Money.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) + if (!$util.isString(message.currencyCode)) + return "currencyCode: string expected"; + if (message.units != null && message.hasOwnProperty("units")) + if (!$util.isInteger(message.units) && !(message.units && $util.isInteger(message.units.low) && $util.isInteger(message.units.high))) + return "units: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Money message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Money + * @static + * @param {Object.} object Plain object + * @returns {google.type.Money} Money + */ + Money.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Money) + return object; + var message = new $root.google.type.Money(); + if (object.currencyCode != null) + message.currencyCode = String(object.currencyCode); + if (object.units != null) + if ($util.Long) + (message.units = $util.Long.fromValue(object.units)).unsigned = false; + else if (typeof object.units === "string") + message.units = parseInt(object.units, 10); + else if (typeof object.units === "number") + message.units = object.units; + else if (typeof object.units === "object") + message.units = new $util.LongBits(object.units.low >>> 0, object.units.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Money message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Money + * @static + * @param {google.type.Money} message Money + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Money.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.currencyCode = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.units = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.units = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) + object.currencyCode = message.currencyCode; + if (message.units != null && message.hasOwnProperty("units")) + if (typeof message.units === "number") + object.units = options.longs === String ? String(message.units) : message.units; + else + object.units = options.longs === String ? $util.Long.prototype.toString.call(message.units) : options.longs === Number ? new $util.LongBits(message.units.low >>> 0, message.units.high >>> 0).toNumber() : message.units; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Money to JSON. + * @function toJSON + * @memberof google.type.Money + * @instance + * @returns {Object.} JSON object + */ + Money.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Money + * @function getTypeUrl + * @memberof google.type.Money + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Money.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Money"; + }; + + return Money; + })(); + + type.PostalAddress = (function() { + + /** + * Properties of a PostalAddress. + * @memberof google.type + * @interface IPostalAddress + * @property {number|null} [revision] PostalAddress revision + * @property {string|null} [regionCode] PostalAddress regionCode + * @property {string|null} [languageCode] PostalAddress languageCode + * @property {string|null} [postalCode] PostalAddress postalCode + * @property {string|null} [sortingCode] PostalAddress sortingCode + * @property {string|null} [administrativeArea] PostalAddress administrativeArea + * @property {string|null} [locality] PostalAddress locality + * @property {string|null} [sublocality] PostalAddress sublocality + * @property {Array.|null} [addressLines] PostalAddress addressLines + * @property {Array.|null} [recipients] PostalAddress recipients + * @property {string|null} [organization] PostalAddress organization + */ + + /** + * Constructs a new PostalAddress. + * @memberof google.type + * @classdesc Represents a PostalAddress. + * @implements IPostalAddress + * @constructor + * @param {google.type.IPostalAddress=} [properties] Properties to set + */ + function PostalAddress(properties) { + this.addressLines = []; + this.recipients = []; + 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]]; + } + + /** + * PostalAddress revision. + * @member {number} revision + * @memberof google.type.PostalAddress + * @instance + */ + PostalAddress.prototype.revision = 0; + + /** + * PostalAddress regionCode. + * @member {string} regionCode + * @memberof google.type.PostalAddress + * @instance + */ + PostalAddress.prototype.regionCode = ""; + + /** + * PostalAddress languageCode. + * @member {string} languageCode + * @memberof google.type.PostalAddress + * @instance + */ + PostalAddress.prototype.languageCode = ""; + + /** + * PostalAddress postalCode. + * @member {string} postalCode + * @memberof google.type.PostalAddress + * @instance + */ + PostalAddress.prototype.postalCode = ""; + + /** + * PostalAddress sortingCode. + * @member {string} sortingCode + * @memberof google.type.PostalAddress + * @instance + */ + PostalAddress.prototype.sortingCode = ""; + + /** + * PostalAddress administrativeArea. + * @member {string} administrativeArea + * @memberof google.type.PostalAddress + * @instance + */ + PostalAddress.prototype.administrativeArea = ""; + + /** + * PostalAddress locality. + * @member {string} locality + * @memberof google.type.PostalAddress + * @instance + */ + PostalAddress.prototype.locality = ""; + + /** + * PostalAddress sublocality. + * @member {string} sublocality + * @memberof google.type.PostalAddress + * @instance + */ + PostalAddress.prototype.sublocality = ""; + + /** + * PostalAddress addressLines. + * @member {Array.} addressLines + * @memberof google.type.PostalAddress + * @instance + */ + PostalAddress.prototype.addressLines = $util.emptyArray; + + /** + * PostalAddress recipients. + * @member {Array.} recipients + * @memberof google.type.PostalAddress + * @instance + */ + PostalAddress.prototype.recipients = $util.emptyArray; + + /** + * PostalAddress organization. + * @member {string} organization + * @memberof google.type.PostalAddress + * @instance + */ + PostalAddress.prototype.organization = ""; + + /** + * Creates a new PostalAddress instance using the specified properties. + * @function create + * @memberof google.type.PostalAddress + * @static + * @param {google.type.IPostalAddress=} [properties] Properties to set + * @returns {google.type.PostalAddress} PostalAddress instance + */ + PostalAddress.create = function create(properties) { + return new PostalAddress(properties); + }; + + /** + * Encodes the specified PostalAddress message. Does not implicitly {@link google.type.PostalAddress.verify|verify} messages. + * @function encode + * @memberof google.type.PostalAddress + * @static + * @param {google.type.IPostalAddress} message PostalAddress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PostalAddress.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.revision != null && Object.hasOwnProperty.call(message, "revision")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.revision); + if (message.regionCode != null && Object.hasOwnProperty.call(message, "regionCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.regionCode); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); + if (message.postalCode != null && Object.hasOwnProperty.call(message, "postalCode")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.postalCode); + if (message.sortingCode != null && Object.hasOwnProperty.call(message, "sortingCode")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.sortingCode); + if (message.administrativeArea != null && Object.hasOwnProperty.call(message, "administrativeArea")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.administrativeArea); + if (message.locality != null && Object.hasOwnProperty.call(message, "locality")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.locality); + if (message.sublocality != null && Object.hasOwnProperty.call(message, "sublocality")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.sublocality); + if (message.addressLines != null && message.addressLines.length) + for (var i = 0; i < message.addressLines.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.addressLines[i]); + if (message.recipients != null && message.recipients.length) + for (var i = 0; i < message.recipients.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.recipients[i]); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.organization); + return writer; + }; + + /** + * Encodes the specified PostalAddress message, length delimited. Does not implicitly {@link google.type.PostalAddress.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.PostalAddress + * @static + * @param {google.type.IPostalAddress} message PostalAddress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PostalAddress.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PostalAddress message from the specified reader or buffer. + * @function decode + * @memberof google.type.PostalAddress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.PostalAddress} PostalAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PostalAddress.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.PostalAddress(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.revision = reader.int32(); + break; + } + case 2: { + message.regionCode = reader.string(); + break; + } + case 3: { + message.languageCode = reader.string(); + break; + } + case 4: { + message.postalCode = reader.string(); + break; + } + case 5: { + message.sortingCode = reader.string(); + break; + } + case 6: { + message.administrativeArea = reader.string(); + break; + } + case 7: { + message.locality = reader.string(); + break; + } + case 8: { + message.sublocality = reader.string(); + break; + } + case 9: { + if (!(message.addressLines && message.addressLines.length)) + message.addressLines = []; + message.addressLines.push(reader.string()); + break; + } + case 10: { + if (!(message.recipients && message.recipients.length)) + message.recipients = []; + message.recipients.push(reader.string()); + break; + } + case 11: { + message.organization = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PostalAddress message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.PostalAddress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.PostalAddress} PostalAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PostalAddress.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PostalAddress message. + * @function verify + * @memberof google.type.PostalAddress + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PostalAddress.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.revision != null && message.hasOwnProperty("revision")) + if (!$util.isInteger(message.revision)) + return "revision: integer expected"; + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + if (!$util.isString(message.regionCode)) + return "regionCode: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.postalCode != null && message.hasOwnProperty("postalCode")) + if (!$util.isString(message.postalCode)) + return "postalCode: string expected"; + if (message.sortingCode != null && message.hasOwnProperty("sortingCode")) + if (!$util.isString(message.sortingCode)) + return "sortingCode: string expected"; + if (message.administrativeArea != null && message.hasOwnProperty("administrativeArea")) + if (!$util.isString(message.administrativeArea)) + return "administrativeArea: string expected"; + if (message.locality != null && message.hasOwnProperty("locality")) + if (!$util.isString(message.locality)) + return "locality: string expected"; + if (message.sublocality != null && message.hasOwnProperty("sublocality")) + if (!$util.isString(message.sublocality)) + return "sublocality: string expected"; + if (message.addressLines != null && message.hasOwnProperty("addressLines")) { + if (!Array.isArray(message.addressLines)) + return "addressLines: array expected"; + for (var i = 0; i < message.addressLines.length; ++i) + if (!$util.isString(message.addressLines[i])) + return "addressLines: string[] expected"; + } + if (message.recipients != null && message.hasOwnProperty("recipients")) { + if (!Array.isArray(message.recipients)) + return "recipients: array expected"; + for (var i = 0; i < message.recipients.length; ++i) + if (!$util.isString(message.recipients[i])) + return "recipients: string[] expected"; + } + if (message.organization != null && message.hasOwnProperty("organization")) + if (!$util.isString(message.organization)) + return "organization: string expected"; + return null; + }; + + /** + * Creates a PostalAddress message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.PostalAddress + * @static + * @param {Object.} object Plain object + * @returns {google.type.PostalAddress} PostalAddress + */ + PostalAddress.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.PostalAddress) + return object; + var message = new $root.google.type.PostalAddress(); + if (object.revision != null) + message.revision = object.revision | 0; + if (object.regionCode != null) + message.regionCode = String(object.regionCode); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.postalCode != null) + message.postalCode = String(object.postalCode); + if (object.sortingCode != null) + message.sortingCode = String(object.sortingCode); + if (object.administrativeArea != null) + message.administrativeArea = String(object.administrativeArea); + if (object.locality != null) + message.locality = String(object.locality); + if (object.sublocality != null) + message.sublocality = String(object.sublocality); + if (object.addressLines) { + if (!Array.isArray(object.addressLines)) + throw TypeError(".google.type.PostalAddress.addressLines: array expected"); + message.addressLines = []; + for (var i = 0; i < object.addressLines.length; ++i) + message.addressLines[i] = String(object.addressLines[i]); + } + if (object.recipients) { + if (!Array.isArray(object.recipients)) + throw TypeError(".google.type.PostalAddress.recipients: array expected"); + message.recipients = []; + for (var i = 0; i < object.recipients.length; ++i) + message.recipients[i] = String(object.recipients[i]); + } + if (object.organization != null) + message.organization = String(object.organization); + return message; + }; + + /** + * Creates a plain object from a PostalAddress message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.PostalAddress + * @static + * @param {google.type.PostalAddress} message PostalAddress + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PostalAddress.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.addressLines = []; + object.recipients = []; + } + if (options.defaults) { + object.revision = 0; + object.regionCode = ""; + object.languageCode = ""; + object.postalCode = ""; + object.sortingCode = ""; + object.administrativeArea = ""; + object.locality = ""; + object.sublocality = ""; + object.organization = ""; + } + if (message.revision != null && message.hasOwnProperty("revision")) + object.revision = message.revision; + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + object.regionCode = message.regionCode; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.postalCode != null && message.hasOwnProperty("postalCode")) + object.postalCode = message.postalCode; + if (message.sortingCode != null && message.hasOwnProperty("sortingCode")) + object.sortingCode = message.sortingCode; + if (message.administrativeArea != null && message.hasOwnProperty("administrativeArea")) + object.administrativeArea = message.administrativeArea; + if (message.locality != null && message.hasOwnProperty("locality")) + object.locality = message.locality; + if (message.sublocality != null && message.hasOwnProperty("sublocality")) + object.sublocality = message.sublocality; + if (message.addressLines && message.addressLines.length) { + object.addressLines = []; + for (var j = 0; j < message.addressLines.length; ++j) + object.addressLines[j] = message.addressLines[j]; + } + if (message.recipients && message.recipients.length) { + object.recipients = []; + for (var j = 0; j < message.recipients.length; ++j) + object.recipients[j] = message.recipients[j]; + } + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = message.organization; + return object; + }; + + /** + * Converts this PostalAddress to JSON. + * @function toJSON + * @memberof google.type.PostalAddress + * @instance + * @returns {Object.} JSON object + */ + PostalAddress.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PostalAddress + * @function getTypeUrl + * @memberof google.type.PostalAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PostalAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.PostalAddress"; + }; + + return PostalAddress; + })(); + + type.Interval = (function() { + + /** + * Properties of an Interval. + * @memberof google.type + * @interface IInterval + * @property {google.protobuf.ITimestamp|null} [startTime] Interval startTime + * @property {google.protobuf.ITimestamp|null} [endTime] Interval endTime + */ + + /** + * Constructs a new Interval. + * @memberof google.type + * @classdesc Represents an Interval. + * @implements IInterval + * @constructor + * @param {google.type.IInterval=} [properties] Properties to set + */ + function Interval(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]]; + } + + /** + * Interval startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.type.Interval + * @instance + */ + Interval.prototype.startTime = null; + + /** + * Interval endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.type.Interval + * @instance + */ + Interval.prototype.endTime = null; + + /** + * Creates a new Interval instance using the specified properties. + * @function create + * @memberof google.type.Interval + * @static + * @param {google.type.IInterval=} [properties] Properties to set + * @returns {google.type.Interval} Interval instance + */ + Interval.create = function create(properties) { + return new Interval(properties); + }; + + /** + * Encodes the specified Interval message. Does not implicitly {@link google.type.Interval.verify|verify} messages. + * @function encode + * @memberof google.type.Interval + * @static + * @param {google.type.IInterval} message Interval message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Interval.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(); + return writer; + }; + + /** + * Encodes the specified Interval message, length delimited. Does not implicitly {@link google.type.Interval.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Interval + * @static + * @param {google.type.IInterval} message Interval message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Interval.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Interval message from the specified reader or buffer. + * @function decode + * @memberof google.type.Interval + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Interval} Interval + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Interval.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Interval(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Interval message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Interval + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Interval} Interval + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Interval.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Interval message. + * @function verify + * @memberof google.type.Interval + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Interval.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; + } + return null; + }; + + /** + * Creates an Interval message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Interval + * @static + * @param {Object.} object Plain object + * @returns {google.type.Interval} Interval + */ + Interval.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Interval) + return object; + var message = new $root.google.type.Interval(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.type.Interval.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.type.Interval.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from an Interval message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Interval + * @static + * @param {google.type.Interval} message Interval + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Interval.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTime = null; + object.endTime = null; + } + 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); + return object; + }; + + /** + * Converts this Interval to JSON. + * @function toJSON + * @memberof google.type.Interval + * @instance + * @returns {Object.} JSON object + */ + Interval.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Interval + * @function getTypeUrl + * @memberof google.type.Interval + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Interval.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Interval"; + }; + + return Interval; + })(); + + type.Expr = (function() { + + /** + * Properties of an Expr. + * @memberof google.type + * @interface IExpr + * @property {string|null} [expression] Expr expression + * @property {string|null} [title] Expr title + * @property {string|null} [description] Expr description + * @property {string|null} [location] Expr location + */ + + /** + * Constructs a new Expr. + * @memberof google.type + * @classdesc Represents an Expr. + * @implements IExpr + * @constructor + * @param {google.type.IExpr=} [properties] Properties to set + */ + function Expr(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]]; + } + + /** + * Expr expression. + * @member {string} expression + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.expression = ""; + + /** + * Expr title. + * @member {string} title + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.title = ""; + + /** + * Expr description. + * @member {string} description + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.description = ""; + + /** + * Expr location. + * @member {string} location + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.location = ""; + + /** + * Creates a new Expr instance using the specified properties. + * @function create + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr=} [properties] Properties to set + * @returns {google.type.Expr} Expr instance + */ + Expr.create = function create(properties) { + return new Expr(properties); + }; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encode + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expression != null && Object.hasOwnProperty.call(message, "expression")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); + return writer; + }; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Expr message from the specified reader or buffer. + * @function decode + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Expr(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.expression = reader.string(); + break; + } + case 2: { + message.title = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.location = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Expr message. + * @function verify + * @memberof google.type.Expr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Expr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expression != null && message.hasOwnProperty("expression")) + if (!$util.isString(message.expression)) + return "expression: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates an Expr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Expr + * @static + * @param {Object.} object Plain object + * @returns {google.type.Expr} Expr + */ + Expr.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Expr) + return object; + var message = new $root.google.type.Expr(); + if (object.expression != null) + message.expression = String(object.expression); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Expr + * @static + * @param {google.type.Expr} message Expr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Expr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.expression = ""; + object.title = ""; + object.description = ""; + object.location = ""; + } + if (message.expression != null && message.hasOwnProperty("expression")) + object.expression = message.expression; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this Expr to JSON. + * @function toJSON + * @memberof google.type.Expr + * @instance + * @returns {Object.} JSON object + */ + Expr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Expr + * @function getTypeUrl + * @memberof google.type.Expr + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Expr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Expr"; + }; + + return Expr; + })(); + + return type; + })(); + + google.iam = (function() { + + /** + * Namespace iam. + * @memberof google + * @namespace + */ + var iam = {}; + + iam.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.iam + * @namespace + */ + var v1 = {}; + + v1.Policy = (function() { + + /** + * Properties of a Policy. + * @memberof google.iam.v1 + * @interface IPolicy + * @property {number|null} [version] Policy version + * @property {Array.|null} [bindings] Policy bindings + * @property {Array.|null} [auditConfigs] Policy auditConfigs + * @property {Uint8Array|null} [etag] Policy etag + */ + + /** + * Constructs a new Policy. + * @memberof google.iam.v1 + * @classdesc Represents a Policy. + * @implements IPolicy + * @constructor + * @param {google.iam.v1.IPolicy=} [properties] Properties to set + */ + function Policy(properties) { + this.bindings = []; + this.auditConfigs = []; + 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]]; + } + + /** + * Policy version. + * @member {number} version + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.version = 0; + + /** + * Policy bindings. + * @member {Array.} bindings + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.bindings = $util.emptyArray; + + /** + * Policy auditConfigs. + * @member {Array.} auditConfigs + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.auditConfigs = $util.emptyArray; + + /** + * Policy etag. + * @member {Uint8Array} etag + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.etag = $util.newBuffer([]); + + /** + * Creates a new Policy instance using the specified properties. + * @function create + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy=} [properties] Properties to set + * @returns {google.iam.v1.Policy} Policy instance + */ + Policy.create = function create(properties) { + return new Policy(properties); + }; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.etag); + if (message.bindings != null && message.bindings.length) + for (var i = 0; i < message.bindings.length; ++i) + $root.google.iam.v1.Binding.encode(message.bindings[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.auditConfigs != null && message.auditConfigs.length) + for (var i = 0; i < message.auditConfigs.length; ++i) + $root.google.iam.v1.AuditConfig.encode(message.auditConfigs[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Policy(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.version = reader.int32(); + break; + } + case 4: { + if (!(message.bindings && message.bindings.length)) + message.bindings = []; + message.bindings.push($root.google.iam.v1.Binding.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.auditConfigs && message.auditConfigs.length)) + message.auditConfigs = []; + message.auditConfigs.push($root.google.iam.v1.AuditConfig.decode(reader, reader.uint32())); + break; + } + case 3: { + message.etag = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Policy message. + * @function verify + * @memberof google.iam.v1.Policy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Policy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isInteger(message.version)) + return "version: integer expected"; + if (message.bindings != null && message.hasOwnProperty("bindings")) { + if (!Array.isArray(message.bindings)) + return "bindings: array expected"; + for (var i = 0; i < message.bindings.length; ++i) { + var error = $root.google.iam.v1.Binding.verify(message.bindings[i]); + if (error) + return "bindings." + error; + } + } + if (message.auditConfigs != null && message.hasOwnProperty("auditConfigs")) { + if (!Array.isArray(message.auditConfigs)) + return "auditConfigs: array expected"; + for (var i = 0; i < message.auditConfigs.length; ++i) { + var error = $root.google.iam.v1.AuditConfig.verify(message.auditConfigs[i]); + if (error) + return "auditConfigs." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!(message.etag && typeof message.etag.length === "number" || $util.isString(message.etag))) + return "etag: buffer expected"; + return null; + }; + + /** + * Creates a Policy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.Policy + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.Policy} Policy + */ + Policy.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.Policy) + return object; + var message = new $root.google.iam.v1.Policy(); + if (object.version != null) + message.version = object.version | 0; + if (object.bindings) { + if (!Array.isArray(object.bindings)) + throw TypeError(".google.iam.v1.Policy.bindings: array expected"); + message.bindings = []; + for (var i = 0; i < object.bindings.length; ++i) { + if (typeof object.bindings[i] !== "object") + throw TypeError(".google.iam.v1.Policy.bindings: object expected"); + message.bindings[i] = $root.google.iam.v1.Binding.fromObject(object.bindings[i]); + } + } + if (object.auditConfigs) { + if (!Array.isArray(object.auditConfigs)) + throw TypeError(".google.iam.v1.Policy.auditConfigs: array expected"); + message.auditConfigs = []; + for (var i = 0; i < object.auditConfigs.length; ++i) { + if (typeof object.auditConfigs[i] !== "object") + throw TypeError(".google.iam.v1.Policy.auditConfigs: object expected"); + message.auditConfigs[i] = $root.google.iam.v1.AuditConfig.fromObject(object.auditConfigs[i]); + } + } + if (object.etag != null) + if (typeof object.etag === "string") + $util.base64.decode(object.etag, message.etag = $util.newBuffer($util.base64.length(object.etag)), 0); + else if (object.etag.length >= 0) + message.etag = object.etag; + return message; + }; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.Policy} message Policy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Policy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.bindings = []; + object.auditConfigs = []; + } + if (options.defaults) { + object.version = 0; + if (options.bytes === String) + object.etag = ""; + else { + object.etag = []; + if (options.bytes !== Array) + object.etag = $util.newBuffer(object.etag); + } + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = options.bytes === String ? $util.base64.encode(message.etag, 0, message.etag.length) : options.bytes === Array ? Array.prototype.slice.call(message.etag) : message.etag; + if (message.bindings && message.bindings.length) { + object.bindings = []; + for (var j = 0; j < message.bindings.length; ++j) + object.bindings[j] = $root.google.iam.v1.Binding.toObject(message.bindings[j], options); + } + if (message.auditConfigs && message.auditConfigs.length) { + object.auditConfigs = []; + for (var j = 0; j < message.auditConfigs.length; ++j) + object.auditConfigs[j] = $root.google.iam.v1.AuditConfig.toObject(message.auditConfigs[j], options); + } + return object; + }; + + /** + * Converts this Policy to JSON. + * @function toJSON + * @memberof google.iam.v1.Policy + * @instance + * @returns {Object.} JSON object + */ + Policy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Policy + * @function getTypeUrl + * @memberof google.iam.v1.Policy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Policy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.Policy"; + }; + + return Policy; + })(); + + v1.Binding = (function() { + + /** + * Properties of a Binding. + * @memberof google.iam.v1 + * @interface IBinding + * @property {string|null} [role] Binding role + * @property {Array.|null} [members] Binding members + * @property {google.type.IExpr|null} [condition] Binding condition + */ + + /** + * Constructs a new Binding. + * @memberof google.iam.v1 + * @classdesc Represents a Binding. + * @implements IBinding + * @constructor + * @param {google.iam.v1.IBinding=} [properties] Properties to set + */ + function Binding(properties) { + this.members = []; + 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]]; + } + + /** + * Binding role. + * @member {string} role + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.role = ""; + + /** + * Binding members. + * @member {Array.} members + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.members = $util.emptyArray; + + /** + * Binding condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.condition = null; + + /** + * Creates a new Binding instance using the specified properties. + * @function create + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding=} [properties] Properties to set + * @returns {google.iam.v1.Binding} Binding instance + */ + Binding.create = function create(properties) { + return new Binding(properties); + }; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Binding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); + if (message.members != null && message.members.length) + for (var i = 0; i < message.members.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.members[i]); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Binding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Binding message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.Binding} Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Binding.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Binding(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.role = reader.string(); + break; + } + case 2: { + if (!(message.members && message.members.length)) + message.members = []; + message.members.push(reader.string()); + break; + } + case 3: { + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.Binding} Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Binding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Binding message. + * @function verify + * @memberof google.iam.v1.Binding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Binding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.members != null && message.hasOwnProperty("members")) { + if (!Array.isArray(message.members)) + return "members: array expected"; + for (var i = 0; i < message.members.length; ++i) + if (!$util.isString(message.members[i])) + return "members: string[] expected"; + } + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + return null; + }; + + /** + * Creates a Binding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.Binding + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.Binding} Binding + */ + Binding.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.Binding) + return object; + var message = new $root.google.iam.v1.Binding(); + if (object.role != null) + message.role = String(object.role); + if (object.members) { + if (!Array.isArray(object.members)) + throw TypeError(".google.iam.v1.Binding.members: array expected"); + message.members = []; + for (var i = 0; i < object.members.length; ++i) + message.members[i] = String(object.members[i]); + } + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.iam.v1.Binding.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } + return message; + }; + + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.Binding} message Binding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Binding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.members = []; + if (options.defaults) { + object.role = ""; + object.condition = null; + } + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.members && message.members.length) { + object.members = []; + for (var j = 0; j < message.members.length; ++j) + object.members[j] = message.members[j]; + } + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + return object; + }; + + /** + * Converts this Binding to JSON. + * @function toJSON + * @memberof google.iam.v1.Binding + * @instance + * @returns {Object.} JSON object + */ + Binding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Binding + * @function getTypeUrl + * @memberof google.iam.v1.Binding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Binding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.Binding"; + }; + + return Binding; + })(); + + v1.AuditConfig = (function() { + + /** + * Properties of an AuditConfig. + * @memberof google.iam.v1 + * @interface IAuditConfig + * @property {string|null} [service] AuditConfig service + * @property {Array.|null} [auditLogConfigs] AuditConfig auditLogConfigs + */ + + /** + * Constructs a new AuditConfig. + * @memberof google.iam.v1 + * @classdesc Represents an AuditConfig. + * @implements IAuditConfig + * @constructor + * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set + */ + function AuditConfig(properties) { + this.auditLogConfigs = []; + 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]]; + } + + /** + * AuditConfig service. + * @member {string} service + * @memberof google.iam.v1.AuditConfig + * @instance + */ + AuditConfig.prototype.service = ""; + + /** + * AuditConfig auditLogConfigs. + * @member {Array.} auditLogConfigs + * @memberof google.iam.v1.AuditConfig + * @instance + */ + AuditConfig.prototype.auditLogConfigs = $util.emptyArray; + + /** + * Creates a new AuditConfig instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set + * @returns {google.iam.v1.AuditConfig} AuditConfig instance + */ + AuditConfig.create = function create(properties) { + return new AuditConfig(properties); + }; + + /** + * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.service); + if (message.auditLogConfigs != null && message.auditLogConfigs.length) + for (var i = 0; i < message.auditLogConfigs.length; ++i) + $root.google.iam.v1.AuditLogConfig.encode(message.auditLogConfigs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditConfig message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditConfig} AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.service = reader.string(); + break; + } + case 3: { + if (!(message.auditLogConfigs && message.auditLogConfigs.length)) + message.auditLogConfigs = []; + message.auditLogConfigs.push($root.google.iam.v1.AuditLogConfig.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditConfig} AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditConfig message. + * @function verify + * @memberof google.iam.v1.AuditConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.auditLogConfigs != null && message.hasOwnProperty("auditLogConfigs")) { + if (!Array.isArray(message.auditLogConfigs)) + return "auditLogConfigs: array expected"; + for (var i = 0; i < message.auditLogConfigs.length; ++i) { + var error = $root.google.iam.v1.AuditLogConfig.verify(message.auditLogConfigs[i]); + if (error) + return "auditLogConfigs." + error; + } + } + return null; + }; + + /** + * Creates an AuditConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditConfig + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditConfig} AuditConfig + */ + AuditConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditConfig) + return object; + var message = new $root.google.iam.v1.AuditConfig(); + if (object.service != null) + message.service = String(object.service); + if (object.auditLogConfigs) { + if (!Array.isArray(object.auditLogConfigs)) + throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: array expected"); + message.auditLogConfigs = []; + for (var i = 0; i < object.auditLogConfigs.length; ++i) { + if (typeof object.auditLogConfigs[i] !== "object") + throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: object expected"); + message.auditLogConfigs[i] = $root.google.iam.v1.AuditLogConfig.fromObject(object.auditLogConfigs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.AuditConfig} message AuditConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.auditLogConfigs = []; + if (options.defaults) + object.service = ""; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.auditLogConfigs && message.auditLogConfigs.length) { + object.auditLogConfigs = []; + for (var j = 0; j < message.auditLogConfigs.length; ++j) + object.auditLogConfigs[j] = $root.google.iam.v1.AuditLogConfig.toObject(message.auditLogConfigs[j], options); + } + return object; + }; + + /** + * Converts this AuditConfig to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditConfig + * @instance + * @returns {Object.} JSON object + */ + AuditConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditConfig + * @function getTypeUrl + * @memberof google.iam.v1.AuditConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditConfig"; + }; + + return AuditConfig; + })(); + + v1.AuditLogConfig = (function() { + + /** + * Properties of an AuditLogConfig. + * @memberof google.iam.v1 + * @interface IAuditLogConfig + * @property {google.iam.v1.AuditLogConfig.LogType|null} [logType] AuditLogConfig logType + * @property {Array.|null} [exemptedMembers] AuditLogConfig exemptedMembers + */ + + /** + * Constructs a new AuditLogConfig. + * @memberof google.iam.v1 + * @classdesc Represents an AuditLogConfig. + * @implements IAuditLogConfig + * @constructor + * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set + */ + function AuditLogConfig(properties) { + this.exemptedMembers = []; + 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]]; + } + + /** + * AuditLogConfig logType. + * @member {google.iam.v1.AuditLogConfig.LogType} logType + * @memberof google.iam.v1.AuditLogConfig + * @instance + */ + AuditLogConfig.prototype.logType = 0; + + /** + * AuditLogConfig exemptedMembers. + * @member {Array.} exemptedMembers + * @memberof google.iam.v1.AuditLogConfig + * @instance + */ + AuditLogConfig.prototype.exemptedMembers = $util.emptyArray; + + /** + * Creates a new AuditLogConfig instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig instance + */ + AuditLogConfig.create = function create(properties) { + return new AuditLogConfig(properties); + }; + + /** + * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditLogConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.logType); + if (message.exemptedMembers != null && message.exemptedMembers.length) + for (var i = 0; i < message.exemptedMembers.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.exemptedMembers[i]); + return writer; + }; + + /** + * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditLogConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditLogConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditLogConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.logType = reader.int32(); + break; + } + case 2: { + if (!(message.exemptedMembers && message.exemptedMembers.length)) + message.exemptedMembers = []; + message.exemptedMembers.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditLogConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditLogConfig message. + * @function verify + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditLogConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.logType != null && message.hasOwnProperty("logType")) + switch (message.logType) { + default: + return "logType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.exemptedMembers != null && message.hasOwnProperty("exemptedMembers")) { + if (!Array.isArray(message.exemptedMembers)) + return "exemptedMembers: array expected"; + for (var i = 0; i < message.exemptedMembers.length; ++i) + if (!$util.isString(message.exemptedMembers[i])) + return "exemptedMembers: string[] expected"; + } + return null; + }; + + /** + * Creates an AuditLogConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + */ + AuditLogConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditLogConfig) + return object; + var message = new $root.google.iam.v1.AuditLogConfig(); + switch (object.logType) { + default: + if (typeof object.logType === "number") { + message.logType = object.logType; + break; + } + break; + case "LOG_TYPE_UNSPECIFIED": + case 0: + message.logType = 0; + break; + case "ADMIN_READ": + case 1: + message.logType = 1; + break; + case "DATA_WRITE": + case 2: + message.logType = 2; + break; + case "DATA_READ": + case 3: + message.logType = 3; + break; + } + if (object.exemptedMembers) { + if (!Array.isArray(object.exemptedMembers)) + throw TypeError(".google.iam.v1.AuditLogConfig.exemptedMembers: array expected"); + message.exemptedMembers = []; + for (var i = 0; i < object.exemptedMembers.length; ++i) + message.exemptedMembers[i] = String(object.exemptedMembers[i]); + } + return message; + }; + + /** + * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.AuditLogConfig} message AuditLogConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditLogConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.exemptedMembers = []; + if (options.defaults) + object.logType = options.enums === String ? "LOG_TYPE_UNSPECIFIED" : 0; + if (message.logType != null && message.hasOwnProperty("logType")) + object.logType = options.enums === String ? $root.google.iam.v1.AuditLogConfig.LogType[message.logType] === undefined ? message.logType : $root.google.iam.v1.AuditLogConfig.LogType[message.logType] : message.logType; + if (message.exemptedMembers && message.exemptedMembers.length) { + object.exemptedMembers = []; + for (var j = 0; j < message.exemptedMembers.length; ++j) + object.exemptedMembers[j] = message.exemptedMembers[j]; + } + return object; + }; + + /** + * Converts this AuditLogConfig to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditLogConfig + * @instance + * @returns {Object.} JSON object + */ + AuditLogConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditLogConfig + * @function getTypeUrl + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditLogConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditLogConfig"; + }; + + /** + * LogType enum. + * @name google.iam.v1.AuditLogConfig.LogType + * @enum {number} + * @property {number} LOG_TYPE_UNSPECIFIED=0 LOG_TYPE_UNSPECIFIED value + * @property {number} ADMIN_READ=1 ADMIN_READ value + * @property {number} DATA_WRITE=2 DATA_WRITE value + * @property {number} DATA_READ=3 DATA_READ value + */ + AuditLogConfig.LogType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LOG_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADMIN_READ"] = 1; + values[valuesById[2] = "DATA_WRITE"] = 2; + values[valuesById[3] = "DATA_READ"] = 3; + return values; + })(); + + return AuditLogConfig; + })(); + + v1.PolicyDelta = (function() { + + /** + * Properties of a PolicyDelta. + * @memberof google.iam.v1 + * @interface IPolicyDelta + * @property {Array.|null} [bindingDeltas] PolicyDelta bindingDeltas + * @property {Array.|null} [auditConfigDeltas] PolicyDelta auditConfigDeltas + */ + + /** + * Constructs a new PolicyDelta. + * @memberof google.iam.v1 + * @classdesc Represents a PolicyDelta. + * @implements IPolicyDelta + * @constructor + * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set + */ + function PolicyDelta(properties) { + this.bindingDeltas = []; + this.auditConfigDeltas = []; + 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]]; + } + + /** + * PolicyDelta bindingDeltas. + * @member {Array.} bindingDeltas + * @memberof google.iam.v1.PolicyDelta + * @instance + */ + PolicyDelta.prototype.bindingDeltas = $util.emptyArray; + + /** + * PolicyDelta auditConfigDeltas. + * @member {Array.} auditConfigDeltas + * @memberof google.iam.v1.PolicyDelta + * @instance + */ + PolicyDelta.prototype.auditConfigDeltas = $util.emptyArray; + + /** + * Creates a new PolicyDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set + * @returns {google.iam.v1.PolicyDelta} PolicyDelta instance + */ + PolicyDelta.create = function create(properties) { + return new PolicyDelta(properties); + }; + + /** + * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bindingDeltas != null && message.bindingDeltas.length) + for (var i = 0; i < message.bindingDeltas.length; ++i) + $root.google.iam.v1.BindingDelta.encode(message.bindingDeltas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.auditConfigDeltas != null && message.auditConfigDeltas.length) + for (var i = 0; i < message.auditConfigDeltas.length; ++i) + $root.google.iam.v1.AuditConfigDelta.encode(message.auditConfigDeltas[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDelta.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.PolicyDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.bindingDeltas && message.bindingDeltas.length)) + message.bindingDeltas = []; + message.bindingDeltas.push($root.google.iam.v1.BindingDelta.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.auditConfigDeltas && message.auditConfigDeltas.length)) + message.auditConfigDeltas = []; + message.auditConfigDeltas.push($root.google.iam.v1.AuditConfigDelta.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PolicyDelta message. + * @function verify + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PolicyDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bindingDeltas != null && message.hasOwnProperty("bindingDeltas")) { + if (!Array.isArray(message.bindingDeltas)) + return "bindingDeltas: array expected"; + for (var i = 0; i < message.bindingDeltas.length; ++i) { + var error = $root.google.iam.v1.BindingDelta.verify(message.bindingDeltas[i]); + if (error) + return "bindingDeltas." + error; + } + } + if (message.auditConfigDeltas != null && message.hasOwnProperty("auditConfigDeltas")) { + if (!Array.isArray(message.auditConfigDeltas)) + return "auditConfigDeltas: array expected"; + for (var i = 0; i < message.auditConfigDeltas.length; ++i) { + var error = $root.google.iam.v1.AuditConfigDelta.verify(message.auditConfigDeltas[i]); + if (error) + return "auditConfigDeltas." + error; + } + } + return null; + }; + + /** + * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + */ + PolicyDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.PolicyDelta) + return object; + var message = new $root.google.iam.v1.PolicyDelta(); + if (object.bindingDeltas) { + if (!Array.isArray(object.bindingDeltas)) + throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: array expected"); + message.bindingDeltas = []; + for (var i = 0; i < object.bindingDeltas.length; ++i) { + if (typeof object.bindingDeltas[i] !== "object") + throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: object expected"); + message.bindingDeltas[i] = $root.google.iam.v1.BindingDelta.fromObject(object.bindingDeltas[i]); + } + } + if (object.auditConfigDeltas) { + if (!Array.isArray(object.auditConfigDeltas)) + throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: array expected"); + message.auditConfigDeltas = []; + for (var i = 0; i < object.auditConfigDeltas.length; ++i) { + if (typeof object.auditConfigDeltas[i] !== "object") + throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: object expected"); + message.auditConfigDeltas[i] = $root.google.iam.v1.AuditConfigDelta.fromObject(object.auditConfigDeltas[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.PolicyDelta} message PolicyDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PolicyDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.bindingDeltas = []; + object.auditConfigDeltas = []; + } + if (message.bindingDeltas && message.bindingDeltas.length) { + object.bindingDeltas = []; + for (var j = 0; j < message.bindingDeltas.length; ++j) + object.bindingDeltas[j] = $root.google.iam.v1.BindingDelta.toObject(message.bindingDeltas[j], options); + } + if (message.auditConfigDeltas && message.auditConfigDeltas.length) { + object.auditConfigDeltas = []; + for (var j = 0; j < message.auditConfigDeltas.length; ++j) + object.auditConfigDeltas[j] = $root.google.iam.v1.AuditConfigDelta.toObject(message.auditConfigDeltas[j], options); + } + return object; + }; + + /** + * Converts this PolicyDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.PolicyDelta + * @instance + * @returns {Object.} JSON object + */ + PolicyDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PolicyDelta + * @function getTypeUrl + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PolicyDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.PolicyDelta"; + }; + + return PolicyDelta; + })(); + + v1.BindingDelta = (function() { + + /** + * Properties of a BindingDelta. + * @memberof google.iam.v1 + * @interface IBindingDelta + * @property {google.iam.v1.BindingDelta.Action|null} [action] BindingDelta action + * @property {string|null} [role] BindingDelta role + * @property {string|null} [member] BindingDelta member + * @property {google.type.IExpr|null} [condition] BindingDelta condition + */ + + /** + * Constructs a new BindingDelta. + * @memberof google.iam.v1 + * @classdesc Represents a BindingDelta. + * @implements IBindingDelta + * @constructor + * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set + */ + function BindingDelta(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]]; + } + + /** + * BindingDelta action. + * @member {google.iam.v1.BindingDelta.Action} action + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.action = 0; + + /** + * BindingDelta role. + * @member {string} role + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.role = ""; + + /** + * BindingDelta member. + * @member {string} member + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.member = ""; + + /** + * BindingDelta condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.condition = null; + + /** + * Creates a new BindingDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set + * @returns {google.iam.v1.BindingDelta} BindingDelta instance + */ + BindingDelta.create = function create(properties) { + return new BindingDelta(properties); + }; + + /** + * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.role); + if (message.member != null && Object.hasOwnProperty.call(message, "member")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.member); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BindingDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.BindingDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.BindingDelta} BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingDelta.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.BindingDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.role = reader.string(); + break; + } + case 3: { + message.member = reader.string(); + break; + } + case 4: { + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BindingDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.BindingDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.BindingDelta} BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BindingDelta message. + * @function verify + * @memberof google.iam.v1.BindingDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BindingDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.member != null && message.hasOwnProperty("member")) + if (!$util.isString(message.member)) + return "member: string expected"; + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + return null; + }; + + /** + * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.BindingDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.BindingDelta} BindingDelta + */ + BindingDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.BindingDelta) + return object; + var message = new $root.google.iam.v1.BindingDelta(); + switch (object.action) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.role != null) + message.role = String(object.role); + if (object.member != null) + message.member = String(object.member); + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.iam.v1.BindingDelta.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } + return message; + }; + + /** + * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.BindingDelta} message BindingDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BindingDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.role = ""; + object.member = ""; + object.condition = null; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.iam.v1.BindingDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.BindingDelta.Action[message.action] : message.action; + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.member != null && message.hasOwnProperty("member")) + object.member = message.member; + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + return object; + }; + + /** + * Converts this BindingDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.BindingDelta + * @instance + * @returns {Object.} JSON object + */ + BindingDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BindingDelta + * @function getTypeUrl + * @memberof google.iam.v1.BindingDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BindingDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.BindingDelta"; + }; + + /** + * Action enum. + * @name google.iam.v1.BindingDelta.Action + * @enum {number} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + BindingDelta.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return BindingDelta; + })(); + + v1.AuditConfigDelta = (function() { + + /** + * Properties of an AuditConfigDelta. + * @memberof google.iam.v1 + * @interface IAuditConfigDelta + * @property {google.iam.v1.AuditConfigDelta.Action|null} [action] AuditConfigDelta action + * @property {string|null} [service] AuditConfigDelta service + * @property {string|null} [exemptedMember] AuditConfigDelta exemptedMember + * @property {string|null} [logType] AuditConfigDelta logType + */ + + /** + * Constructs a new AuditConfigDelta. + * @memberof google.iam.v1 + * @classdesc Represents an AuditConfigDelta. + * @implements IAuditConfigDelta + * @constructor + * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set + */ + function AuditConfigDelta(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]]; + } + + /** + * AuditConfigDelta action. + * @member {google.iam.v1.AuditConfigDelta.Action} action + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.action = 0; + + /** + * AuditConfigDelta service. + * @member {string} service + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.service = ""; + + /** + * AuditConfigDelta exemptedMember. + * @member {string} exemptedMember + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.exemptedMember = ""; + + /** + * AuditConfigDelta logType. + * @member {string} logType + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.logType = ""; + + /** + * Creates a new AuditConfigDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta instance + */ + AuditConfigDelta.create = function create(properties) { + return new AuditConfigDelta(properties); + }; + + /** + * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfigDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.service); + if (message.exemptedMember != null && Object.hasOwnProperty.call(message, "exemptedMember")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.exemptedMember); + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.logType); + return writer; + }; + + /** + * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfigDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfigDelta.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfigDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.service = reader.string(); + break; + } + case 3: { + message.exemptedMember = reader.string(); + break; + } + case 4: { + message.logType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfigDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditConfigDelta message. + * @function verify + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditConfigDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + if (!$util.isString(message.exemptedMember)) + return "exemptedMember: string expected"; + if (message.logType != null && message.hasOwnProperty("logType")) + if (!$util.isString(message.logType)) + return "logType: string expected"; + return null; + }; + + /** + * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + */ + AuditConfigDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditConfigDelta) + return object; + var message = new $root.google.iam.v1.AuditConfigDelta(); + switch (object.action) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.service != null) + message.service = String(object.service); + if (object.exemptedMember != null) + message.exemptedMember = String(object.exemptedMember); + if (object.logType != null) + message.logType = String(object.logType); + return message; + }; + + /** + * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.AuditConfigDelta} message AuditConfigDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditConfigDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.service = ""; + object.exemptedMember = ""; + object.logType = ""; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.iam.v1.AuditConfigDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.AuditConfigDelta.Action[message.action] : message.action; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + object.exemptedMember = message.exemptedMember; + if (message.logType != null && message.hasOwnProperty("logType")) + object.logType = message.logType; + return object; + }; + + /** + * Converts this AuditConfigDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditConfigDelta + * @instance + * @returns {Object.} JSON object + */ + AuditConfigDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditConfigDelta + * @function getTypeUrl + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditConfigDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditConfigDelta"; + }; + + /** + * Action enum. + * @name google.iam.v1.AuditConfigDelta.Action + * @enum {number} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + AuditConfigDelta.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return AuditConfigDelta; + })(); + + return v1; + })(); + + return iam; + })(); + + google.longrunning = (function() { + + /** + * Namespace longrunning. + * @memberof google + * @namespace + */ + var longrunning = {}; + + longrunning.Operations = (function() { + + /** + * Constructs a new Operations service. + * @memberof google.longrunning + * @classdesc Represents an Operations + * @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 Operations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; + + /** + * Creates new Operations service using the specified rpc implementation. + * @function create + * @memberof google.longrunning.Operations + * @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 {Operations} RPC service. Useful where requests and/or responses are streamed. + */ + Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @memberof google.longrunning.Operations + * @typedef ListOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse + */ + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { + return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); + }, "name", { value: "ListOperations" }); + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @memberof google.longrunning.Operations + * @typedef GetOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { + return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GetOperation" }); + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @memberof google.longrunning.Operations + * @typedef DeleteOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { + return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteOperation" }); + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @memberof google.longrunning.Operations + * @typedef CancelOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { + return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelOperation" }); + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @memberof google.longrunning.Operations + * @typedef WaitOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { + return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "WaitOperation" }); + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Operations; + })(); + + longrunning.Operation = (function() { + + /** + * Properties of an Operation. + * @memberof google.longrunning + * @interface IOperation + * @property {string|null} [name] Operation name + * @property {google.protobuf.IAny|null} [metadata] Operation metadata + * @property {boolean|null} [done] Operation done + * @property {google.rpc.IStatus|null} [error] Operation error + * @property {google.protobuf.IAny|null} [response] Operation response + */ + + /** + * Constructs a new Operation. + * @memberof google.longrunning + * @classdesc Represents an Operation. + * @implements IOperation + * @constructor + * @param {google.longrunning.IOperation=} [properties] Properties to set + */ + function Operation(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]]; + } + + /** + * Operation name. + * @member {string} name + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.name = ""; + + /** + * Operation metadata. + * @member {google.protobuf.IAny|null|undefined} metadata + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.metadata = null; + + /** + * Operation done. + * @member {boolean} done + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.done = false; + + /** + * Operation error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.error = null; + + /** + * Operation response. + * @member {google.protobuf.IAny|null|undefined} response + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Operation result. + * @member {"error"|"response"|undefined} result + * @memberof google.longrunning.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Operation instance using the specified properties. + * @function create + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation=} [properties] Properties to set + * @returns {google.longrunning.Operation} Operation instance + */ + Operation.create = function create(properties) { + return new Operation(properties); + }; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encode + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.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.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + case 3: { + message.done = reader.bool(); + break; + } + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 5: { + message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Operation message. + * @function verify + * @memberof google.longrunning.Operation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Operation.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.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Any.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.response != null && message.hasOwnProperty("response")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.protobuf.Any.verify(message.response); + if (error) + return "response." + error; + } + } + return null; + }; + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.Operation + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.Operation} Operation + */ + Operation.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.Operation) + return object; + var message = new $root.google.longrunning.Operation(); + if (object.name != null) + message.name = String(object.name); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.longrunning.Operation.metadata: object expected"); + message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); + } + if (object.done != null) + message.done = Boolean(object.done); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.longrunning.Operation.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.longrunning.Operation.response: object expected"); + message.response = $root.google.protobuf.Any.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.Operation} message Operation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Operation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.metadata = null; + object.done = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = $root.google.protobuf.Any.toObject(message.response, options); + if (options.oneofs) + object.result = "response"; + } + return object; + }; + + /** + * Converts this Operation to JSON. + * @function toJSON + * @memberof google.longrunning.Operation + * @instance + * @returns {Object.} JSON object + */ + Operation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Operation + * @function getTypeUrl + * @memberof google.longrunning.Operation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.Operation"; + }; + + return Operation; + })(); + + longrunning.GetOperationRequest = (function() { + + /** + * Properties of a GetOperationRequest. + * @memberof google.longrunning + * @interface IGetOperationRequest + * @property {string|null} [name] GetOperationRequest name + */ + + /** + * Constructs a new GetOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a GetOperationRequest. + * @implements IGetOperationRequest + * @constructor + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + */ + function GetOperationRequest(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]]; + } + + /** + * GetOperationRequest name. + * @member {string} name + * @memberof google.longrunning.GetOperationRequest + * @instance + */ + GetOperationRequest.prototype.name = ""; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance + */ + GetOperationRequest.create = function create(properties) { + return new GetOperationRequest(properties); + }; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.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 GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOperationRequest message. + * @function verify + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOperationRequest.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 GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + */ + GetOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.GetOperationRequest) + return object; + var message = new $root.google.longrunning.GetOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.GetOperationRequest} message GetOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOperationRequest.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 GetOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.GetOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; + }; + + return GetOperationRequest; + })(); + + longrunning.ListOperationsRequest = (function() { + + /** + * Properties of a ListOperationsRequest. + * @memberof google.longrunning + * @interface IListOperationsRequest + * @property {string|null} [name] ListOperationsRequest name + * @property {string|null} [filter] ListOperationsRequest filter + * @property {number|null} [pageSize] ListOperationsRequest pageSize + * @property {string|null} [pageToken] ListOperationsRequest pageToken + */ + + /** + * Constructs a new ListOperationsRequest. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsRequest. + * @implements IListOperationsRequest + * @constructor + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + */ + function ListOperationsRequest(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]]; + } + + /** + * ListOperationsRequest name. + * @member {string} name + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.name = ""; + + /** + * ListOperationsRequest filter. + * @member {string} filter + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.filter = ""; + + /** + * ListOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageSize = 0; + + /** + * ListOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance + */ + ListOperationsRequest.create = function create(properties) { + return new ListOperationsRequest(properties); + }; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.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.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 4: { + message.name = reader.string(); + break; + } + case 1: { + message.filter = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsRequest message. + * @function verify + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsRequest.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.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"; + return null; + }; + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + */ + ListOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsRequest) + return object; + var message = new $root.google.longrunning.ListOperationsRequest(); + if (object.name != null) + message.name = String(object.name); + 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); + return message; + }; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.name = ""; + } + 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.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ListOperationsRequest to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsRequest + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; + }; + + return ListOperationsRequest; + })(); + + longrunning.ListOperationsResponse = (function() { + + /** + * Properties of a ListOperationsResponse. + * @memberof google.longrunning + * @interface IListOperationsResponse + * @property {Array.|null} [operations] ListOperationsResponse operations + * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListOperationsResponse. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsResponse. + * @implements IListOperationsResponse + * @constructor + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + */ + function ListOperationsResponse(properties) { + this.operations = []; + 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]]; + } + + /** + * ListOperationsResponse operations. + * @member {Array.} operations + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance + */ + ListOperationsResponse.create = function create(properties) { + return new ListOperationsResponse(properties); + }; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[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 ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsResponse message. + * @function verify + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + */ + ListOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsResponse) + return object; + var message = new $root.google.longrunning.ListOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOperationsResponse to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsResponse + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; + }; + + return ListOperationsResponse; + })(); + + longrunning.CancelOperationRequest = (function() { + + /** + * Properties of a CancelOperationRequest. + * @memberof google.longrunning + * @interface ICancelOperationRequest + * @property {string|null} [name] CancelOperationRequest name + */ + + /** + * Constructs a new CancelOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a CancelOperationRequest. + * @implements ICancelOperationRequest + * @constructor + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + */ + function CancelOperationRequest(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]]; + } + + /** + * CancelOperationRequest name. + * @member {string} name + * @memberof google.longrunning.CancelOperationRequest + * @instance + */ + CancelOperationRequest.prototype.name = ""; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance + */ + CancelOperationRequest.create = function create(properties) { + return new CancelOperationRequest(properties); + }; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.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 CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelOperationRequest message. + * @function verify + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelOperationRequest.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 CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + */ + CancelOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.CancelOperationRequest) + return object; + var message = new $root.google.longrunning.CancelOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelOperationRequest.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 CancelOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.CancelOperationRequest + * @instance + * @returns {Object.} JSON object + */ + CancelOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; + }; + + return CancelOperationRequest; + })(); + + longrunning.DeleteOperationRequest = (function() { + + /** + * Properties of a DeleteOperationRequest. + * @memberof google.longrunning + * @interface IDeleteOperationRequest + * @property {string|null} [name] DeleteOperationRequest name + */ + + /** + * Constructs a new DeleteOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a DeleteOperationRequest. + * @implements IDeleteOperationRequest + * @constructor + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + */ + function DeleteOperationRequest(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]]; + } + + /** + * DeleteOperationRequest name. + * @member {string} name + * @memberof google.longrunning.DeleteOperationRequest + * @instance + */ + DeleteOperationRequest.prototype.name = ""; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance + */ + DeleteOperationRequest.create = function create(properties) { + return new DeleteOperationRequest(properties); + }; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.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 DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOperationRequest message. + * @function verify + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOperationRequest.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 DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + */ + DeleteOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.DeleteOperationRequest) + return object; + var message = new $root.google.longrunning.DeleteOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOperationRequest.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 DeleteOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.DeleteOperationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; + }; + + return DeleteOperationRequest; + })(); + + longrunning.WaitOperationRequest = (function() { + + /** + * Properties of a WaitOperationRequest. + * @memberof google.longrunning + * @interface IWaitOperationRequest + * @property {string|null} [name] WaitOperationRequest name + * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout + */ + + /** + * Constructs a new WaitOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a WaitOperationRequest. + * @implements IWaitOperationRequest + * @constructor + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + */ + function WaitOperationRequest(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]]; + } + + /** + * WaitOperationRequest name. + * @member {string} name + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.name = ""; + + /** + * WaitOperationRequest timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.timeout = null; + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance + */ + WaitOperationRequest.create = function create(properties) { + return new WaitOperationRequest(properties); + }; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.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.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitOperationRequest message. + * @function verify + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitOperationRequest.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.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + return null; + }; + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + */ + WaitOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.WaitOperationRequest) + return object; + var message = new $root.google.longrunning.WaitOperationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + return message; + }; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.timeout = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + return object; + }; + + /** + * Converts this WaitOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.WaitOperationRequest + * @instance + * @returns {Object.} JSON object + */ + WaitOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WaitOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; + }; + + return WaitOperationRequest; + })(); + + longrunning.OperationInfo = (function() { + + /** + * Properties of an OperationInfo. + * @memberof google.longrunning + * @interface IOperationInfo + * @property {string|null} [responseType] OperationInfo responseType + * @property {string|null} [metadataType] OperationInfo metadataType + */ + + /** + * Constructs a new OperationInfo. + * @memberof google.longrunning + * @classdesc Represents an OperationInfo. + * @implements IOperationInfo + * @constructor + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + */ + function OperationInfo(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]]; + } + + /** + * OperationInfo responseType. + * @member {string} responseType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.responseType = ""; + + /** + * OperationInfo metadataType. + * @member {string} metadataType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.metadataType = ""; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @function create + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + * @returns {google.longrunning.OperationInfo} OperationInfo instance + */ + OperationInfo.create = function create(properties) { + return new OperationInfo(properties); + }; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encode + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); + return writer; + }; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.responseType = reader.string(); + break; + } + case 2: { + message.metadataType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationInfo message. + * @function verify + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responseType != null && message.hasOwnProperty("responseType")) + if (!$util.isString(message.responseType)) + return "responseType: string expected"; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (!$util.isString(message.metadataType)) + return "metadataType: string expected"; + return null; + }; + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.OperationInfo} OperationInfo + */ + OperationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.OperationInfo) + return object; + var message = new $root.google.longrunning.OperationInfo(); + if (object.responseType != null) + message.responseType = String(object.responseType); + if (object.metadataType != null) + message.metadataType = String(object.metadataType); + return message; + }; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.OperationInfo} message OperationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseType = ""; + object.metadataType = ""; + } + if (message.responseType != null && message.hasOwnProperty("responseType")) + object.responseType = message.responseType; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + object.metadataType = message.metadataType; + return object; + }; + + /** + * Converts this OperationInfo to JSON. + * @function toJSON + * @memberof google.longrunning.OperationInfo + * @instance + * @returns {Object.} JSON object + */ + OperationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationInfo + * @function getTypeUrl + * @memberof google.longrunning.OperationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.OperationInfo"; + }; + + return OperationInfo; + })(); + + return longrunning; + })(); + + return google; + })(); + + return $root; +}); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/protos.json b/owl-bot-staging/google-cloud-contentwarehouse/protos/protos.json new file mode 100644 index 00000000000..6e4d44cee1a --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/protos/protos.json @@ -0,0 +1,7060 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "contentwarehouse": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.ContentWarehouse.V1", + "go_package": "cloud.google.com/go/contentwarehouse/apiv1/contentwarehousepb;contentwarehousepb", + "java_multiple_files": true, + "java_outer_classname": "SynonymSetServiceRequestProto", + "java_package": "com.google.cloud.contentwarehouse.v1", + "php_namespace": "Google\\Cloud\\ContentWarehouse\\V1", + "ruby_package": "Google::Cloud::ContentWarehouse::V1", + "(google.api.resource_definition).type": "cloudfunctions.googleapis.com/CloudFunction", + "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}/functions/{function}" + }, + "nested": { + "CreateDocumentMetadata": { + "fields": {} + }, + "UpdateDocumentMetadata": { + "fields": {} + }, + "RequestMetadata": { + "fields": { + "userInfo": { + "type": "UserInfo", + "id": 1 + } + } + }, + "ResponseMetadata": { + "fields": { + "requestId": { + "type": "string", + "id": 1 + } + } + }, + "UserInfo": { + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "groupIds": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + }, + "UpdateOptions": { + "fields": { + "updateType": { + "type": "UpdateType", + "id": 1 + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + }, + "mergeFieldsOptions": { + "type": "MergeFieldsOptions", + "id": 3 + } + } + }, + "MergeFieldsOptions": { + "oneofs": { + "_replaceMessageFields": { + "oneof": [ + "replaceMessageFields" + ] + }, + "_replaceRepeatedFields": { + "oneof": [ + "replaceRepeatedFields" + ] + } + }, + "fields": { + "replaceMessageFields": { + "type": "bool", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "replaceRepeatedFields": { + "type": "bool", + "id": 2, + "options": { + "proto3_optional": true + } + } + } + }, + "UpdateType": { + "values": { + "UPDATE_TYPE_UNSPECIFIED": 0, + "UPDATE_TYPE_REPLACE": 1, + "UPDATE_TYPE_MERGE": 2, + "UPDATE_TYPE_INSERT_PROPERTIES_BY_NAMES": 3, + "UPDATE_TYPE_REPLACE_PROPERTIES_BY_NAMES": 4, + "UPDATE_TYPE_DELETE_PROPERTIES_BY_NAMES": 5, + "UPDATE_TYPE_MERGE_AND_REPLACE_OR_INSERT_PROPERTIES_BY_NAMES": 6 + } + }, + "DatabaseType": { + "valuesOptions": { + "DB_CLOUD_SQL_POSTGRES": { + "deprecated": true + } + }, + "values": { + "DB_UNKNOWN": 0, + "DB_INFRA_SPANNER": 1, + "DB_CLOUD_SQL_POSTGRES": 2 + } + }, + "AccessControlMode": { + "values": { + "ACL_MODE_UNKNOWN": 0, + "ACL_MODE_UNIVERSAL_ACCESS": 1, + "ACL_MODE_DOCUMENT_LEVEL_ACCESS_CONTROL_BYOID": 2, + "ACL_MODE_DOCUMENT_LEVEL_ACCESS_CONTROL_GCI": 3 + } + }, + "DocumentCreatorDefaultRole": { + "values": { + "DOCUMENT_CREATOR_DEFAULT_ROLE_UNSPECIFIED": 0, + "DOCUMENT_ADMIN": 1, + "DOCUMENT_EDITOR": 2, + "DOCUMENT_VIEWER": 3 + } + }, + "Document": { + "options": { + "(google.api.resource).type": "contentwarehouse.googleapis.com/Document", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/documents/referenceId/{reference_id}" + }, + "oneofs": { + "structuredContent": { + "oneof": [ + "plainText", + "cloudAiDocument" + ] + }, + "rawDocument": { + "oneof": [ + "rawDocumentPath", + "inlineRawDocument" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "referenceId": { + "type": "string", + "id": 11 + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "title": { + "type": "string", + "id": 18 + }, + "displayUri": { + "type": "string", + "id": 17 + }, + "documentSchemaName": { + "type": "string", + "id": 3, + "options": { + "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/DocumentSchema" + } + }, + "plainText": { + "type": "string", + "id": 15 + }, + "cloudAiDocument": { + "type": "google.cloud.documentai.v1.Document", + "id": 4 + }, + "structuredContentUri": { + "type": "string", + "id": 16, + "options": { + "deprecated": true + } + }, + "rawDocumentPath": { + "type": "string", + "id": 5 + }, + "inlineRawDocument": { + "type": "bytes", + "id": 6 + }, + "properties": { + "rule": "repeated", + "type": "Property", + "id": 7 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "rawDocumentFileType": { + "type": "RawDocumentFileType", + "id": 10 + }, + "asyncEnabled": { + "type": "bool", + "id": 12, + "options": { + "deprecated": true + } + }, + "contentCategory": { + "type": "ContentCategory", + "id": 20 + }, + "textExtractionDisabled": { + "type": "bool", + "id": 19, + "options": { + "deprecated": true + } + }, + "textExtractionEnabled": { + "type": "bool", + "id": 21 + }, + "creator": { + "type": "string", + "id": 13 + }, + "updater": { + "type": "string", + "id": 14 + }, + "dispositionTime": { + "type": "google.protobuf.Timestamp", + "id": 22, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "legalHold": { + "type": "bool", + "id": 23, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "DocumentReference": { + "fields": { + "documentName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/Document" + } + }, + "displayName": { + "type": "string", + "id": 2 + }, + "snippet": { + "type": "string", + "id": 3 + }, + "documentIsFolder": { + "type": "bool", + "id": 4 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deleteTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "documentIsRetentionFolder": { + "type": "bool", + "id": 8 + }, + "documentIsLegalHoldFolder": { + "type": "bool", + "id": 9 + } + } + }, + "Property": { + "oneofs": { + "values": { + "oneof": [ + "integerValues", + "floatValues", + "textValues", + "enumValues", + "propertyValues", + "dateTimeValues", + "mapProperty", + "timestampValues" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "integerValues": { + "type": "IntegerArray", + "id": 2 + }, + "floatValues": { + "type": "FloatArray", + "id": 3 + }, + "textValues": { + "type": "TextArray", + "id": 4 + }, + "enumValues": { + "type": "EnumArray", + "id": 5 + }, + "propertyValues": { + "type": "PropertyArray", + "id": 6 + }, + "dateTimeValues": { + "type": "DateTimeArray", + "id": 7 + }, + "mapProperty": { + "type": "MapProperty", + "id": 8 + }, + "timestampValues": { + "type": "TimestampArray", + "id": 9 + } + } + }, + "IntegerArray": { + "fields": { + "values": { + "rule": "repeated", + "type": "int32", + "id": 1 + } + } + }, + "FloatArray": { + "fields": { + "values": { + "rule": "repeated", + "type": "float", + "id": 1 + } + } + }, + "TextArray": { + "fields": { + "values": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "EnumArray": { + "fields": { + "values": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "DateTimeArray": { + "fields": { + "values": { + "rule": "repeated", + "type": "google.type.DateTime", + "id": 1 + } + } + }, + "TimestampArray": { + "fields": { + "values": { + "rule": "repeated", + "type": "TimestampValue", + "id": 1 + } + } + }, + "TimestampValue": { + "oneofs": { + "value": { + "oneof": [ + "timestampValue", + "textValue" + ] + } + }, + "fields": { + "timestampValue": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "textValue": { + "type": "string", + "id": 2 + } + } + }, + "PropertyArray": { + "fields": { + "properties": { + "rule": "repeated", + "type": "Property", + "id": 1 + } + } + }, + "MapProperty": { + "fields": { + "fields": { + "keyType": "string", + "type": "Value", + "id": 1 + } + } + }, + "Value": { + "oneofs": { + "kind": { + "oneof": [ + "floatValue", + "intValue", + "stringValue", + "enumValue", + "datetimeValue", + "timestampValue", + "booleanValue" + ] + } + }, + "fields": { + "floatValue": { + "type": "float", + "id": 1 + }, + "intValue": { + "type": "int32", + "id": 2 + }, + "stringValue": { + "type": "string", + "id": 3 + }, + "enumValue": { + "type": "EnumValue", + "id": 4 + }, + "datetimeValue": { + "type": "google.type.DateTime", + "id": 5 + }, + "timestampValue": { + "type": "TimestampValue", + "id": 6 + }, + "booleanValue": { + "type": "bool", + "id": 7 + } + } + }, + "EnumValue": { + "fields": { + "value": { + "type": "string", + "id": 1 + } + } + }, + "RawDocumentFileType": { + "values": { + "RAW_DOCUMENT_FILE_TYPE_UNSPECIFIED": 0, + "RAW_DOCUMENT_FILE_TYPE_PDF": 1, + "RAW_DOCUMENT_FILE_TYPE_DOCX": 2, + "RAW_DOCUMENT_FILE_TYPE_XLSX": 3, + "RAW_DOCUMENT_FILE_TYPE_PPTX": 4, + "RAW_DOCUMENT_FILE_TYPE_TEXT": 5, + "RAW_DOCUMENT_FILE_TYPE_TIFF": 6 + } + }, + "ContentCategory": { + "values": { + "CONTENT_CATEGORY_UNSPECIFIED": 0, + "CONTENT_CATEGORY_IMAGE": 1, + "CONTENT_CATEGORY_AUDIO": 2, + "CONTENT_CATEGORY_VIDEO": 3 + } + }, + "DocumentLinkService": { + "options": { + "(google.api.default_host)": "contentwarehouse.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListLinkedTargets": { + "requestType": "ListLinkedTargetsRequest", + "responseType": "ListLinkedTargetsResponse", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/documents/*}/linkedTargets", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/documents/*}/linkedTargets", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListLinkedSources": { + "requestType": "ListLinkedSourcesRequest", + "responseType": "ListLinkedSourcesResponse", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/documents/*}/linkedSources", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/documents/*}/linkedSources", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "CreateDocumentLink": { + "requestType": "CreateDocumentLinkRequest", + "responseType": "DocumentLink", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/documents/*}/documentLinks", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,document_link" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/documents/*}/documentLinks", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,document_link" + } + ] + }, + "DeleteDocumentLink": { + "requestType": "DeleteDocumentLinkRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/documents/*/documentLinks/*}:delete", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/documents/*/documentLinks/*}:delete", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "ListLinkedTargetsResponse": { + "fields": { + "documentLinks": { + "rule": "repeated", + "type": "DocumentLink", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListLinkedTargetsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/Document" + } + }, + "requestMetadata": { + "type": "RequestMetadata", + "id": 2 + } + } + }, + "ListLinkedSourcesResponse": { + "fields": { + "documentLinks": { + "rule": "repeated", + "type": "DocumentLink", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListLinkedSourcesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/Document" + } + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + }, + "requestMetadata": { + "type": "RequestMetadata", + "id": 2 + } + } + }, + "DocumentLink": { + "options": { + "(google.api.resource).type": "contentwarehouse.googleapis.com/DocumentLink", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/documents/{document}/documentLinks/{document_link}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "sourceDocumentReference": { + "type": "DocumentReference", + "id": 2 + }, + "targetDocumentReference": { + "type": "DocumentReference", + "id": 3 + }, + "description": { + "type": "string", + "id": 4 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 7 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "SOFT_DELETED": 2 + } + } + } + }, + "CreateDocumentLinkRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/Document" + } + }, + "documentLink": { + "type": "DocumentLink", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestMetadata": { + "type": "RequestMetadata", + "id": 3 + } + } + }, + "DeleteDocumentLinkRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/DocumentLink" + } + }, + "requestMetadata": { + "type": "RequestMetadata", + "id": 2 + } + } + }, + "DocumentSchema": { + "options": { + "(google.api.resource).type": "contentwarehouse.googleapis.com/DocumentSchema", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/documentSchemas/{document_schema}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "propertyDefinitions": { + "rule": "repeated", + "type": "PropertyDefinition", + "id": 3 + }, + "documentIsFolder": { + "type": "bool", + "id": 4 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 7 + } + } + }, + "PropertyDefinition": { + "oneofs": { + "valueTypeOptions": { + "oneof": [ + "integerTypeOptions", + "floatTypeOptions", + "textTypeOptions", + "propertyTypeOptions", + "enumTypeOptions", + "dateTimeTypeOptions", + "mapTypeOptions", + "timestampTypeOptions" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "displayName": { + "type": "string", + "id": 12 + }, + "isRepeatable": { + "type": "bool", + "id": 2 + }, + "isFilterable": { + "type": "bool", + "id": 3 + }, + "isSearchable": { + "type": "bool", + "id": 4 + }, + "isMetadata": { + "type": "bool", + "id": 5 + }, + "isRequired": { + "type": "bool", + "id": 14 + }, + "retrievalImportance": { + "type": "RetrievalImportance", + "id": 18 + }, + "integerTypeOptions": { + "type": "IntegerTypeOptions", + "id": 7 + }, + "floatTypeOptions": { + "type": "FloatTypeOptions", + "id": 8 + }, + "textTypeOptions": { + "type": "TextTypeOptions", + "id": 9 + }, + "propertyTypeOptions": { + "type": "PropertyTypeOptions", + "id": 10 + }, + "enumTypeOptions": { + "type": "EnumTypeOptions", + "id": 11 + }, + "dateTimeTypeOptions": { + "type": "DateTimeTypeOptions", + "id": 13 + }, + "mapTypeOptions": { + "type": "MapTypeOptions", + "id": 15 + }, + "timestampTypeOptions": { + "type": "TimestampTypeOptions", + "id": 16 + }, + "schemaSources": { + "rule": "repeated", + "type": "SchemaSource", + "id": 19 + } + }, + "nested": { + "RetrievalImportance": { + "values": { + "RETRIEVAL_IMPORTANCE_UNSPECIFIED": 0, + "HIGHEST": 1, + "HIGHER": 2, + "HIGH": 3, + "MEDIUM": 4, + "LOW": 5, + "LOWEST": 6 + } + }, + "SchemaSource": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "processorType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "IntegerTypeOptions": { + "fields": {} + }, + "FloatTypeOptions": { + "fields": {} + }, + "TextTypeOptions": { + "fields": {} + }, + "DateTimeTypeOptions": { + "fields": {} + }, + "MapTypeOptions": { + "fields": {} + }, + "TimestampTypeOptions": { + "fields": {} + }, + "PropertyTypeOptions": { + "fields": { + "propertyDefinitions": { + "rule": "repeated", + "type": "PropertyDefinition", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "EnumTypeOptions": { + "fields": { + "possibleValues": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "validationCheckDisabled": { + "type": "bool", + "id": 2 + } + } + }, + "DocumentSchemaService": { + "options": { + "(google.api.default_host)": "contentwarehouse.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateDocumentSchema": { + "requestType": "CreateDocumentSchemaRequest", + "responseType": "DocumentSchema", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/documentSchemas", + "(google.api.http).body": "document_schema", + "(google.api.method_signature)": "parent,document_schema" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/documentSchemas", + "body": "document_schema" + } + }, + { + "(google.api.method_signature)": "parent,document_schema" + } + ] + }, + "UpdateDocumentSchema": { + "requestType": "UpdateDocumentSchemaRequest", + "responseType": "DocumentSchema", + "options": { + "(google.api.http).patch": "/v1/{name=projects/*/locations/*/documentSchemas/*}", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,document_schema" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{name=projects/*/locations/*/documentSchemas/*}", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,document_schema" + } + ] + }, + "GetDocumentSchema": { + "requestType": "GetDocumentSchemaRequest", + "responseType": "DocumentSchema", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/documentSchemas/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/documentSchemas/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteDocumentSchema": { + "requestType": "DeleteDocumentSchemaRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/documentSchemas/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/documentSchemas/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListDocumentSchemas": { + "requestType": "ListDocumentSchemasRequest", + "responseType": "ListDocumentSchemasResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/documentSchemas", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/documentSchemas" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "CreateDocumentSchemaRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/Location" + } + }, + "documentSchema": { + "type": "DocumentSchema", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetDocumentSchemaRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/DocumentSchema" + } + } + } + }, + "UpdateDocumentSchemaRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/DocumentSchema" + } + }, + "documentSchema": { + "type": "DocumentSchema", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteDocumentSchemaRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/DocumentSchema" + } + } + } + }, + "ListDocumentSchemasRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/Location" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListDocumentSchemasResponse": { + "fields": { + "documentSchemas": { + "rule": "repeated", + "type": "DocumentSchema", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DocumentService": { + "options": { + "(google.api.default_host)": "contentwarehouse.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateDocument": { + "requestType": "CreateDocumentRequest", + "responseType": "CreateDocumentResponse", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/documents", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,document" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/documents", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,document" + } + ] + }, + "GetDocument": { + "requestType": "GetDocumentRequest", + "responseType": "Document", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/documents/*}:get", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{name=projects/*/locations/*/documents/referenceId/*}:get", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/documents/*}:get", + "body": "*", + "additional_bindings": { + "post": "/v1/{name=projects/*/locations/*/documents/referenceId/*}:get", + "body": "*" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateDocument": { + "requestType": "UpdateDocumentRequest", + "responseType": "UpdateDocumentResponse", + "options": { + "(google.api.http).patch": "/v1/{name=projects/*/locations/*/documents/*}", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.patch": "/v1/{name=projects/*/locations/*/documents/referenceId/*}", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "name,document" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{name=projects/*/locations/*/documents/*}", + "body": "*", + "additional_bindings": { + "patch": "/v1/{name=projects/*/locations/*/documents/referenceId/*}", + "body": "*" + } + } + }, + { + "(google.api.method_signature)": "name,document" + } + ] + }, + "DeleteDocument": { + "requestType": "DeleteDocumentRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/documents/*}:delete", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{name=projects/*/locations/*/documents/referenceId/*}:delete", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/documents/*}:delete", + "body": "*", + "additional_bindings": { + "post": "/v1/{name=projects/*/locations/*/documents/referenceId/*}:delete", + "body": "*" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "SearchDocuments": { + "requestType": "SearchDocumentsRequest", + "responseType": "SearchDocumentsResponse", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/documents:search", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/documents:search", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "LockDocument": { + "requestType": "LockDocumentRequest", + "responseType": "Document", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/documents/*}:lock", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/documents/*}:lock", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "FetchAcl": { + "requestType": "FetchAclRequest", + "responseType": "FetchAclResponse", + "options": { + "(google.api.http).post": "/v1/{resource=projects/*/locations/*/documents/*}:fetchAcl", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{resource=projects/*}:fetchAcl", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=projects/*/locations/*/documents/*}:fetchAcl", + "body": "*", + "additional_bindings": { + "post": "/v1/{resource=projects/*}:fetchAcl", + "body": "*" + } + } + }, + { + "(google.api.method_signature)": "resource" + } + ] + }, + "SetAcl": { + "requestType": "SetAclRequest", + "responseType": "SetAclResponse", + "options": { + "(google.api.http).post": "/v1/{resource=projects/*/locations/*/documents/*}:setAcl", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{resource=projects/*}:setAcl", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "resource,policy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=projects/*/locations/*/documents/*}:setAcl", + "body": "*", + "additional_bindings": { + "post": "/v1/{resource=projects/*}:setAcl", + "body": "*" + } + } + }, + { + "(google.api.method_signature)": "resource,policy" + } + ] + } + } + }, + "CreateDocumentResponse": { + "fields": { + "document": { + "type": "Document", + "id": 1 + }, + "ruleEngineOutput": { + "type": "RuleEngineOutput", + "id": 2 + }, + "metadata": { + "type": "ResponseMetadata", + "id": 3 + }, + "longRunningOperations": { + "rule": "repeated", + "type": "google.longrunning.Operation", + "id": 4 + } + } + }, + "UpdateDocumentResponse": { + "fields": { + "document": { + "type": "Document", + "id": 1 + }, + "ruleEngineOutput": { + "type": "RuleEngineOutput", + "id": 2 + }, + "metadata": { + "type": "ResponseMetadata", + "id": 3 + } + } + }, + "QAResult": { + "fields": { + "highlights": { + "rule": "repeated", + "type": "Highlight", + "id": 1 + }, + "confidenceScore": { + "type": "float", + "id": 2 + } + }, + "nested": { + "Highlight": { + "fields": { + "startIndex": { + "type": "int32", + "id": 1 + }, + "endIndex": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "SearchDocumentsResponse": { + "fields": { + "matchingDocuments": { + "rule": "repeated", + "type": "MatchingDocument", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "totalSize": { + "type": "int32", + "id": 3 + }, + "metadata": { + "type": "ResponseMetadata", + "id": 4 + }, + "histogramQueryResults": { + "rule": "repeated", + "type": "HistogramQueryResult", + "id": 6 + }, + "questionAnswer": { + "type": "string", + "id": 7 + } + }, + "nested": { + "MatchingDocument": { + "fields": { + "document": { + "type": "Document", + "id": 1 + }, + "searchTextSnippet": { + "type": "string", + "id": 2 + }, + "qaResult": { + "type": "QAResult", + "id": 3 + }, + "matchedTokenPageIndices": { + "rule": "repeated", + "type": "int64", + "id": 4 + } + } + } + } + }, + "FetchAclResponse": { + "fields": { + "policy": { + "type": "google.iam.v1.Policy", + "id": 1 + }, + "metadata": { + "type": "ResponseMetadata", + "id": 2 + } + } + }, + "SetAclResponse": { + "fields": { + "policy": { + "type": "google.iam.v1.Policy", + "id": 1 + }, + "metadata": { + "type": "ResponseMetadata", + "id": 2 + } + } + }, + "CloudAIDocumentOption": { + "fields": { + "enableEntitiesConversions": { + "type": "bool", + "id": 1 + }, + "customizedEntitiesPropertiesConversions": { + "keyType": "string", + "type": "string", + "id": 2 + } + } + }, + "CreateDocumentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/Location" + } + }, + "document": { + "type": "Document", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestMetadata": { + "type": "RequestMetadata", + "id": 3 + }, + "policy": { + "type": "google.iam.v1.Policy", + "id": 4 + }, + "cloudAiDocumentOption": { + "type": "CloudAIDocumentOption", + "id": 5 + }, + "createMask": { + "type": "google.protobuf.FieldMask", + "id": 6 + } + } + }, + "GetDocumentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/Document" + } + }, + "requestMetadata": { + "type": "RequestMetadata", + "id": 2 + } + } + }, + "UpdateDocumentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/Document" + } + }, + "document": { + "type": "Document", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestMetadata": { + "type": "RequestMetadata", + "id": 3 + }, + "cloudAiDocumentOption": { + "type": "CloudAIDocumentOption", + "id": 5 + }, + "updateOptions": { + "type": "UpdateOptions", + "id": 6 + } + } + }, + "DeleteDocumentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/Document" + } + }, + "requestMetadata": { + "type": "RequestMetadata", + "id": 2 + } + } + }, + "SearchDocumentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/Location" + } + }, + "requestMetadata": { + "type": "RequestMetadata", + "id": 3 + }, + "documentQuery": { + "type": "DocumentQuery", + "id": 4 + }, + "offset": { + "type": "int32", + "id": 5 + }, + "pageSize": { + "type": "int32", + "id": 6 + }, + "pageToken": { + "type": "string", + "id": 7 + }, + "orderBy": { + "type": "string", + "id": 8 + }, + "histogramQueries": { + "rule": "repeated", + "type": "HistogramQuery", + "id": 9 + }, + "requireTotalSize": { + "type": "bool", + "id": 10 + }, + "totalResultSize": { + "type": "TotalResultSize", + "id": 12 + }, + "qaSizeLimit": { + "type": "int32", + "id": 11 + } + }, + "nested": { + "TotalResultSize": { + "values": { + "TOTAL_RESULT_SIZE_UNSPECIFIED": 0, + "ESTIMATED_SIZE": 1, + "ACTUAL_SIZE": 2 + } + } + } + }, + "LockDocumentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/Document" + } + }, + "collectionId": { + "type": "string", + "id": 2 + }, + "lockingUser": { + "type": "UserInfo", + "id": 3 + } + } + }, + "FetchAclRequest": { + "fields": { + "resource": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestMetadata": { + "type": "RequestMetadata", + "id": 2 + }, + "projectOwner": { + "type": "bool", + "id": 3 + } + } + }, + "SetAclRequest": { + "fields": { + "resource": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "policy": { + "type": "google.iam.v1.Policy", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestMetadata": { + "type": "RequestMetadata", + "id": 3 + }, + "projectOwner": { + "type": "bool", + "id": 4 + } + } + }, + "DocumentQuery": { + "fields": { + "query": { + "type": "string", + "id": 1 + }, + "isNlQuery": { + "type": "bool", + "id": 12 + }, + "customPropertyFilter": { + "type": "string", + "id": 4, + "options": { + "deprecated": true + } + }, + "timeFilters": { + "rule": "repeated", + "type": "TimeFilter", + "id": 5 + }, + "documentSchemaNames": { + "rule": "repeated", + "type": "string", + "id": 6 + }, + "propertyFilter": { + "rule": "repeated", + "type": "PropertyFilter", + "id": 7 + }, + "fileTypeFilter": { + "type": "FileTypeFilter", + "id": 8 + }, + "folderNameFilter": { + "type": "string", + "id": 9 + }, + "documentNameFilter": { + "rule": "repeated", + "type": "string", + "id": 14 + }, + "queryContext": { + "rule": "repeated", + "type": "string", + "id": 10 + }, + "documentCreatorFilter": { + "rule": "repeated", + "type": "string", + "id": 11 + }, + "customWeightsMetadata": { + "type": "CustomWeightsMetadata", + "id": 13 + } + } + }, + "TimeFilter": { + "fields": { + "timeRange": { + "type": "google.type.Interval", + "id": 1 + }, + "timeField": { + "type": "TimeField", + "id": 2 + } + }, + "nested": { + "TimeField": { + "values": { + "TIME_FIELD_UNSPECIFIED": 0, + "CREATE_TIME": 1, + "UPDATE_TIME": 2, + "DISPOSITION_TIME": 3 + } + } + } + }, + "PropertyFilter": { + "fields": { + "documentSchemaName": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/DocumentSchema" + } + }, + "condition": { + "type": "string", + "id": 2 + } + } + }, + "FileTypeFilter": { + "fields": { + "fileType": { + "type": "FileType", + "id": 1 + } + }, + "nested": { + "FileType": { + "values": { + "FILE_TYPE_UNSPECIFIED": 0, + "ALL": 1, + "FOLDER": 2, + "DOCUMENT": 3, + "ROOT_FOLDER": 4 + } + } + } + }, + "CustomWeightsMetadata": { + "fields": { + "weightedSchemaProperties": { + "rule": "repeated", + "type": "WeightedSchemaProperty", + "id": 1 + } + } + }, + "WeightedSchemaProperty": { + "fields": { + "documentSchemaName": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/DocumentSchema" + } + }, + "propertyNames": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + }, + "HistogramQuery": { + "fields": { + "histogramQuery": { + "type": "string", + "id": 1 + }, + "requirePreciseResultSize": { + "type": "bool", + "id": 2 + }, + "filters": { + "type": "HistogramQueryPropertyNameFilter", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "HistogramQueryPropertyNameFilter": { + "fields": { + "documentSchemas": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/DocumentSchema" + } + }, + "propertyNames": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "yAxis": { + "type": "HistogramYAxis", + "id": 3 + } + }, + "nested": { + "HistogramYAxis": { + "values": { + "HISTOGRAM_YAXIS_DOCUMENT": 0, + "HISTOGRAM_YAXIS_PROPERTY": 1 + } + } + } + }, + "HistogramQueryResult": { + "fields": { + "histogramQuery": { + "type": "string", + "id": 1 + }, + "histogram": { + "keyType": "string", + "type": "int64", + "id": 2 + } + } + }, + "RuleSet": { + "options": { + "(google.api.resource).type": "contentwarehouse.googleapis.com/RuleSet", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/ruleSets/{rule_set}" + }, + "fields": { + "name": { + "type": "string", + "id": 6 + }, + "description": { + "type": "string", + "id": 1 + }, + "source": { + "type": "string", + "id": 2 + }, + "rules": { + "rule": "repeated", + "type": "Rule", + "id": 3 + } + } + }, + "Rule": { + "fields": { + "description": { + "type": "string", + "id": 1 + }, + "ruleId": { + "type": "string", + "id": 2 + }, + "triggerType": { + "type": "TriggerType", + "id": 3 + }, + "condition": { + "type": "string", + "id": 4 + }, + "actions": { + "rule": "repeated", + "type": "Action", + "id": 5 + } + }, + "nested": { + "TriggerType": { + "values": { + "UNKNOWN": 0, + "ON_CREATE": 1, + "ON_UPDATE": 4, + "ON_CREATE_LINK": 7, + "ON_DELETE_LINK": 8 + } + } + } + }, + "Action": { + "oneofs": { + "action": { + "oneof": [ + "accessControl", + "dataValidation", + "dataUpdate", + "addToFolder", + "publishToPubSub", + "removeFromFolderAction", + "deleteDocumentAction" + ] + } + }, + "fields": { + "actionId": { + "type": "string", + "id": 1 + }, + "accessControl": { + "type": "AccessControlAction", + "id": 2 + }, + "dataValidation": { + "type": "DataValidationAction", + "id": 3 + }, + "dataUpdate": { + "type": "DataUpdateAction", + "id": 4 + }, + "addToFolder": { + "type": "AddToFolderAction", + "id": 5 + }, + "publishToPubSub": { + "type": "PublishAction", + "id": 6 + }, + "removeFromFolderAction": { + "type": "RemoveFromFolderAction", + "id": 9 + }, + "deleteDocumentAction": { + "type": "DeleteDocumentAction", + "id": 10 + } + } + }, + "AccessControlAction": { + "fields": { + "operationType": { + "type": "OperationType", + "id": 1 + }, + "policy": { + "type": "google.iam.v1.Policy", + "id": 2 + } + }, + "nested": { + "OperationType": { + "values": { + "UNKNOWN": 0, + "ADD_POLICY_BINDING": 1, + "REMOVE_POLICY_BINDING": 2, + "REPLACE_POLICY_BINDING": 3 + } + } + } + }, + "DataValidationAction": { + "fields": { + "conditions": { + "keyType": "string", + "type": "string", + "id": 1 + } + } + }, + "DataUpdateAction": { + "fields": { + "entries": { + "keyType": "string", + "type": "string", + "id": 1 + } + } + }, + "AddToFolderAction": { + "fields": { + "folders": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/Document" + } + } + } + }, + "RemoveFromFolderAction": { + "fields": { + "condition": { + "type": "string", + "id": 1 + }, + "folder": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/Document" + } + } + } + }, + "PublishAction": { + "fields": { + "topicId": { + "type": "string", + "id": 1 + }, + "messages": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + }, + "DeleteDocumentAction": { + "fields": { + "enableHardDelete": { + "type": "bool", + "id": 1 + } + } + }, + "RuleEngineOutput": { + "fields": { + "documentName": { + "type": "string", + "id": 3 + }, + "ruleEvaluatorOutput": { + "type": "RuleEvaluatorOutput", + "id": 1 + }, + "actionExecutorOutput": { + "type": "ActionExecutorOutput", + "id": 2 + } + } + }, + "RuleEvaluatorOutput": { + "fields": { + "triggeredRules": { + "rule": "repeated", + "type": "Rule", + "id": 1 + }, + "matchedRules": { + "rule": "repeated", + "type": "Rule", + "id": 2 + }, + "invalidRules": { + "rule": "repeated", + "type": "InvalidRule", + "id": 3 + } + } + }, + "InvalidRule": { + "fields": { + "rule": { + "type": "Rule", + "id": 1 + }, + "error": { + "type": "string", + "id": 2 + } + } + }, + "ActionExecutorOutput": { + "fields": { + "ruleActionsPairs": { + "rule": "repeated", + "type": "RuleActionsPair", + "id": 1 + } + } + }, + "RuleActionsPair": { + "fields": { + "rule": { + "type": "Rule", + "id": 1 + }, + "actionOutputs": { + "rule": "repeated", + "type": "ActionOutput", + "id": 2 + } + } + }, + "ActionOutput": { + "fields": { + "actionId": { + "type": "string", + "id": 1 + }, + "actionState": { + "type": "State", + "id": 2 + }, + "outputMessage": { + "type": "string", + "id": 3 + } + }, + "nested": { + "State": { + "values": { + "UNKNOWN": 0, + "ACTION_SUCCEEDED": 1, + "ACTION_FAILED": 2, + "ACTION_TIMED_OUT": 3, + "ACTION_PENDING": 4 + } + } + } + }, + "PipelineService": { + "options": { + "(google.api.default_host)": "contentwarehouse.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "RunPipeline": { + "requestType": "RunPipelineRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*}:runPipeline", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "RunPipelineResponse", + "(google.longrunning.operation_info).metadata_type": "RunPipelineMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*}:runPipeline", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "RunPipelineResponse", + "metadata_type": "RunPipelineMetadata" + } + } + ] + } + } + }, + "RunPipelineRequest": { + "oneofs": { + "pipeline": { + "oneof": [ + "gcsIngestPipeline", + "gcsIngestWithDocAiProcessorsPipeline", + "exportCdwPipeline", + "processWithDocAiPipeline" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/Location" + } + }, + "gcsIngestPipeline": { + "type": "GcsIngestPipeline", + "id": 2 + }, + "gcsIngestWithDocAiProcessorsPipeline": { + "type": "GcsIngestWithDocAiProcessorsPipeline", + "id": 3 + }, + "exportCdwPipeline": { + "type": "ExportToCdwPipeline", + "id": 4 + }, + "processWithDocAiPipeline": { + "type": "ProcessWithDocAiPipeline", + "id": 5 + }, + "requestMetadata": { + "type": "RequestMetadata", + "id": 6 + } + } + }, + "RunPipelineResponse": { + "fields": {} + }, + "RunPipelineMetadata": { + "oneofs": { + "pipelineMetadata": { + "oneof": [ + "gcsIngestPipelineMetadata", + "exportToCdwPipelineMetadata", + "processWithDocAiPipelineMetadata" + ] + } + }, + "fields": { + "totalFileCount": { + "type": "int32", + "id": 1 + }, + "failedFileCount": { + "type": "int32", + "id": 2 + }, + "userInfo": { + "type": "UserInfo", + "id": 3 + }, + "gcsIngestPipelineMetadata": { + "type": "GcsIngestPipelineMetadata", + "id": 4 + }, + "exportToCdwPipelineMetadata": { + "type": "ExportToCdwPipelineMetadata", + "id": 6 + }, + "processWithDocAiPipelineMetadata": { + "type": "ProcessWithDocAiPipelineMetadata", + "id": 7 + }, + "individualDocumentStatuses": { + "rule": "repeated", + "type": "IndividualDocumentStatus", + "id": 5 + } + }, + "nested": { + "GcsIngestPipelineMetadata": { + "fields": { + "inputPath": { + "type": "string", + "id": 1 + } + } + }, + "ExportToCdwPipelineMetadata": { + "fields": { + "documents": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "docAiDataset": { + "type": "string", + "id": 2 + }, + "outputPath": { + "type": "string", + "id": 3 + } + } + }, + "ProcessWithDocAiPipelineMetadata": { + "fields": { + "documents": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "processorInfo": { + "type": "ProcessorInfo", + "id": 2 + } + } + }, + "IndividualDocumentStatus": { + "fields": { + "documentId": { + "type": "string", + "id": 1 + }, + "status": { + "type": "google.rpc.Status", + "id": 2 + } + } + } + } + }, + "ProcessorInfo": { + "fields": { + "processorName": { + "type": "string", + "id": 1 + }, + "documentType": { + "type": "string", + "id": 2 + }, + "schemaName": { + "type": "string", + "id": 3 + } + } + }, + "IngestPipelineConfig": { + "fields": { + "documentAclPolicy": { + "type": "google.iam.v1.Policy", + "id": 1 + }, + "enableDocumentTextExtraction": { + "type": "bool", + "id": 2 + }, + "folder": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "cloudFunction": { + "type": "string", + "id": 4, + "options": { + "(google.api.resource_reference).type": "cloudfunctions.googleapis.com/CloudFunction" + } + } + } + }, + "GcsIngestPipeline": { + "fields": { + "inputPath": { + "type": "string", + "id": 1 + }, + "schemaName": { + "type": "string", + "id": 2 + }, + "processorType": { + "type": "string", + "id": 3 + }, + "skipIngestedDocuments": { + "type": "bool", + "id": 4 + }, + "pipelineConfig": { + "type": "IngestPipelineConfig", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GcsIngestWithDocAiProcessorsPipeline": { + "fields": { + "inputPath": { + "type": "string", + "id": 1 + }, + "splitClassifyProcessorInfo": { + "type": "ProcessorInfo", + "id": 2 + }, + "extractProcessorInfos": { + "rule": "repeated", + "type": "ProcessorInfo", + "id": 3 + }, + "processorResultsFolderPath": { + "type": "string", + "id": 4 + }, + "skipIngestedDocuments": { + "type": "bool", + "id": 5 + }, + "pipelineConfig": { + "type": "IngestPipelineConfig", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ExportToCdwPipeline": { + "fields": { + "documents": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "exportFolderPath": { + "type": "string", + "id": 2 + }, + "docAiDataset": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "trainingSplitRatio": { + "type": "float", + "id": 4 + } + } + }, + "ProcessWithDocAiPipeline": { + "fields": { + "documents": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "exportFolderPath": { + "type": "string", + "id": 2 + }, + "processorInfo": { + "type": "ProcessorInfo", + "id": 3 + }, + "processorResultsFolderPath": { + "type": "string", + "id": 4 + } + } + }, + "RuleSetService": { + "options": { + "(google.api.default_host)": "contentwarehouse.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateRuleSet": { + "requestType": "CreateRuleSetRequest", + "responseType": "RuleSet", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/ruleSets", + "(google.api.http).body": "rule_set", + "(google.api.method_signature)": "parent,rule_set" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/ruleSets", + "body": "rule_set" + } + }, + { + "(google.api.method_signature)": "parent,rule_set" + } + ] + }, + "GetRuleSet": { + "requestType": "GetRuleSetRequest", + "responseType": "RuleSet", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/ruleSets/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/ruleSets/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateRuleSet": { + "requestType": "UpdateRuleSetRequest", + "responseType": "RuleSet", + "options": { + "(google.api.http).patch": "/v1/{name=projects/*/locations/*/ruleSets/*}", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,rule_set" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{name=projects/*/locations/*/ruleSets/*}", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,rule_set" + } + ] + }, + "DeleteRuleSet": { + "requestType": "DeleteRuleSetRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/ruleSets/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/ruleSets/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListRuleSets": { + "requestType": "ListRuleSetsRequest", + "responseType": "ListRuleSetsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/ruleSets", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/ruleSets" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "CreateRuleSetRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/Location" + } + }, + "ruleSet": { + "type": "RuleSet", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetRuleSetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/RuleSet" + } + } + } + }, + "UpdateRuleSetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/RuleSet" + } + }, + "ruleSet": { + "type": "RuleSet", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteRuleSetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/RuleSet" + } + } + } + }, + "ListRuleSetsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/Location" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListRuleSetsResponse": { + "fields": { + "ruleSets": { + "rule": "repeated", + "type": "RuleSet", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "SynonymSet": { + "options": { + "(google.api.resource).type": "contentwarehouse.googleapis.com/SynonymSet", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/synonymSets/{context}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "context": { + "type": "string", + "id": 2 + }, + "synonyms": { + "rule": "repeated", + "type": "Synonym", + "id": 3 + } + }, + "nested": { + "Synonym": { + "fields": { + "words": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + } + } + }, + "SynonymSetService": { + "options": { + "(google.api.default_host)": "contentwarehouse.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateSynonymSet": { + "requestType": "CreateSynonymSetRequest", + "responseType": "SynonymSet", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/synonymSets", + "(google.api.http).body": "synonym_set", + "(google.api.method_signature)": "parent,synonym_set" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/synonymSets", + "body": "synonym_set" + } + }, + { + "(google.api.method_signature)": "parent,synonym_set" + } + ] + }, + "GetSynonymSet": { + "requestType": "GetSynonymSetRequest", + "responseType": "SynonymSet", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/synonymSets/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/synonymSets/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateSynonymSet": { + "requestType": "UpdateSynonymSetRequest", + "responseType": "SynonymSet", + "options": { + "(google.api.http).patch": "/v1/{name=projects/*/locations/*/synonymSets/*}", + "(google.api.http).body": "synonym_set", + "(google.api.method_signature)": "name,synonym_set" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{name=projects/*/locations/*/synonymSets/*}", + "body": "synonym_set" + } + }, + { + "(google.api.method_signature)": "name,synonym_set" + } + ] + }, + "DeleteSynonymSet": { + "requestType": "DeleteSynonymSetRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/synonymSets/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/synonymSets/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListSynonymSets": { + "requestType": "ListSynonymSetsRequest", + "responseType": "ListSynonymSetsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/synonymSets", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/synonymSets" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "CreateSynonymSetRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/Location" + } + }, + "synonymSet": { + "type": "SynonymSet", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetSynonymSetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/SynonymSet" + } + } + } + }, + "ListSynonymSetsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/Location" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListSynonymSetsResponse": { + "fields": { + "synonymSets": { + "rule": "repeated", + "type": "SynonymSet", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "UpdateSynonymSetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/SynonymSet" + } + }, + "synonymSet": { + "type": "SynonymSet", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteSynonymSetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/SynonymSet" + } + } + } + } + } + } + } + }, + "documentai": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.DocumentAI.V1", + "go_package": "cloud.google.com/go/documentai/apiv1/documentaipb;documentaipb", + "java_multiple_files": true, + "java_outer_classname": "GeometryProto", + "java_package": "com.google.cloud.documentai.v1", + "php_namespace": "Google\\Cloud\\DocumentAI\\V1", + "ruby_package": "Google::Cloud::DocumentAI::V1" + }, + "nested": { + "Document": { + "oneofs": { + "source": { + "oneof": [ + "uri", + "content" + ] + } + }, + "fields": { + "uri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "content": { + "type": "bytes", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "docid": { + "type": "string", + "id": 15, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "mimeType": { + "type": "string", + "id": 3 + }, + "text": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "textStyles": { + "rule": "repeated", + "type": "Style", + "id": 5, + "options": { + "deprecated": true + } + }, + "pages": { + "rule": "repeated", + "type": "Page", + "id": 6 + }, + "entities": { + "rule": "repeated", + "type": "Entity", + "id": 7 + }, + "entityRelations": { + "rule": "repeated", + "type": "EntityRelation", + "id": 8 + }, + "textChanges": { + "rule": "repeated", + "type": "TextChange", + "id": 14 + }, + "shardInfo": { + "type": "ShardInfo", + "id": 9 + }, + "error": { + "type": "google.rpc.Status", + "id": 10 + }, + "revisions": { + "rule": "repeated", + "type": "Revision", + "id": 13 + }, + "documentLayout": { + "type": "DocumentLayout", + "id": 17 + }, + "chunkedDocument": { + "type": "ChunkedDocument", + "id": 18 + }, + "entityValidationOutput": { + "type": "EntityValidationOutput", + "id": 21 + }, + "entitiesRevisions": { + "rule": "repeated", + "type": "EntitiesRevision", + "id": 22 + }, + "entitiesRevisionId": { + "type": "string", + "id": 23 + } + }, + "nested": { + "ShardInfo": { + "fields": { + "shardIndex": { + "type": "int64", + "id": 1 + }, + "shardCount": { + "type": "int64", + "id": 2 + }, + "textOffset": { + "type": "int64", + "id": 3 + } + } + }, + "Style": { + "fields": { + "textAnchor": { + "type": "TextAnchor", + "id": 1 + }, + "color": { + "type": "google.type.Color", + "id": 2 + }, + "backgroundColor": { + "type": "google.type.Color", + "id": 3 + }, + "fontWeight": { + "type": "string", + "id": 4 + }, + "textStyle": { + "type": "string", + "id": 5 + }, + "textDecoration": { + "type": "string", + "id": 6 + }, + "fontSize": { + "type": "FontSize", + "id": 7 + }, + "fontFamily": { + "type": "string", + "id": 8 + } + }, + "nested": { + "FontSize": { + "fields": { + "size": { + "type": "float", + "id": 1 + }, + "unit": { + "type": "string", + "id": 2 + } + } + } + } + }, + "Page": { + "fields": { + "pageNumber": { + "type": "int32", + "id": 1 + }, + "image": { + "type": "Image", + "id": 13 + }, + "transforms": { + "rule": "repeated", + "type": "Matrix", + "id": 14 + }, + "dimension": { + "type": "Dimension", + "id": 2 + }, + "layout": { + "type": "Layout", + "id": 3 + }, + "detectedLanguages": { + "rule": "repeated", + "type": "DetectedLanguage", + "id": 4 + }, + "blocks": { + "rule": "repeated", + "type": "Block", + "id": 5 + }, + "paragraphs": { + "rule": "repeated", + "type": "Paragraph", + "id": 6 + }, + "lines": { + "rule": "repeated", + "type": "Line", + "id": 7 + }, + "tokens": { + "rule": "repeated", + "type": "Token", + "id": 8 + }, + "visualElements": { + "rule": "repeated", + "type": "VisualElement", + "id": 9 + }, + "tables": { + "rule": "repeated", + "type": "Table", + "id": 10 + }, + "formFields": { + "rule": "repeated", + "type": "FormField", + "id": 11 + }, + "symbols": { + "rule": "repeated", + "type": "Symbol", + "id": 12 + }, + "detectedBarcodes": { + "rule": "repeated", + "type": "DetectedBarcode", + "id": 15 + }, + "imageQualityScores": { + "type": "ImageQualityScores", + "id": 17 + }, + "provenance": { + "type": "Provenance", + "id": 16, + "options": { + "deprecated": true + } + } + }, + "nested": { + "Dimension": { + "fields": { + "width": { + "type": "float", + "id": 1 + }, + "height": { + "type": "float", + "id": 2 + }, + "unit": { + "type": "string", + "id": 3 + } + } + }, + "Image": { + "fields": { + "content": { + "type": "bytes", + "id": 1 + }, + "mimeType": { + "type": "string", + "id": 2 + }, + "width": { + "type": "int32", + "id": 3 + }, + "height": { + "type": "int32", + "id": 4 + } + } + }, + "Matrix": { + "fields": { + "rows": { + "type": "int32", + "id": 1 + }, + "cols": { + "type": "int32", + "id": 2 + }, + "type": { + "type": "int32", + "id": 3 + }, + "data": { + "type": "bytes", + "id": 4 + } + } + }, + "Layout": { + "fields": { + "textAnchor": { + "type": "TextAnchor", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + }, + "boundingPoly": { + "type": "BoundingPoly", + "id": 3 + }, + "orientation": { + "type": "Orientation", + "id": 4 + } + }, + "nested": { + "Orientation": { + "values": { + "ORIENTATION_UNSPECIFIED": 0, + "PAGE_UP": 1, + "PAGE_RIGHT": 2, + "PAGE_DOWN": 3, + "PAGE_LEFT": 4 + } + } + } + }, + "Block": { + "fields": { + "layout": { + "type": "Layout", + "id": 1 + }, + "detectedLanguages": { + "rule": "repeated", + "type": "DetectedLanguage", + "id": 2 + }, + "provenance": { + "type": "Provenance", + "id": 3, + "options": { + "deprecated": true + } + } + } + }, + "Paragraph": { + "fields": { + "layout": { + "type": "Layout", + "id": 1 + }, + "detectedLanguages": { + "rule": "repeated", + "type": "DetectedLanguage", + "id": 2 + }, + "provenance": { + "type": "Provenance", + "id": 3, + "options": { + "deprecated": true + } + } + } + }, + "Line": { + "fields": { + "layout": { + "type": "Layout", + "id": 1 + }, + "detectedLanguages": { + "rule": "repeated", + "type": "DetectedLanguage", + "id": 2 + }, + "provenance": { + "type": "Provenance", + "id": 3, + "options": { + "deprecated": true + } + } + } + }, + "Token": { + "fields": { + "layout": { + "type": "Layout", + "id": 1 + }, + "detectedBreak": { + "type": "DetectedBreak", + "id": 2 + }, + "detectedLanguages": { + "rule": "repeated", + "type": "DetectedLanguage", + "id": 3 + }, + "provenance": { + "type": "Provenance", + "id": 4, + "options": { + "deprecated": true + } + }, + "styleInfo": { + "type": "StyleInfo", + "id": 5 + } + }, + "nested": { + "DetectedBreak": { + "fields": { + "type": { + "type": "Type", + "id": 1 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "SPACE": 1, + "WIDE_SPACE": 2, + "HYPHEN": 3 + } + } + } + }, + "StyleInfo": { + "fields": { + "fontSize": { + "type": "int32", + "id": 1 + }, + "pixelFontSize": { + "type": "double", + "id": 2 + }, + "letterSpacing": { + "type": "double", + "id": 3 + }, + "fontType": { + "type": "string", + "id": 4 + }, + "bold": { + "type": "bool", + "id": 5 + }, + "italic": { + "type": "bool", + "id": 6 + }, + "underlined": { + "type": "bool", + "id": 7 + }, + "strikeout": { + "type": "bool", + "id": 8 + }, + "subscript": { + "type": "bool", + "id": 9 + }, + "superscript": { + "type": "bool", + "id": 10 + }, + "smallcaps": { + "type": "bool", + "id": 11 + }, + "fontWeight": { + "type": "int32", + "id": 12 + }, + "handwritten": { + "type": "bool", + "id": 13 + }, + "textColor": { + "type": "google.type.Color", + "id": 14 + }, + "backgroundColor": { + "type": "google.type.Color", + "id": 15 + } + } + } + } + }, + "Symbol": { + "fields": { + "layout": { + "type": "Layout", + "id": 1 + }, + "detectedLanguages": { + "rule": "repeated", + "type": "DetectedLanguage", + "id": 2 + } + } + }, + "VisualElement": { + "fields": { + "layout": { + "type": "Layout", + "id": 1 + }, + "type": { + "type": "string", + "id": 2 + }, + "detectedLanguages": { + "rule": "repeated", + "type": "DetectedLanguage", + "id": 3 + } + } + }, + "Table": { + "fields": { + "layout": { + "type": "Layout", + "id": 1 + }, + "headerRows": { + "rule": "repeated", + "type": "TableRow", + "id": 2 + }, + "bodyRows": { + "rule": "repeated", + "type": "TableRow", + "id": 3 + }, + "detectedLanguages": { + "rule": "repeated", + "type": "DetectedLanguage", + "id": 4 + }, + "provenance": { + "type": "Provenance", + "id": 5, + "options": { + "deprecated": true + } + } + }, + "nested": { + "TableRow": { + "fields": { + "cells": { + "rule": "repeated", + "type": "TableCell", + "id": 1 + } + } + }, + "TableCell": { + "fields": { + "layout": { + "type": "Layout", + "id": 1 + }, + "rowSpan": { + "type": "int32", + "id": 2 + }, + "colSpan": { + "type": "int32", + "id": 3 + }, + "detectedLanguages": { + "rule": "repeated", + "type": "DetectedLanguage", + "id": 4 + } + } + } + } + }, + "FormField": { + "fields": { + "fieldName": { + "type": "Layout", + "id": 1 + }, + "fieldValue": { + "type": "Layout", + "id": 2 + }, + "nameDetectedLanguages": { + "rule": "repeated", + "type": "DetectedLanguage", + "id": 3 + }, + "valueDetectedLanguages": { + "rule": "repeated", + "type": "DetectedLanguage", + "id": 4 + }, + "valueType": { + "type": "string", + "id": 5 + }, + "correctedKeyText": { + "type": "string", + "id": 6 + }, + "correctedValueText": { + "type": "string", + "id": 7 + }, + "provenance": { + "type": "Provenance", + "id": 8 + } + } + }, + "DetectedBarcode": { + "fields": { + "layout": { + "type": "Layout", + "id": 1 + }, + "barcode": { + "type": "Barcode", + "id": 2 + } + } + }, + "DetectedLanguage": { + "fields": { + "languageCode": { + "type": "string", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + } + } + }, + "ImageQualityScores": { + "fields": { + "qualityScore": { + "type": "float", + "id": 1 + }, + "detectedDefects": { + "rule": "repeated", + "type": "DetectedDefect", + "id": 2 + } + }, + "nested": { + "DetectedDefect": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + } + } + } + } + } + } + }, + "Entity": { + "fields": { + "textAnchor": { + "type": "TextAnchor", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "type": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "mentionText": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "mentionId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "confidence": { + "type": "float", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageAnchor": { + "type": "PageAnchor", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "id": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "normalizedValue": { + "type": "NormalizedValue", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "properties": { + "rule": "repeated", + "type": "Entity", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "provenance": { + "type": "Provenance", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "redacted": { + "type": "bool", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "method": { + "type": "Method", + "id": 15, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "NormalizedValue": { + "oneofs": { + "structuredValue": { + "oneof": [ + "moneyValue", + "dateValue", + "datetimeValue", + "addressValue", + "booleanValue", + "integerValue", + "floatValue", + "signatureValue" + ] + } + }, + "fields": { + "moneyValue": { + "type": "google.type.Money", + "id": 2 + }, + "dateValue": { + "type": "google.type.Date", + "id": 3 + }, + "datetimeValue": { + "type": "google.type.DateTime", + "id": 4 + }, + "addressValue": { + "type": "google.type.PostalAddress", + "id": 5 + }, + "booleanValue": { + "type": "bool", + "id": 6 + }, + "integerValue": { + "type": "int32", + "id": 7 + }, + "floatValue": { + "type": "float", + "id": 8 + }, + "signatureValue": { + "type": "bool", + "id": 10 + }, + "text": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Method": { + "values": { + "METHOD_UNSPECIFIED": 0, + "EXTRACT": 1, + "DERIVE": 2 + } + } + } + }, + "EntityRelation": { + "fields": { + "subjectId": { + "type": "string", + "id": 1 + }, + "objectId": { + "type": "string", + "id": 2 + }, + "relation": { + "type": "string", + "id": 3 + } + } + }, + "TextAnchor": { + "fields": { + "textSegments": { + "rule": "repeated", + "type": "TextSegment", + "id": 1 + }, + "content": { + "type": "string", + "id": 2 + } + }, + "nested": { + "TextSegment": { + "fields": { + "startIndex": { + "type": "int64", + "id": 1 + }, + "endIndex": { + "type": "int64", + "id": 2 + } + } + } + } + }, + "PageAnchor": { + "fields": { + "pageRefs": { + "rule": "repeated", + "type": "PageRef", + "id": 1 + } + }, + "nested": { + "PageRef": { + "fields": { + "page": { + "type": "int64", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "layoutType": { + "type": "LayoutType", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "layoutId": { + "type": "string", + "id": 3, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "boundingPoly": { + "type": "BoundingPoly", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "confidence": { + "type": "float", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "LayoutType": { + "values": { + "LAYOUT_TYPE_UNSPECIFIED": 0, + "BLOCK": 1, + "PARAGRAPH": 2, + "LINE": 3, + "TOKEN": 4, + "VISUAL_ELEMENT": 5, + "TABLE": 6, + "FORM_FIELD": 7 + } + } + } + } + } + }, + "Provenance": { + "fields": { + "revision": { + "type": "int32", + "id": 1, + "options": { + "deprecated": true + } + }, + "id": { + "type": "int32", + "id": 2, + "options": { + "deprecated": true + } + }, + "parents": { + "rule": "repeated", + "type": "Parent", + "id": 3 + }, + "type": { + "type": "OperationType", + "id": 4 + } + }, + "nested": { + "Parent": { + "fields": { + "revision": { + "type": "int32", + "id": 1 + }, + "index": { + "type": "int32", + "id": 3 + }, + "id": { + "type": "int32", + "id": 2, + "options": { + "deprecated": true + } + } + } + }, + "OperationType": { + "valuesOptions": { + "EVAL_REQUESTED": { + "deprecated": true + }, + "EVAL_APPROVED": { + "deprecated": true + }, + "EVAL_SKIPPED": { + "deprecated": true + } + }, + "values": { + "OPERATION_TYPE_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2, + "UPDATE": 7, + "REPLACE": 3, + "EVAL_REQUESTED": 4, + "EVAL_APPROVED": 5, + "EVAL_SKIPPED": 6 + } + } + } + }, + "Revision": { + "oneofs": { + "source": { + "oneof": [ + "agent", + "processor" + ] + } + }, + "fields": { + "agent": { + "type": "string", + "id": 4 + }, + "processor": { + "type": "string", + "id": 5 + }, + "id": { + "type": "string", + "id": 1 + }, + "parent": { + "rule": "repeated", + "type": "int32", + "id": 2, + "options": { + "deprecated": true + } + }, + "parentIds": { + "rule": "repeated", + "type": "string", + "id": 7 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "humanReview": { + "type": "HumanReview", + "id": 6 + } + }, + "nested": { + "HumanReview": { + "fields": { + "state": { + "type": "string", + "id": 1 + }, + "stateMessage": { + "type": "string", + "id": 2 + } + } + } + } + }, + "TextChange": { + "fields": { + "textAnchor": { + "type": "TextAnchor", + "id": 1 + }, + "changedText": { + "type": "string", + "id": 2 + }, + "provenance": { + "rule": "repeated", + "type": "Provenance", + "id": 3, + "options": { + "deprecated": true + } + } + } + }, + "DocumentLayout": { + "fields": { + "blocks": { + "rule": "repeated", + "type": "DocumentLayoutBlock", + "id": 1 + } + }, + "nested": { + "DocumentLayoutBlock": { + "oneofs": { + "block": { + "oneof": [ + "textBlock", + "tableBlock", + "listBlock" + ] + } + }, + "fields": { + "textBlock": { + "type": "LayoutTextBlock", + "id": 2 + }, + "tableBlock": { + "type": "LayoutTableBlock", + "id": 3 + }, + "listBlock": { + "type": "LayoutListBlock", + "id": 4 + }, + "blockId": { + "type": "string", + "id": 1 + }, + "pageSpan": { + "type": "LayoutPageSpan", + "id": 5 + }, + "boundingBox": { + "type": "BoundingPoly", + "id": 6 + } + }, + "nested": { + "LayoutPageSpan": { + "fields": { + "pageStart": { + "type": "int32", + "id": 1 + }, + "pageEnd": { + "type": "int32", + "id": 2 + } + } + }, + "LayoutTextBlock": { + "fields": { + "text": { + "type": "string", + "id": 1 + }, + "type": { + "type": "string", + "id": 2 + }, + "blocks": { + "rule": "repeated", + "type": "DocumentLayoutBlock", + "id": 3 + } + } + }, + "LayoutTableBlock": { + "fields": { + "headerRows": { + "rule": "repeated", + "type": "LayoutTableRow", + "id": 1 + }, + "bodyRows": { + "rule": "repeated", + "type": "LayoutTableRow", + "id": 2 + }, + "caption": { + "type": "string", + "id": 3 + } + } + }, + "LayoutTableRow": { + "fields": { + "cells": { + "rule": "repeated", + "type": "LayoutTableCell", + "id": 1 + } + } + }, + "LayoutTableCell": { + "fields": { + "blocks": { + "rule": "repeated", + "type": "DocumentLayoutBlock", + "id": 1 + }, + "rowSpan": { + "type": "int32", + "id": 2 + }, + "colSpan": { + "type": "int32", + "id": 3 + } + } + }, + "LayoutListBlock": { + "fields": { + "listEntries": { + "rule": "repeated", + "type": "LayoutListEntry", + "id": 1 + }, + "type": { + "type": "string", + "id": 2 + } + } + }, + "LayoutListEntry": { + "fields": { + "blocks": { + "rule": "repeated", + "type": "DocumentLayoutBlock", + "id": 1 + } + } + } + } + } + } + }, + "ChunkedDocument": { + "fields": { + "chunks": { + "rule": "repeated", + "type": "Chunk", + "id": 1 + } + }, + "nested": { + "Chunk": { + "fields": { + "chunkId": { + "type": "string", + "id": 1 + }, + "sourceBlockIds": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "content": { + "type": "string", + "id": 3 + }, + "pageSpan": { + "type": "ChunkPageSpan", + "id": 4 + }, + "pageHeaders": { + "rule": "repeated", + "type": "ChunkPageHeader", + "id": 5 + }, + "pageFooters": { + "rule": "repeated", + "type": "ChunkPageFooter", + "id": 6 + } + }, + "nested": { + "ChunkPageSpan": { + "fields": { + "pageStart": { + "type": "int32", + "id": 1 + }, + "pageEnd": { + "type": "int32", + "id": 2 + } + } + }, + "ChunkPageHeader": { + "fields": { + "text": { + "type": "string", + "id": 1 + }, + "pageSpan": { + "type": "ChunkPageSpan", + "id": 2 + } + } + }, + "ChunkPageFooter": { + "fields": { + "text": { + "type": "string", + "id": 1 + }, + "pageSpan": { + "type": "ChunkPageSpan", + "id": 2 + } + } + } + } + } + } + }, + "EntityValidationOutput": { + "fields": { + "validationResults": { + "rule": "repeated", + "type": "ValidationResult", + "id": 1 + }, + "passAllRules": { + "type": "bool", + "id": 2 + } + }, + "nested": { + "ValidationResult": { + "fields": { + "ruleName": { + "type": "string", + "id": 1 + }, + "ruleDescription": { + "type": "string", + "id": 2 + }, + "validationResultType": { + "type": "ValidationResultType", + "id": 3 + }, + "validationDetails": { + "type": "string", + "id": 4 + } + }, + "nested": { + "ValidationResultType": { + "values": { + "VALIDATION_RESULT_TYPE_UNSPECIFIED": 0, + "VALIDATION_RESULT_TYPE_VALID": 1, + "VALIDATION_RESULT_TYPE_INVALID": 2, + "VALIDATION_RESULT_TYPE_SKIPPED": 3, + "VALIDATION_RESULT_TYPE_NOT_APPLICABLE": 4 + } + } + } + } + } + }, + "EntitiesRevision": { + "fields": { + "revisionId": { + "type": "string", + "id": 1 + }, + "entities": { + "rule": "repeated", + "type": "Entity", + "id": 2 + }, + "entityValidationOutput": { + "type": "EntityValidationOutput", + "id": 3 + } + } + } + } + }, + "Barcode": { + "fields": { + "format": { + "type": "string", + "id": 1 + }, + "valueFormat": { + "type": "string", + "id": 2 + }, + "rawValue": { + "type": "string", + "id": 3 + } + } + }, + "Vertex": { + "fields": { + "x": { + "type": "int32", + "id": 1 + }, + "y": { + "type": "int32", + "id": 2 + } + } + }, + "NormalizedVertex": { + "fields": { + "x": { + "type": "float", + "id": 1 + }, + "y": { + "type": "float", + "id": 2 + } + } + }, + "BoundingPoly": { + "fields": { + "vertices": { + "rule": "repeated", + "type": "Vertex", + "id": 1 + }, + "normalizedVertices": { + "rule": "repeated", + "type": "NormalizedVertex", + "id": 2 + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api;api", + "java_multiple_files": true, + "java_outer_classname": "LaunchStageProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions", + "options": { + "packed": false + } + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7, + "IDENTIFIER": 8 + } + }, + "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 + } + } + }, + "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" + }, + "apiVersion": { + "type": "string", + "id": 525000001, + "extend": "google.protobuf.ServiceOptions" + }, + "CommonLanguageSettings": { + "fields": { + "referenceDocsUri": { + "type": "string", + "id": 1, + "options": { + "deprecated": true + } + }, + "destinations": { + "rule": "repeated", + "type": "ClientLibraryDestination", + "id": 2 + } + } + }, + "ClientLibrarySettings": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "launchStage": { + "type": "LaunchStage", + "id": 2 + }, + "restNumericEnums": { + "type": "bool", + "id": 3 + }, + "javaSettings": { + "type": "JavaSettings", + "id": 21 + }, + "cppSettings": { + "type": "CppSettings", + "id": 22 + }, + "phpSettings": { + "type": "PhpSettings", + "id": 23 + }, + "pythonSettings": { + "type": "PythonSettings", + "id": 24 + }, + "nodeSettings": { + "type": "NodeSettings", + "id": 25 + }, + "dotnetSettings": { + "type": "DotnetSettings", + "id": 26 + }, + "rubySettings": { + "type": "RubySettings", + "id": 27 + }, + "goSettings": { + "type": "GoSettings", + "id": 28 + } + } + }, + "Publishing": { + "fields": { + "methodSettings": { + "rule": "repeated", + "type": "MethodSettings", + "id": 2 + }, + "newIssueUri": { + "type": "string", + "id": 101 + }, + "documentationUri": { + "type": "string", + "id": 102 + }, + "apiShortName": { + "type": "string", + "id": 103 + }, + "githubLabel": { + "type": "string", + "id": 104 + }, + "codeownerGithubTeams": { + "rule": "repeated", + "type": "string", + "id": 105 + }, + "docTagPrefix": { + "type": "string", + "id": 106 + }, + "organization": { + "type": "ClientLibraryOrganization", + "id": 107 + }, + "librarySettings": { + "rule": "repeated", + "type": "ClientLibrarySettings", + "id": 109 + }, + "protoReferenceDocumentationUri": { + "type": "string", + "id": 110 + }, + "restReferenceDocumentationUri": { + "type": "string", + "id": 111 + } + } + }, + "JavaSettings": { + "fields": { + "libraryPackage": { + "type": "string", + "id": 1 + }, + "serviceClassNames": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "common": { + "type": "CommonLanguageSettings", + "id": 3 + } + } + }, + "CppSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PhpSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PythonSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "NodeSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "DotnetSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "renamedResources": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "ignoredResources": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "forcedNamespaceAliases": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "handwrittenSignatures": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + }, + "RubySettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "GoSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "MethodSettings": { + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "longRunning": { + "type": "LongRunning", + "id": 2 + }, + "autoPopulatedFields": { + "rule": "repeated", + "type": "string", + "id": 3 + } + }, + "nested": { + "LongRunning": { + "fields": { + "initialPollDelay": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "pollDelayMultiplier": { + "type": "float", + "id": 2 + }, + "maxPollDelay": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "totalPollTimeout": { + "type": "google.protobuf.Duration", + "id": 4 + } + } + } + } + }, + "ClientLibraryOrganization": { + "values": { + "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, + "CLOUD": 1, + "ADS": 2, + "PHOTOS": 3, + "STREET_VIEW": 4, + "SHOPPING": 5, + "GEO": 6, + "GENERATIVE_AI": 7 + } + }, + "ClientLibraryDestination": { + "values": { + "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, + "GITHUB": 10, + "PACKAGE_MANAGER": 20 + } + }, + "LaunchStage": { + "values": { + "LAUNCH_STAGE_UNSPECIFIED": 0, + "UNIMPLEMENTED": 6, + "PRELAUNCH": 7, + "EARLY_ACCESS": 1, + "ALPHA": 2, + "BETA": 3, + "GA": 4, + "DEPRECATED": 5 + } + } + } + }, + "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": { + "edition": "proto2", + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "Edition": { + "edition": "proto2", + "values": { + "EDITION_UNKNOWN": 0, + "EDITION_PROTO2": 998, + "EDITION_PROTO3": 999, + "EDITION_2023": 1000, + "EDITION_2024": 1001, + "EDITION_1_TEST_ONLY": 1, + "EDITION_2_TEST_ONLY": 2, + "EDITION_99997_TEST_ONLY": 99997, + "EDITION_99998_TEST_ONLY": 99998, + "EDITION_99999_TEST_ONLY": 99999, + "EDITION_MAX": 2147483647 + } + }, + "FileDescriptorProto": { + "edition": "proto2", + "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 + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11 + }, + "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 + }, + "edition": { + "type": "Edition", + "id": 14 + } + } + }, + "DescriptorProto": { + "edition": "proto2", + "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": { + "edition": "proto2", + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + }, + "declaration": { + "rule": "repeated", + "type": "Declaration", + "id": 2, + "options": { + "retention": "RETENTION_SOURCE" + } + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "verification": { + "type": "VerificationState", + "id": 3, + "options": { + "default": "UNVERIFIED", + "retention": "RETENTION_SOURCE" + } + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "Declaration": { + "fields": { + "number": { + "type": "int32", + "id": 1 + }, + "fullName": { + "type": "string", + "id": 2 + }, + "type": { + "type": "string", + "id": 3 + }, + "reserved": { + "type": "bool", + "id": 5 + }, + "repeated": { + "type": "bool", + "id": 6 + } + }, + "reserved": [ + [ + 4, + 4 + ] + ] + }, + "VerificationState": { + "values": { + "DECLARATION": 0, + "UNVERIFIED": 1 + } + } + } + }, + "FieldDescriptorProto": { + "edition": "proto2", + "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_REPEATED": 3, + "LABEL_REQUIRED": 2 + } + } + } + }, + "OneofDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "edition": "proto2", + "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": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "edition": "proto2", + "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": { + "edition": "proto2", + "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 + } + }, + "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 + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 42, + 42 + ], + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "edition": "proto2", + "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 + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 11, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 12 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "edition": "proto2", + "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 + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "debugRedact": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "retention": { + "type": "OptionRetention", + "id": 17 + }, + "targets": { + "rule": "repeated", + "type": "OptionTargetType", + "id": 19 + }, + "editionDefaults": { + "rule": "repeated", + "type": "EditionDefault", + "id": 20 + }, + "features": { + "type": "FeatureSet", + "id": 21 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 18, + 18 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + }, + "OptionRetention": { + "values": { + "RETENTION_UNKNOWN": 0, + "RETENTION_RUNTIME": 1, + "RETENTION_SOURCE": 2 + } + }, + "OptionTargetType": { + "values": { + "TARGET_TYPE_UNKNOWN": 0, + "TARGET_TYPE_FILE": 1, + "TARGET_TYPE_EXTENSION_RANGE": 2, + "TARGET_TYPE_MESSAGE": 3, + "TARGET_TYPE_FIELD": 4, + "TARGET_TYPE_ONEOF": 5, + "TARGET_TYPE_ENUM": 6, + "TARGET_TYPE_ENUM_ENTRY": 7, + "TARGET_TYPE_SERVICE": 8, + "TARGET_TYPE_METHOD": 9 + } + }, + "EditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "value": { + "type": "string", + "id": 2 + } + } + } + } + }, + "OneofOptions": { + "edition": "proto2", + "fields": { + "features": { + "type": "FeatureSet", + "id": 1 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "edition": "proto2", + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 6, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "edition": "proto2", + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "features": { + "type": "FeatureSet", + "id": 2 + }, + "debugRedact": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "edition": "proto2", + "fields": { + "features": { + "type": "FeatureSet", + "id": 34 + }, + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "edition": "proto2", + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "features": { + "type": "FeatureSet", + "id": 35 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "edition": "proto2", + "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 + } + } + } + } + }, + "FeatureSet": { + "edition": "proto2", + "fields": { + "fieldPresence": { + "type": "FieldPresence", + "id": 1, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_2023", + "edition_defaults.value": "EXPLICIT" + } + }, + "enumType": { + "type": "EnumType", + "id": 2, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "OPEN" + } + }, + "repeatedFieldEncoding": { + "type": "RepeatedFieldEncoding", + "id": 3, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "PACKED" + } + }, + "utf8Validation": { + "type": "Utf8Validation", + "id": 4, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "VERIFY" + } + }, + "messageEncoding": { + "type": "MessageEncoding", + "id": 5, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO2", + "edition_defaults.value": "LENGTH_PREFIXED" + } + }, + "jsonFormat": { + "type": "JsonFormat", + "id": 6, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "ALLOW" + } + } + }, + "extensions": [ + [ + 1000, + 1000 + ], + [ + 1001, + 1001 + ], + [ + 1002, + 1002 + ], + [ + 9990, + 9990 + ], + [ + 9995, + 9999 + ], + [ + 10000, + 10000 + ] + ], + "reserved": [ + [ + 999, + 999 + ] + ], + "nested": { + "FieldPresence": { + "values": { + "FIELD_PRESENCE_UNKNOWN": 0, + "EXPLICIT": 1, + "IMPLICIT": 2, + "LEGACY_REQUIRED": 3 + } + }, + "EnumType": { + "values": { + "ENUM_TYPE_UNKNOWN": 0, + "OPEN": 1, + "CLOSED": 2 + } + }, + "RepeatedFieldEncoding": { + "values": { + "REPEATED_FIELD_ENCODING_UNKNOWN": 0, + "PACKED": 1, + "EXPANDED": 2 + } + }, + "Utf8Validation": { + "values": { + "UTF8_VALIDATION_UNKNOWN": 0, + "VERIFY": 2, + "NONE": 3 + } + }, + "MessageEncoding": { + "values": { + "MESSAGE_ENCODING_UNKNOWN": 0, + "LENGTH_PREFIXED": 1, + "DELIMITED": 2 + } + }, + "JsonFormat": { + "values": { + "JSON_FORMAT_UNKNOWN": 0, + "ALLOW": 1, + "LEGACY_BEST_EFFORT": 2 + } + } + } + }, + "FeatureSetDefaults": { + "edition": "proto2", + "fields": { + "defaults": { + "rule": "repeated", + "type": "FeatureSetEditionDefault", + "id": 1 + }, + "minimumEdition": { + "type": "Edition", + "id": 4 + }, + "maximumEdition": { + "type": "Edition", + "id": 5 + } + }, + "nested": { + "FeatureSetEditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "features": { + "type": "FeatureSet", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "edition": "proto2", + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1, + "options": { + "packed": true + } + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2, + "options": { + "packed": true + } + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "edition": "proto2", + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1, + "options": { + "packed": true + } + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "DoubleValue": { + "fields": { + "value": { + "type": "double", + "id": 1 + } + } + }, + "FloatValue": { + "fields": { + "value": { + "type": "float", + "id": 1 + } + } + }, + "Int64Value": { + "fields": { + "value": { + "type": "int64", + "id": 1 + } + } + }, + "UInt64Value": { + "fields": { + "value": { + "type": "uint64", + "id": 1 + } + } + }, + "Int32Value": { + "fields": { + "value": { + "type": "int32", + "id": 1 + } + } + }, + "UInt32Value": { + "fields": { + "value": { + "type": "uint32", + "id": 1 + } + } + }, + "BoolValue": { + "fields": { + "value": { + "type": "bool", + "id": 1 + } + } + }, + "StringValue": { + "fields": { + "value": { + "type": "string", + "id": 1 + } + } + }, + "BytesValue": { + "fields": { + "value": { + "type": "bytes", + "id": 1 + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + } + } + }, + "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/expr;expr", + "java_multiple_files": true, + "java_outer_classname": "ExprProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP" + }, + "nested": { + "Color": { + "fields": { + "red": { + "type": "float", + "id": 1 + }, + "green": { + "type": "float", + "id": 2 + }, + "blue": { + "type": "float", + "id": 3 + }, + "alpha": { + "type": "google.protobuf.FloatValue", + "id": 4 + } + } + }, + "Date": { + "fields": { + "year": { + "type": "int32", + "id": 1 + }, + "month": { + "type": "int32", + "id": 2 + }, + "day": { + "type": "int32", + "id": 3 + } + } + }, + "DateTime": { + "oneofs": { + "timeOffset": { + "oneof": [ + "utcOffset", + "timeZone" + ] + } + }, + "fields": { + "year": { + "type": "int32", + "id": 1 + }, + "month": { + "type": "int32", + "id": 2 + }, + "day": { + "type": "int32", + "id": 3 + }, + "hours": { + "type": "int32", + "id": 4 + }, + "minutes": { + "type": "int32", + "id": 5 + }, + "seconds": { + "type": "int32", + "id": 6 + }, + "nanos": { + "type": "int32", + "id": 7 + }, + "utcOffset": { + "type": "google.protobuf.Duration", + "id": 8 + }, + "timeZone": { + "type": "TimeZone", + "id": 9 + } + } + }, + "TimeZone": { + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "version": { + "type": "string", + "id": 2 + } + } + }, + "Money": { + "fields": { + "currencyCode": { + "type": "string", + "id": 1 + }, + "units": { + "type": "int64", + "id": 2 + }, + "nanos": { + "type": "int32", + "id": 3 + } + } + }, + "PostalAddress": { + "fields": { + "revision": { + "type": "int32", + "id": 1 + }, + "regionCode": { + "type": "string", + "id": 2 + }, + "languageCode": { + "type": "string", + "id": 3 + }, + "postalCode": { + "type": "string", + "id": 4 + }, + "sortingCode": { + "type": "string", + "id": 5 + }, + "administrativeArea": { + "type": "string", + "id": 6 + }, + "locality": { + "type": "string", + "id": 7 + }, + "sublocality": { + "type": "string", + "id": 8 + }, + "addressLines": { + "rule": "repeated", + "type": "string", + "id": 9 + }, + "recipients": { + "rule": "repeated", + "type": "string", + "id": 10 + }, + "organization": { + "type": "string", + "id": 11 + } + } + }, + "Interval": { + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + }, + "Expr": { + "fields": { + "expression": { + "type": "string", + "id": 1 + }, + "title": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "location": { + "type": "string", + "id": 4 + } + } + } + } + }, + "iam": { + "nested": { + "v1": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.Cloud.Iam.V1", + "go_package": "cloud.google.com/go/iam/apiv1/iampb;iampb", + "java_multiple_files": true, + "java_outer_classname": "PolicyProto", + "java_package": "com.google.iam.v1", + "php_namespace": "Google\\Cloud\\Iam\\V1" + }, + "nested": { + "Policy": { + "fields": { + "version": { + "type": "int32", + "id": 1 + }, + "bindings": { + "rule": "repeated", + "type": "Binding", + "id": 4 + }, + "auditConfigs": { + "rule": "repeated", + "type": "AuditConfig", + "id": 6 + }, + "etag": { + "type": "bytes", + "id": 3 + } + } + }, + "Binding": { + "fields": { + "role": { + "type": "string", + "id": 1 + }, + "members": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "condition": { + "type": "google.type.Expr", + "id": 3 + } + } + }, + "AuditConfig": { + "fields": { + "service": { + "type": "string", + "id": 1 + }, + "auditLogConfigs": { + "rule": "repeated", + "type": "AuditLogConfig", + "id": 3 + } + } + }, + "AuditLogConfig": { + "fields": { + "logType": { + "type": "LogType", + "id": 1 + }, + "exemptedMembers": { + "rule": "repeated", + "type": "string", + "id": 2 + } + }, + "nested": { + "LogType": { + "values": { + "LOG_TYPE_UNSPECIFIED": 0, + "ADMIN_READ": 1, + "DATA_WRITE": 2, + "DATA_READ": 3 + } + } + } + }, + "PolicyDelta": { + "fields": { + "bindingDeltas": { + "rule": "repeated", + "type": "BindingDelta", + "id": 1 + }, + "auditConfigDeltas": { + "rule": "repeated", + "type": "AuditConfigDelta", + "id": 2 + } + } + }, + "BindingDelta": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "role": { + "type": "string", + "id": 2 + }, + "member": { + "type": "string", + "id": 3 + }, + "condition": { + "type": "google.type.Expr", + "id": 4 + } + }, + "nested": { + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2 + } + } + } + }, + "AuditConfigDelta": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "service": { + "type": "string", + "id": 2 + }, + "exemptedMember": { + "type": "string", + "id": 3 + }, + "logType": { + "type": "string", + "id": 4 + } + }, + "nested": { + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2 + } + } + } + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "cloud.google.com/go/longrunning/autogen/longrunningpb;longrunningpb", + "java_multiple_files": true, + "java_outer_classname": "OperationsProto", + "java_package": "com.google.longrunning", + "php_namespace": "Google\\LongRunning" + }, + "nested": { + "operationInfo": { + "type": "google.longrunning.OperationInfo", + "id": 1049, + "extend": "google.protobuf.MethodOptions" + }, + "Operations": { + "options": { + "(google.api.default_host)": "longrunning.googleapis.com" + }, + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{name=operations}", + "(google.api.method_signature)": "name,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations}" + } + }, + { + "(google.api.method_signature)": "name,filter" + } + ] + }, + "GetOperation": { + "requestType": "GetOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteOperation": { + "requestType": "DeleteOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CancelOperation": { + "requestType": "CancelOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=operations/**}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=operations/**}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "WaitOperation": { + "requestType": "WaitOperationRequest", + "responseType": "Operation" + } + } + }, + "Operation": { + "oneofs": { + "result": { + "oneof": [ + "error", + "response" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "metadata": { + "type": "google.protobuf.Any", + "id": 2 + }, + "done": { + "type": "bool", + "id": 3 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + }, + "response": { + "type": "google.protobuf.Any", + "id": 5 + } + } + }, + "GetOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListOperationsRequest": { + "fields": { + "name": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "WaitOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "OperationInfo": { + "fields": { + "responseType": { + "type": "string", + "id": 1 + }, + "metadataType": { + "type": "string", + "id": 2 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_link_service.create_document_link.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_link_service.create_document_link.js new file mode 100644 index 00000000000..5d8559aaca1 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_link_service.create_document_link.js @@ -0,0 +1,75 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, documentLink) { + // [START contentwarehouse_v1_generated_DocumentLinkService_CreateDocumentLink_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent of the document-link to be created. + * parent of document-link should be a document. + * Format: + * projects/{project_number}/locations/{location}/documents/{source_document_id}. + */ + // const parent = 'abc123' + /** + * Required. Document links associated with the source documents + * (source_document_id). + */ + // const documentLink = {} + /** + * The meta information collected about the document creator, used to enforce + * access control for the service. + */ + // const requestMetadata = {} + + // Imports the Contentwarehouse library + const {DocumentLinkServiceClient} = require('@google-cloud/contentwarehouse').v1; + + // Instantiates a client + const contentwarehouseClient = new DocumentLinkServiceClient(); + + async function callCreateDocumentLink() { + // Construct request + const request = { + parent, + documentLink, + }; + + // Run request + const response = await contentwarehouseClient.createDocumentLink(request); + console.log(response); + } + + callCreateDocumentLink(); + // [END contentwarehouse_v1_generated_DocumentLinkService_CreateDocumentLink_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_link_service.delete_document_link.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_link_service.delete_document_link.js new file mode 100644 index 00000000000..d2ab4f5e653 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_link_service.delete_document_link.js @@ -0,0 +1,68 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START contentwarehouse_v1_generated_DocumentLinkService_DeleteDocumentLink_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the document-link to be deleted. + * Format: + * projects/{project_number}/locations/{location}/documents/{source_document_id}/documentLinks/{document_link_id}. + */ + // const name = 'abc123' + /** + * The meta information collected about the document creator, used to enforce + * access control for the service. + */ + // const requestMetadata = {} + + // Imports the Contentwarehouse library + const {DocumentLinkServiceClient} = require('@google-cloud/contentwarehouse').v1; + + // Instantiates a client + const contentwarehouseClient = new DocumentLinkServiceClient(); + + async function callDeleteDocumentLink() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await contentwarehouseClient.deleteDocumentLink(request); + console.log(response); + } + + callDeleteDocumentLink(); + // [END contentwarehouse_v1_generated_DocumentLinkService_DeleteDocumentLink_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_link_service.list_linked_sources.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_link_service.list_linked_sources.js new file mode 100644 index 00000000000..28a30c4fd90 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_link_service.list_linked_sources.js @@ -0,0 +1,84 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START contentwarehouse_v1_generated_DocumentLinkService_ListLinkedSources_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the document, for which all source links are + * returned. Format: + * projects/{project_number}/locations/{location}/documents/{source_document_id}. + */ + // const parent = 'abc123' + /** + * The maximum number of document-links to return. The service may return + * fewer than this value. + * If unspecified, at most 50 document-links will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListLinkedSources` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListLinkedSources` + * must match the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * The meta information collected about the document creator, used to enforce + * access control for the service. + */ + // const requestMetadata = {} + + // Imports the Contentwarehouse library + const {DocumentLinkServiceClient} = require('@google-cloud/contentwarehouse').v1; + + // Instantiates a client + const contentwarehouseClient = new DocumentLinkServiceClient(); + + async function callListLinkedSources() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = contentwarehouseClient.listLinkedSourcesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListLinkedSources(); + // [END contentwarehouse_v1_generated_DocumentLinkService_ListLinkedSources_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_link_service.list_linked_targets.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_link_service.list_linked_targets.js new file mode 100644 index 00000000000..edda257f228 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_link_service.list_linked_targets.js @@ -0,0 +1,68 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START contentwarehouse_v1_generated_DocumentLinkService_ListLinkedTargets_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the document, for which all target links are + * returned. Format: + * projects/{project_number}/locations/{location}/documents/{target_document_id}. + */ + // const parent = 'abc123' + /** + * The meta information collected about the document creator, used to enforce + * access control for the service. + */ + // const requestMetadata = {} + + // Imports the Contentwarehouse library + const {DocumentLinkServiceClient} = require('@google-cloud/contentwarehouse').v1; + + // Instantiates a client + const contentwarehouseClient = new DocumentLinkServiceClient(); + + async function callListLinkedTargets() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await contentwarehouseClient.listLinkedTargets(request); + console.log(response); + } + + callListLinkedTargets(); + // [END contentwarehouse_v1_generated_DocumentLinkService_ListLinkedTargets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_schema_service.create_document_schema.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_schema_service.create_document_schema.js new file mode 100644 index 00000000000..a112f4c5678 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_schema_service.create_document_schema.js @@ -0,0 +1,66 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, documentSchema) { + // [START contentwarehouse_v1_generated_DocumentSchemaService_CreateDocumentSchema_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent name. + */ + // const parent = 'abc123' + /** + * Required. The document schema to create. + */ + // const documentSchema = {} + + // Imports the Contentwarehouse library + const {DocumentSchemaServiceClient} = require('@google-cloud/contentwarehouse').v1; + + // Instantiates a client + const contentwarehouseClient = new DocumentSchemaServiceClient(); + + async function callCreateDocumentSchema() { + // Construct request + const request = { + parent, + documentSchema, + }; + + // Run request + const response = await contentwarehouseClient.createDocumentSchema(request); + console.log(response); + } + + callCreateDocumentSchema(); + // [END contentwarehouse_v1_generated_DocumentSchemaService_CreateDocumentSchema_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_schema_service.delete_document_schema.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_schema_service.delete_document_schema.js new file mode 100644 index 00000000000..a664ffa9dd2 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_schema_service.delete_document_schema.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START contentwarehouse_v1_generated_DocumentSchemaService_DeleteDocumentSchema_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the document schema to delete. + */ + // const name = 'abc123' + + // Imports the Contentwarehouse library + const {DocumentSchemaServiceClient} = require('@google-cloud/contentwarehouse').v1; + + // Instantiates a client + const contentwarehouseClient = new DocumentSchemaServiceClient(); + + async function callDeleteDocumentSchema() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await contentwarehouseClient.deleteDocumentSchema(request); + console.log(response); + } + + callDeleteDocumentSchema(); + // [END contentwarehouse_v1_generated_DocumentSchemaService_DeleteDocumentSchema_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_schema_service.get_document_schema.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_schema_service.get_document_schema.js new file mode 100644 index 00000000000..cc6b7231f4a --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_schema_service.get_document_schema.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START contentwarehouse_v1_generated_DocumentSchemaService_GetDocumentSchema_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the document schema to retrieve. + */ + // const name = 'abc123' + + // Imports the Contentwarehouse library + const {DocumentSchemaServiceClient} = require('@google-cloud/contentwarehouse').v1; + + // Instantiates a client + const contentwarehouseClient = new DocumentSchemaServiceClient(); + + async function callGetDocumentSchema() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await contentwarehouseClient.getDocumentSchema(request); + console.log(response); + } + + callGetDocumentSchema(); + // [END contentwarehouse_v1_generated_DocumentSchemaService_GetDocumentSchema_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_schema_service.list_document_schemas.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_schema_service.list_document_schemas.js new file mode 100644 index 00000000000..6c0e14ff672 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_schema_service.list_document_schemas.js @@ -0,0 +1,78 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START contentwarehouse_v1_generated_DocumentSchemaService_ListDocumentSchemas_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, which owns this collection of document schemas. + * Format: projects/{project_number}/locations/{location}. + */ + // const parent = 'abc123' + /** + * The maximum number of document schemas to return. The service may return + * fewer than this value. + * If unspecified, at most 50 document schemas will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListDocumentSchemas` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListDocumentSchemas` + * must match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Contentwarehouse library + const {DocumentSchemaServiceClient} = require('@google-cloud/contentwarehouse').v1; + + // Instantiates a client + const contentwarehouseClient = new DocumentSchemaServiceClient(); + + async function callListDocumentSchemas() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = contentwarehouseClient.listDocumentSchemasAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListDocumentSchemas(); + // [END contentwarehouse_v1_generated_DocumentSchemaService_ListDocumentSchemas_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_schema_service.update_document_schema.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_schema_service.update_document_schema.js new file mode 100644 index 00000000000..40802f1b5dd --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_schema_service.update_document_schema.js @@ -0,0 +1,68 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name, documentSchema) { + // [START contentwarehouse_v1_generated_DocumentSchemaService_UpdateDocumentSchema_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the document schema to update. + * Format: + * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}. + */ + // const name = 'abc123' + /** + * Required. The document schema to update with. + */ + // const documentSchema = {} + + // Imports the Contentwarehouse library + const {DocumentSchemaServiceClient} = require('@google-cloud/contentwarehouse').v1; + + // Instantiates a client + const contentwarehouseClient = new DocumentSchemaServiceClient(); + + async function callUpdateDocumentSchema() { + // Construct request + const request = { + name, + documentSchema, + }; + + // Run request + const response = await contentwarehouseClient.updateDocumentSchema(request); + console.log(response); + } + + callUpdateDocumentSchema(); + // [END contentwarehouse_v1_generated_DocumentSchemaService_UpdateDocumentSchema_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.create_document.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.create_document.js new file mode 100644 index 00000000000..a056ee14a91 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.create_document.js @@ -0,0 +1,94 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, document) { + // [START contentwarehouse_v1_generated_DocumentService_CreateDocument_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent name. + * Format: projects/{project_number}/locations/{location}. + */ + // const parent = 'abc123' + /** + * Required. The document to create. + */ + // const document = {} + /** + * The meta information collected about the end user, used to enforce access + * control for the service. + */ + // const requestMetadata = {} + /** + * Default document policy during creation. + * This refers to an Identity and Access (IAM) policy, which specifies access + * controls for the Document. + * Conditions defined in the policy will be ignored. + */ + // const policy = {} + /** + * Request Option for processing Cloud AI Document in Document Warehouse. + * This field offers limited support for mapping entities from Cloud AI + * Document to Warehouse Document. Please consult with product team before + * using this field and other available options. + */ + // const cloudAiDocumentOption = {} + /** + * Field mask for creating Document fields. If mask path is empty, + * it means all fields are masked. + * For the `FieldMask` definition, + * see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask. + */ + // const createMask = {} + + // Imports the Contentwarehouse library + const {DocumentServiceClient} = require('@google-cloud/contentwarehouse').v1; + + // Instantiates a client + const contentwarehouseClient = new DocumentServiceClient(); + + async function callCreateDocument() { + // Construct request + const request = { + parent, + document, + }; + + // Run request + const response = await contentwarehouseClient.createDocument(request); + console.log(response); + } + + callCreateDocument(); + // [END contentwarehouse_v1_generated_DocumentService_CreateDocument_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.delete_document.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.delete_document.js new file mode 100644 index 00000000000..386331ba9c7 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.delete_document.js @@ -0,0 +1,70 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START contentwarehouse_v1_generated_DocumentService_DeleteDocument_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the document to delete. + * Format: + * projects/{project_number}/locations/{location}/documents/{document_id} + * or + * projects/{project_number}/locations/{location}/documents/referenceId/{reference_id}. + */ + // const name = 'abc123' + /** + * The meta information collected about the end user, used to enforce access + * control for the service. + */ + // const requestMetadata = {} + + // Imports the Contentwarehouse library + const {DocumentServiceClient} = require('@google-cloud/contentwarehouse').v1; + + // Instantiates a client + const contentwarehouseClient = new DocumentServiceClient(); + + async function callDeleteDocument() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await contentwarehouseClient.deleteDocument(request); + console.log(response); + } + + callDeleteDocument(); + // [END contentwarehouse_v1_generated_DocumentService_DeleteDocument_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.fetch_acl.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.fetch_acl.js new file mode 100644 index 00000000000..bab03a270e1 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.fetch_acl.js @@ -0,0 +1,76 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(resource) { + // [START contentwarehouse_v1_generated_DocumentService_FetchAcl_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. REQUIRED: The resource for which the policy is being requested. + * Format for document: + * projects/{project_number}/locations/{location}/documents/{document_id}. + * Format for collection: + * projects/{project_number}/locations/{location}/collections/{collection_id}. + * Format for project: projects/{project_number}. + */ + // const resource = 'abc123' + /** + * The meta information collected about the end user, used to enforce access + * control for the service. + */ + // const requestMetadata = {} + /** + * For Get Project ACL only. Authorization check for end user will be ignored + * when project_owner=true. + */ + // const projectOwner = true + + // Imports the Contentwarehouse library + const {DocumentServiceClient} = require('@google-cloud/contentwarehouse').v1; + + // Instantiates a client + const contentwarehouseClient = new DocumentServiceClient(); + + async function callFetchAcl() { + // Construct request + const request = { + resource, + }; + + // Run request + const response = await contentwarehouseClient.fetchAcl(request); + console.log(response); + } + + callFetchAcl(); + // [END contentwarehouse_v1_generated_DocumentService_FetchAcl_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.get_document.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.get_document.js new file mode 100644 index 00000000000..6f00ab8ab0d --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.get_document.js @@ -0,0 +1,69 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START contentwarehouse_v1_generated_DocumentService_GetDocument_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the document to retrieve. + * Format: + * projects/{project_number}/locations/{location}/documents/{document_id} or + * projects/{project_number}/locations/{location}/documents/referenceId/{reference_id}. + */ + // const name = 'abc123' + /** + * The meta information collected about the end user, used to enforce access + * control for the service. + */ + // const requestMetadata = {} + + // Imports the Contentwarehouse library + const {DocumentServiceClient} = require('@google-cloud/contentwarehouse').v1; + + // Instantiates a client + const contentwarehouseClient = new DocumentServiceClient(); + + async function callGetDocument() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await contentwarehouseClient.getDocument(request); + console.log(response); + } + + callGetDocument(); + // [END contentwarehouse_v1_generated_DocumentService_GetDocument_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.lock_document.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.lock_document.js new file mode 100644 index 00000000000..0c6e8dd36d6 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.lock_document.js @@ -0,0 +1,71 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START contentwarehouse_v1_generated_DocumentService_LockDocument_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the document to lock. + * Format: + * projects/{project_number}/locations/{location}/documents/{document}. + */ + // const name = 'abc123' + /** + * The collection the document connects to. + */ + // const collectionId = 'abc123' + /** + * The user information who locks the document. + */ + // const lockingUser = {} + + // Imports the Contentwarehouse library + const {DocumentServiceClient} = require('@google-cloud/contentwarehouse').v1; + + // Instantiates a client + const contentwarehouseClient = new DocumentServiceClient(); + + async function callLockDocument() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await contentwarehouseClient.lockDocument(request); + console.log(response); + } + + callLockDocument(); + // [END contentwarehouse_v1_generated_DocumentService_LockDocument_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.search_documents.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.search_documents.js new file mode 100644 index 00000000000..90c508fec1e --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.search_documents.js @@ -0,0 +1,164 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START contentwarehouse_v1_generated_DocumentService_SearchDocuments_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, which owns this collection of documents. + * Format: projects/{project_number}/locations/{location}. + */ + // const parent = 'abc123' + /** + * The meta information collected about the end user, used to enforce access + * control and improve the search quality of the service. + */ + // const requestMetadata = {} + /** + * Query used to search against documents (keyword, filters, etc.). + */ + // const documentQuery = {} + /** + * An integer that specifies the current offset (that is, starting result + * location, amongst the documents deemed by the API as relevant) in search + * results. This field is only considered if + * page_token google.cloud.contentwarehouse.v1.SearchDocumentsRequest.page_token + * is unset. + * The maximum allowed value is 5000. Otherwise an error is thrown. + * For example, 0 means to return results starting from the first matching + * document, and 10 means to return from the 11th document. This can be used + * for pagination, (for example, pageSize = 10 and offset = 10 means to return + * from the second page). + */ + // const offset = 1234 + /** + * A limit on the number of documents returned in the search results. + * Increasing this value above the default value of 10 can increase search + * response time. The value can be between 1 and 100. + */ + // const pageSize = 1234 + /** + * The token specifying the current offset within search results. + * See + * SearchDocumentsResponse.next_page_token google.cloud.contentwarehouse.v1.SearchDocumentsResponse.next_page_token + * for an explanation of how to obtain the next set of query results. + */ + // const pageToken = 'abc123' + /** + * The criteria determining how search results are sorted. For non-empty + * query, default is `"relevance desc"`. For empty query, default is + * `"upload_date desc"`. + * Supported options are: + * * `"relevance desc"`: By relevance descending, as determined by the API + * algorithms. + * * `"upload_date desc"`: By upload date descending. + * * `"upload_date"`: By upload date ascending. + * * `"update_date desc"`: By last updated date descending. + * * `"update_date"`: By last updated date ascending. + * * `"retrieval_importance desc"`: By retrieval importance of properties + * descending. This feature is still under development, please do not use + * unless otherwise instructed to do so. + */ + // const orderBy = 'abc123' + /** + * An expression specifying a histogram request against matching + * documents. Expression syntax is an aggregation function call with + * histogram facets and other options. + * The following aggregation functions are supported: + * * `count(string_histogram_facet)`: Count the number of matching entities + * for each distinct attribute value. + * Data types: + * * Histogram facet (aka filterable properties): Facet names with format + * <schema id>.<facet>. Facets will have the + * format of: `[a-zA-Z][a-zA-Z0-9_:/-.]`. If the facet is a child + * facet, then the parent hierarchy needs to be specified separated by + * dots in the prefix after the schema id. Thus, the format for a multi- + * level facet is: <schema id>.<parent facet name>. + * <child facet name>. Example: + * schema123.root_parent_facet.middle_facet.child_facet + * * DocumentSchemaId: (with no schema id prefix) to get + * histograms for each document type (returns the schema id path, e.g. + * projects/12345/locations/us-west/documentSchemas/abc123). + * Example expression: + * * Document type counts: + * count('DocumentSchemaId') + * * For schema id, abc123, get the counts for MORTGAGE_TYPE: + * count('abc123.MORTGAGE_TYPE') + */ + // const histogramQueries = [1,2,3,4] + /** + * Controls if the search document request requires the return of a total size + * of matched documents. See + * SearchDocumentsResponse.total_size google.cloud.contentwarehouse.v1.SearchDocumentsResponse.total_size. + * Enabling this flag may adversely impact performance. Hint: If this is + * used with pagination, set this flag on the initial query but set this + * to false on subsequent page calls (keep the total count locally). + * Defaults to false. + */ + // const requireTotalSize = true + /** + * Controls if the search document request requires the return of a total size + * of matched documents. See + * SearchDocumentsResponse.total_size google.cloud.contentwarehouse.v1.SearchDocumentsResponse.total_size. + */ + // const totalResultSize = {} + /** + * Experimental, do not use. + * The limit on the number of documents returned for the question-answering + * feature. To enable the question-answering feature, set + * DocumentQuery.is_nl_query to true. + */ + // const qaSizeLimit = 1234 + + // Imports the Contentwarehouse library + const {DocumentServiceClient} = require('@google-cloud/contentwarehouse').v1; + + // Instantiates a client + const contentwarehouseClient = new DocumentServiceClient(); + + async function callSearchDocuments() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = contentwarehouseClient.searchDocumentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callSearchDocuments(); + // [END contentwarehouse_v1_generated_DocumentService_SearchDocuments_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.set_acl.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.set_acl.js new file mode 100644 index 00000000000..ad763044022 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.set_acl.js @@ -0,0 +1,95 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(resource, policy) { + // [START contentwarehouse_v1_generated_DocumentService_SetAcl_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. REQUIRED: The resource for which the policy is being requested. + * Format for document: + * projects/{project_number}/locations/{location}/documents/{document_id}. + * Format for collection: + * projects/{project_number}/locations/{location}/collections/{collection_id}. + * Format for project: projects/{project_number}. + */ + // const resource = 'abc123' + /** + * Required. REQUIRED: The complete policy to be applied to the `resource`. + * The size of the policy is limited to a few 10s of KB. This refers to an + * Identity and Access (IAM) policy, which specifies access controls for the + * Document. + * You can set ACL with condition for projects only. + * Supported operators are: `=`, `!=`, `<`, `<=`, `>`, and `>=` where + * the left of the operator is `DocumentSchemaId` or property name and the + * right of the operator is a number or a quoted string. You must escape + * backslash (\\) and quote (\") characters. + * Boolean expressions (AND/OR) are supported up to 3 levels of nesting (for + * example, "((A AND B AND C) OR D) AND E"), a maximum of 10 comparisons are + * allowed in the expression. The expression must be < 6000 bytes in length. + * Sample condition: + * `"DocumentSchemaId = \"some schema id\" OR SchemaId.floatPropertyName + * >= 10"` + */ + // const policy = {} + /** + * The meta information collected about the end user, used to enforce access + * control for the service. + */ + // const requestMetadata = {} + /** + * For Set Project ACL only. Authorization check for end user will be ignored + * when project_owner=true. + */ + // const projectOwner = true + + // Imports the Contentwarehouse library + const {DocumentServiceClient} = require('@google-cloud/contentwarehouse').v1; + + // Instantiates a client + const contentwarehouseClient = new DocumentServiceClient(); + + async function callSetAcl() { + // Construct request + const request = { + resource, + policy, + }; + + // Run request + const response = await contentwarehouseClient.setAcl(request); + console.log(response); + } + + callSetAcl(); + // [END contentwarehouse_v1_generated_DocumentService_SetAcl_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.update_document.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.update_document.js new file mode 100644 index 00000000000..43e0dd4ce75 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.update_document.js @@ -0,0 +1,86 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name, document) { + // [START contentwarehouse_v1_generated_DocumentService_UpdateDocument_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the document to update. + * Format: + * projects/{project_number}/locations/{location}/documents/{document_id} + * or + * projects/{project_number}/locations/{location}/documents/referenceId/{reference_id}. + */ + // const name = 'abc123' + /** + * Required. The document to update. + */ + // const document = {} + /** + * The meta information collected about the end user, used to enforce access + * control for the service. + */ + // const requestMetadata = {} + /** + * Request Option for processing Cloud AI Document in Document Warehouse. + * This field offers limited support for mapping entities from Cloud AI + * Document to Warehouse Document. Please consult with product team before + * using this field and other available options. + */ + // const cloudAiDocumentOption = {} + /** + * Options for the update operation. + */ + // const updateOptions = {} + + // Imports the Contentwarehouse library + const {DocumentServiceClient} = require('@google-cloud/contentwarehouse').v1; + + // Instantiates a client + const contentwarehouseClient = new DocumentServiceClient(); + + async function callUpdateDocument() { + // Construct request + const request = { + name, + document, + }; + + // Run request + const response = await contentwarehouseClient.updateDocument(request); + console.log(response); + } + + callUpdateDocument(); + // [END contentwarehouse_v1_generated_DocumentService_UpdateDocument_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/pipeline_service.run_pipeline.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/pipeline_service.run_pipeline.js new file mode 100644 index 00000000000..e3704ceb790 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/pipeline_service.run_pipeline.js @@ -0,0 +1,86 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START contentwarehouse_v1_generated_PipelineService_RunPipeline_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name which owns the resources of the pipeline. + * Format: projects/{project_number}/locations/{location}. + */ + // const name = 'abc123' + /** + * Cloud Storage ingestion pipeline. + */ + // const gcsIngestPipeline = {} + /** + * Use DocAI processors to process documents in Cloud Storage and ingest + * them to Document Warehouse. + */ + // const gcsIngestWithDocAiProcessorsPipeline = {} + /** + * Export docuemnts from Document Warehouse to CDW for training purpose. + */ + // const exportCdwPipeline = {} + /** + * Use a DocAI processor to process documents in Document Warehouse, and + * re-ingest the updated results into Document Warehouse. + */ + // const processWithDocAiPipeline = {} + /** + * The meta information collected about the end user, used to enforce access + * control for the service. + */ + // const requestMetadata = {} + + // Imports the Contentwarehouse library + const {PipelineServiceClient} = require('@google-cloud/contentwarehouse').v1; + + // Instantiates a client + const contentwarehouseClient = new PipelineServiceClient(); + + async function callRunPipeline() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await contentwarehouseClient.runPipeline(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRunPipeline(); + // [END contentwarehouse_v1_generated_PipelineService_RunPipeline_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/rule_set_service.create_rule_set.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/rule_set_service.create_rule_set.js new file mode 100644 index 00000000000..c5465d4d8af --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/rule_set_service.create_rule_set.js @@ -0,0 +1,67 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, ruleSet) { + // [START contentwarehouse_v1_generated_RuleSetService_CreateRuleSet_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent name. + * Format: projects/{project_number}/locations/{location}. + */ + // const parent = 'abc123' + /** + * Required. The rule set to create. + */ + // const ruleSet = {} + + // Imports the Contentwarehouse library + const {RuleSetServiceClient} = require('@google-cloud/contentwarehouse').v1; + + // Instantiates a client + const contentwarehouseClient = new RuleSetServiceClient(); + + async function callCreateRuleSet() { + // Construct request + const request = { + parent, + ruleSet, + }; + + // Run request + const response = await contentwarehouseClient.createRuleSet(request); + console.log(response); + } + + callCreateRuleSet(); + // [END contentwarehouse_v1_generated_RuleSetService_CreateRuleSet_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/rule_set_service.delete_rule_set.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/rule_set_service.delete_rule_set.js new file mode 100644 index 00000000000..e7080517a33 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/rule_set_service.delete_rule_set.js @@ -0,0 +1,63 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START contentwarehouse_v1_generated_RuleSetService_DeleteRuleSet_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the rule set to delete. + * Format: + * projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}. + */ + // const name = 'abc123' + + // Imports the Contentwarehouse library + const {RuleSetServiceClient} = require('@google-cloud/contentwarehouse').v1; + + // Instantiates a client + const contentwarehouseClient = new RuleSetServiceClient(); + + async function callDeleteRuleSet() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await contentwarehouseClient.deleteRuleSet(request); + console.log(response); + } + + callDeleteRuleSet(); + // [END contentwarehouse_v1_generated_RuleSetService_DeleteRuleSet_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/rule_set_service.get_rule_set.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/rule_set_service.get_rule_set.js new file mode 100644 index 00000000000..34404dbad31 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/rule_set_service.get_rule_set.js @@ -0,0 +1,63 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START contentwarehouse_v1_generated_RuleSetService_GetRuleSet_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the rule set to retrieve. + * Format: + * projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}. + */ + // const name = 'abc123' + + // Imports the Contentwarehouse library + const {RuleSetServiceClient} = require('@google-cloud/contentwarehouse').v1; + + // Instantiates a client + const contentwarehouseClient = new RuleSetServiceClient(); + + async function callGetRuleSet() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await contentwarehouseClient.getRuleSet(request); + console.log(response); + } + + callGetRuleSet(); + // [END contentwarehouse_v1_generated_RuleSetService_GetRuleSet_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/rule_set_service.list_rule_sets.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/rule_set_service.list_rule_sets.js new file mode 100644 index 00000000000..ade3218846a --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/rule_set_service.list_rule_sets.js @@ -0,0 +1,78 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START contentwarehouse_v1_generated_RuleSetService_ListRuleSets_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, which owns this collection of document. + * Format: projects/{project_number}/locations/{location}. + */ + // const parent = 'abc123' + /** + * The maximum number of rule sets to return. The service may return + * fewer than this value. + * If unspecified, at most 50 rule sets will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListRuleSets` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListRuleSets` + * must match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Contentwarehouse library + const {RuleSetServiceClient} = require('@google-cloud/contentwarehouse').v1; + + // Instantiates a client + const contentwarehouseClient = new RuleSetServiceClient(); + + async function callListRuleSets() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = contentwarehouseClient.listRuleSetsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListRuleSets(); + // [END contentwarehouse_v1_generated_RuleSetService_ListRuleSets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/rule_set_service.update_rule_set.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/rule_set_service.update_rule_set.js new file mode 100644 index 00000000000..38a0adf11bc --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/rule_set_service.update_rule_set.js @@ -0,0 +1,68 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name, ruleSet) { + // [START contentwarehouse_v1_generated_RuleSetService_UpdateRuleSet_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the rule set to update. + * Format: + * projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}. + */ + // const name = 'abc123' + /** + * Required. The rule set to update. + */ + // const ruleSet = {} + + // Imports the Contentwarehouse library + const {RuleSetServiceClient} = require('@google-cloud/contentwarehouse').v1; + + // Instantiates a client + const contentwarehouseClient = new RuleSetServiceClient(); + + async function callUpdateRuleSet() { + // Construct request + const request = { + name, + ruleSet, + }; + + // Run request + const response = await contentwarehouseClient.updateRuleSet(request); + console.log(response); + } + + callUpdateRuleSet(); + // [END contentwarehouse_v1_generated_RuleSetService_UpdateRuleSet_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/snippet_metadata_google.cloud.contentwarehouse.v1.json b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/snippet_metadata_google.cloud.contentwarehouse.v1.json new file mode 100644 index 00000000000..52a33abeeea --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/snippet_metadata_google.cloud.contentwarehouse.v1.json @@ -0,0 +1,1343 @@ +{ + "clientLibrary": { + "name": "nodejs-contentwarehouse", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.contentwarehouse.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "contentwarehouse_v1_generated_DocumentLinkService_ListLinkedTargets_async", + "title": "DocumentLinkService listLinkedTargets Sample", + "origin": "API_DEFINITION", + "description": " Return all target document-links from the document.", + "canonical": true, + "file": "document_link_service.list_linked_targets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListLinkedTargets", + "fullName": "google.cloud.contentwarehouse.v1.DocumentLinkService.ListLinkedTargets", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "request_metadata", + "type": ".google.cloud.contentwarehouse.v1.RequestMetadata" + } + ], + "resultType": ".google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse", + "client": { + "shortName": "DocumentLinkServiceClient", + "fullName": "google.cloud.contentwarehouse.v1.DocumentLinkServiceClient" + }, + "method": { + "shortName": "ListLinkedTargets", + "fullName": "google.cloud.contentwarehouse.v1.DocumentLinkService.ListLinkedTargets", + "service": { + "shortName": "DocumentLinkService", + "fullName": "google.cloud.contentwarehouse.v1.DocumentLinkService" + } + } + } + }, + { + "regionTag": "contentwarehouse_v1_generated_DocumentLinkService_ListLinkedSources_async", + "title": "DocumentLinkService listLinkedSources Sample", + "origin": "API_DEFINITION", + "description": " Return all source document-links from the document.", + "canonical": true, + "file": "document_link_service.list_linked_sources.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListLinkedSources", + "fullName": "google.cloud.contentwarehouse.v1.DocumentLinkService.ListLinkedSources", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "request_metadata", + "type": ".google.cloud.contentwarehouse.v1.RequestMetadata" + } + ], + "resultType": ".google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse", + "client": { + "shortName": "DocumentLinkServiceClient", + "fullName": "google.cloud.contentwarehouse.v1.DocumentLinkServiceClient" + }, + "method": { + "shortName": "ListLinkedSources", + "fullName": "google.cloud.contentwarehouse.v1.DocumentLinkService.ListLinkedSources", + "service": { + "shortName": "DocumentLinkService", + "fullName": "google.cloud.contentwarehouse.v1.DocumentLinkService" + } + } + } + }, + { + "regionTag": "contentwarehouse_v1_generated_DocumentLinkService_CreateDocumentLink_async", + "title": "DocumentLinkService createDocumentLink Sample", + "origin": "API_DEFINITION", + "description": " Create a link between a source document and a target document.", + "canonical": true, + "file": "document_link_service.create_document_link.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateDocumentLink", + "fullName": "google.cloud.contentwarehouse.v1.DocumentLinkService.CreateDocumentLink", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "document_link", + "type": ".google.cloud.contentwarehouse.v1.DocumentLink" + }, + { + "name": "request_metadata", + "type": ".google.cloud.contentwarehouse.v1.RequestMetadata" + } + ], + "resultType": ".google.cloud.contentwarehouse.v1.DocumentLink", + "client": { + "shortName": "DocumentLinkServiceClient", + "fullName": "google.cloud.contentwarehouse.v1.DocumentLinkServiceClient" + }, + "method": { + "shortName": "CreateDocumentLink", + "fullName": "google.cloud.contentwarehouse.v1.DocumentLinkService.CreateDocumentLink", + "service": { + "shortName": "DocumentLinkService", + "fullName": "google.cloud.contentwarehouse.v1.DocumentLinkService" + } + } + } + }, + { + "regionTag": "contentwarehouse_v1_generated_DocumentLinkService_DeleteDocumentLink_async", + "title": "DocumentLinkService deleteDocumentLink Sample", + "origin": "API_DEFINITION", + "description": " Remove the link between the source and target documents.", + "canonical": true, + "file": "document_link_service.delete_document_link.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteDocumentLink", + "fullName": "google.cloud.contentwarehouse.v1.DocumentLinkService.DeleteDocumentLink", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_metadata", + "type": ".google.cloud.contentwarehouse.v1.RequestMetadata" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "DocumentLinkServiceClient", + "fullName": "google.cloud.contentwarehouse.v1.DocumentLinkServiceClient" + }, + "method": { + "shortName": "DeleteDocumentLink", + "fullName": "google.cloud.contentwarehouse.v1.DocumentLinkService.DeleteDocumentLink", + "service": { + "shortName": "DocumentLinkService", + "fullName": "google.cloud.contentwarehouse.v1.DocumentLinkService" + } + } + } + }, + { + "regionTag": "contentwarehouse_v1_generated_DocumentSchemaService_CreateDocumentSchema_async", + "title": "DocumentLinkService createDocumentSchema Sample", + "origin": "API_DEFINITION", + "description": " Creates a document schema.", + "canonical": true, + "file": "document_schema_service.create_document_schema.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateDocumentSchema", + "fullName": "google.cloud.contentwarehouse.v1.DocumentSchemaService.CreateDocumentSchema", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "document_schema", + "type": ".google.cloud.contentwarehouse.v1.DocumentSchema" + } + ], + "resultType": ".google.cloud.contentwarehouse.v1.DocumentSchema", + "client": { + "shortName": "DocumentSchemaServiceClient", + "fullName": "google.cloud.contentwarehouse.v1.DocumentSchemaServiceClient" + }, + "method": { + "shortName": "CreateDocumentSchema", + "fullName": "google.cloud.contentwarehouse.v1.DocumentSchemaService.CreateDocumentSchema", + "service": { + "shortName": "DocumentSchemaService", + "fullName": "google.cloud.contentwarehouse.v1.DocumentSchemaService" + } + } + } + }, + { + "regionTag": "contentwarehouse_v1_generated_DocumentSchemaService_UpdateDocumentSchema_async", + "title": "DocumentLinkService updateDocumentSchema Sample", + "origin": "API_DEFINITION", + "description": " Updates a Document Schema. Returns INVALID_ARGUMENT if the name of the Document Schema is non-empty and does not equal the existing name. Supports only appending new properties, adding new ENUM possible values, and updating the [EnumTypeOptions.validation_check_disabled][google.cloud.contentwarehouse.v1.EnumTypeOptions.validation_check_disabled] flag for ENUM possible values. Updating existing properties will result into INVALID_ARGUMENT.", + "canonical": true, + "file": "document_schema_service.update_document_schema.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateDocumentSchema", + "fullName": "google.cloud.contentwarehouse.v1.DocumentSchemaService.UpdateDocumentSchema", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "document_schema", + "type": ".google.cloud.contentwarehouse.v1.DocumentSchema" + } + ], + "resultType": ".google.cloud.contentwarehouse.v1.DocumentSchema", + "client": { + "shortName": "DocumentSchemaServiceClient", + "fullName": "google.cloud.contentwarehouse.v1.DocumentSchemaServiceClient" + }, + "method": { + "shortName": "UpdateDocumentSchema", + "fullName": "google.cloud.contentwarehouse.v1.DocumentSchemaService.UpdateDocumentSchema", + "service": { + "shortName": "DocumentSchemaService", + "fullName": "google.cloud.contentwarehouse.v1.DocumentSchemaService" + } + } + } + }, + { + "regionTag": "contentwarehouse_v1_generated_DocumentSchemaService_GetDocumentSchema_async", + "title": "DocumentLinkService getDocumentSchema Sample", + "origin": "API_DEFINITION", + "description": " Gets a document schema. Returns NOT_FOUND if the document schema does not exist.", + "canonical": true, + "file": "document_schema_service.get_document_schema.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDocumentSchema", + "fullName": "google.cloud.contentwarehouse.v1.DocumentSchemaService.GetDocumentSchema", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.contentwarehouse.v1.DocumentSchema", + "client": { + "shortName": "DocumentSchemaServiceClient", + "fullName": "google.cloud.contentwarehouse.v1.DocumentSchemaServiceClient" + }, + "method": { + "shortName": "GetDocumentSchema", + "fullName": "google.cloud.contentwarehouse.v1.DocumentSchemaService.GetDocumentSchema", + "service": { + "shortName": "DocumentSchemaService", + "fullName": "google.cloud.contentwarehouse.v1.DocumentSchemaService" + } + } + } + }, + { + "regionTag": "contentwarehouse_v1_generated_DocumentSchemaService_DeleteDocumentSchema_async", + "title": "DocumentLinkService deleteDocumentSchema Sample", + "origin": "API_DEFINITION", + "description": " Deletes a document schema. Returns NOT_FOUND if the document schema does not exist. Returns BAD_REQUEST if the document schema has documents depending on it.", + "canonical": true, + "file": "document_schema_service.delete_document_schema.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteDocumentSchema", + "fullName": "google.cloud.contentwarehouse.v1.DocumentSchemaService.DeleteDocumentSchema", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "DocumentSchemaServiceClient", + "fullName": "google.cloud.contentwarehouse.v1.DocumentSchemaServiceClient" + }, + "method": { + "shortName": "DeleteDocumentSchema", + "fullName": "google.cloud.contentwarehouse.v1.DocumentSchemaService.DeleteDocumentSchema", + "service": { + "shortName": "DocumentSchemaService", + "fullName": "google.cloud.contentwarehouse.v1.DocumentSchemaService" + } + } + } + }, + { + "regionTag": "contentwarehouse_v1_generated_DocumentSchemaService_ListDocumentSchemas_async", + "title": "DocumentLinkService listDocumentSchemas Sample", + "origin": "API_DEFINITION", + "description": " Lists document schemas.", + "canonical": true, + "file": "document_schema_service.list_document_schemas.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListDocumentSchemas", + "fullName": "google.cloud.contentwarehouse.v1.DocumentSchemaService.ListDocumentSchemas", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse", + "client": { + "shortName": "DocumentSchemaServiceClient", + "fullName": "google.cloud.contentwarehouse.v1.DocumentSchemaServiceClient" + }, + "method": { + "shortName": "ListDocumentSchemas", + "fullName": "google.cloud.contentwarehouse.v1.DocumentSchemaService.ListDocumentSchemas", + "service": { + "shortName": "DocumentSchemaService", + "fullName": "google.cloud.contentwarehouse.v1.DocumentSchemaService" + } + } + } + }, + { + "regionTag": "contentwarehouse_v1_generated_DocumentService_CreateDocument_async", + "title": "DocumentLinkService createDocument Sample", + "origin": "API_DEFINITION", + "description": " Creates a document.", + "canonical": true, + "file": "document_service.create_document.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 86, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateDocument", + "fullName": "google.cloud.contentwarehouse.v1.DocumentService.CreateDocument", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "document", + "type": ".google.cloud.contentwarehouse.v1.Document" + }, + { + "name": "request_metadata", + "type": ".google.cloud.contentwarehouse.v1.RequestMetadata" + }, + { + "name": "policy", + "type": ".google.iam.v1.Policy" + }, + { + "name": "cloud_ai_document_option", + "type": ".google.cloud.contentwarehouse.v1.CloudAIDocumentOption" + }, + { + "name": "create_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.contentwarehouse.v1.CreateDocumentResponse", + "client": { + "shortName": "DocumentServiceClient", + "fullName": "google.cloud.contentwarehouse.v1.DocumentServiceClient" + }, + "method": { + "shortName": "CreateDocument", + "fullName": "google.cloud.contentwarehouse.v1.DocumentService.CreateDocument", + "service": { + "shortName": "DocumentService", + "fullName": "google.cloud.contentwarehouse.v1.DocumentService" + } + } + } + }, + { + "regionTag": "contentwarehouse_v1_generated_DocumentService_GetDocument_async", + "title": "DocumentLinkService getDocument Sample", + "origin": "API_DEFINITION", + "description": " Gets a document. Returns NOT_FOUND if the document does not exist.", + "canonical": true, + "file": "document_service.get_document.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDocument", + "fullName": "google.cloud.contentwarehouse.v1.DocumentService.GetDocument", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_metadata", + "type": ".google.cloud.contentwarehouse.v1.RequestMetadata" + } + ], + "resultType": ".google.cloud.contentwarehouse.v1.Document", + "client": { + "shortName": "DocumentServiceClient", + "fullName": "google.cloud.contentwarehouse.v1.DocumentServiceClient" + }, + "method": { + "shortName": "GetDocument", + "fullName": "google.cloud.contentwarehouse.v1.DocumentService.GetDocument", + "service": { + "shortName": "DocumentService", + "fullName": "google.cloud.contentwarehouse.v1.DocumentService" + } + } + } + }, + { + "regionTag": "contentwarehouse_v1_generated_DocumentService_UpdateDocument_async", + "title": "DocumentLinkService updateDocument Sample", + "origin": "API_DEFINITION", + "description": " Updates a document. Returns INVALID_ARGUMENT if the name of the document is non-empty and does not equal the existing name.", + "canonical": true, + "file": "document_service.update_document.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateDocument", + "fullName": "google.cloud.contentwarehouse.v1.DocumentService.UpdateDocument", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "document", + "type": ".google.cloud.contentwarehouse.v1.Document" + }, + { + "name": "request_metadata", + "type": ".google.cloud.contentwarehouse.v1.RequestMetadata" + }, + { + "name": "cloud_ai_document_option", + "type": ".google.cloud.contentwarehouse.v1.CloudAIDocumentOption" + }, + { + "name": "update_options", + "type": ".google.cloud.contentwarehouse.v1.UpdateOptions" + } + ], + "resultType": ".google.cloud.contentwarehouse.v1.UpdateDocumentResponse", + "client": { + "shortName": "DocumentServiceClient", + "fullName": "google.cloud.contentwarehouse.v1.DocumentServiceClient" + }, + "method": { + "shortName": "UpdateDocument", + "fullName": "google.cloud.contentwarehouse.v1.DocumentService.UpdateDocument", + "service": { + "shortName": "DocumentService", + "fullName": "google.cloud.contentwarehouse.v1.DocumentService" + } + } + } + }, + { + "regionTag": "contentwarehouse_v1_generated_DocumentService_DeleteDocument_async", + "title": "DocumentLinkService deleteDocument Sample", + "origin": "API_DEFINITION", + "description": " Deletes a document. Returns NOT_FOUND if the document does not exist.", + "canonical": true, + "file": "document_service.delete_document.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteDocument", + "fullName": "google.cloud.contentwarehouse.v1.DocumentService.DeleteDocument", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_metadata", + "type": ".google.cloud.contentwarehouse.v1.RequestMetadata" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "DocumentServiceClient", + "fullName": "google.cloud.contentwarehouse.v1.DocumentServiceClient" + }, + "method": { + "shortName": "DeleteDocument", + "fullName": "google.cloud.contentwarehouse.v1.DocumentService.DeleteDocument", + "service": { + "shortName": "DocumentService", + "fullName": "google.cloud.contentwarehouse.v1.DocumentService" + } + } + } + }, + { + "regionTag": "contentwarehouse_v1_generated_DocumentService_SearchDocuments_async", + "title": "DocumentLinkService searchDocuments Sample", + "origin": "API_DEFINITION", + "description": " Searches for documents using provided [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest]. This call only returns documents that the caller has permission to search against.", + "canonical": true, + "file": "document_service.search_documents.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 156, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SearchDocuments", + "fullName": "google.cloud.contentwarehouse.v1.DocumentService.SearchDocuments", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "request_metadata", + "type": ".google.cloud.contentwarehouse.v1.RequestMetadata" + }, + { + "name": "document_query", + "type": ".google.cloud.contentwarehouse.v1.DocumentQuery" + }, + { + "name": "offset", + "type": "TYPE_INT32" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "histogram_queries", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "require_total_size", + "type": "TYPE_BOOL" + }, + { + "name": "total_result_size", + "type": ".google.cloud.contentwarehouse.v1.SearchDocumentsRequest.TotalResultSize" + }, + { + "name": "qa_size_limit", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.contentwarehouse.v1.SearchDocumentsResponse", + "client": { + "shortName": "DocumentServiceClient", + "fullName": "google.cloud.contentwarehouse.v1.DocumentServiceClient" + }, + "method": { + "shortName": "SearchDocuments", + "fullName": "google.cloud.contentwarehouse.v1.DocumentService.SearchDocuments", + "service": { + "shortName": "DocumentService", + "fullName": "google.cloud.contentwarehouse.v1.DocumentService" + } + } + } + }, + { + "regionTag": "contentwarehouse_v1_generated_DocumentService_LockDocument_async", + "title": "DocumentLinkService lockDocument Sample", + "origin": "API_DEFINITION", + "description": " Lock the document so the document cannot be updated by other users.", + "canonical": true, + "file": "document_service.lock_document.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "LockDocument", + "fullName": "google.cloud.contentwarehouse.v1.DocumentService.LockDocument", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "collection_id", + "type": "TYPE_STRING" + }, + { + "name": "locking_user", + "type": ".google.cloud.contentwarehouse.v1.UserInfo" + } + ], + "resultType": ".google.cloud.contentwarehouse.v1.Document", + "client": { + "shortName": "DocumentServiceClient", + "fullName": "google.cloud.contentwarehouse.v1.DocumentServiceClient" + }, + "method": { + "shortName": "LockDocument", + "fullName": "google.cloud.contentwarehouse.v1.DocumentService.LockDocument", + "service": { + "shortName": "DocumentService", + "fullName": "google.cloud.contentwarehouse.v1.DocumentService" + } + } + } + }, + { + "regionTag": "contentwarehouse_v1_generated_DocumentService_FetchAcl_async", + "title": "DocumentLinkService fetchAcl Sample", + "origin": "API_DEFINITION", + "description": " Gets the access control policy for a resource. Returns NOT_FOUND error if the resource does not exist. Returns an empty policy if the resource exists but does not have a policy set.", + "canonical": true, + "file": "document_service.fetch_acl.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "FetchAcl", + "fullName": "google.cloud.contentwarehouse.v1.DocumentService.FetchAcl", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "request_metadata", + "type": ".google.cloud.contentwarehouse.v1.RequestMetadata" + }, + { + "name": "project_owner", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.contentwarehouse.v1.FetchAclResponse", + "client": { + "shortName": "DocumentServiceClient", + "fullName": "google.cloud.contentwarehouse.v1.DocumentServiceClient" + }, + "method": { + "shortName": "FetchAcl", + "fullName": "google.cloud.contentwarehouse.v1.DocumentService.FetchAcl", + "service": { + "shortName": "DocumentService", + "fullName": "google.cloud.contentwarehouse.v1.DocumentService" + } + } + } + }, + { + "regionTag": "contentwarehouse_v1_generated_DocumentService_SetAcl_async", + "title": "DocumentLinkService setAcl Sample", + "origin": "API_DEFINITION", + "description": " Sets the access control policy for a resource. Replaces any existing policy.", + "canonical": true, + "file": "document_service.set_acl.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 87, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetAcl", + "fullName": "google.cloud.contentwarehouse.v1.DocumentService.SetAcl", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "policy", + "type": ".google.iam.v1.Policy" + }, + { + "name": "request_metadata", + "type": ".google.cloud.contentwarehouse.v1.RequestMetadata" + }, + { + "name": "project_owner", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.contentwarehouse.v1.SetAclResponse", + "client": { + "shortName": "DocumentServiceClient", + "fullName": "google.cloud.contentwarehouse.v1.DocumentServiceClient" + }, + "method": { + "shortName": "SetAcl", + "fullName": "google.cloud.contentwarehouse.v1.DocumentService.SetAcl", + "service": { + "shortName": "DocumentService", + "fullName": "google.cloud.contentwarehouse.v1.DocumentService" + } + } + } + }, + { + "regionTag": "contentwarehouse_v1_generated_PipelineService_RunPipeline_async", + "title": "DocumentLinkService runPipeline Sample", + "origin": "API_DEFINITION", + "description": " Run a predefined pipeline.", + "canonical": true, + "file": "pipeline_service.run_pipeline.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RunPipeline", + "fullName": "google.cloud.contentwarehouse.v1.PipelineService.RunPipeline", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "gcs_ingest_pipeline", + "type": ".google.cloud.contentwarehouse.v1.GcsIngestPipeline" + }, + { + "name": "gcs_ingest_with_doc_ai_processors_pipeline", + "type": ".google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline" + }, + { + "name": "export_cdw_pipeline", + "type": ".google.cloud.contentwarehouse.v1.ExportToCdwPipeline" + }, + { + "name": "process_with_doc_ai_pipeline", + "type": ".google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline" + }, + { + "name": "request_metadata", + "type": ".google.cloud.contentwarehouse.v1.RequestMetadata" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "PipelineServiceClient", + "fullName": "google.cloud.contentwarehouse.v1.PipelineServiceClient" + }, + "method": { + "shortName": "RunPipeline", + "fullName": "google.cloud.contentwarehouse.v1.PipelineService.RunPipeline", + "service": { + "shortName": "PipelineService", + "fullName": "google.cloud.contentwarehouse.v1.PipelineService" + } + } + } + }, + { + "regionTag": "contentwarehouse_v1_generated_RuleSetService_CreateRuleSet_async", + "title": "DocumentLinkService createRuleSet Sample", + "origin": "API_DEFINITION", + "description": " Creates a ruleset.", + "canonical": true, + "file": "rule_set_service.create_rule_set.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateRuleSet", + "fullName": "google.cloud.contentwarehouse.v1.RuleSetService.CreateRuleSet", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "rule_set", + "type": ".google.cloud.contentwarehouse.v1.RuleSet" + } + ], + "resultType": ".google.cloud.contentwarehouse.v1.RuleSet", + "client": { + "shortName": "RuleSetServiceClient", + "fullName": "google.cloud.contentwarehouse.v1.RuleSetServiceClient" + }, + "method": { + "shortName": "CreateRuleSet", + "fullName": "google.cloud.contentwarehouse.v1.RuleSetService.CreateRuleSet", + "service": { + "shortName": "RuleSetService", + "fullName": "google.cloud.contentwarehouse.v1.RuleSetService" + } + } + } + }, + { + "regionTag": "contentwarehouse_v1_generated_RuleSetService_GetRuleSet_async", + "title": "DocumentLinkService getRuleSet Sample", + "origin": "API_DEFINITION", + "description": " Gets a ruleset. Returns NOT_FOUND if the ruleset does not exist.", + "canonical": true, + "file": "rule_set_service.get_rule_set.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetRuleSet", + "fullName": "google.cloud.contentwarehouse.v1.RuleSetService.GetRuleSet", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.contentwarehouse.v1.RuleSet", + "client": { + "shortName": "RuleSetServiceClient", + "fullName": "google.cloud.contentwarehouse.v1.RuleSetServiceClient" + }, + "method": { + "shortName": "GetRuleSet", + "fullName": "google.cloud.contentwarehouse.v1.RuleSetService.GetRuleSet", + "service": { + "shortName": "RuleSetService", + "fullName": "google.cloud.contentwarehouse.v1.RuleSetService" + } + } + } + }, + { + "regionTag": "contentwarehouse_v1_generated_RuleSetService_UpdateRuleSet_async", + "title": "DocumentLinkService updateRuleSet Sample", + "origin": "API_DEFINITION", + "description": " Updates a ruleset. Returns INVALID_ARGUMENT if the name of the ruleset is non-empty and does not equal the existing name.", + "canonical": true, + "file": "rule_set_service.update_rule_set.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateRuleSet", + "fullName": "google.cloud.contentwarehouse.v1.RuleSetService.UpdateRuleSet", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "rule_set", + "type": ".google.cloud.contentwarehouse.v1.RuleSet" + } + ], + "resultType": ".google.cloud.contentwarehouse.v1.RuleSet", + "client": { + "shortName": "RuleSetServiceClient", + "fullName": "google.cloud.contentwarehouse.v1.RuleSetServiceClient" + }, + "method": { + "shortName": "UpdateRuleSet", + "fullName": "google.cloud.contentwarehouse.v1.RuleSetService.UpdateRuleSet", + "service": { + "shortName": "RuleSetService", + "fullName": "google.cloud.contentwarehouse.v1.RuleSetService" + } + } + } + }, + { + "regionTag": "contentwarehouse_v1_generated_RuleSetService_DeleteRuleSet_async", + "title": "DocumentLinkService deleteRuleSet Sample", + "origin": "API_DEFINITION", + "description": " Deletes a ruleset. Returns NOT_FOUND if the document does not exist.", + "canonical": true, + "file": "rule_set_service.delete_rule_set.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteRuleSet", + "fullName": "google.cloud.contentwarehouse.v1.RuleSetService.DeleteRuleSet", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "RuleSetServiceClient", + "fullName": "google.cloud.contentwarehouse.v1.RuleSetServiceClient" + }, + "method": { + "shortName": "DeleteRuleSet", + "fullName": "google.cloud.contentwarehouse.v1.RuleSetService.DeleteRuleSet", + "service": { + "shortName": "RuleSetService", + "fullName": "google.cloud.contentwarehouse.v1.RuleSetService" + } + } + } + }, + { + "regionTag": "contentwarehouse_v1_generated_RuleSetService_ListRuleSets_async", + "title": "DocumentLinkService listRuleSets Sample", + "origin": "API_DEFINITION", + "description": " Lists rulesets.", + "canonical": true, + "file": "rule_set_service.list_rule_sets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListRuleSets", + "fullName": "google.cloud.contentwarehouse.v1.RuleSetService.ListRuleSets", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.contentwarehouse.v1.ListRuleSetsResponse", + "client": { + "shortName": "RuleSetServiceClient", + "fullName": "google.cloud.contentwarehouse.v1.RuleSetServiceClient" + }, + "method": { + "shortName": "ListRuleSets", + "fullName": "google.cloud.contentwarehouse.v1.RuleSetService.ListRuleSets", + "service": { + "shortName": "RuleSetService", + "fullName": "google.cloud.contentwarehouse.v1.RuleSetService" + } + } + } + }, + { + "regionTag": "contentwarehouse_v1_generated_SynonymSetService_CreateSynonymSet_async", + "title": "DocumentLinkService createSynonymSet Sample", + "origin": "API_DEFINITION", + "description": " Creates a SynonymSet for a single context. Throws an ALREADY_EXISTS exception if a synonymset already exists for the context.", + "canonical": true, + "file": "synonym_set_service.create_synonym_set.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateSynonymSet", + "fullName": "google.cloud.contentwarehouse.v1.SynonymSetService.CreateSynonymSet", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "synonym_set", + "type": ".google.cloud.contentwarehouse.v1.SynonymSet" + } + ], + "resultType": ".google.cloud.contentwarehouse.v1.SynonymSet", + "client": { + "shortName": "SynonymSetServiceClient", + "fullName": "google.cloud.contentwarehouse.v1.SynonymSetServiceClient" + }, + "method": { + "shortName": "CreateSynonymSet", + "fullName": "google.cloud.contentwarehouse.v1.SynonymSetService.CreateSynonymSet", + "service": { + "shortName": "SynonymSetService", + "fullName": "google.cloud.contentwarehouse.v1.SynonymSetService" + } + } + } + }, + { + "regionTag": "contentwarehouse_v1_generated_SynonymSetService_GetSynonymSet_async", + "title": "DocumentLinkService getSynonymSet Sample", + "origin": "API_DEFINITION", + "description": " Gets a SynonymSet for a particular context. Throws a NOT_FOUND exception if the Synonymset does not exist", + "canonical": true, + "file": "synonym_set_service.get_synonym_set.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSynonymSet", + "fullName": "google.cloud.contentwarehouse.v1.SynonymSetService.GetSynonymSet", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.contentwarehouse.v1.SynonymSet", + "client": { + "shortName": "SynonymSetServiceClient", + "fullName": "google.cloud.contentwarehouse.v1.SynonymSetServiceClient" + }, + "method": { + "shortName": "GetSynonymSet", + "fullName": "google.cloud.contentwarehouse.v1.SynonymSetService.GetSynonymSet", + "service": { + "shortName": "SynonymSetService", + "fullName": "google.cloud.contentwarehouse.v1.SynonymSetService" + } + } + } + }, + { + "regionTag": "contentwarehouse_v1_generated_SynonymSetService_UpdateSynonymSet_async", + "title": "DocumentLinkService updateSynonymSet Sample", + "origin": "API_DEFINITION", + "description": " Remove the existing SynonymSet for the context and replaces it with a new one. Throws a NOT_FOUND exception if the SynonymSet is not found.", + "canonical": true, + "file": "synonym_set_service.update_synonym_set.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateSynonymSet", + "fullName": "google.cloud.contentwarehouse.v1.SynonymSetService.UpdateSynonymSet", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "synonym_set", + "type": ".google.cloud.contentwarehouse.v1.SynonymSet" + } + ], + "resultType": ".google.cloud.contentwarehouse.v1.SynonymSet", + "client": { + "shortName": "SynonymSetServiceClient", + "fullName": "google.cloud.contentwarehouse.v1.SynonymSetServiceClient" + }, + "method": { + "shortName": "UpdateSynonymSet", + "fullName": "google.cloud.contentwarehouse.v1.SynonymSetService.UpdateSynonymSet", + "service": { + "shortName": "SynonymSetService", + "fullName": "google.cloud.contentwarehouse.v1.SynonymSetService" + } + } + } + }, + { + "regionTag": "contentwarehouse_v1_generated_SynonymSetService_DeleteSynonymSet_async", + "title": "DocumentLinkService deleteSynonymSet Sample", + "origin": "API_DEFINITION", + "description": " Deletes a SynonymSet for a given context. Throws a NOT_FOUND exception if the SynonymSet is not found.", + "canonical": true, + "file": "synonym_set_service.delete_synonym_set.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteSynonymSet", + "fullName": "google.cloud.contentwarehouse.v1.SynonymSetService.DeleteSynonymSet", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "SynonymSetServiceClient", + "fullName": "google.cloud.contentwarehouse.v1.SynonymSetServiceClient" + }, + "method": { + "shortName": "DeleteSynonymSet", + "fullName": "google.cloud.contentwarehouse.v1.SynonymSetService.DeleteSynonymSet", + "service": { + "shortName": "SynonymSetService", + "fullName": "google.cloud.contentwarehouse.v1.SynonymSetService" + } + } + } + }, + { + "regionTag": "contentwarehouse_v1_generated_SynonymSetService_ListSynonymSets_async", + "title": "DocumentLinkService listSynonymSets Sample", + "origin": "API_DEFINITION", + "description": " Returns all SynonymSets (for all contexts) for the specified location.", + "canonical": true, + "file": "synonym_set_service.list_synonym_sets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListSynonymSets", + "fullName": "google.cloud.contentwarehouse.v1.SynonymSetService.ListSynonymSets", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.contentwarehouse.v1.ListSynonymSetsResponse", + "client": { + "shortName": "SynonymSetServiceClient", + "fullName": "google.cloud.contentwarehouse.v1.SynonymSetServiceClient" + }, + "method": { + "shortName": "ListSynonymSets", + "fullName": "google.cloud.contentwarehouse.v1.SynonymSetService.ListSynonymSets", + "service": { + "shortName": "SynonymSetService", + "fullName": "google.cloud.contentwarehouse.v1.SynonymSetService" + } + } + } + } + ] +} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/synonym_set_service.create_synonym_set.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/synonym_set_service.create_synonym_set.js new file mode 100644 index 00000000000..8298b8b04b6 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/synonym_set_service.create_synonym_set.js @@ -0,0 +1,67 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, synonymSet) { + // [START contentwarehouse_v1_generated_SynonymSetService_CreateSynonymSet_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent name. + * Format: projects/{project_number}/locations/{location}. + */ + // const parent = 'abc123' + /** + * Required. The synonymSet to be created for a context + */ + // const synonymSet = {} + + // Imports the Contentwarehouse library + const {SynonymSetServiceClient} = require('@google-cloud/contentwarehouse').v1; + + // Instantiates a client + const contentwarehouseClient = new SynonymSetServiceClient(); + + async function callCreateSynonymSet() { + // Construct request + const request = { + parent, + synonymSet, + }; + + // Run request + const response = await contentwarehouseClient.createSynonymSet(request); + console.log(response); + } + + callCreateSynonymSet(); + // [END contentwarehouse_v1_generated_SynonymSetService_CreateSynonymSet_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/synonym_set_service.delete_synonym_set.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/synonym_set_service.delete_synonym_set.js new file mode 100644 index 00000000000..e358c275e31 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/synonym_set_service.delete_synonym_set.js @@ -0,0 +1,63 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START contentwarehouse_v1_generated_SynonymSetService_DeleteSynonymSet_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the synonymSet to delete + * Format: + * projects/{project_number}/locations/{location}/synonymSets/{context}. + */ + // const name = 'abc123' + + // Imports the Contentwarehouse library + const {SynonymSetServiceClient} = require('@google-cloud/contentwarehouse').v1; + + // Instantiates a client + const contentwarehouseClient = new SynonymSetServiceClient(); + + async function callDeleteSynonymSet() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await contentwarehouseClient.deleteSynonymSet(request); + console.log(response); + } + + callDeleteSynonymSet(); + // [END contentwarehouse_v1_generated_SynonymSetService_DeleteSynonymSet_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/synonym_set_service.get_synonym_set.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/synonym_set_service.get_synonym_set.js new file mode 100644 index 00000000000..cc7a7735a6d --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/synonym_set_service.get_synonym_set.js @@ -0,0 +1,63 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START contentwarehouse_v1_generated_SynonymSetService_GetSynonymSet_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the synonymSet to retrieve + * Format: + * projects/{project_number}/locations/{location}/synonymSets/{context}. + */ + // const name = 'abc123' + + // Imports the Contentwarehouse library + const {SynonymSetServiceClient} = require('@google-cloud/contentwarehouse').v1; + + // Instantiates a client + const contentwarehouseClient = new SynonymSetServiceClient(); + + async function callGetSynonymSet() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await contentwarehouseClient.getSynonymSet(request); + console.log(response); + } + + callGetSynonymSet(); + // [END contentwarehouse_v1_generated_SynonymSetService_GetSynonymSet_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/synonym_set_service.list_synonym_sets.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/synonym_set_service.list_synonym_sets.js new file mode 100644 index 00000000000..3b702ce999c --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/synonym_set_service.list_synonym_sets.js @@ -0,0 +1,78 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START contentwarehouse_v1_generated_SynonymSetService_ListSynonymSets_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent name. + * Format: projects/{project_number}/locations/{location}. + */ + // const parent = 'abc123' + /** + * The maximum number of synonymSets to return. The service may return + * fewer than this value. + * If unspecified, at most 50 rule sets will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListSynonymSets` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListSynonymSets` + * must match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Contentwarehouse library + const {SynonymSetServiceClient} = require('@google-cloud/contentwarehouse').v1; + + // Instantiates a client + const contentwarehouseClient = new SynonymSetServiceClient(); + + async function callListSynonymSets() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = contentwarehouseClient.listSynonymSetsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListSynonymSets(); + // [END contentwarehouse_v1_generated_SynonymSetService_ListSynonymSets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/synonym_set_service.update_synonym_set.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/synonym_set_service.update_synonym_set.js new file mode 100644 index 00000000000..18ee417fc8f --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/synonym_set_service.update_synonym_set.js @@ -0,0 +1,68 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name, synonymSet) { + // [START contentwarehouse_v1_generated_SynonymSetService_UpdateSynonymSet_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the synonymSet to update + * Format: + * projects/{project_number}/locations/{location}/synonymSets/{context}. + */ + // const name = 'abc123' + /** + * Required. The synonymSet to be updated for the customer + */ + // const synonymSet = {} + + // Imports the Contentwarehouse library + const {SynonymSetServiceClient} = require('@google-cloud/contentwarehouse').v1; + + // Instantiates a client + const contentwarehouseClient = new SynonymSetServiceClient(); + + async function callUpdateSynonymSet() { + // Construct request + const request = { + name, + synonymSet, + }; + + // Run request + const response = await contentwarehouseClient.updateSynonymSet(request); + console.log(response); + } + + callUpdateSynonymSet(); + // [END contentwarehouse_v1_generated_SynonymSetService_UpdateSynonymSet_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/src/index.ts b/owl-bot-staging/google-cloud-contentwarehouse/src/index.ts new file mode 100644 index 00000000000..15f1470600a --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/src/index.ts @@ -0,0 +1,37 @@ +// Copyright 2025 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 v1 from './v1'; + +const DocumentLinkServiceClient = v1.DocumentLinkServiceClient; +type DocumentLinkServiceClient = v1.DocumentLinkServiceClient; +const DocumentSchemaServiceClient = v1.DocumentSchemaServiceClient; +type DocumentSchemaServiceClient = v1.DocumentSchemaServiceClient; +const DocumentServiceClient = v1.DocumentServiceClient; +type DocumentServiceClient = v1.DocumentServiceClient; +const PipelineServiceClient = v1.PipelineServiceClient; +type PipelineServiceClient = v1.PipelineServiceClient; +const RuleSetServiceClient = v1.RuleSetServiceClient; +type RuleSetServiceClient = v1.RuleSetServiceClient; +const SynonymSetServiceClient = v1.SynonymSetServiceClient; +type SynonymSetServiceClient = v1.SynonymSetServiceClient; + +export {v1, DocumentLinkServiceClient, DocumentSchemaServiceClient, DocumentServiceClient, PipelineServiceClient, RuleSetServiceClient, SynonymSetServiceClient}; +export default {v1, DocumentLinkServiceClient, DocumentSchemaServiceClient, DocumentServiceClient, PipelineServiceClient, RuleSetServiceClient, SynonymSetServiceClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_link_service_client.ts b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_link_service_client.ts new file mode 100644 index 00000000000..069be3eedbf --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_link_service_client.ts @@ -0,0 +1,1214 @@ +// Copyright 2026 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 type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1/document_link_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './document_link_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * This service lets you manage document-links. + * Document-Links are treated as sub-resources under source documents. + * @class + * @memberof v1 + */ +export class DocumentLinkServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('contentwarehouse'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + documentLinkServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of DocumentLinkServiceClient. + * + * @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/main/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://cloud.google.com/docs/authentication/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/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new DocumentLinkServiceClient({fallback: true}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof DocumentLinkServiceClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'contentwarehouse.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + documentLinkPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/documents/{document}/documentLinks/{document_link}' + ), + documentSchemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/documentSchemas/{document_schema}' + ), + projectLocationDocumentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/documents/{document}' + ), + projectLocationDocumentsReferenceIdPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/documents/referenceId/{reference_id}' + ), + ruleSetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ruleSets/{rule_set}' + ), + synonymSetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/synonymSets/{context}' + ), + }; + + // 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 = { + listLinkedSources: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'documentLinks') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.contentwarehouse.v1.DocumentLinkService', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.documentLinkServiceStub) { + return this.documentLinkServiceStub; + } + + // Put together the "service stub" for + // google.cloud.contentwarehouse.v1.DocumentLinkService. + this.documentLinkServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.contentwarehouse.v1.DocumentLinkService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.contentwarehouse.v1.DocumentLinkService, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const documentLinkServiceStubMethods = + ['listLinkedTargets', 'listLinkedSources', 'createDocumentLink', 'deleteDocumentLink']; + for (const methodName of documentLinkServiceStubMethods) { + const callPromise = this.documentLinkServiceStub.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._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.documentLinkServiceStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'contentwarehouse.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'contentwarehouse.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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 -- + // ------------------- +/** + * Return all target document-links from the document. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the document, for which all target links are + * returned. Format: + * projects/{project_number}/locations/{location}/documents/{target_document_id}. + * @param {google.cloud.contentwarehouse.v1.RequestMetadata} request.requestMetadata + * The meta information collected about the document creator, used to enforce + * access control for the service. + * @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 {@link protos.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse|ListLinkedTargetsResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/document_link_service.list_linked_targets.js + * region_tag:contentwarehouse_v1_generated_DocumentLinkService_ListLinkedTargets_async + */ + listLinkedTargets( + request?: protos.google.cloud.contentwarehouse.v1.IListLinkedTargetsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.contentwarehouse.v1.IListLinkedTargetsResponse, + protos.google.cloud.contentwarehouse.v1.IListLinkedTargetsRequest|undefined, {}|undefined + ]>; + listLinkedTargets( + request: protos.google.cloud.contentwarehouse.v1.IListLinkedTargetsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.contentwarehouse.v1.IListLinkedTargetsResponse, + protos.google.cloud.contentwarehouse.v1.IListLinkedTargetsRequest|null|undefined, + {}|null|undefined>): void; + listLinkedTargets( + request: protos.google.cloud.contentwarehouse.v1.IListLinkedTargetsRequest, + callback: Callback< + protos.google.cloud.contentwarehouse.v1.IListLinkedTargetsResponse, + protos.google.cloud.contentwarehouse.v1.IListLinkedTargetsRequest|null|undefined, + {}|null|undefined>): void; + listLinkedTargets( + request?: protos.google.cloud.contentwarehouse.v1.IListLinkedTargetsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.contentwarehouse.v1.IListLinkedTargetsResponse, + protos.google.cloud.contentwarehouse.v1.IListLinkedTargetsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.contentwarehouse.v1.IListLinkedTargetsResponse, + protos.google.cloud.contentwarehouse.v1.IListLinkedTargetsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.contentwarehouse.v1.IListLinkedTargetsResponse, + protos.google.cloud.contentwarehouse.v1.IListLinkedTargetsRequest|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('listLinkedTargets request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.contentwarehouse.v1.IListLinkedTargetsResponse, + protos.google.cloud.contentwarehouse.v1.IListLinkedTargetsRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('listLinkedTargets response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.listLinkedTargets(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.contentwarehouse.v1.IListLinkedTargetsResponse, + protos.google.cloud.contentwarehouse.v1.IListLinkedTargetsRequest|undefined, + {}|undefined + ]) => { + this._log.info('listLinkedTargets response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Create a link between a source document and a target document. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent of the document-link to be created. + * parent of document-link should be a document. + * Format: + * projects/{project_number}/locations/{location}/documents/{source_document_id}. + * @param {google.cloud.contentwarehouse.v1.DocumentLink} request.documentLink + * Required. Document links associated with the source documents + * (source_document_id). + * @param {google.cloud.contentwarehouse.v1.RequestMetadata} request.requestMetadata + * The meta information collected about the document creator, used to enforce + * access control for the service. + * @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 {@link protos.google.cloud.contentwarehouse.v1.DocumentLink|DocumentLink}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/document_link_service.create_document_link.js + * region_tag:contentwarehouse_v1_generated_DocumentLinkService_CreateDocumentLink_async + */ + createDocumentLink( + request?: protos.google.cloud.contentwarehouse.v1.ICreateDocumentLinkRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.contentwarehouse.v1.IDocumentLink, + protos.google.cloud.contentwarehouse.v1.ICreateDocumentLinkRequest|undefined, {}|undefined + ]>; + createDocumentLink( + request: protos.google.cloud.contentwarehouse.v1.ICreateDocumentLinkRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.contentwarehouse.v1.IDocumentLink, + protos.google.cloud.contentwarehouse.v1.ICreateDocumentLinkRequest|null|undefined, + {}|null|undefined>): void; + createDocumentLink( + request: protos.google.cloud.contentwarehouse.v1.ICreateDocumentLinkRequest, + callback: Callback< + protos.google.cloud.contentwarehouse.v1.IDocumentLink, + protos.google.cloud.contentwarehouse.v1.ICreateDocumentLinkRequest|null|undefined, + {}|null|undefined>): void; + createDocumentLink( + request?: protos.google.cloud.contentwarehouse.v1.ICreateDocumentLinkRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.contentwarehouse.v1.IDocumentLink, + protos.google.cloud.contentwarehouse.v1.ICreateDocumentLinkRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.contentwarehouse.v1.IDocumentLink, + protos.google.cloud.contentwarehouse.v1.ICreateDocumentLinkRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.contentwarehouse.v1.IDocumentLink, + protos.google.cloud.contentwarehouse.v1.ICreateDocumentLinkRequest|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createDocumentLink request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.contentwarehouse.v1.IDocumentLink, + protos.google.cloud.contentwarehouse.v1.ICreateDocumentLinkRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createDocumentLink response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createDocumentLink(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.contentwarehouse.v1.IDocumentLink, + protos.google.cloud.contentwarehouse.v1.ICreateDocumentLinkRequest|undefined, + {}|undefined + ]) => { + this._log.info('createDocumentLink response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Remove the link between the source and target documents. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the document-link to be deleted. + * Format: + * projects/{project_number}/locations/{location}/documents/{source_document_id}/documentLinks/{document_link_id}. + * @param {google.cloud.contentwarehouse.v1.RequestMetadata} request.requestMetadata + * The meta information collected about the document creator, used to enforce + * access control for the service. + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/document_link_service.delete_document_link.js + * region_tag:contentwarehouse_v1_generated_DocumentLinkService_DeleteDocumentLink_async + */ + deleteDocumentLink( + request?: protos.google.cloud.contentwarehouse.v1.IDeleteDocumentLinkRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.contentwarehouse.v1.IDeleteDocumentLinkRequest|undefined, {}|undefined + ]>; + deleteDocumentLink( + request: protos.google.cloud.contentwarehouse.v1.IDeleteDocumentLinkRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.contentwarehouse.v1.IDeleteDocumentLinkRequest|null|undefined, + {}|null|undefined>): void; + deleteDocumentLink( + request: protos.google.cloud.contentwarehouse.v1.IDeleteDocumentLinkRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.contentwarehouse.v1.IDeleteDocumentLinkRequest|null|undefined, + {}|null|undefined>): void; + deleteDocumentLink( + request?: protos.google.cloud.contentwarehouse.v1.IDeleteDocumentLinkRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.contentwarehouse.v1.IDeleteDocumentLinkRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.contentwarehouse.v1.IDeleteDocumentLinkRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.contentwarehouse.v1.IDeleteDocumentLinkRequest|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deleteDocumentLink request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.contentwarehouse.v1.IDeleteDocumentLinkRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteDocumentLink response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteDocumentLink(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.contentwarehouse.v1.IDeleteDocumentLinkRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteDocumentLink response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + + /** + * Return all source document-links from the document. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the document, for which all source links are + * returned. Format: + * projects/{project_number}/locations/{location}/documents/{source_document_id}. + * @param {number} request.pageSize + * The maximum number of document-links to return. The service may return + * fewer than this value. + * + * If unspecified, at most 50 document-links will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListLinkedSources` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListLinkedSources` + * must match the call that provided the page token. + * @param {google.cloud.contentwarehouse.v1.RequestMetadata} request.requestMetadata + * The meta information collected about the document creator, used to enforce + * access control for the service. + * @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 {@link protos.google.cloud.contentwarehouse.v1.DocumentLink|DocumentLink}. + * 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 `listLinkedSourcesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listLinkedSources( + request?: protos.google.cloud.contentwarehouse.v1.IListLinkedSourcesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.contentwarehouse.v1.IDocumentLink[], + protos.google.cloud.contentwarehouse.v1.IListLinkedSourcesRequest|null, + protos.google.cloud.contentwarehouse.v1.IListLinkedSourcesResponse + ]>; + listLinkedSources( + request: protos.google.cloud.contentwarehouse.v1.IListLinkedSourcesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.contentwarehouse.v1.IListLinkedSourcesRequest, + protos.google.cloud.contentwarehouse.v1.IListLinkedSourcesResponse|null|undefined, + protos.google.cloud.contentwarehouse.v1.IDocumentLink>): void; + listLinkedSources( + request: protos.google.cloud.contentwarehouse.v1.IListLinkedSourcesRequest, + callback: PaginationCallback< + protos.google.cloud.contentwarehouse.v1.IListLinkedSourcesRequest, + protos.google.cloud.contentwarehouse.v1.IListLinkedSourcesResponse|null|undefined, + protos.google.cloud.contentwarehouse.v1.IDocumentLink>): void; + listLinkedSources( + request?: protos.google.cloud.contentwarehouse.v1.IListLinkedSourcesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.contentwarehouse.v1.IListLinkedSourcesRequest, + protos.google.cloud.contentwarehouse.v1.IListLinkedSourcesResponse|null|undefined, + protos.google.cloud.contentwarehouse.v1.IDocumentLink>, + callback?: PaginationCallback< + protos.google.cloud.contentwarehouse.v1.IListLinkedSourcesRequest, + protos.google.cloud.contentwarehouse.v1.IListLinkedSourcesResponse|null|undefined, + protos.google.cloud.contentwarehouse.v1.IDocumentLink>): + Promise<[ + protos.google.cloud.contentwarehouse.v1.IDocumentLink[], + protos.google.cloud.contentwarehouse.v1.IListLinkedSourcesRequest|null, + protos.google.cloud.contentwarehouse.v1.IListLinkedSourcesResponse + ]>|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.contentwarehouse.v1.IListLinkedSourcesRequest, + protos.google.cloud.contentwarehouse.v1.IListLinkedSourcesResponse|null|undefined, + protos.google.cloud.contentwarehouse.v1.IDocumentLink>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listLinkedSources values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listLinkedSources request %j', request); + return this.innerApiCalls + .listLinkedSources(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.contentwarehouse.v1.IDocumentLink[], + protos.google.cloud.contentwarehouse.v1.IListLinkedSourcesRequest|null, + protos.google.cloud.contentwarehouse.v1.IListLinkedSourcesResponse + ]) => { + this._log.info('listLinkedSources values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listLinkedSources`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the document, for which all source links are + * returned. Format: + * projects/{project_number}/locations/{location}/documents/{source_document_id}. + * @param {number} request.pageSize + * The maximum number of document-links to return. The service may return + * fewer than this value. + * + * If unspecified, at most 50 document-links will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListLinkedSources` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListLinkedSources` + * must match the call that provided the page token. + * @param {google.cloud.contentwarehouse.v1.RequestMetadata} request.requestMetadata + * The meta information collected about the document creator, used to enforce + * access control for the service. + * @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 {@link protos.google.cloud.contentwarehouse.v1.DocumentLink|DocumentLink} 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 `listLinkedSourcesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listLinkedSourcesStream( + request?: protos.google.cloud.contentwarehouse.v1.IListLinkedSourcesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listLinkedSources']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listLinkedSources stream %j', request); + return this.descriptors.page.listLinkedSources.createStream( + this.innerApiCalls.listLinkedSources as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listLinkedSources`, 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. The name of the document, for which all source links are + * returned. Format: + * projects/{project_number}/locations/{location}/documents/{source_document_id}. + * @param {number} request.pageSize + * The maximum number of document-links to return. The service may return + * fewer than this value. + * + * If unspecified, at most 50 document-links will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListLinkedSources` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListLinkedSources` + * must match the call that provided the page token. + * @param {google.cloud.contentwarehouse.v1.RequestMetadata} request.requestMetadata + * The meta information collected about the document creator, used to enforce + * access control for the service. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.contentwarehouse.v1.DocumentLink|DocumentLink}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/document_link_service.list_linked_sources.js + * region_tag:contentwarehouse_v1_generated_DocumentLinkService_ListLinkedSources_async + */ + listLinkedSourcesAsync( + request?: protos.google.cloud.contentwarehouse.v1.IListLinkedSourcesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listLinkedSources']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listLinkedSources iterate %j', request); + return this.descriptors.page.listLinkedSources.asyncIterate( + this.innerApiCalls['listLinkedSources'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified documentLink resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} document + * @param {string} document_link + * @returns {string} Resource name string. + */ + documentLinkPath(project:string,location:string,document:string,documentLink:string) { + return this.pathTemplates.documentLinkPathTemplate.render({ + project: project, + location: location, + document: document, + document_link: documentLink, + }); + } + + /** + * Parse the project from DocumentLink resource. + * + * @param {string} documentLinkName + * A fully-qualified path representing DocumentLink resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDocumentLinkName(documentLinkName: string) { + return this.pathTemplates.documentLinkPathTemplate.match(documentLinkName).project; + } + + /** + * Parse the location from DocumentLink resource. + * + * @param {string} documentLinkName + * A fully-qualified path representing DocumentLink resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDocumentLinkName(documentLinkName: string) { + return this.pathTemplates.documentLinkPathTemplate.match(documentLinkName).location; + } + + /** + * Parse the document from DocumentLink resource. + * + * @param {string} documentLinkName + * A fully-qualified path representing DocumentLink resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromDocumentLinkName(documentLinkName: string) { + return this.pathTemplates.documentLinkPathTemplate.match(documentLinkName).document; + } + + /** + * Parse the document_link from DocumentLink resource. + * + * @param {string} documentLinkName + * A fully-qualified path representing DocumentLink resource. + * @returns {string} A string representing the document_link. + */ + matchDocumentLinkFromDocumentLinkName(documentLinkName: string) { + return this.pathTemplates.documentLinkPathTemplate.match(documentLinkName).document_link; + } + + /** + * Return a fully-qualified documentSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} document_schema + * @returns {string} Resource name string. + */ + documentSchemaPath(project:string,location:string,documentSchema:string) { + return this.pathTemplates.documentSchemaPathTemplate.render({ + project: project, + location: location, + document_schema: documentSchema, + }); + } + + /** + * Parse the project from DocumentSchema resource. + * + * @param {string} documentSchemaName + * A fully-qualified path representing DocumentSchema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDocumentSchemaName(documentSchemaName: string) { + return this.pathTemplates.documentSchemaPathTemplate.match(documentSchemaName).project; + } + + /** + * Parse the location from DocumentSchema resource. + * + * @param {string} documentSchemaName + * A fully-qualified path representing DocumentSchema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDocumentSchemaName(documentSchemaName: string) { + return this.pathTemplates.documentSchemaPathTemplate.match(documentSchemaName).location; + } + + /** + * Parse the document_schema from DocumentSchema resource. + * + * @param {string} documentSchemaName + * A fully-qualified path representing DocumentSchema resource. + * @returns {string} A string representing the document_schema. + */ + matchDocumentSchemaFromDocumentSchemaName(documentSchemaName: string) { + return this.pathTemplates.documentSchemaPathTemplate.match(documentSchemaName).document_schema; + } + + /** + * Return a fully-qualified projectLocationDocument resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} document + * @returns {string} Resource name string. + */ + projectLocationDocumentPath(project:string,location:string,document:string) { + return this.pathTemplates.projectLocationDocumentPathTemplate.render({ + project: project, + location: location, + document: document, + }); + } + + /** + * Parse the project from ProjectLocationDocument resource. + * + * @param {string} projectLocationDocumentName + * A fully-qualified path representing project_location_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationDocumentName(projectLocationDocumentName: string) { + return this.pathTemplates.projectLocationDocumentPathTemplate.match(projectLocationDocumentName).project; + } + + /** + * Parse the location from ProjectLocationDocument resource. + * + * @param {string} projectLocationDocumentName + * A fully-qualified path representing project_location_document resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationDocumentName(projectLocationDocumentName: string) { + return this.pathTemplates.projectLocationDocumentPathTemplate.match(projectLocationDocumentName).location; + } + + /** + * Parse the document from ProjectLocationDocument resource. + * + * @param {string} projectLocationDocumentName + * A fully-qualified path representing project_location_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectLocationDocumentName(projectLocationDocumentName: string) { + return this.pathTemplates.projectLocationDocumentPathTemplate.match(projectLocationDocumentName).document; + } + + /** + * Return a fully-qualified projectLocationDocumentsReferenceId resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} reference_id + * @returns {string} Resource name string. + */ + projectLocationDocumentsReferenceIdPath(project:string,location:string,referenceId:string) { + return this.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.render({ + project: project, + location: location, + reference_id: referenceId, + }); + } + + /** + * Parse the project from ProjectLocationDocumentsReferenceId resource. + * + * @param {string} projectLocationDocumentsReferenceIdName + * A fully-qualified path representing project_location_documents_reference_id resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationDocumentsReferenceIdName(projectLocationDocumentsReferenceIdName: string) { + return this.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match(projectLocationDocumentsReferenceIdName).project; + } + + /** + * Parse the location from ProjectLocationDocumentsReferenceId resource. + * + * @param {string} projectLocationDocumentsReferenceIdName + * A fully-qualified path representing project_location_documents_reference_id resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationDocumentsReferenceIdName(projectLocationDocumentsReferenceIdName: string) { + return this.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match(projectLocationDocumentsReferenceIdName).location; + } + + /** + * Parse the reference_id from ProjectLocationDocumentsReferenceId resource. + * + * @param {string} projectLocationDocumentsReferenceIdName + * A fully-qualified path representing project_location_documents_reference_id resource. + * @returns {string} A string representing the reference_id. + */ + matchReferenceIdFromProjectLocationDocumentsReferenceIdName(projectLocationDocumentsReferenceIdName: string) { + return this.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match(projectLocationDocumentsReferenceIdName).reference_id; + } + + /** + * Return a fully-qualified ruleSet resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rule_set + * @returns {string} Resource name string. + */ + ruleSetPath(project:string,location:string,ruleSet:string) { + return this.pathTemplates.ruleSetPathTemplate.render({ + project: project, + location: location, + rule_set: ruleSet, + }); + } + + /** + * Parse the project from RuleSet resource. + * + * @param {string} ruleSetName + * A fully-qualified path representing RuleSet resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRuleSetName(ruleSetName: string) { + return this.pathTemplates.ruleSetPathTemplate.match(ruleSetName).project; + } + + /** + * Parse the location from RuleSet resource. + * + * @param {string} ruleSetName + * A fully-qualified path representing RuleSet resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRuleSetName(ruleSetName: string) { + return this.pathTemplates.ruleSetPathTemplate.match(ruleSetName).location; + } + + /** + * Parse the rule_set from RuleSet resource. + * + * @param {string} ruleSetName + * A fully-qualified path representing RuleSet resource. + * @returns {string} A string representing the rule_set. + */ + matchRuleSetFromRuleSetName(ruleSetName: string) { + return this.pathTemplates.ruleSetPathTemplate.match(ruleSetName).rule_set; + } + + /** + * Return a fully-qualified synonymSet resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} context + * @returns {string} Resource name string. + */ + synonymSetPath(project:string,location:string,context:string) { + return this.pathTemplates.synonymSetPathTemplate.render({ + project: project, + location: location, + context: context, + }); + } + + /** + * Parse the project from SynonymSet resource. + * + * @param {string} synonymSetName + * A fully-qualified path representing SynonymSet resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSynonymSetName(synonymSetName: string) { + return this.pathTemplates.synonymSetPathTemplate.match(synonymSetName).project; + } + + /** + * Parse the location from SynonymSet resource. + * + * @param {string} synonymSetName + * A fully-qualified path representing SynonymSet resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSynonymSetName(synonymSetName: string) { + return this.pathTemplates.synonymSetPathTemplate.match(synonymSetName).location; + } + + /** + * Parse the context from SynonymSet resource. + * + * @param {string} synonymSetName + * A fully-qualified path representing SynonymSet resource. + * @returns {string} A string representing the context. + */ + matchContextFromSynonymSetName(synonymSetName: string) { + return this.pathTemplates.synonymSetPathTemplate.match(synonymSetName).context; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.documentLinkServiceStub && !this._terminated) { + return this.documentLinkServiceStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_link_service_client_config.json b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_link_service_client_config.json new file mode 100644 index 00000000000..50fc7af4f4a --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_link_service_client_config.json @@ -0,0 +1,46 @@ +{ + "interfaces": { + "google.cloud.contentwarehouse.v1.DocumentLinkService": { + "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": { + "ListLinkedTargets": { + "timeout_millis": 180000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListLinkedSources": { + "timeout_millis": 180000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateDocumentLink": { + "timeout_millis": 180000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteDocumentLink": { + "timeout_millis": 180000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_link_service_proto_list.json b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_link_service_proto_list.json new file mode 100644 index 00000000000..a1775b1134d --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_link_service_proto_list.json @@ -0,0 +1,23 @@ +[ + "../../protos/google/cloud/contentwarehouse/v1/async_document_service_request.proto", + "../../protos/google/cloud/contentwarehouse/v1/common.proto", + "../../protos/google/cloud/contentwarehouse/v1/document.proto", + "../../protos/google/cloud/contentwarehouse/v1/document_link_service.proto", + "../../protos/google/cloud/contentwarehouse/v1/document_schema.proto", + "../../protos/google/cloud/contentwarehouse/v1/document_schema_service.proto", + "../../protos/google/cloud/contentwarehouse/v1/document_service.proto", + "../../protos/google/cloud/contentwarehouse/v1/document_service_request.proto", + "../../protos/google/cloud/contentwarehouse/v1/filters.proto", + "../../protos/google/cloud/contentwarehouse/v1/histogram.proto", + "../../protos/google/cloud/contentwarehouse/v1/pipeline_service.proto", + "../../protos/google/cloud/contentwarehouse/v1/pipelines.proto", + "../../protos/google/cloud/contentwarehouse/v1/rule_engine.proto", + "../../protos/google/cloud/contentwarehouse/v1/ruleset_service.proto", + "../../protos/google/cloud/contentwarehouse/v1/ruleset_service_request.proto", + "../../protos/google/cloud/contentwarehouse/v1/synonymset.proto", + "../../protos/google/cloud/contentwarehouse/v1/synonymset_service.proto", + "../../protos/google/cloud/contentwarehouse/v1/synonymset_service_request.proto", + "../../protos/google/cloud/documentai/v1/barcode.proto", + "../../protos/google/cloud/documentai/v1/document.proto", + "../../protos/google/cloud/documentai/v1/geometry.proto" +] diff --git a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_schema_service_client.ts b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_schema_service_client.ts new file mode 100644 index 00000000000..04717fbd017 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_schema_service_client.ts @@ -0,0 +1,1327 @@ +// Copyright 2026 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 type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1/document_schema_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './document_schema_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * This service lets you manage document schema. + * @class + * @memberof v1 + */ +export class DocumentSchemaServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('contentwarehouse'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + documentSchemaServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of DocumentSchemaServiceClient. + * + * @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/main/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://cloud.google.com/docs/authentication/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/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new DocumentSchemaServiceClient({fallback: true}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof DocumentSchemaServiceClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'contentwarehouse.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + documentLinkPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/documents/{document}/documentLinks/{document_link}' + ), + documentSchemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/documentSchemas/{document_schema}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + projectLocationDocumentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/documents/{document}' + ), + projectLocationDocumentsReferenceIdPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/documents/referenceId/{reference_id}' + ), + ruleSetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ruleSets/{rule_set}' + ), + synonymSetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/synonymSets/{context}' + ), + }; + + // 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 = { + listDocumentSchemas: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'documentSchemas') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.contentwarehouse.v1.DocumentSchemaService', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.documentSchemaServiceStub) { + return this.documentSchemaServiceStub; + } + + // Put together the "service stub" for + // google.cloud.contentwarehouse.v1.DocumentSchemaService. + this.documentSchemaServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.contentwarehouse.v1.DocumentSchemaService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.contentwarehouse.v1.DocumentSchemaService, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const documentSchemaServiceStubMethods = + ['createDocumentSchema', 'updateDocumentSchema', 'getDocumentSchema', 'deleteDocumentSchema', 'listDocumentSchemas']; + for (const methodName of documentSchemaServiceStubMethods) { + const callPromise = this.documentSchemaServiceStub.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._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.documentSchemaServiceStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'contentwarehouse.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'contentwarehouse.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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 -- + // ------------------- +/** + * Creates a document schema. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent name. + * @param {google.cloud.contentwarehouse.v1.DocumentSchema} request.documentSchema + * Required. The document schema to create. + * @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 {@link protos.google.cloud.contentwarehouse.v1.DocumentSchema|DocumentSchema}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/document_schema_service.create_document_schema.js + * region_tag:contentwarehouse_v1_generated_DocumentSchemaService_CreateDocumentSchema_async + */ + createDocumentSchema( + request?: protos.google.cloud.contentwarehouse.v1.ICreateDocumentSchemaRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.contentwarehouse.v1.IDocumentSchema, + protos.google.cloud.contentwarehouse.v1.ICreateDocumentSchemaRequest|undefined, {}|undefined + ]>; + createDocumentSchema( + request: protos.google.cloud.contentwarehouse.v1.ICreateDocumentSchemaRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.contentwarehouse.v1.IDocumentSchema, + protos.google.cloud.contentwarehouse.v1.ICreateDocumentSchemaRequest|null|undefined, + {}|null|undefined>): void; + createDocumentSchema( + request: protos.google.cloud.contentwarehouse.v1.ICreateDocumentSchemaRequest, + callback: Callback< + protos.google.cloud.contentwarehouse.v1.IDocumentSchema, + protos.google.cloud.contentwarehouse.v1.ICreateDocumentSchemaRequest|null|undefined, + {}|null|undefined>): void; + createDocumentSchema( + request?: protos.google.cloud.contentwarehouse.v1.ICreateDocumentSchemaRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.contentwarehouse.v1.IDocumentSchema, + protos.google.cloud.contentwarehouse.v1.ICreateDocumentSchemaRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.contentwarehouse.v1.IDocumentSchema, + protos.google.cloud.contentwarehouse.v1.ICreateDocumentSchemaRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.contentwarehouse.v1.IDocumentSchema, + protos.google.cloud.contentwarehouse.v1.ICreateDocumentSchemaRequest|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createDocumentSchema request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.contentwarehouse.v1.IDocumentSchema, + protos.google.cloud.contentwarehouse.v1.ICreateDocumentSchemaRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createDocumentSchema response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createDocumentSchema(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.contentwarehouse.v1.IDocumentSchema, + protos.google.cloud.contentwarehouse.v1.ICreateDocumentSchemaRequest|undefined, + {}|undefined + ]) => { + this._log.info('createDocumentSchema response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Updates a Document Schema. Returns INVALID_ARGUMENT if the name of the + * Document Schema is non-empty and does not equal the existing name. + * Supports only appending new properties, adding new ENUM possible values, + * and updating the + * {@link protos.google.cloud.contentwarehouse.v1.EnumTypeOptions.validation_check_disabled|EnumTypeOptions.validation_check_disabled} + * flag for ENUM possible values. Updating existing properties will result + * into INVALID_ARGUMENT. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the document schema to update. + * Format: + * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}. + * @param {google.cloud.contentwarehouse.v1.DocumentSchema} request.documentSchema + * Required. The document schema to update with. + * @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 {@link protos.google.cloud.contentwarehouse.v1.DocumentSchema|DocumentSchema}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/document_schema_service.update_document_schema.js + * region_tag:contentwarehouse_v1_generated_DocumentSchemaService_UpdateDocumentSchema_async + */ + updateDocumentSchema( + request?: protos.google.cloud.contentwarehouse.v1.IUpdateDocumentSchemaRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.contentwarehouse.v1.IDocumentSchema, + protos.google.cloud.contentwarehouse.v1.IUpdateDocumentSchemaRequest|undefined, {}|undefined + ]>; + updateDocumentSchema( + request: protos.google.cloud.contentwarehouse.v1.IUpdateDocumentSchemaRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.contentwarehouse.v1.IDocumentSchema, + protos.google.cloud.contentwarehouse.v1.IUpdateDocumentSchemaRequest|null|undefined, + {}|null|undefined>): void; + updateDocumentSchema( + request: protos.google.cloud.contentwarehouse.v1.IUpdateDocumentSchemaRequest, + callback: Callback< + protos.google.cloud.contentwarehouse.v1.IDocumentSchema, + protos.google.cloud.contentwarehouse.v1.IUpdateDocumentSchemaRequest|null|undefined, + {}|null|undefined>): void; + updateDocumentSchema( + request?: protos.google.cloud.contentwarehouse.v1.IUpdateDocumentSchemaRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.contentwarehouse.v1.IDocumentSchema, + protos.google.cloud.contentwarehouse.v1.IUpdateDocumentSchemaRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.contentwarehouse.v1.IDocumentSchema, + protos.google.cloud.contentwarehouse.v1.IUpdateDocumentSchemaRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.contentwarehouse.v1.IDocumentSchema, + protos.google.cloud.contentwarehouse.v1.IUpdateDocumentSchemaRequest|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateDocumentSchema request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.contentwarehouse.v1.IDocumentSchema, + protos.google.cloud.contentwarehouse.v1.IUpdateDocumentSchemaRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateDocumentSchema response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateDocumentSchema(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.contentwarehouse.v1.IDocumentSchema, + protos.google.cloud.contentwarehouse.v1.IUpdateDocumentSchemaRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateDocumentSchema response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets a document schema. Returns NOT_FOUND if the document schema does not + * exist. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the document schema to retrieve. + * @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 {@link protos.google.cloud.contentwarehouse.v1.DocumentSchema|DocumentSchema}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/document_schema_service.get_document_schema.js + * region_tag:contentwarehouse_v1_generated_DocumentSchemaService_GetDocumentSchema_async + */ + getDocumentSchema( + request?: protos.google.cloud.contentwarehouse.v1.IGetDocumentSchemaRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.contentwarehouse.v1.IDocumentSchema, + protos.google.cloud.contentwarehouse.v1.IGetDocumentSchemaRequest|undefined, {}|undefined + ]>; + getDocumentSchema( + request: protos.google.cloud.contentwarehouse.v1.IGetDocumentSchemaRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.contentwarehouse.v1.IDocumentSchema, + protos.google.cloud.contentwarehouse.v1.IGetDocumentSchemaRequest|null|undefined, + {}|null|undefined>): void; + getDocumentSchema( + request: protos.google.cloud.contentwarehouse.v1.IGetDocumentSchemaRequest, + callback: Callback< + protos.google.cloud.contentwarehouse.v1.IDocumentSchema, + protos.google.cloud.contentwarehouse.v1.IGetDocumentSchemaRequest|null|undefined, + {}|null|undefined>): void; + getDocumentSchema( + request?: protos.google.cloud.contentwarehouse.v1.IGetDocumentSchemaRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.contentwarehouse.v1.IDocumentSchema, + protos.google.cloud.contentwarehouse.v1.IGetDocumentSchemaRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.contentwarehouse.v1.IDocumentSchema, + protos.google.cloud.contentwarehouse.v1.IGetDocumentSchemaRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.contentwarehouse.v1.IDocumentSchema, + protos.google.cloud.contentwarehouse.v1.IGetDocumentSchemaRequest|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getDocumentSchema request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.contentwarehouse.v1.IDocumentSchema, + protos.google.cloud.contentwarehouse.v1.IGetDocumentSchemaRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getDocumentSchema response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getDocumentSchema(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.contentwarehouse.v1.IDocumentSchema, + protos.google.cloud.contentwarehouse.v1.IGetDocumentSchemaRequest|undefined, + {}|undefined + ]) => { + this._log.info('getDocumentSchema response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Deletes a document schema. Returns NOT_FOUND if the document schema does + * not exist. Returns BAD_REQUEST if the document schema has documents + * depending on it. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the document schema to delete. + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/document_schema_service.delete_document_schema.js + * region_tag:contentwarehouse_v1_generated_DocumentSchemaService_DeleteDocumentSchema_async + */ + deleteDocumentSchema( + request?: protos.google.cloud.contentwarehouse.v1.IDeleteDocumentSchemaRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.contentwarehouse.v1.IDeleteDocumentSchemaRequest|undefined, {}|undefined + ]>; + deleteDocumentSchema( + request: protos.google.cloud.contentwarehouse.v1.IDeleteDocumentSchemaRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.contentwarehouse.v1.IDeleteDocumentSchemaRequest|null|undefined, + {}|null|undefined>): void; + deleteDocumentSchema( + request: protos.google.cloud.contentwarehouse.v1.IDeleteDocumentSchemaRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.contentwarehouse.v1.IDeleteDocumentSchemaRequest|null|undefined, + {}|null|undefined>): void; + deleteDocumentSchema( + request?: protos.google.cloud.contentwarehouse.v1.IDeleteDocumentSchemaRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.contentwarehouse.v1.IDeleteDocumentSchemaRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.contentwarehouse.v1.IDeleteDocumentSchemaRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.contentwarehouse.v1.IDeleteDocumentSchemaRequest|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deleteDocumentSchema request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.contentwarehouse.v1.IDeleteDocumentSchemaRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteDocumentSchema response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteDocumentSchema(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.contentwarehouse.v1.IDeleteDocumentSchemaRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteDocumentSchema response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + + /** + * Lists document schemas. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of document schemas. + * Format: projects/{project_number}/locations/{location}. + * @param {number} request.pageSize + * The maximum number of document schemas to return. The service may return + * fewer than this value. + * If unspecified, at most 50 document schemas will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListDocumentSchemas` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListDocumentSchemas` + * must match the call that provided the page token. + * @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 {@link protos.google.cloud.contentwarehouse.v1.DocumentSchema|DocumentSchema}. + * 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 `listDocumentSchemasAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listDocumentSchemas( + request?: protos.google.cloud.contentwarehouse.v1.IListDocumentSchemasRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.contentwarehouse.v1.IDocumentSchema[], + protos.google.cloud.contentwarehouse.v1.IListDocumentSchemasRequest|null, + protos.google.cloud.contentwarehouse.v1.IListDocumentSchemasResponse + ]>; + listDocumentSchemas( + request: protos.google.cloud.contentwarehouse.v1.IListDocumentSchemasRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.contentwarehouse.v1.IListDocumentSchemasRequest, + protos.google.cloud.contentwarehouse.v1.IListDocumentSchemasResponse|null|undefined, + protos.google.cloud.contentwarehouse.v1.IDocumentSchema>): void; + listDocumentSchemas( + request: protos.google.cloud.contentwarehouse.v1.IListDocumentSchemasRequest, + callback: PaginationCallback< + protos.google.cloud.contentwarehouse.v1.IListDocumentSchemasRequest, + protos.google.cloud.contentwarehouse.v1.IListDocumentSchemasResponse|null|undefined, + protos.google.cloud.contentwarehouse.v1.IDocumentSchema>): void; + listDocumentSchemas( + request?: protos.google.cloud.contentwarehouse.v1.IListDocumentSchemasRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.contentwarehouse.v1.IListDocumentSchemasRequest, + protos.google.cloud.contentwarehouse.v1.IListDocumentSchemasResponse|null|undefined, + protos.google.cloud.contentwarehouse.v1.IDocumentSchema>, + callback?: PaginationCallback< + protos.google.cloud.contentwarehouse.v1.IListDocumentSchemasRequest, + protos.google.cloud.contentwarehouse.v1.IListDocumentSchemasResponse|null|undefined, + protos.google.cloud.contentwarehouse.v1.IDocumentSchema>): + Promise<[ + protos.google.cloud.contentwarehouse.v1.IDocumentSchema[], + protos.google.cloud.contentwarehouse.v1.IListDocumentSchemasRequest|null, + protos.google.cloud.contentwarehouse.v1.IListDocumentSchemasResponse + ]>|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.contentwarehouse.v1.IListDocumentSchemasRequest, + protos.google.cloud.contentwarehouse.v1.IListDocumentSchemasResponse|null|undefined, + protos.google.cloud.contentwarehouse.v1.IDocumentSchema>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listDocumentSchemas values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listDocumentSchemas request %j', request); + return this.innerApiCalls + .listDocumentSchemas(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.contentwarehouse.v1.IDocumentSchema[], + protos.google.cloud.contentwarehouse.v1.IListDocumentSchemasRequest|null, + protos.google.cloud.contentwarehouse.v1.IListDocumentSchemasResponse + ]) => { + this._log.info('listDocumentSchemas values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listDocumentSchemas`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of document schemas. + * Format: projects/{project_number}/locations/{location}. + * @param {number} request.pageSize + * The maximum number of document schemas to return. The service may return + * fewer than this value. + * If unspecified, at most 50 document schemas will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListDocumentSchemas` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListDocumentSchemas` + * must match the call that provided the page token. + * @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 {@link protos.google.cloud.contentwarehouse.v1.DocumentSchema|DocumentSchema} 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 `listDocumentSchemasAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listDocumentSchemasStream( + request?: protos.google.cloud.contentwarehouse.v1.IListDocumentSchemasRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listDocumentSchemas']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listDocumentSchemas stream %j', request); + return this.descriptors.page.listDocumentSchemas.createStream( + this.innerApiCalls.listDocumentSchemas as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listDocumentSchemas`, 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. The parent, which owns this collection of document schemas. + * Format: projects/{project_number}/locations/{location}. + * @param {number} request.pageSize + * The maximum number of document schemas to return. The service may return + * fewer than this value. + * If unspecified, at most 50 document schemas will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListDocumentSchemas` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListDocumentSchemas` + * must match the call that provided the page token. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.contentwarehouse.v1.DocumentSchema|DocumentSchema}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/document_schema_service.list_document_schemas.js + * region_tag:contentwarehouse_v1_generated_DocumentSchemaService_ListDocumentSchemas_async + */ + listDocumentSchemasAsync( + request?: protos.google.cloud.contentwarehouse.v1.IListDocumentSchemasRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listDocumentSchemas']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listDocumentSchemas iterate %j', request); + return this.descriptors.page.listDocumentSchemas.asyncIterate( + this.innerApiCalls['listDocumentSchemas'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified documentLink resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} document + * @param {string} document_link + * @returns {string} Resource name string. + */ + documentLinkPath(project:string,location:string,document:string,documentLink:string) { + return this.pathTemplates.documentLinkPathTemplate.render({ + project: project, + location: location, + document: document, + document_link: documentLink, + }); + } + + /** + * Parse the project from DocumentLink resource. + * + * @param {string} documentLinkName + * A fully-qualified path representing DocumentLink resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDocumentLinkName(documentLinkName: string) { + return this.pathTemplates.documentLinkPathTemplate.match(documentLinkName).project; + } + + /** + * Parse the location from DocumentLink resource. + * + * @param {string} documentLinkName + * A fully-qualified path representing DocumentLink resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDocumentLinkName(documentLinkName: string) { + return this.pathTemplates.documentLinkPathTemplate.match(documentLinkName).location; + } + + /** + * Parse the document from DocumentLink resource. + * + * @param {string} documentLinkName + * A fully-qualified path representing DocumentLink resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromDocumentLinkName(documentLinkName: string) { + return this.pathTemplates.documentLinkPathTemplate.match(documentLinkName).document; + } + + /** + * Parse the document_link from DocumentLink resource. + * + * @param {string} documentLinkName + * A fully-qualified path representing DocumentLink resource. + * @returns {string} A string representing the document_link. + */ + matchDocumentLinkFromDocumentLinkName(documentLinkName: string) { + return this.pathTemplates.documentLinkPathTemplate.match(documentLinkName).document_link; + } + + /** + * Return a fully-qualified documentSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} document_schema + * @returns {string} Resource name string. + */ + documentSchemaPath(project:string,location:string,documentSchema:string) { + return this.pathTemplates.documentSchemaPathTemplate.render({ + project: project, + location: location, + document_schema: documentSchema, + }); + } + + /** + * Parse the project from DocumentSchema resource. + * + * @param {string} documentSchemaName + * A fully-qualified path representing DocumentSchema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDocumentSchemaName(documentSchemaName: string) { + return this.pathTemplates.documentSchemaPathTemplate.match(documentSchemaName).project; + } + + /** + * Parse the location from DocumentSchema resource. + * + * @param {string} documentSchemaName + * A fully-qualified path representing DocumentSchema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDocumentSchemaName(documentSchemaName: string) { + return this.pathTemplates.documentSchemaPathTemplate.match(documentSchemaName).location; + } + + /** + * Parse the document_schema from DocumentSchema resource. + * + * @param {string} documentSchemaName + * A fully-qualified path representing DocumentSchema resource. + * @returns {string} A string representing the document_schema. + */ + matchDocumentSchemaFromDocumentSchemaName(documentSchemaName: string) { + return this.pathTemplates.documentSchemaPathTemplate.match(documentSchemaName).document_schema; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified projectLocationDocument resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} document + * @returns {string} Resource name string. + */ + projectLocationDocumentPath(project:string,location:string,document:string) { + return this.pathTemplates.projectLocationDocumentPathTemplate.render({ + project: project, + location: location, + document: document, + }); + } + + /** + * Parse the project from ProjectLocationDocument resource. + * + * @param {string} projectLocationDocumentName + * A fully-qualified path representing project_location_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationDocumentName(projectLocationDocumentName: string) { + return this.pathTemplates.projectLocationDocumentPathTemplate.match(projectLocationDocumentName).project; + } + + /** + * Parse the location from ProjectLocationDocument resource. + * + * @param {string} projectLocationDocumentName + * A fully-qualified path representing project_location_document resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationDocumentName(projectLocationDocumentName: string) { + return this.pathTemplates.projectLocationDocumentPathTemplate.match(projectLocationDocumentName).location; + } + + /** + * Parse the document from ProjectLocationDocument resource. + * + * @param {string} projectLocationDocumentName + * A fully-qualified path representing project_location_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectLocationDocumentName(projectLocationDocumentName: string) { + return this.pathTemplates.projectLocationDocumentPathTemplate.match(projectLocationDocumentName).document; + } + + /** + * Return a fully-qualified projectLocationDocumentsReferenceId resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} reference_id + * @returns {string} Resource name string. + */ + projectLocationDocumentsReferenceIdPath(project:string,location:string,referenceId:string) { + return this.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.render({ + project: project, + location: location, + reference_id: referenceId, + }); + } + + /** + * Parse the project from ProjectLocationDocumentsReferenceId resource. + * + * @param {string} projectLocationDocumentsReferenceIdName + * A fully-qualified path representing project_location_documents_reference_id resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationDocumentsReferenceIdName(projectLocationDocumentsReferenceIdName: string) { + return this.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match(projectLocationDocumentsReferenceIdName).project; + } + + /** + * Parse the location from ProjectLocationDocumentsReferenceId resource. + * + * @param {string} projectLocationDocumentsReferenceIdName + * A fully-qualified path representing project_location_documents_reference_id resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationDocumentsReferenceIdName(projectLocationDocumentsReferenceIdName: string) { + return this.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match(projectLocationDocumentsReferenceIdName).location; + } + + /** + * Parse the reference_id from ProjectLocationDocumentsReferenceId resource. + * + * @param {string} projectLocationDocumentsReferenceIdName + * A fully-qualified path representing project_location_documents_reference_id resource. + * @returns {string} A string representing the reference_id. + */ + matchReferenceIdFromProjectLocationDocumentsReferenceIdName(projectLocationDocumentsReferenceIdName: string) { + return this.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match(projectLocationDocumentsReferenceIdName).reference_id; + } + + /** + * Return a fully-qualified ruleSet resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rule_set + * @returns {string} Resource name string. + */ + ruleSetPath(project:string,location:string,ruleSet:string) { + return this.pathTemplates.ruleSetPathTemplate.render({ + project: project, + location: location, + rule_set: ruleSet, + }); + } + + /** + * Parse the project from RuleSet resource. + * + * @param {string} ruleSetName + * A fully-qualified path representing RuleSet resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRuleSetName(ruleSetName: string) { + return this.pathTemplates.ruleSetPathTemplate.match(ruleSetName).project; + } + + /** + * Parse the location from RuleSet resource. + * + * @param {string} ruleSetName + * A fully-qualified path representing RuleSet resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRuleSetName(ruleSetName: string) { + return this.pathTemplates.ruleSetPathTemplate.match(ruleSetName).location; + } + + /** + * Parse the rule_set from RuleSet resource. + * + * @param {string} ruleSetName + * A fully-qualified path representing RuleSet resource. + * @returns {string} A string representing the rule_set. + */ + matchRuleSetFromRuleSetName(ruleSetName: string) { + return this.pathTemplates.ruleSetPathTemplate.match(ruleSetName).rule_set; + } + + /** + * Return a fully-qualified synonymSet resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} context + * @returns {string} Resource name string. + */ + synonymSetPath(project:string,location:string,context:string) { + return this.pathTemplates.synonymSetPathTemplate.render({ + project: project, + location: location, + context: context, + }); + } + + /** + * Parse the project from SynonymSet resource. + * + * @param {string} synonymSetName + * A fully-qualified path representing SynonymSet resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSynonymSetName(synonymSetName: string) { + return this.pathTemplates.synonymSetPathTemplate.match(synonymSetName).project; + } + + /** + * Parse the location from SynonymSet resource. + * + * @param {string} synonymSetName + * A fully-qualified path representing SynonymSet resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSynonymSetName(synonymSetName: string) { + return this.pathTemplates.synonymSetPathTemplate.match(synonymSetName).location; + } + + /** + * Parse the context from SynonymSet resource. + * + * @param {string} synonymSetName + * A fully-qualified path representing SynonymSet resource. + * @returns {string} A string representing the context. + */ + matchContextFromSynonymSetName(synonymSetName: string) { + return this.pathTemplates.synonymSetPathTemplate.match(synonymSetName).context; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.documentSchemaServiceStub && !this._terminated) { + return this.documentSchemaServiceStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_schema_service_client_config.json b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_schema_service_client_config.json new file mode 100644 index 00000000000..80dfa82b9d0 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_schema_service_client_config.json @@ -0,0 +1,63 @@ +{ + "interfaces": { + "google.cloud.contentwarehouse.v1.DocumentSchemaService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "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 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateDocumentSchema": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateDocumentSchema": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetDocumentSchema": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "DeleteDocumentSchema": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListDocumentSchemas": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_schema_service_proto_list.json b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_schema_service_proto_list.json new file mode 100644 index 00000000000..a1775b1134d --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_schema_service_proto_list.json @@ -0,0 +1,23 @@ +[ + "../../protos/google/cloud/contentwarehouse/v1/async_document_service_request.proto", + "../../protos/google/cloud/contentwarehouse/v1/common.proto", + "../../protos/google/cloud/contentwarehouse/v1/document.proto", + "../../protos/google/cloud/contentwarehouse/v1/document_link_service.proto", + "../../protos/google/cloud/contentwarehouse/v1/document_schema.proto", + "../../protos/google/cloud/contentwarehouse/v1/document_schema_service.proto", + "../../protos/google/cloud/contentwarehouse/v1/document_service.proto", + "../../protos/google/cloud/contentwarehouse/v1/document_service_request.proto", + "../../protos/google/cloud/contentwarehouse/v1/filters.proto", + "../../protos/google/cloud/contentwarehouse/v1/histogram.proto", + "../../protos/google/cloud/contentwarehouse/v1/pipeline_service.proto", + "../../protos/google/cloud/contentwarehouse/v1/pipelines.proto", + "../../protos/google/cloud/contentwarehouse/v1/rule_engine.proto", + "../../protos/google/cloud/contentwarehouse/v1/ruleset_service.proto", + "../../protos/google/cloud/contentwarehouse/v1/ruleset_service_request.proto", + "../../protos/google/cloud/contentwarehouse/v1/synonymset.proto", + "../../protos/google/cloud/contentwarehouse/v1/synonymset_service.proto", + "../../protos/google/cloud/contentwarehouse/v1/synonymset_service_request.proto", + "../../protos/google/cloud/documentai/v1/barcode.proto", + "../../protos/google/cloud/documentai/v1/document.proto", + "../../protos/google/cloud/documentai/v1/geometry.proto" +] diff --git a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_service_client.ts b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_service_client.ts new file mode 100644 index 00000000000..b66b791d12b --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_service_client.ts @@ -0,0 +1,1907 @@ +// Copyright 2026 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 type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1/document_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './document_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * This service lets you manage document. + * @class + * @memberof v1 + */ +export class DocumentServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('contentwarehouse'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + documentServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of DocumentServiceClient. + * + * @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/main/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://cloud.google.com/docs/authentication/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/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new DocumentServiceClient({fallback: true}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof DocumentServiceClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'contentwarehouse.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + documentLinkPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/documents/{document}/documentLinks/{document_link}' + ), + documentSchemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/documentSchemas/{document_schema}' + ), + projectLocationDocumentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/documents/{document}' + ), + projectLocationDocumentsReferenceIdPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/documents/referenceId/{reference_id}' + ), + ruleSetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ruleSets/{rule_set}' + ), + synonymSetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/synonymSets/{context}' + ), + }; + + // 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 = { + searchDocuments: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'matchingDocuments') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.contentwarehouse.v1.DocumentService', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.documentServiceStub) { + return this.documentServiceStub; + } + + // Put together the "service stub" for + // google.cloud.contentwarehouse.v1.DocumentService. + this.documentServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.contentwarehouse.v1.DocumentService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.contentwarehouse.v1.DocumentService, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const documentServiceStubMethods = + ['createDocument', 'getDocument', 'updateDocument', 'deleteDocument', 'searchDocuments', 'lockDocument', 'fetchAcl', 'setAcl']; + for (const methodName of documentServiceStubMethods) { + const callPromise = this.documentServiceStub.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._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.documentServiceStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'contentwarehouse.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'contentwarehouse.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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 -- + // ------------------- +/** + * Creates a document. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent name. + * Format: projects/{project_number}/locations/{location}. + * @param {google.cloud.contentwarehouse.v1.Document} request.document + * Required. The document to create. + * @param {google.cloud.contentwarehouse.v1.RequestMetadata} request.requestMetadata + * The meta information collected about the end user, used to enforce access + * control for the service. + * @param {google.iam.v1.Policy} request.policy + * Default document policy during creation. + * This refers to an Identity and Access (IAM) policy, which specifies access + * controls for the Document. + * Conditions defined in the policy will be ignored. + * @param {google.cloud.contentwarehouse.v1.CloudAIDocumentOption} request.cloudAiDocumentOption + * Request Option for processing Cloud AI Document in Document Warehouse. + * This field offers limited support for mapping entities from Cloud AI + * Document to Warehouse Document. Please consult with product team before + * using this field and other available options. + * @param {google.protobuf.FieldMask} request.createMask + * Field mask for creating Document fields. If mask path is empty, + * it means all fields are masked. + * For the `FieldMask` definition, + * see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask. + * @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 {@link protos.google.cloud.contentwarehouse.v1.CreateDocumentResponse|CreateDocumentResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/document_service.create_document.js + * region_tag:contentwarehouse_v1_generated_DocumentService_CreateDocument_async + */ + createDocument( + request?: protos.google.cloud.contentwarehouse.v1.ICreateDocumentRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.contentwarehouse.v1.ICreateDocumentResponse, + protos.google.cloud.contentwarehouse.v1.ICreateDocumentRequest|undefined, {}|undefined + ]>; + createDocument( + request: protos.google.cloud.contentwarehouse.v1.ICreateDocumentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.contentwarehouse.v1.ICreateDocumentResponse, + protos.google.cloud.contentwarehouse.v1.ICreateDocumentRequest|null|undefined, + {}|null|undefined>): void; + createDocument( + request: protos.google.cloud.contentwarehouse.v1.ICreateDocumentRequest, + callback: Callback< + protos.google.cloud.contentwarehouse.v1.ICreateDocumentResponse, + protos.google.cloud.contentwarehouse.v1.ICreateDocumentRequest|null|undefined, + {}|null|undefined>): void; + createDocument( + request?: protos.google.cloud.contentwarehouse.v1.ICreateDocumentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.contentwarehouse.v1.ICreateDocumentResponse, + protos.google.cloud.contentwarehouse.v1.ICreateDocumentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.contentwarehouse.v1.ICreateDocumentResponse, + protos.google.cloud.contentwarehouse.v1.ICreateDocumentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.contentwarehouse.v1.ICreateDocumentResponse, + protos.google.cloud.contentwarehouse.v1.ICreateDocumentRequest|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createDocument request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.contentwarehouse.v1.ICreateDocumentResponse, + protos.google.cloud.contentwarehouse.v1.ICreateDocumentRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createDocument response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createDocument(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.contentwarehouse.v1.ICreateDocumentResponse, + protos.google.cloud.contentwarehouse.v1.ICreateDocumentRequest|undefined, + {}|undefined + ]) => { + this._log.info('createDocument response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets a document. Returns NOT_FOUND if the document does not exist. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the document to retrieve. + * Format: + * projects/{project_number}/locations/{location}/documents/{document_id} or + * projects/{project_number}/locations/{location}/documents/referenceId/{reference_id}. + * @param {google.cloud.contentwarehouse.v1.RequestMetadata} request.requestMetadata + * The meta information collected about the end user, used to enforce access + * control for the service. + * @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 {@link protos.google.cloud.contentwarehouse.v1.Document|Document}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/document_service.get_document.js + * region_tag:contentwarehouse_v1_generated_DocumentService_GetDocument_async + */ + getDocument( + request?: protos.google.cloud.contentwarehouse.v1.IGetDocumentRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.contentwarehouse.v1.IDocument, + protos.google.cloud.contentwarehouse.v1.IGetDocumentRequest|undefined, {}|undefined + ]>; + getDocument( + request: protos.google.cloud.contentwarehouse.v1.IGetDocumentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.contentwarehouse.v1.IDocument, + protos.google.cloud.contentwarehouse.v1.IGetDocumentRequest|null|undefined, + {}|null|undefined>): void; + getDocument( + request: protos.google.cloud.contentwarehouse.v1.IGetDocumentRequest, + callback: Callback< + protos.google.cloud.contentwarehouse.v1.IDocument, + protos.google.cloud.contentwarehouse.v1.IGetDocumentRequest|null|undefined, + {}|null|undefined>): void; + getDocument( + request?: protos.google.cloud.contentwarehouse.v1.IGetDocumentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.contentwarehouse.v1.IDocument, + protos.google.cloud.contentwarehouse.v1.IGetDocumentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.contentwarehouse.v1.IDocument, + protos.google.cloud.contentwarehouse.v1.IGetDocumentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.contentwarehouse.v1.IDocument, + protos.google.cloud.contentwarehouse.v1.IGetDocumentRequest|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getDocument request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.contentwarehouse.v1.IDocument, + protos.google.cloud.contentwarehouse.v1.IGetDocumentRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getDocument response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getDocument(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.contentwarehouse.v1.IDocument, + protos.google.cloud.contentwarehouse.v1.IGetDocumentRequest|undefined, + {}|undefined + ]) => { + this._log.info('getDocument response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Updates a document. Returns INVALID_ARGUMENT if the name of the document + * is non-empty and does not equal the existing name. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the document to update. + * Format: + * projects/{project_number}/locations/{location}/documents/{document_id} + * or + * projects/{project_number}/locations/{location}/documents/referenceId/{reference_id}. + * @param {google.cloud.contentwarehouse.v1.Document} request.document + * Required. The document to update. + * @param {google.cloud.contentwarehouse.v1.RequestMetadata} request.requestMetadata + * The meta information collected about the end user, used to enforce access + * control for the service. + * @param {google.cloud.contentwarehouse.v1.CloudAIDocumentOption} request.cloudAiDocumentOption + * Request Option for processing Cloud AI Document in Document Warehouse. + * This field offers limited support for mapping entities from Cloud AI + * Document to Warehouse Document. Please consult with product team before + * using this field and other available options. + * @param {google.cloud.contentwarehouse.v1.UpdateOptions} request.updateOptions + * Options for the update operation. + * @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 {@link protos.google.cloud.contentwarehouse.v1.UpdateDocumentResponse|UpdateDocumentResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/document_service.update_document.js + * region_tag:contentwarehouse_v1_generated_DocumentService_UpdateDocument_async + */ + updateDocument( + request?: protos.google.cloud.contentwarehouse.v1.IUpdateDocumentRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.contentwarehouse.v1.IUpdateDocumentResponse, + protos.google.cloud.contentwarehouse.v1.IUpdateDocumentRequest|undefined, {}|undefined + ]>; + updateDocument( + request: protos.google.cloud.contentwarehouse.v1.IUpdateDocumentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.contentwarehouse.v1.IUpdateDocumentResponse, + protos.google.cloud.contentwarehouse.v1.IUpdateDocumentRequest|null|undefined, + {}|null|undefined>): void; + updateDocument( + request: protos.google.cloud.contentwarehouse.v1.IUpdateDocumentRequest, + callback: Callback< + protos.google.cloud.contentwarehouse.v1.IUpdateDocumentResponse, + protos.google.cloud.contentwarehouse.v1.IUpdateDocumentRequest|null|undefined, + {}|null|undefined>): void; + updateDocument( + request?: protos.google.cloud.contentwarehouse.v1.IUpdateDocumentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.contentwarehouse.v1.IUpdateDocumentResponse, + protos.google.cloud.contentwarehouse.v1.IUpdateDocumentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.contentwarehouse.v1.IUpdateDocumentResponse, + protos.google.cloud.contentwarehouse.v1.IUpdateDocumentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.contentwarehouse.v1.IUpdateDocumentResponse, + protos.google.cloud.contentwarehouse.v1.IUpdateDocumentRequest|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateDocument request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.contentwarehouse.v1.IUpdateDocumentResponse, + protos.google.cloud.contentwarehouse.v1.IUpdateDocumentRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateDocument response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateDocument(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.contentwarehouse.v1.IUpdateDocumentResponse, + protos.google.cloud.contentwarehouse.v1.IUpdateDocumentRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateDocument response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Deletes a document. Returns NOT_FOUND if the document does not exist. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the document to delete. + * Format: + * projects/{project_number}/locations/{location}/documents/{document_id} + * or + * projects/{project_number}/locations/{location}/documents/referenceId/{reference_id}. + * @param {google.cloud.contentwarehouse.v1.RequestMetadata} request.requestMetadata + * The meta information collected about the end user, used to enforce access + * control for the service. + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/document_service.delete_document.js + * region_tag:contentwarehouse_v1_generated_DocumentService_DeleteDocument_async + */ + deleteDocument( + request?: protos.google.cloud.contentwarehouse.v1.IDeleteDocumentRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.contentwarehouse.v1.IDeleteDocumentRequest|undefined, {}|undefined + ]>; + deleteDocument( + request: protos.google.cloud.contentwarehouse.v1.IDeleteDocumentRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.contentwarehouse.v1.IDeleteDocumentRequest|null|undefined, + {}|null|undefined>): void; + deleteDocument( + request: protos.google.cloud.contentwarehouse.v1.IDeleteDocumentRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.contentwarehouse.v1.IDeleteDocumentRequest|null|undefined, + {}|null|undefined>): void; + deleteDocument( + request?: protos.google.cloud.contentwarehouse.v1.IDeleteDocumentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.contentwarehouse.v1.IDeleteDocumentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.contentwarehouse.v1.IDeleteDocumentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.contentwarehouse.v1.IDeleteDocumentRequest|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deleteDocument request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.contentwarehouse.v1.IDeleteDocumentRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteDocument response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteDocument(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.contentwarehouse.v1.IDeleteDocumentRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteDocument response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Lock the document so the document cannot be updated by other users. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the document to lock. + * Format: + * projects/{project_number}/locations/{location}/documents/{document}. + * @param {string} request.collectionId + * The collection the document connects to. + * @param {google.cloud.contentwarehouse.v1.UserInfo} request.lockingUser + * The user information who locks the document. + * @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 {@link protos.google.cloud.contentwarehouse.v1.Document|Document}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/document_service.lock_document.js + * region_tag:contentwarehouse_v1_generated_DocumentService_LockDocument_async + */ + lockDocument( + request?: protos.google.cloud.contentwarehouse.v1.ILockDocumentRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.contentwarehouse.v1.IDocument, + protos.google.cloud.contentwarehouse.v1.ILockDocumentRequest|undefined, {}|undefined + ]>; + lockDocument( + request: protos.google.cloud.contentwarehouse.v1.ILockDocumentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.contentwarehouse.v1.IDocument, + protos.google.cloud.contentwarehouse.v1.ILockDocumentRequest|null|undefined, + {}|null|undefined>): void; + lockDocument( + request: protos.google.cloud.contentwarehouse.v1.ILockDocumentRequest, + callback: Callback< + protos.google.cloud.contentwarehouse.v1.IDocument, + protos.google.cloud.contentwarehouse.v1.ILockDocumentRequest|null|undefined, + {}|null|undefined>): void; + lockDocument( + request?: protos.google.cloud.contentwarehouse.v1.ILockDocumentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.contentwarehouse.v1.IDocument, + protos.google.cloud.contentwarehouse.v1.ILockDocumentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.contentwarehouse.v1.IDocument, + protos.google.cloud.contentwarehouse.v1.ILockDocumentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.contentwarehouse.v1.IDocument, + protos.google.cloud.contentwarehouse.v1.ILockDocumentRequest|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('lockDocument request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.contentwarehouse.v1.IDocument, + protos.google.cloud.contentwarehouse.v1.ILockDocumentRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('lockDocument response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.lockDocument(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.contentwarehouse.v1.IDocument, + protos.google.cloud.contentwarehouse.v1.ILockDocumentRequest|undefined, + {}|undefined + ]) => { + this._log.info('lockDocument response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets the access control policy for a resource. Returns NOT_FOUND error if + * the resource does not exist. Returns an empty policy if the resource exists + * but does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * Required. REQUIRED: The resource for which the policy is being requested. + * Format for document: + * projects/{project_number}/locations/{location}/documents/{document_id}. + * Format for collection: + * projects/{project_number}/locations/{location}/collections/{collection_id}. + * Format for project: projects/{project_number}. + * @param {google.cloud.contentwarehouse.v1.RequestMetadata} request.requestMetadata + * The meta information collected about the end user, used to enforce access + * control for the service. + * @param {boolean} request.projectOwner + * For Get Project ACL only. Authorization check for end user will be ignored + * when project_owner=true. + * @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 {@link protos.google.cloud.contentwarehouse.v1.FetchAclResponse|FetchAclResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/document_service.fetch_acl.js + * region_tag:contentwarehouse_v1_generated_DocumentService_FetchAcl_async + */ + fetchAcl( + request?: protos.google.cloud.contentwarehouse.v1.IFetchAclRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.contentwarehouse.v1.IFetchAclResponse, + protos.google.cloud.contentwarehouse.v1.IFetchAclRequest|undefined, {}|undefined + ]>; + fetchAcl( + request: protos.google.cloud.contentwarehouse.v1.IFetchAclRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.contentwarehouse.v1.IFetchAclResponse, + protos.google.cloud.contentwarehouse.v1.IFetchAclRequest|null|undefined, + {}|null|undefined>): void; + fetchAcl( + request: protos.google.cloud.contentwarehouse.v1.IFetchAclRequest, + callback: Callback< + protos.google.cloud.contentwarehouse.v1.IFetchAclResponse, + protos.google.cloud.contentwarehouse.v1.IFetchAclRequest|null|undefined, + {}|null|undefined>): void; + fetchAcl( + request?: protos.google.cloud.contentwarehouse.v1.IFetchAclRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.contentwarehouse.v1.IFetchAclResponse, + protos.google.cloud.contentwarehouse.v1.IFetchAclRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.contentwarehouse.v1.IFetchAclResponse, + protos.google.cloud.contentwarehouse.v1.IFetchAclRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.contentwarehouse.v1.IFetchAclResponse, + protos.google.cloud.contentwarehouse.v1.IFetchAclRequest|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'resource': request.resource ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('fetchAcl request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.contentwarehouse.v1.IFetchAclResponse, + protos.google.cloud.contentwarehouse.v1.IFetchAclRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('fetchAcl response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.fetchAcl(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.contentwarehouse.v1.IFetchAclResponse, + protos.google.cloud.contentwarehouse.v1.IFetchAclRequest|undefined, + {}|undefined + ]) => { + this._log.info('fetchAcl response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Sets the access control policy for a resource. Replaces any existing + * policy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * Required. REQUIRED: The resource for which the policy is being requested. + * Format for document: + * projects/{project_number}/locations/{location}/documents/{document_id}. + * Format for collection: + * projects/{project_number}/locations/{location}/collections/{collection_id}. + * Format for project: projects/{project_number}. + * @param {google.iam.v1.Policy} request.policy + * Required. REQUIRED: The complete policy to be applied to the `resource`. + * The size of the policy is limited to a few 10s of KB. This refers to an + * Identity and Access (IAM) policy, which specifies access controls for the + * Document. + * + * You can set ACL with condition for projects only. + * + * Supported operators are: `=`, `!=`, `<`, `<=`, `>`, and `>=` where + * the left of the operator is `DocumentSchemaId` or property name and the + * right of the operator is a number or a quoted string. You must escape + * backslash (\\) and quote (\") characters. + * + * Boolean expressions (AND/OR) are supported up to 3 levels of nesting (for + * example, "((A AND B AND C) OR D) AND E"), a maximum of 10 comparisons are + * allowed in the expression. The expression must be < 6000 bytes in length. + * + * Sample condition: + * `"DocumentSchemaId = \"some schema id\" OR SchemaId.floatPropertyName + * >= 10"` + * @param {google.cloud.contentwarehouse.v1.RequestMetadata} request.requestMetadata + * The meta information collected about the end user, used to enforce access + * control for the service. + * @param {boolean} request.projectOwner + * For Set Project ACL only. Authorization check for end user will be ignored + * when project_owner=true. + * @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 {@link protos.google.cloud.contentwarehouse.v1.SetAclResponse|SetAclResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/document_service.set_acl.js + * region_tag:contentwarehouse_v1_generated_DocumentService_SetAcl_async + */ + setAcl( + request?: protos.google.cloud.contentwarehouse.v1.ISetAclRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.contentwarehouse.v1.ISetAclResponse, + protos.google.cloud.contentwarehouse.v1.ISetAclRequest|undefined, {}|undefined + ]>; + setAcl( + request: protos.google.cloud.contentwarehouse.v1.ISetAclRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.contentwarehouse.v1.ISetAclResponse, + protos.google.cloud.contentwarehouse.v1.ISetAclRequest|null|undefined, + {}|null|undefined>): void; + setAcl( + request: protos.google.cloud.contentwarehouse.v1.ISetAclRequest, + callback: Callback< + protos.google.cloud.contentwarehouse.v1.ISetAclResponse, + protos.google.cloud.contentwarehouse.v1.ISetAclRequest|null|undefined, + {}|null|undefined>): void; + setAcl( + request?: protos.google.cloud.contentwarehouse.v1.ISetAclRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.contentwarehouse.v1.ISetAclResponse, + protos.google.cloud.contentwarehouse.v1.ISetAclRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.contentwarehouse.v1.ISetAclResponse, + protos.google.cloud.contentwarehouse.v1.ISetAclRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.contentwarehouse.v1.ISetAclResponse, + protos.google.cloud.contentwarehouse.v1.ISetAclRequest|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'resource': request.resource ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('setAcl request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.contentwarehouse.v1.ISetAclResponse, + protos.google.cloud.contentwarehouse.v1.ISetAclRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('setAcl response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.setAcl(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.contentwarehouse.v1.ISetAclResponse, + protos.google.cloud.contentwarehouse.v1.ISetAclRequest|undefined, + {}|undefined + ]) => { + this._log.info('setAcl response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + + /** + * Searches for documents using provided + * {@link protos.google.cloud.contentwarehouse.v1.SearchDocumentsRequest|SearchDocumentsRequest}. + * This call only returns documents that the caller has permission to search + * against. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of documents. + * Format: projects/{project_number}/locations/{location}. + * @param {google.cloud.contentwarehouse.v1.RequestMetadata} request.requestMetadata + * The meta information collected about the end user, used to enforce access + * control and improve the search quality of the service. + * @param {google.cloud.contentwarehouse.v1.DocumentQuery} request.documentQuery + * Query used to search against documents (keyword, filters, etc.). + * @param {number} request.offset + * An integer that specifies the current offset (that is, starting result + * location, amongst the documents deemed by the API as relevant) in search + * results. This field is only considered if + * {@link protos.google.cloud.contentwarehouse.v1.SearchDocumentsRequest.page_token|page_token} + * is unset. + * + * The maximum allowed value is 5000. Otherwise an error is thrown. + * + * For example, 0 means to return results starting from the first matching + * document, and 10 means to return from the 11th document. This can be used + * for pagination, (for example, pageSize = 10 and offset = 10 means to return + * from the second page). + * @param {number} request.pageSize + * A limit on the number of documents returned in the search results. + * Increasing this value above the default value of 10 can increase search + * response time. The value can be between 1 and 100. + * @param {string} request.pageToken + * The token specifying the current offset within search results. + * See + * {@link protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.next_page_token|SearchDocumentsResponse.next_page_token} + * for an explanation of how to obtain the next set of query results. + * @param {string} request.orderBy + * The criteria determining how search results are sorted. For non-empty + * query, default is `"relevance desc"`. For empty query, default is + * `"upload_date desc"`. + * + * Supported options are: + * + * * `"relevance desc"`: By relevance descending, as determined by the API + * algorithms. + * * `"upload_date desc"`: By upload date descending. + * * `"upload_date"`: By upload date ascending. + * * `"update_date desc"`: By last updated date descending. + * * `"update_date"`: By last updated date ascending. + * * `"retrieval_importance desc"`: By retrieval importance of properties + * descending. This feature is still under development, please do not use + * unless otherwise instructed to do so. + * @param {number[]} request.histogramQueries + * An expression specifying a histogram request against matching + * documents. Expression syntax is an aggregation function call with + * histogram facets and other options. + * + * The following aggregation functions are supported: + * + * * `count(string_histogram_facet)`: Count the number of matching entities + * for each distinct attribute value. + * + * Data types: + * + * * Histogram facet (aka filterable properties): Facet names with format + * <schema id>.<facet>. Facets will have the + * format of: `{@link protos.a-zA-Z0-9_:/-.|a-zA-Z}`. If the facet is a child + * facet, then the parent hierarchy needs to be specified separated by + * dots in the prefix after the schema id. Thus, the format for a multi- + * level facet is: <schema id>.<parent facet name>. + * <child facet name>. Example: + * schema123.root_parent_facet.middle_facet.child_facet + * * DocumentSchemaId: (with no schema id prefix) to get + * histograms for each document type (returns the schema id path, e.g. + * projects/12345/locations/us-west/documentSchemas/abc123). + * + * Example expression: + * + * * Document type counts: + * count('DocumentSchemaId') + * + * * For schema id, abc123, get the counts for MORTGAGE_TYPE: + * count('abc123.MORTGAGE_TYPE') + * @param {boolean} request.requireTotalSize + * Controls if the search document request requires the return of a total size + * of matched documents. See + * {@link protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.total_size|SearchDocumentsResponse.total_size}. + * + * Enabling this flag may adversely impact performance. Hint: If this is + * used with pagination, set this flag on the initial query but set this + * to false on subsequent page calls (keep the total count locally). + * + * Defaults to false. + * @param {google.cloud.contentwarehouse.v1.SearchDocumentsRequest.TotalResultSize} request.totalResultSize + * Controls if the search document request requires the return of a total size + * of matched documents. See + * {@link protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.total_size|SearchDocumentsResponse.total_size}. + * @param {number} request.qaSizeLimit + * Experimental, do not use. + * The limit on the number of documents returned for the question-answering + * feature. To enable the question-answering feature, set + * {@link protos.|DocumentQuery].[is_nl_query} to true. + * @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 {@link protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument|MatchingDocument}. + * 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 `searchDocumentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + searchDocuments( + request?: protos.google.cloud.contentwarehouse.v1.ISearchDocumentsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.IMatchingDocument[], + protos.google.cloud.contentwarehouse.v1.ISearchDocumentsRequest|null, + protos.google.cloud.contentwarehouse.v1.ISearchDocumentsResponse + ]>; + searchDocuments( + request: protos.google.cloud.contentwarehouse.v1.ISearchDocumentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.contentwarehouse.v1.ISearchDocumentsRequest, + protos.google.cloud.contentwarehouse.v1.ISearchDocumentsResponse|null|undefined, + protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.IMatchingDocument>): void; + searchDocuments( + request: protos.google.cloud.contentwarehouse.v1.ISearchDocumentsRequest, + callback: PaginationCallback< + protos.google.cloud.contentwarehouse.v1.ISearchDocumentsRequest, + protos.google.cloud.contentwarehouse.v1.ISearchDocumentsResponse|null|undefined, + protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.IMatchingDocument>): void; + searchDocuments( + request?: protos.google.cloud.contentwarehouse.v1.ISearchDocumentsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.contentwarehouse.v1.ISearchDocumentsRequest, + protos.google.cloud.contentwarehouse.v1.ISearchDocumentsResponse|null|undefined, + protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.IMatchingDocument>, + callback?: PaginationCallback< + protos.google.cloud.contentwarehouse.v1.ISearchDocumentsRequest, + protos.google.cloud.contentwarehouse.v1.ISearchDocumentsResponse|null|undefined, + protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.IMatchingDocument>): + Promise<[ + protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.IMatchingDocument[], + protos.google.cloud.contentwarehouse.v1.ISearchDocumentsRequest|null, + protos.google.cloud.contentwarehouse.v1.ISearchDocumentsResponse + ]>|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.contentwarehouse.v1.ISearchDocumentsRequest, + protos.google.cloud.contentwarehouse.v1.ISearchDocumentsResponse|null|undefined, + protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.IMatchingDocument>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('searchDocuments values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('searchDocuments request %j', request); + return this.innerApiCalls + .searchDocuments(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.IMatchingDocument[], + protos.google.cloud.contentwarehouse.v1.ISearchDocumentsRequest|null, + protos.google.cloud.contentwarehouse.v1.ISearchDocumentsResponse + ]) => { + this._log.info('searchDocuments values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `searchDocuments`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of documents. + * Format: projects/{project_number}/locations/{location}. + * @param {google.cloud.contentwarehouse.v1.RequestMetadata} request.requestMetadata + * The meta information collected about the end user, used to enforce access + * control and improve the search quality of the service. + * @param {google.cloud.contentwarehouse.v1.DocumentQuery} request.documentQuery + * Query used to search against documents (keyword, filters, etc.). + * @param {number} request.offset + * An integer that specifies the current offset (that is, starting result + * location, amongst the documents deemed by the API as relevant) in search + * results. This field is only considered if + * {@link protos.google.cloud.contentwarehouse.v1.SearchDocumentsRequest.page_token|page_token} + * is unset. + * + * The maximum allowed value is 5000. Otherwise an error is thrown. + * + * For example, 0 means to return results starting from the first matching + * document, and 10 means to return from the 11th document. This can be used + * for pagination, (for example, pageSize = 10 and offset = 10 means to return + * from the second page). + * @param {number} request.pageSize + * A limit on the number of documents returned in the search results. + * Increasing this value above the default value of 10 can increase search + * response time. The value can be between 1 and 100. + * @param {string} request.pageToken + * The token specifying the current offset within search results. + * See + * {@link protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.next_page_token|SearchDocumentsResponse.next_page_token} + * for an explanation of how to obtain the next set of query results. + * @param {string} request.orderBy + * The criteria determining how search results are sorted. For non-empty + * query, default is `"relevance desc"`. For empty query, default is + * `"upload_date desc"`. + * + * Supported options are: + * + * * `"relevance desc"`: By relevance descending, as determined by the API + * algorithms. + * * `"upload_date desc"`: By upload date descending. + * * `"upload_date"`: By upload date ascending. + * * `"update_date desc"`: By last updated date descending. + * * `"update_date"`: By last updated date ascending. + * * `"retrieval_importance desc"`: By retrieval importance of properties + * descending. This feature is still under development, please do not use + * unless otherwise instructed to do so. + * @param {number[]} request.histogramQueries + * An expression specifying a histogram request against matching + * documents. Expression syntax is an aggregation function call with + * histogram facets and other options. + * + * The following aggregation functions are supported: + * + * * `count(string_histogram_facet)`: Count the number of matching entities + * for each distinct attribute value. + * + * Data types: + * + * * Histogram facet (aka filterable properties): Facet names with format + * <schema id>.<facet>. Facets will have the + * format of: `{@link protos.a-zA-Z0-9_:/-.|a-zA-Z}`. If the facet is a child + * facet, then the parent hierarchy needs to be specified separated by + * dots in the prefix after the schema id. Thus, the format for a multi- + * level facet is: <schema id>.<parent facet name>. + * <child facet name>. Example: + * schema123.root_parent_facet.middle_facet.child_facet + * * DocumentSchemaId: (with no schema id prefix) to get + * histograms for each document type (returns the schema id path, e.g. + * projects/12345/locations/us-west/documentSchemas/abc123). + * + * Example expression: + * + * * Document type counts: + * count('DocumentSchemaId') + * + * * For schema id, abc123, get the counts for MORTGAGE_TYPE: + * count('abc123.MORTGAGE_TYPE') + * @param {boolean} request.requireTotalSize + * Controls if the search document request requires the return of a total size + * of matched documents. See + * {@link protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.total_size|SearchDocumentsResponse.total_size}. + * + * Enabling this flag may adversely impact performance. Hint: If this is + * used with pagination, set this flag on the initial query but set this + * to false on subsequent page calls (keep the total count locally). + * + * Defaults to false. + * @param {google.cloud.contentwarehouse.v1.SearchDocumentsRequest.TotalResultSize} request.totalResultSize + * Controls if the search document request requires the return of a total size + * of matched documents. See + * {@link protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.total_size|SearchDocumentsResponse.total_size}. + * @param {number} request.qaSizeLimit + * Experimental, do not use. + * The limit on the number of documents returned for the question-answering + * feature. To enable the question-answering feature, set + * {@link protos.|DocumentQuery].[is_nl_query} to true. + * @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 {@link protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument|MatchingDocument} 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 `searchDocumentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + searchDocumentsStream( + request?: protos.google.cloud.contentwarehouse.v1.ISearchDocumentsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['searchDocuments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('searchDocuments stream %j', request); + return this.descriptors.page.searchDocuments.createStream( + this.innerApiCalls.searchDocuments as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `searchDocuments`, 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. The parent, which owns this collection of documents. + * Format: projects/{project_number}/locations/{location}. + * @param {google.cloud.contentwarehouse.v1.RequestMetadata} request.requestMetadata + * The meta information collected about the end user, used to enforce access + * control and improve the search quality of the service. + * @param {google.cloud.contentwarehouse.v1.DocumentQuery} request.documentQuery + * Query used to search against documents (keyword, filters, etc.). + * @param {number} request.offset + * An integer that specifies the current offset (that is, starting result + * location, amongst the documents deemed by the API as relevant) in search + * results. This field is only considered if + * {@link protos.google.cloud.contentwarehouse.v1.SearchDocumentsRequest.page_token|page_token} + * is unset. + * + * The maximum allowed value is 5000. Otherwise an error is thrown. + * + * For example, 0 means to return results starting from the first matching + * document, and 10 means to return from the 11th document. This can be used + * for pagination, (for example, pageSize = 10 and offset = 10 means to return + * from the second page). + * @param {number} request.pageSize + * A limit on the number of documents returned in the search results. + * Increasing this value above the default value of 10 can increase search + * response time. The value can be between 1 and 100. + * @param {string} request.pageToken + * The token specifying the current offset within search results. + * See + * {@link protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.next_page_token|SearchDocumentsResponse.next_page_token} + * for an explanation of how to obtain the next set of query results. + * @param {string} request.orderBy + * The criteria determining how search results are sorted. For non-empty + * query, default is `"relevance desc"`. For empty query, default is + * `"upload_date desc"`. + * + * Supported options are: + * + * * `"relevance desc"`: By relevance descending, as determined by the API + * algorithms. + * * `"upload_date desc"`: By upload date descending. + * * `"upload_date"`: By upload date ascending. + * * `"update_date desc"`: By last updated date descending. + * * `"update_date"`: By last updated date ascending. + * * `"retrieval_importance desc"`: By retrieval importance of properties + * descending. This feature is still under development, please do not use + * unless otherwise instructed to do so. + * @param {number[]} request.histogramQueries + * An expression specifying a histogram request against matching + * documents. Expression syntax is an aggregation function call with + * histogram facets and other options. + * + * The following aggregation functions are supported: + * + * * `count(string_histogram_facet)`: Count the number of matching entities + * for each distinct attribute value. + * + * Data types: + * + * * Histogram facet (aka filterable properties): Facet names with format + * <schema id>.<facet>. Facets will have the + * format of: `{@link protos.a-zA-Z0-9_:/-.|a-zA-Z}`. If the facet is a child + * facet, then the parent hierarchy needs to be specified separated by + * dots in the prefix after the schema id. Thus, the format for a multi- + * level facet is: <schema id>.<parent facet name>. + * <child facet name>. Example: + * schema123.root_parent_facet.middle_facet.child_facet + * * DocumentSchemaId: (with no schema id prefix) to get + * histograms for each document type (returns the schema id path, e.g. + * projects/12345/locations/us-west/documentSchemas/abc123). + * + * Example expression: + * + * * Document type counts: + * count('DocumentSchemaId') + * + * * For schema id, abc123, get the counts for MORTGAGE_TYPE: + * count('abc123.MORTGAGE_TYPE') + * @param {boolean} request.requireTotalSize + * Controls if the search document request requires the return of a total size + * of matched documents. See + * {@link protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.total_size|SearchDocumentsResponse.total_size}. + * + * Enabling this flag may adversely impact performance. Hint: If this is + * used with pagination, set this flag on the initial query but set this + * to false on subsequent page calls (keep the total count locally). + * + * Defaults to false. + * @param {google.cloud.contentwarehouse.v1.SearchDocumentsRequest.TotalResultSize} request.totalResultSize + * Controls if the search document request requires the return of a total size + * of matched documents. See + * {@link protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.total_size|SearchDocumentsResponse.total_size}. + * @param {number} request.qaSizeLimit + * Experimental, do not use. + * The limit on the number of documents returned for the question-answering + * feature. To enable the question-answering feature, set + * {@link protos.|DocumentQuery].[is_nl_query} to true. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument|MatchingDocument}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/document_service.search_documents.js + * region_tag:contentwarehouse_v1_generated_DocumentService_SearchDocuments_async + */ + searchDocumentsAsync( + request?: protos.google.cloud.contentwarehouse.v1.ISearchDocumentsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['searchDocuments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('searchDocuments iterate %j', request); + return this.descriptors.page.searchDocuments.asyncIterate( + this.innerApiCalls['searchDocuments'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified documentLink resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} document + * @param {string} document_link + * @returns {string} Resource name string. + */ + documentLinkPath(project:string,location:string,document:string,documentLink:string) { + return this.pathTemplates.documentLinkPathTemplate.render({ + project: project, + location: location, + document: document, + document_link: documentLink, + }); + } + + /** + * Parse the project from DocumentLink resource. + * + * @param {string} documentLinkName + * A fully-qualified path representing DocumentLink resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDocumentLinkName(documentLinkName: string) { + return this.pathTemplates.documentLinkPathTemplate.match(documentLinkName).project; + } + + /** + * Parse the location from DocumentLink resource. + * + * @param {string} documentLinkName + * A fully-qualified path representing DocumentLink resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDocumentLinkName(documentLinkName: string) { + return this.pathTemplates.documentLinkPathTemplate.match(documentLinkName).location; + } + + /** + * Parse the document from DocumentLink resource. + * + * @param {string} documentLinkName + * A fully-qualified path representing DocumentLink resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromDocumentLinkName(documentLinkName: string) { + return this.pathTemplates.documentLinkPathTemplate.match(documentLinkName).document; + } + + /** + * Parse the document_link from DocumentLink resource. + * + * @param {string} documentLinkName + * A fully-qualified path representing DocumentLink resource. + * @returns {string} A string representing the document_link. + */ + matchDocumentLinkFromDocumentLinkName(documentLinkName: string) { + return this.pathTemplates.documentLinkPathTemplate.match(documentLinkName).document_link; + } + + /** + * Return a fully-qualified documentSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} document_schema + * @returns {string} Resource name string. + */ + documentSchemaPath(project:string,location:string,documentSchema:string) { + return this.pathTemplates.documentSchemaPathTemplate.render({ + project: project, + location: location, + document_schema: documentSchema, + }); + } + + /** + * Parse the project from DocumentSchema resource. + * + * @param {string} documentSchemaName + * A fully-qualified path representing DocumentSchema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDocumentSchemaName(documentSchemaName: string) { + return this.pathTemplates.documentSchemaPathTemplate.match(documentSchemaName).project; + } + + /** + * Parse the location from DocumentSchema resource. + * + * @param {string} documentSchemaName + * A fully-qualified path representing DocumentSchema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDocumentSchemaName(documentSchemaName: string) { + return this.pathTemplates.documentSchemaPathTemplate.match(documentSchemaName).location; + } + + /** + * Parse the document_schema from DocumentSchema resource. + * + * @param {string} documentSchemaName + * A fully-qualified path representing DocumentSchema resource. + * @returns {string} A string representing the document_schema. + */ + matchDocumentSchemaFromDocumentSchemaName(documentSchemaName: string) { + return this.pathTemplates.documentSchemaPathTemplate.match(documentSchemaName).document_schema; + } + + /** + * Return a fully-qualified projectLocationDocument resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} document + * @returns {string} Resource name string. + */ + projectLocationDocumentPath(project:string,location:string,document:string) { + return this.pathTemplates.projectLocationDocumentPathTemplate.render({ + project: project, + location: location, + document: document, + }); + } + + /** + * Parse the project from ProjectLocationDocument resource. + * + * @param {string} projectLocationDocumentName + * A fully-qualified path representing project_location_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationDocumentName(projectLocationDocumentName: string) { + return this.pathTemplates.projectLocationDocumentPathTemplate.match(projectLocationDocumentName).project; + } + + /** + * Parse the location from ProjectLocationDocument resource. + * + * @param {string} projectLocationDocumentName + * A fully-qualified path representing project_location_document resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationDocumentName(projectLocationDocumentName: string) { + return this.pathTemplates.projectLocationDocumentPathTemplate.match(projectLocationDocumentName).location; + } + + /** + * Parse the document from ProjectLocationDocument resource. + * + * @param {string} projectLocationDocumentName + * A fully-qualified path representing project_location_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectLocationDocumentName(projectLocationDocumentName: string) { + return this.pathTemplates.projectLocationDocumentPathTemplate.match(projectLocationDocumentName).document; + } + + /** + * Return a fully-qualified projectLocationDocumentsReferenceId resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} reference_id + * @returns {string} Resource name string. + */ + projectLocationDocumentsReferenceIdPath(project:string,location:string,referenceId:string) { + return this.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.render({ + project: project, + location: location, + reference_id: referenceId, + }); + } + + /** + * Parse the project from ProjectLocationDocumentsReferenceId resource. + * + * @param {string} projectLocationDocumentsReferenceIdName + * A fully-qualified path representing project_location_documents_reference_id resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationDocumentsReferenceIdName(projectLocationDocumentsReferenceIdName: string) { + return this.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match(projectLocationDocumentsReferenceIdName).project; + } + + /** + * Parse the location from ProjectLocationDocumentsReferenceId resource. + * + * @param {string} projectLocationDocumentsReferenceIdName + * A fully-qualified path representing project_location_documents_reference_id resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationDocumentsReferenceIdName(projectLocationDocumentsReferenceIdName: string) { + return this.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match(projectLocationDocumentsReferenceIdName).location; + } + + /** + * Parse the reference_id from ProjectLocationDocumentsReferenceId resource. + * + * @param {string} projectLocationDocumentsReferenceIdName + * A fully-qualified path representing project_location_documents_reference_id resource. + * @returns {string} A string representing the reference_id. + */ + matchReferenceIdFromProjectLocationDocumentsReferenceIdName(projectLocationDocumentsReferenceIdName: string) { + return this.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match(projectLocationDocumentsReferenceIdName).reference_id; + } + + /** + * Return a fully-qualified ruleSet resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rule_set + * @returns {string} Resource name string. + */ + ruleSetPath(project:string,location:string,ruleSet:string) { + return this.pathTemplates.ruleSetPathTemplate.render({ + project: project, + location: location, + rule_set: ruleSet, + }); + } + + /** + * Parse the project from RuleSet resource. + * + * @param {string} ruleSetName + * A fully-qualified path representing RuleSet resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRuleSetName(ruleSetName: string) { + return this.pathTemplates.ruleSetPathTemplate.match(ruleSetName).project; + } + + /** + * Parse the location from RuleSet resource. + * + * @param {string} ruleSetName + * A fully-qualified path representing RuleSet resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRuleSetName(ruleSetName: string) { + return this.pathTemplates.ruleSetPathTemplate.match(ruleSetName).location; + } + + /** + * Parse the rule_set from RuleSet resource. + * + * @param {string} ruleSetName + * A fully-qualified path representing RuleSet resource. + * @returns {string} A string representing the rule_set. + */ + matchRuleSetFromRuleSetName(ruleSetName: string) { + return this.pathTemplates.ruleSetPathTemplate.match(ruleSetName).rule_set; + } + + /** + * Return a fully-qualified synonymSet resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} context + * @returns {string} Resource name string. + */ + synonymSetPath(project:string,location:string,context:string) { + return this.pathTemplates.synonymSetPathTemplate.render({ + project: project, + location: location, + context: context, + }); + } + + /** + * Parse the project from SynonymSet resource. + * + * @param {string} synonymSetName + * A fully-qualified path representing SynonymSet resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSynonymSetName(synonymSetName: string) { + return this.pathTemplates.synonymSetPathTemplate.match(synonymSetName).project; + } + + /** + * Parse the location from SynonymSet resource. + * + * @param {string} synonymSetName + * A fully-qualified path representing SynonymSet resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSynonymSetName(synonymSetName: string) { + return this.pathTemplates.synonymSetPathTemplate.match(synonymSetName).location; + } + + /** + * Parse the context from SynonymSet resource. + * + * @param {string} synonymSetName + * A fully-qualified path representing SynonymSet resource. + * @returns {string} A string representing the context. + */ + matchContextFromSynonymSetName(synonymSetName: string) { + return this.pathTemplates.synonymSetPathTemplate.match(synonymSetName).context; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.documentServiceStub && !this._terminated) { + return this.documentServiceStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_service_client_config.json b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_service_client_config.json new file mode 100644 index 00000000000..5e6b92bc69b --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_service_client_config.json @@ -0,0 +1,77 @@ +{ + "interfaces": { + "google.cloud.contentwarehouse.v1.DocumentService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "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 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateDocument": { + "timeout_millis": 180000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetDocument": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateDocument": { + "timeout_millis": 180000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteDocument": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SearchDocuments": { + "timeout_millis": 180000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "LockDocument": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "FetchAcl": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "SetAcl": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_service_proto_list.json b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_service_proto_list.json new file mode 100644 index 00000000000..a1775b1134d --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_service_proto_list.json @@ -0,0 +1,23 @@ +[ + "../../protos/google/cloud/contentwarehouse/v1/async_document_service_request.proto", + "../../protos/google/cloud/contentwarehouse/v1/common.proto", + "../../protos/google/cloud/contentwarehouse/v1/document.proto", + "../../protos/google/cloud/contentwarehouse/v1/document_link_service.proto", + "../../protos/google/cloud/contentwarehouse/v1/document_schema.proto", + "../../protos/google/cloud/contentwarehouse/v1/document_schema_service.proto", + "../../protos/google/cloud/contentwarehouse/v1/document_service.proto", + "../../protos/google/cloud/contentwarehouse/v1/document_service_request.proto", + "../../protos/google/cloud/contentwarehouse/v1/filters.proto", + "../../protos/google/cloud/contentwarehouse/v1/histogram.proto", + "../../protos/google/cloud/contentwarehouse/v1/pipeline_service.proto", + "../../protos/google/cloud/contentwarehouse/v1/pipelines.proto", + "../../protos/google/cloud/contentwarehouse/v1/rule_engine.proto", + "../../protos/google/cloud/contentwarehouse/v1/ruleset_service.proto", + "../../protos/google/cloud/contentwarehouse/v1/ruleset_service_request.proto", + "../../protos/google/cloud/contentwarehouse/v1/synonymset.proto", + "../../protos/google/cloud/contentwarehouse/v1/synonymset_service.proto", + "../../protos/google/cloud/contentwarehouse/v1/synonymset_service_request.proto", + "../../protos/google/cloud/documentai/v1/barcode.proto", + "../../protos/google/cloud/documentai/v1/document.proto", + "../../protos/google/cloud/documentai/v1/geometry.proto" +] diff --git a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/gapic_metadata.json b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..a81852f4a41 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/gapic_metadata.json @@ -0,0 +1,393 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.contentwarehouse.v1", + "libraryPackage": "@google-cloud/contentwarehouse", + "services": { + "DocumentLinkService": { + "clients": { + "grpc": { + "libraryClient": "DocumentLinkServiceClient", + "rpcs": { + "ListLinkedTargets": { + "methods": [ + "listLinkedTargets" + ] + }, + "CreateDocumentLink": { + "methods": [ + "createDocumentLink" + ] + }, + "DeleteDocumentLink": { + "methods": [ + "deleteDocumentLink" + ] + }, + "ListLinkedSources": { + "methods": [ + "listLinkedSources", + "listLinkedSourcesStream", + "listLinkedSourcesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "DocumentLinkServiceClient", + "rpcs": { + "ListLinkedTargets": { + "methods": [ + "listLinkedTargets" + ] + }, + "CreateDocumentLink": { + "methods": [ + "createDocumentLink" + ] + }, + "DeleteDocumentLink": { + "methods": [ + "deleteDocumentLink" + ] + }, + "ListLinkedSources": { + "methods": [ + "listLinkedSources", + "listLinkedSourcesStream", + "listLinkedSourcesAsync" + ] + } + } + } + } + }, + "DocumentSchemaService": { + "clients": { + "grpc": { + "libraryClient": "DocumentSchemaServiceClient", + "rpcs": { + "CreateDocumentSchema": { + "methods": [ + "createDocumentSchema" + ] + }, + "UpdateDocumentSchema": { + "methods": [ + "updateDocumentSchema" + ] + }, + "GetDocumentSchema": { + "methods": [ + "getDocumentSchema" + ] + }, + "DeleteDocumentSchema": { + "methods": [ + "deleteDocumentSchema" + ] + }, + "ListDocumentSchemas": { + "methods": [ + "listDocumentSchemas", + "listDocumentSchemasStream", + "listDocumentSchemasAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "DocumentSchemaServiceClient", + "rpcs": { + "CreateDocumentSchema": { + "methods": [ + "createDocumentSchema" + ] + }, + "UpdateDocumentSchema": { + "methods": [ + "updateDocumentSchema" + ] + }, + "GetDocumentSchema": { + "methods": [ + "getDocumentSchema" + ] + }, + "DeleteDocumentSchema": { + "methods": [ + "deleteDocumentSchema" + ] + }, + "ListDocumentSchemas": { + "methods": [ + "listDocumentSchemas", + "listDocumentSchemasStream", + "listDocumentSchemasAsync" + ] + } + } + } + } + }, + "DocumentService": { + "clients": { + "grpc": { + "libraryClient": "DocumentServiceClient", + "rpcs": { + "CreateDocument": { + "methods": [ + "createDocument" + ] + }, + "GetDocument": { + "methods": [ + "getDocument" + ] + }, + "UpdateDocument": { + "methods": [ + "updateDocument" + ] + }, + "DeleteDocument": { + "methods": [ + "deleteDocument" + ] + }, + "LockDocument": { + "methods": [ + "lockDocument" + ] + }, + "FetchAcl": { + "methods": [ + "fetchAcl" + ] + }, + "SetAcl": { + "methods": [ + "setAcl" + ] + }, + "SearchDocuments": { + "methods": [ + "searchDocuments", + "searchDocumentsStream", + "searchDocumentsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "DocumentServiceClient", + "rpcs": { + "CreateDocument": { + "methods": [ + "createDocument" + ] + }, + "GetDocument": { + "methods": [ + "getDocument" + ] + }, + "UpdateDocument": { + "methods": [ + "updateDocument" + ] + }, + "DeleteDocument": { + "methods": [ + "deleteDocument" + ] + }, + "LockDocument": { + "methods": [ + "lockDocument" + ] + }, + "FetchAcl": { + "methods": [ + "fetchAcl" + ] + }, + "SetAcl": { + "methods": [ + "setAcl" + ] + }, + "SearchDocuments": { + "methods": [ + "searchDocuments", + "searchDocumentsStream", + "searchDocumentsAsync" + ] + } + } + } + } + }, + "PipelineService": { + "clients": { + "grpc": { + "libraryClient": "PipelineServiceClient", + "rpcs": { + "RunPipeline": { + "methods": [ + "runPipeline" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "PipelineServiceClient", + "rpcs": { + "RunPipeline": { + "methods": [ + "runPipeline" + ] + } + } + } + } + }, + "RuleSetService": { + "clients": { + "grpc": { + "libraryClient": "RuleSetServiceClient", + "rpcs": { + "CreateRuleSet": { + "methods": [ + "createRuleSet" + ] + }, + "GetRuleSet": { + "methods": [ + "getRuleSet" + ] + }, + "UpdateRuleSet": { + "methods": [ + "updateRuleSet" + ] + }, + "DeleteRuleSet": { + "methods": [ + "deleteRuleSet" + ] + }, + "ListRuleSets": { + "methods": [ + "listRuleSets", + "listRuleSetsStream", + "listRuleSetsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "RuleSetServiceClient", + "rpcs": { + "CreateRuleSet": { + "methods": [ + "createRuleSet" + ] + }, + "GetRuleSet": { + "methods": [ + "getRuleSet" + ] + }, + "UpdateRuleSet": { + "methods": [ + "updateRuleSet" + ] + }, + "DeleteRuleSet": { + "methods": [ + "deleteRuleSet" + ] + }, + "ListRuleSets": { + "methods": [ + "listRuleSets", + "listRuleSetsStream", + "listRuleSetsAsync" + ] + } + } + } + } + }, + "SynonymSetService": { + "clients": { + "grpc": { + "libraryClient": "SynonymSetServiceClient", + "rpcs": { + "CreateSynonymSet": { + "methods": [ + "createSynonymSet" + ] + }, + "GetSynonymSet": { + "methods": [ + "getSynonymSet" + ] + }, + "UpdateSynonymSet": { + "methods": [ + "updateSynonymSet" + ] + }, + "DeleteSynonymSet": { + "methods": [ + "deleteSynonymSet" + ] + }, + "ListSynonymSets": { + "methods": [ + "listSynonymSets", + "listSynonymSetsStream", + "listSynonymSetsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "SynonymSetServiceClient", + "rpcs": { + "CreateSynonymSet": { + "methods": [ + "createSynonymSet" + ] + }, + "GetSynonymSet": { + "methods": [ + "getSynonymSet" + ] + }, + "UpdateSynonymSet": { + "methods": [ + "updateSynonymSet" + ] + }, + "DeleteSynonymSet": { + "methods": [ + "deleteSynonymSet" + ] + }, + "ListSynonymSets": { + "methods": [ + "listSynonymSets", + "listSynonymSetsStream", + "listSynonymSetsAsync" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/index.ts b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/index.ts new file mode 100644 index 00000000000..e6134079557 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/index.ts @@ -0,0 +1,24 @@ +// Copyright 2026 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 {DocumentLinkServiceClient} from './document_link_service_client'; +export {DocumentSchemaServiceClient} from './document_schema_service_client'; +export {DocumentServiceClient} from './document_service_client'; +export {PipelineServiceClient} from './pipeline_service_client'; +export {RuleSetServiceClient} from './rule_set_service_client'; +export {SynonymSetServiceClient} from './synonym_set_service_client'; diff --git a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/pipeline_service_client.ts b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/pipeline_service_client.ts new file mode 100644 index 00000000000..028ef622ceb --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/pipeline_service_client.ts @@ -0,0 +1,1085 @@ +// Copyright 2026 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 type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1/pipeline_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './pipeline_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * This service lets you manage pipelines. + * @class + * @memberof v1 + */ +export class PipelineServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('contentwarehouse'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + pipelineServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of PipelineServiceClient. + * + * @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/main/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://cloud.google.com/docs/authentication/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/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new PipelineServiceClient({fallback: true}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof PipelineServiceClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'contentwarehouse.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + documentLinkPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/documents/{document}/documentLinks/{document_link}' + ), + documentSchemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/documentSchemas/{document_schema}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + projectLocationDocumentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/documents/{document}' + ), + projectLocationDocumentsReferenceIdPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/documents/referenceId/{reference_id}' + ), + ruleSetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ruleSets/{rule_set}' + ), + synonymSetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/synonymSets/{context}' + ), + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.longrunning.Operations.GetOperation',get: '/v1/{name=projects/*/locations/*/operations/*}',}]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + const runPipelineResponse = protoFilesRoot.lookup( + '.google.cloud.contentwarehouse.v1.RunPipelineResponse') as gax.protobuf.Type; + const runPipelineMetadata = protoFilesRoot.lookup( + '.google.cloud.contentwarehouse.v1.RunPipelineMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + runPipeline: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + runPipelineResponse.decode.bind(runPipelineResponse), + runPipelineMetadata.decode.bind(runPipelineMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.contentwarehouse.v1.PipelineService', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.pipelineServiceStub) { + return this.pipelineServiceStub; + } + + // Put together the "service stub" for + // google.cloud.contentwarehouse.v1.PipelineService. + this.pipelineServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.contentwarehouse.v1.PipelineService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.contentwarehouse.v1.PipelineService, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const pipelineServiceStubMethods = + ['runPipeline']; + for (const methodName of pipelineServiceStubMethods) { + const callPromise = this.pipelineServiceStub.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.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.pipelineServiceStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'contentwarehouse.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'contentwarehouse.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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 -- + // ------------------- + +/** + * Run a predefined pipeline. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name which owns the resources of the pipeline. + * Format: projects/{project_number}/locations/{location}. + * @param {google.cloud.contentwarehouse.v1.GcsIngestPipeline} request.gcsIngestPipeline + * Cloud Storage ingestion pipeline. + * @param {google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline} request.gcsIngestWithDocAiProcessorsPipeline + * Use DocAI processors to process documents in Cloud Storage and ingest + * them to Document Warehouse. + * @param {google.cloud.contentwarehouse.v1.ExportToCdwPipeline} request.exportCdwPipeline + * Export docuemnts from Document Warehouse to CDW for training purpose. + * @param {google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline} request.processWithDocAiPipeline + * Use a DocAI processor to process documents in Document Warehouse, and + * re-ingest the updated results into Document Warehouse. + * @param {google.cloud.contentwarehouse.v1.RequestMetadata} request.requestMetadata + * The meta information collected about the end user, used to enforce access + * control for the service. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/pipeline_service.run_pipeline.js + * region_tag:contentwarehouse_v1_generated_PipelineService_RunPipeline_async + */ + runPipeline( + request?: protos.google.cloud.contentwarehouse.v1.IRunPipelineRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + runPipeline( + request: protos.google.cloud.contentwarehouse.v1.IRunPipelineRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + runPipeline( + request: protos.google.cloud.contentwarehouse.v1.IRunPipelineRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + runPipeline( + request?: protos.google.cloud.contentwarehouse.v1.IRunPipelineRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('runPipeline response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('runPipeline request %j', request); + return this.innerApiCalls.runPipeline(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('runPipeline response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `runPipeline()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/pipeline_service.run_pipeline.js + * region_tag:contentwarehouse_v1_generated_PipelineService_RunPipeline_async + */ + async checkRunPipelineProgress(name: string): Promise>{ + this._log.info('runPipeline long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.runPipeline, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified documentLink resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} document + * @param {string} document_link + * @returns {string} Resource name string. + */ + documentLinkPath(project:string,location:string,document:string,documentLink:string) { + return this.pathTemplates.documentLinkPathTemplate.render({ + project: project, + location: location, + document: document, + document_link: documentLink, + }); + } + + /** + * Parse the project from DocumentLink resource. + * + * @param {string} documentLinkName + * A fully-qualified path representing DocumentLink resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDocumentLinkName(documentLinkName: string) { + return this.pathTemplates.documentLinkPathTemplate.match(documentLinkName).project; + } + + /** + * Parse the location from DocumentLink resource. + * + * @param {string} documentLinkName + * A fully-qualified path representing DocumentLink resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDocumentLinkName(documentLinkName: string) { + return this.pathTemplates.documentLinkPathTemplate.match(documentLinkName).location; + } + + /** + * Parse the document from DocumentLink resource. + * + * @param {string} documentLinkName + * A fully-qualified path representing DocumentLink resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromDocumentLinkName(documentLinkName: string) { + return this.pathTemplates.documentLinkPathTemplate.match(documentLinkName).document; + } + + /** + * Parse the document_link from DocumentLink resource. + * + * @param {string} documentLinkName + * A fully-qualified path representing DocumentLink resource. + * @returns {string} A string representing the document_link. + */ + matchDocumentLinkFromDocumentLinkName(documentLinkName: string) { + return this.pathTemplates.documentLinkPathTemplate.match(documentLinkName).document_link; + } + + /** + * Return a fully-qualified documentSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} document_schema + * @returns {string} Resource name string. + */ + documentSchemaPath(project:string,location:string,documentSchema:string) { + return this.pathTemplates.documentSchemaPathTemplate.render({ + project: project, + location: location, + document_schema: documentSchema, + }); + } + + /** + * Parse the project from DocumentSchema resource. + * + * @param {string} documentSchemaName + * A fully-qualified path representing DocumentSchema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDocumentSchemaName(documentSchemaName: string) { + return this.pathTemplates.documentSchemaPathTemplate.match(documentSchemaName).project; + } + + /** + * Parse the location from DocumentSchema resource. + * + * @param {string} documentSchemaName + * A fully-qualified path representing DocumentSchema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDocumentSchemaName(documentSchemaName: string) { + return this.pathTemplates.documentSchemaPathTemplate.match(documentSchemaName).location; + } + + /** + * Parse the document_schema from DocumentSchema resource. + * + * @param {string} documentSchemaName + * A fully-qualified path representing DocumentSchema resource. + * @returns {string} A string representing the document_schema. + */ + matchDocumentSchemaFromDocumentSchemaName(documentSchemaName: string) { + return this.pathTemplates.documentSchemaPathTemplate.match(documentSchemaName).document_schema; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified projectLocationDocument resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} document + * @returns {string} Resource name string. + */ + projectLocationDocumentPath(project:string,location:string,document:string) { + return this.pathTemplates.projectLocationDocumentPathTemplate.render({ + project: project, + location: location, + document: document, + }); + } + + /** + * Parse the project from ProjectLocationDocument resource. + * + * @param {string} projectLocationDocumentName + * A fully-qualified path representing project_location_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationDocumentName(projectLocationDocumentName: string) { + return this.pathTemplates.projectLocationDocumentPathTemplate.match(projectLocationDocumentName).project; + } + + /** + * Parse the location from ProjectLocationDocument resource. + * + * @param {string} projectLocationDocumentName + * A fully-qualified path representing project_location_document resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationDocumentName(projectLocationDocumentName: string) { + return this.pathTemplates.projectLocationDocumentPathTemplate.match(projectLocationDocumentName).location; + } + + /** + * Parse the document from ProjectLocationDocument resource. + * + * @param {string} projectLocationDocumentName + * A fully-qualified path representing project_location_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectLocationDocumentName(projectLocationDocumentName: string) { + return this.pathTemplates.projectLocationDocumentPathTemplate.match(projectLocationDocumentName).document; + } + + /** + * Return a fully-qualified projectLocationDocumentsReferenceId resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} reference_id + * @returns {string} Resource name string. + */ + projectLocationDocumentsReferenceIdPath(project:string,location:string,referenceId:string) { + return this.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.render({ + project: project, + location: location, + reference_id: referenceId, + }); + } + + /** + * Parse the project from ProjectLocationDocumentsReferenceId resource. + * + * @param {string} projectLocationDocumentsReferenceIdName + * A fully-qualified path representing project_location_documents_reference_id resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationDocumentsReferenceIdName(projectLocationDocumentsReferenceIdName: string) { + return this.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match(projectLocationDocumentsReferenceIdName).project; + } + + /** + * Parse the location from ProjectLocationDocumentsReferenceId resource. + * + * @param {string} projectLocationDocumentsReferenceIdName + * A fully-qualified path representing project_location_documents_reference_id resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationDocumentsReferenceIdName(projectLocationDocumentsReferenceIdName: string) { + return this.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match(projectLocationDocumentsReferenceIdName).location; + } + + /** + * Parse the reference_id from ProjectLocationDocumentsReferenceId resource. + * + * @param {string} projectLocationDocumentsReferenceIdName + * A fully-qualified path representing project_location_documents_reference_id resource. + * @returns {string} A string representing the reference_id. + */ + matchReferenceIdFromProjectLocationDocumentsReferenceIdName(projectLocationDocumentsReferenceIdName: string) { + return this.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match(projectLocationDocumentsReferenceIdName).reference_id; + } + + /** + * Return a fully-qualified ruleSet resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rule_set + * @returns {string} Resource name string. + */ + ruleSetPath(project:string,location:string,ruleSet:string) { + return this.pathTemplates.ruleSetPathTemplate.render({ + project: project, + location: location, + rule_set: ruleSet, + }); + } + + /** + * Parse the project from RuleSet resource. + * + * @param {string} ruleSetName + * A fully-qualified path representing RuleSet resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRuleSetName(ruleSetName: string) { + return this.pathTemplates.ruleSetPathTemplate.match(ruleSetName).project; + } + + /** + * Parse the location from RuleSet resource. + * + * @param {string} ruleSetName + * A fully-qualified path representing RuleSet resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRuleSetName(ruleSetName: string) { + return this.pathTemplates.ruleSetPathTemplate.match(ruleSetName).location; + } + + /** + * Parse the rule_set from RuleSet resource. + * + * @param {string} ruleSetName + * A fully-qualified path representing RuleSet resource. + * @returns {string} A string representing the rule_set. + */ + matchRuleSetFromRuleSetName(ruleSetName: string) { + return this.pathTemplates.ruleSetPathTemplate.match(ruleSetName).rule_set; + } + + /** + * Return a fully-qualified synonymSet resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} context + * @returns {string} Resource name string. + */ + synonymSetPath(project:string,location:string,context:string) { + return this.pathTemplates.synonymSetPathTemplate.render({ + project: project, + location: location, + context: context, + }); + } + + /** + * Parse the project from SynonymSet resource. + * + * @param {string} synonymSetName + * A fully-qualified path representing SynonymSet resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSynonymSetName(synonymSetName: string) { + return this.pathTemplates.synonymSetPathTemplate.match(synonymSetName).project; + } + + /** + * Parse the location from SynonymSet resource. + * + * @param {string} synonymSetName + * A fully-qualified path representing SynonymSet resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSynonymSetName(synonymSetName: string) { + return this.pathTemplates.synonymSetPathTemplate.match(synonymSetName).location; + } + + /** + * Parse the context from SynonymSet resource. + * + * @param {string} synonymSetName + * A fully-qualified path representing SynonymSet resource. + * @returns {string} A string representing the context. + */ + matchContextFromSynonymSetName(synonymSetName: string) { + return this.pathTemplates.synonymSetPathTemplate.match(synonymSetName).context; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.pipelineServiceStub && !this._terminated) { + return this.pipelineServiceStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/pipeline_service_client_config.json b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/pipeline_service_client_config.json new file mode 100644 index 00000000000..abee50e0504 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/pipeline_service_client_config.json @@ -0,0 +1,31 @@ +{ + "interfaces": { + "google.cloud.contentwarehouse.v1.PipelineService": { + "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": { + "RunPipeline": { + "timeout_millis": 120000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/pipeline_service_proto_list.json b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/pipeline_service_proto_list.json new file mode 100644 index 00000000000..a1775b1134d --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/pipeline_service_proto_list.json @@ -0,0 +1,23 @@ +[ + "../../protos/google/cloud/contentwarehouse/v1/async_document_service_request.proto", + "../../protos/google/cloud/contentwarehouse/v1/common.proto", + "../../protos/google/cloud/contentwarehouse/v1/document.proto", + "../../protos/google/cloud/contentwarehouse/v1/document_link_service.proto", + "../../protos/google/cloud/contentwarehouse/v1/document_schema.proto", + "../../protos/google/cloud/contentwarehouse/v1/document_schema_service.proto", + "../../protos/google/cloud/contentwarehouse/v1/document_service.proto", + "../../protos/google/cloud/contentwarehouse/v1/document_service_request.proto", + "../../protos/google/cloud/contentwarehouse/v1/filters.proto", + "../../protos/google/cloud/contentwarehouse/v1/histogram.proto", + "../../protos/google/cloud/contentwarehouse/v1/pipeline_service.proto", + "../../protos/google/cloud/contentwarehouse/v1/pipelines.proto", + "../../protos/google/cloud/contentwarehouse/v1/rule_engine.proto", + "../../protos/google/cloud/contentwarehouse/v1/ruleset_service.proto", + "../../protos/google/cloud/contentwarehouse/v1/ruleset_service_request.proto", + "../../protos/google/cloud/contentwarehouse/v1/synonymset.proto", + "../../protos/google/cloud/contentwarehouse/v1/synonymset_service.proto", + "../../protos/google/cloud/contentwarehouse/v1/synonymset_service_request.proto", + "../../protos/google/cloud/documentai/v1/barcode.proto", + "../../protos/google/cloud/documentai/v1/document.proto", + "../../protos/google/cloud/documentai/v1/geometry.proto" +] diff --git a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/rule_set_service_client.ts b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/rule_set_service_client.ts new file mode 100644 index 00000000000..6226b95ce2a --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/rule_set_service_client.ts @@ -0,0 +1,1285 @@ +// Copyright 2026 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 type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1/rule_set_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './rule_set_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service to manage customer specific RuleSets. + * @class + * @memberof v1 + */ +export class RuleSetServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('contentwarehouse'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + ruleSetServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of RuleSetServiceClient. + * + * @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/main/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://cloud.google.com/docs/authentication/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/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new RuleSetServiceClient({fallback: true}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof RuleSetServiceClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'contentwarehouse.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + documentLinkPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/documents/{document}/documentLinks/{document_link}' + ), + documentSchemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/documentSchemas/{document_schema}' + ), + projectLocationDocumentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/documents/{document}' + ), + projectLocationDocumentsReferenceIdPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/documents/referenceId/{reference_id}' + ), + ruleSetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ruleSets/{rule_set}' + ), + synonymSetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/synonymSets/{context}' + ), + }; + + // 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 = { + listRuleSets: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'ruleSets') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.contentwarehouse.v1.RuleSetService', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.ruleSetServiceStub) { + return this.ruleSetServiceStub; + } + + // Put together the "service stub" for + // google.cloud.contentwarehouse.v1.RuleSetService. + this.ruleSetServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.contentwarehouse.v1.RuleSetService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.contentwarehouse.v1.RuleSetService, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const ruleSetServiceStubMethods = + ['createRuleSet', 'getRuleSet', 'updateRuleSet', 'deleteRuleSet', 'listRuleSets']; + for (const methodName of ruleSetServiceStubMethods) { + const callPromise = this.ruleSetServiceStub.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._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.ruleSetServiceStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'contentwarehouse.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'contentwarehouse.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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 -- + // ------------------- +/** + * Creates a ruleset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent name. + * Format: projects/{project_number}/locations/{location}. + * @param {google.cloud.contentwarehouse.v1.RuleSet} request.ruleSet + * Required. The rule set to create. + * @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 {@link protos.google.cloud.contentwarehouse.v1.RuleSet|RuleSet}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/rule_set_service.create_rule_set.js + * region_tag:contentwarehouse_v1_generated_RuleSetService_CreateRuleSet_async + */ + createRuleSet( + request?: protos.google.cloud.contentwarehouse.v1.ICreateRuleSetRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.contentwarehouse.v1.IRuleSet, + protos.google.cloud.contentwarehouse.v1.ICreateRuleSetRequest|undefined, {}|undefined + ]>; + createRuleSet( + request: protos.google.cloud.contentwarehouse.v1.ICreateRuleSetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.contentwarehouse.v1.IRuleSet, + protos.google.cloud.contentwarehouse.v1.ICreateRuleSetRequest|null|undefined, + {}|null|undefined>): void; + createRuleSet( + request: protos.google.cloud.contentwarehouse.v1.ICreateRuleSetRequest, + callback: Callback< + protos.google.cloud.contentwarehouse.v1.IRuleSet, + protos.google.cloud.contentwarehouse.v1.ICreateRuleSetRequest|null|undefined, + {}|null|undefined>): void; + createRuleSet( + request?: protos.google.cloud.contentwarehouse.v1.ICreateRuleSetRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.contentwarehouse.v1.IRuleSet, + protos.google.cloud.contentwarehouse.v1.ICreateRuleSetRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.contentwarehouse.v1.IRuleSet, + protos.google.cloud.contentwarehouse.v1.ICreateRuleSetRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.contentwarehouse.v1.IRuleSet, + protos.google.cloud.contentwarehouse.v1.ICreateRuleSetRequest|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createRuleSet request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.contentwarehouse.v1.IRuleSet, + protos.google.cloud.contentwarehouse.v1.ICreateRuleSetRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createRuleSet response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createRuleSet(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.contentwarehouse.v1.IRuleSet, + protos.google.cloud.contentwarehouse.v1.ICreateRuleSetRequest|undefined, + {}|undefined + ]) => { + this._log.info('createRuleSet response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets a ruleset. Returns NOT_FOUND if the ruleset does not exist. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the rule set to retrieve. + * Format: + * projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}. + * @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 {@link protos.google.cloud.contentwarehouse.v1.RuleSet|RuleSet}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/rule_set_service.get_rule_set.js + * region_tag:contentwarehouse_v1_generated_RuleSetService_GetRuleSet_async + */ + getRuleSet( + request?: protos.google.cloud.contentwarehouse.v1.IGetRuleSetRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.contentwarehouse.v1.IRuleSet, + protos.google.cloud.contentwarehouse.v1.IGetRuleSetRequest|undefined, {}|undefined + ]>; + getRuleSet( + request: protos.google.cloud.contentwarehouse.v1.IGetRuleSetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.contentwarehouse.v1.IRuleSet, + protos.google.cloud.contentwarehouse.v1.IGetRuleSetRequest|null|undefined, + {}|null|undefined>): void; + getRuleSet( + request: protos.google.cloud.contentwarehouse.v1.IGetRuleSetRequest, + callback: Callback< + protos.google.cloud.contentwarehouse.v1.IRuleSet, + protos.google.cloud.contentwarehouse.v1.IGetRuleSetRequest|null|undefined, + {}|null|undefined>): void; + getRuleSet( + request?: protos.google.cloud.contentwarehouse.v1.IGetRuleSetRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.contentwarehouse.v1.IRuleSet, + protos.google.cloud.contentwarehouse.v1.IGetRuleSetRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.contentwarehouse.v1.IRuleSet, + protos.google.cloud.contentwarehouse.v1.IGetRuleSetRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.contentwarehouse.v1.IRuleSet, + protos.google.cloud.contentwarehouse.v1.IGetRuleSetRequest|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getRuleSet request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.contentwarehouse.v1.IRuleSet, + protos.google.cloud.contentwarehouse.v1.IGetRuleSetRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getRuleSet response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getRuleSet(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.contentwarehouse.v1.IRuleSet, + protos.google.cloud.contentwarehouse.v1.IGetRuleSetRequest|undefined, + {}|undefined + ]) => { + this._log.info('getRuleSet response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Updates a ruleset. Returns INVALID_ARGUMENT if the name of the ruleset + * is non-empty and does not equal the existing name. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the rule set to update. + * Format: + * projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}. + * @param {google.cloud.contentwarehouse.v1.RuleSet} request.ruleSet + * Required. The rule set to update. + * @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 {@link protos.google.cloud.contentwarehouse.v1.RuleSet|RuleSet}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/rule_set_service.update_rule_set.js + * region_tag:contentwarehouse_v1_generated_RuleSetService_UpdateRuleSet_async + */ + updateRuleSet( + request?: protos.google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.contentwarehouse.v1.IRuleSet, + protos.google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest|undefined, {}|undefined + ]>; + updateRuleSet( + request: protos.google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.contentwarehouse.v1.IRuleSet, + protos.google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest|null|undefined, + {}|null|undefined>): void; + updateRuleSet( + request: protos.google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest, + callback: Callback< + protos.google.cloud.contentwarehouse.v1.IRuleSet, + protos.google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest|null|undefined, + {}|null|undefined>): void; + updateRuleSet( + request?: protos.google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.contentwarehouse.v1.IRuleSet, + protos.google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.contentwarehouse.v1.IRuleSet, + protos.google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.contentwarehouse.v1.IRuleSet, + protos.google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateRuleSet request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.contentwarehouse.v1.IRuleSet, + protos.google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateRuleSet response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateRuleSet(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.contentwarehouse.v1.IRuleSet, + protos.google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateRuleSet response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Deletes a ruleset. Returns NOT_FOUND if the document does not exist. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the rule set to delete. + * Format: + * projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}. + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/rule_set_service.delete_rule_set.js + * region_tag:contentwarehouse_v1_generated_RuleSetService_DeleteRuleSet_async + */ + deleteRuleSet( + request?: protos.google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest|undefined, {}|undefined + ]>; + deleteRuleSet( + request: protos.google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest|null|undefined, + {}|null|undefined>): void; + deleteRuleSet( + request: protos.google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest|null|undefined, + {}|null|undefined>): void; + deleteRuleSet( + request?: protos.google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deleteRuleSet request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteRuleSet response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteRuleSet(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteRuleSet response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + + /** + * Lists rulesets. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of document. + * Format: projects/{project_number}/locations/{location}. + * @param {number} request.pageSize + * The maximum number of rule sets to return. The service may return + * fewer than this value. + * If unspecified, at most 50 rule sets will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListRuleSets` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListRuleSets` + * must match the call that provided the page token. + * @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 {@link protos.google.cloud.contentwarehouse.v1.RuleSet|RuleSet}. + * 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 `listRuleSetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listRuleSets( + request?: protos.google.cloud.contentwarehouse.v1.IListRuleSetsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.contentwarehouse.v1.IRuleSet[], + protos.google.cloud.contentwarehouse.v1.IListRuleSetsRequest|null, + protos.google.cloud.contentwarehouse.v1.IListRuleSetsResponse + ]>; + listRuleSets( + request: protos.google.cloud.contentwarehouse.v1.IListRuleSetsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.contentwarehouse.v1.IListRuleSetsRequest, + protos.google.cloud.contentwarehouse.v1.IListRuleSetsResponse|null|undefined, + protos.google.cloud.contentwarehouse.v1.IRuleSet>): void; + listRuleSets( + request: protos.google.cloud.contentwarehouse.v1.IListRuleSetsRequest, + callback: PaginationCallback< + protos.google.cloud.contentwarehouse.v1.IListRuleSetsRequest, + protos.google.cloud.contentwarehouse.v1.IListRuleSetsResponse|null|undefined, + protos.google.cloud.contentwarehouse.v1.IRuleSet>): void; + listRuleSets( + request?: protos.google.cloud.contentwarehouse.v1.IListRuleSetsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.contentwarehouse.v1.IListRuleSetsRequest, + protos.google.cloud.contentwarehouse.v1.IListRuleSetsResponse|null|undefined, + protos.google.cloud.contentwarehouse.v1.IRuleSet>, + callback?: PaginationCallback< + protos.google.cloud.contentwarehouse.v1.IListRuleSetsRequest, + protos.google.cloud.contentwarehouse.v1.IListRuleSetsResponse|null|undefined, + protos.google.cloud.contentwarehouse.v1.IRuleSet>): + Promise<[ + protos.google.cloud.contentwarehouse.v1.IRuleSet[], + protos.google.cloud.contentwarehouse.v1.IListRuleSetsRequest|null, + protos.google.cloud.contentwarehouse.v1.IListRuleSetsResponse + ]>|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.contentwarehouse.v1.IListRuleSetsRequest, + protos.google.cloud.contentwarehouse.v1.IListRuleSetsResponse|null|undefined, + protos.google.cloud.contentwarehouse.v1.IRuleSet>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listRuleSets values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listRuleSets request %j', request); + return this.innerApiCalls + .listRuleSets(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.contentwarehouse.v1.IRuleSet[], + protos.google.cloud.contentwarehouse.v1.IListRuleSetsRequest|null, + protos.google.cloud.contentwarehouse.v1.IListRuleSetsResponse + ]) => { + this._log.info('listRuleSets values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listRuleSets`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of document. + * Format: projects/{project_number}/locations/{location}. + * @param {number} request.pageSize + * The maximum number of rule sets to return. The service may return + * fewer than this value. + * If unspecified, at most 50 rule sets will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListRuleSets` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListRuleSets` + * must match the call that provided the page token. + * @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 {@link protos.google.cloud.contentwarehouse.v1.RuleSet|RuleSet} 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 `listRuleSetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listRuleSetsStream( + request?: protos.google.cloud.contentwarehouse.v1.IListRuleSetsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listRuleSets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listRuleSets stream %j', request); + return this.descriptors.page.listRuleSets.createStream( + this.innerApiCalls.listRuleSets as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listRuleSets`, 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. The parent, which owns this collection of document. + * Format: projects/{project_number}/locations/{location}. + * @param {number} request.pageSize + * The maximum number of rule sets to return. The service may return + * fewer than this value. + * If unspecified, at most 50 rule sets will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListRuleSets` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListRuleSets` + * must match the call that provided the page token. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.contentwarehouse.v1.RuleSet|RuleSet}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/rule_set_service.list_rule_sets.js + * region_tag:contentwarehouse_v1_generated_RuleSetService_ListRuleSets_async + */ + listRuleSetsAsync( + request?: protos.google.cloud.contentwarehouse.v1.IListRuleSetsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listRuleSets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listRuleSets iterate %j', request); + return this.descriptors.page.listRuleSets.asyncIterate( + this.innerApiCalls['listRuleSets'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified documentLink resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} document + * @param {string} document_link + * @returns {string} Resource name string. + */ + documentLinkPath(project:string,location:string,document:string,documentLink:string) { + return this.pathTemplates.documentLinkPathTemplate.render({ + project: project, + location: location, + document: document, + document_link: documentLink, + }); + } + + /** + * Parse the project from DocumentLink resource. + * + * @param {string} documentLinkName + * A fully-qualified path representing DocumentLink resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDocumentLinkName(documentLinkName: string) { + return this.pathTemplates.documentLinkPathTemplate.match(documentLinkName).project; + } + + /** + * Parse the location from DocumentLink resource. + * + * @param {string} documentLinkName + * A fully-qualified path representing DocumentLink resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDocumentLinkName(documentLinkName: string) { + return this.pathTemplates.documentLinkPathTemplate.match(documentLinkName).location; + } + + /** + * Parse the document from DocumentLink resource. + * + * @param {string} documentLinkName + * A fully-qualified path representing DocumentLink resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromDocumentLinkName(documentLinkName: string) { + return this.pathTemplates.documentLinkPathTemplate.match(documentLinkName).document; + } + + /** + * Parse the document_link from DocumentLink resource. + * + * @param {string} documentLinkName + * A fully-qualified path representing DocumentLink resource. + * @returns {string} A string representing the document_link. + */ + matchDocumentLinkFromDocumentLinkName(documentLinkName: string) { + return this.pathTemplates.documentLinkPathTemplate.match(documentLinkName).document_link; + } + + /** + * Return a fully-qualified documentSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} document_schema + * @returns {string} Resource name string. + */ + documentSchemaPath(project:string,location:string,documentSchema:string) { + return this.pathTemplates.documentSchemaPathTemplate.render({ + project: project, + location: location, + document_schema: documentSchema, + }); + } + + /** + * Parse the project from DocumentSchema resource. + * + * @param {string} documentSchemaName + * A fully-qualified path representing DocumentSchema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDocumentSchemaName(documentSchemaName: string) { + return this.pathTemplates.documentSchemaPathTemplate.match(documentSchemaName).project; + } + + /** + * Parse the location from DocumentSchema resource. + * + * @param {string} documentSchemaName + * A fully-qualified path representing DocumentSchema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDocumentSchemaName(documentSchemaName: string) { + return this.pathTemplates.documentSchemaPathTemplate.match(documentSchemaName).location; + } + + /** + * Parse the document_schema from DocumentSchema resource. + * + * @param {string} documentSchemaName + * A fully-qualified path representing DocumentSchema resource. + * @returns {string} A string representing the document_schema. + */ + matchDocumentSchemaFromDocumentSchemaName(documentSchemaName: string) { + return this.pathTemplates.documentSchemaPathTemplate.match(documentSchemaName).document_schema; + } + + /** + * Return a fully-qualified projectLocationDocument resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} document + * @returns {string} Resource name string. + */ + projectLocationDocumentPath(project:string,location:string,document:string) { + return this.pathTemplates.projectLocationDocumentPathTemplate.render({ + project: project, + location: location, + document: document, + }); + } + + /** + * Parse the project from ProjectLocationDocument resource. + * + * @param {string} projectLocationDocumentName + * A fully-qualified path representing project_location_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationDocumentName(projectLocationDocumentName: string) { + return this.pathTemplates.projectLocationDocumentPathTemplate.match(projectLocationDocumentName).project; + } + + /** + * Parse the location from ProjectLocationDocument resource. + * + * @param {string} projectLocationDocumentName + * A fully-qualified path representing project_location_document resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationDocumentName(projectLocationDocumentName: string) { + return this.pathTemplates.projectLocationDocumentPathTemplate.match(projectLocationDocumentName).location; + } + + /** + * Parse the document from ProjectLocationDocument resource. + * + * @param {string} projectLocationDocumentName + * A fully-qualified path representing project_location_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectLocationDocumentName(projectLocationDocumentName: string) { + return this.pathTemplates.projectLocationDocumentPathTemplate.match(projectLocationDocumentName).document; + } + + /** + * Return a fully-qualified projectLocationDocumentsReferenceId resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} reference_id + * @returns {string} Resource name string. + */ + projectLocationDocumentsReferenceIdPath(project:string,location:string,referenceId:string) { + return this.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.render({ + project: project, + location: location, + reference_id: referenceId, + }); + } + + /** + * Parse the project from ProjectLocationDocumentsReferenceId resource. + * + * @param {string} projectLocationDocumentsReferenceIdName + * A fully-qualified path representing project_location_documents_reference_id resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationDocumentsReferenceIdName(projectLocationDocumentsReferenceIdName: string) { + return this.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match(projectLocationDocumentsReferenceIdName).project; + } + + /** + * Parse the location from ProjectLocationDocumentsReferenceId resource. + * + * @param {string} projectLocationDocumentsReferenceIdName + * A fully-qualified path representing project_location_documents_reference_id resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationDocumentsReferenceIdName(projectLocationDocumentsReferenceIdName: string) { + return this.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match(projectLocationDocumentsReferenceIdName).location; + } + + /** + * Parse the reference_id from ProjectLocationDocumentsReferenceId resource. + * + * @param {string} projectLocationDocumentsReferenceIdName + * A fully-qualified path representing project_location_documents_reference_id resource. + * @returns {string} A string representing the reference_id. + */ + matchReferenceIdFromProjectLocationDocumentsReferenceIdName(projectLocationDocumentsReferenceIdName: string) { + return this.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match(projectLocationDocumentsReferenceIdName).reference_id; + } + + /** + * Return a fully-qualified ruleSet resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rule_set + * @returns {string} Resource name string. + */ + ruleSetPath(project:string,location:string,ruleSet:string) { + return this.pathTemplates.ruleSetPathTemplate.render({ + project: project, + location: location, + rule_set: ruleSet, + }); + } + + /** + * Parse the project from RuleSet resource. + * + * @param {string} ruleSetName + * A fully-qualified path representing RuleSet resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRuleSetName(ruleSetName: string) { + return this.pathTemplates.ruleSetPathTemplate.match(ruleSetName).project; + } + + /** + * Parse the location from RuleSet resource. + * + * @param {string} ruleSetName + * A fully-qualified path representing RuleSet resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRuleSetName(ruleSetName: string) { + return this.pathTemplates.ruleSetPathTemplate.match(ruleSetName).location; + } + + /** + * Parse the rule_set from RuleSet resource. + * + * @param {string} ruleSetName + * A fully-qualified path representing RuleSet resource. + * @returns {string} A string representing the rule_set. + */ + matchRuleSetFromRuleSetName(ruleSetName: string) { + return this.pathTemplates.ruleSetPathTemplate.match(ruleSetName).rule_set; + } + + /** + * Return a fully-qualified synonymSet resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} context + * @returns {string} Resource name string. + */ + synonymSetPath(project:string,location:string,context:string) { + return this.pathTemplates.synonymSetPathTemplate.render({ + project: project, + location: location, + context: context, + }); + } + + /** + * Parse the project from SynonymSet resource. + * + * @param {string} synonymSetName + * A fully-qualified path representing SynonymSet resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSynonymSetName(synonymSetName: string) { + return this.pathTemplates.synonymSetPathTemplate.match(synonymSetName).project; + } + + /** + * Parse the location from SynonymSet resource. + * + * @param {string} synonymSetName + * A fully-qualified path representing SynonymSet resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSynonymSetName(synonymSetName: string) { + return this.pathTemplates.synonymSetPathTemplate.match(synonymSetName).location; + } + + /** + * Parse the context from SynonymSet resource. + * + * @param {string} synonymSetName + * A fully-qualified path representing SynonymSet resource. + * @returns {string} A string representing the context. + */ + matchContextFromSynonymSetName(synonymSetName: string) { + return this.pathTemplates.synonymSetPathTemplate.match(synonymSetName).context; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.ruleSetServiceStub && !this._terminated) { + return this.ruleSetServiceStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/rule_set_service_client_config.json b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/rule_set_service_client_config.json new file mode 100644 index 00000000000..e5e5bf93f5d --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/rule_set_service_client_config.json @@ -0,0 +1,63 @@ +{ + "interfaces": { + "google.cloud.contentwarehouse.v1.RuleSetService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "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 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateRuleSet": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetRuleSet": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateRuleSet": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteRuleSet": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListRuleSets": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/rule_set_service_proto_list.json b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/rule_set_service_proto_list.json new file mode 100644 index 00000000000..a1775b1134d --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/rule_set_service_proto_list.json @@ -0,0 +1,23 @@ +[ + "../../protos/google/cloud/contentwarehouse/v1/async_document_service_request.proto", + "../../protos/google/cloud/contentwarehouse/v1/common.proto", + "../../protos/google/cloud/contentwarehouse/v1/document.proto", + "../../protos/google/cloud/contentwarehouse/v1/document_link_service.proto", + "../../protos/google/cloud/contentwarehouse/v1/document_schema.proto", + "../../protos/google/cloud/contentwarehouse/v1/document_schema_service.proto", + "../../protos/google/cloud/contentwarehouse/v1/document_service.proto", + "../../protos/google/cloud/contentwarehouse/v1/document_service_request.proto", + "../../protos/google/cloud/contentwarehouse/v1/filters.proto", + "../../protos/google/cloud/contentwarehouse/v1/histogram.proto", + "../../protos/google/cloud/contentwarehouse/v1/pipeline_service.proto", + "../../protos/google/cloud/contentwarehouse/v1/pipelines.proto", + "../../protos/google/cloud/contentwarehouse/v1/rule_engine.proto", + "../../protos/google/cloud/contentwarehouse/v1/ruleset_service.proto", + "../../protos/google/cloud/contentwarehouse/v1/ruleset_service_request.proto", + "../../protos/google/cloud/contentwarehouse/v1/synonymset.proto", + "../../protos/google/cloud/contentwarehouse/v1/synonymset_service.proto", + "../../protos/google/cloud/contentwarehouse/v1/synonymset_service_request.proto", + "../../protos/google/cloud/documentai/v1/barcode.proto", + "../../protos/google/cloud/documentai/v1/document.proto", + "../../protos/google/cloud/documentai/v1/geometry.proto" +] diff --git a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/synonym_set_service_client.ts b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/synonym_set_service_client.ts new file mode 100644 index 00000000000..936611b515e --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/synonym_set_service_client.ts @@ -0,0 +1,1291 @@ +// Copyright 2026 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 type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1/synonym_set_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './synonym_set_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * A Service that manage/custom customer specified SynonymSets. + * @class + * @memberof v1 + */ +export class SynonymSetServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('contentwarehouse'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + synonymSetServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of SynonymSetServiceClient. + * + * @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/main/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://cloud.google.com/docs/authentication/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/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new SynonymSetServiceClient({fallback: true}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof SynonymSetServiceClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'contentwarehouse.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + documentLinkPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/documents/{document}/documentLinks/{document_link}' + ), + documentSchemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/documentSchemas/{document_schema}' + ), + projectLocationDocumentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/documents/{document}' + ), + projectLocationDocumentsReferenceIdPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/documents/referenceId/{reference_id}' + ), + ruleSetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ruleSets/{rule_set}' + ), + synonymSetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/synonymSets/{context}' + ), + }; + + // 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 = { + listSynonymSets: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'synonymSets') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.contentwarehouse.v1.SynonymSetService', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.synonymSetServiceStub) { + return this.synonymSetServiceStub; + } + + // Put together the "service stub" for + // google.cloud.contentwarehouse.v1.SynonymSetService. + this.synonymSetServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.contentwarehouse.v1.SynonymSetService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.contentwarehouse.v1.SynonymSetService, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const synonymSetServiceStubMethods = + ['createSynonymSet', 'getSynonymSet', 'updateSynonymSet', 'deleteSynonymSet', 'listSynonymSets']; + for (const methodName of synonymSetServiceStubMethods) { + const callPromise = this.synonymSetServiceStub.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._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.synonymSetServiceStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'contentwarehouse.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'contentwarehouse.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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 -- + // ------------------- +/** + * Creates a SynonymSet for a single context. + * Throws an ALREADY_EXISTS exception if a synonymset already exists + * for the context. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent name. + * Format: projects/{project_number}/locations/{location}. + * @param {google.cloud.contentwarehouse.v1.SynonymSet} request.synonymSet + * Required. The synonymSet to be created for a context + * @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 {@link protos.google.cloud.contentwarehouse.v1.SynonymSet|SynonymSet}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/synonym_set_service.create_synonym_set.js + * region_tag:contentwarehouse_v1_generated_SynonymSetService_CreateSynonymSet_async + */ + createSynonymSet( + request?: protos.google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.contentwarehouse.v1.ISynonymSet, + protos.google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest|undefined, {}|undefined + ]>; + createSynonymSet( + request: protos.google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.contentwarehouse.v1.ISynonymSet, + protos.google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest|null|undefined, + {}|null|undefined>): void; + createSynonymSet( + request: protos.google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest, + callback: Callback< + protos.google.cloud.contentwarehouse.v1.ISynonymSet, + protos.google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest|null|undefined, + {}|null|undefined>): void; + createSynonymSet( + request?: protos.google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.contentwarehouse.v1.ISynonymSet, + protos.google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.contentwarehouse.v1.ISynonymSet, + protos.google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.contentwarehouse.v1.ISynonymSet, + protos.google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createSynonymSet request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.contentwarehouse.v1.ISynonymSet, + protos.google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createSynonymSet response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createSynonymSet(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.contentwarehouse.v1.ISynonymSet, + protos.google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest|undefined, + {}|undefined + ]) => { + this._log.info('createSynonymSet response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets a SynonymSet for a particular context. + * Throws a NOT_FOUND exception if the Synonymset + * does not exist + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the synonymSet to retrieve + * Format: + * projects/{project_number}/locations/{location}/synonymSets/{context}. + * @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 {@link protos.google.cloud.contentwarehouse.v1.SynonymSet|SynonymSet}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/synonym_set_service.get_synonym_set.js + * region_tag:contentwarehouse_v1_generated_SynonymSetService_GetSynonymSet_async + */ + getSynonymSet( + request?: protos.google.cloud.contentwarehouse.v1.IGetSynonymSetRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.contentwarehouse.v1.ISynonymSet, + protos.google.cloud.contentwarehouse.v1.IGetSynonymSetRequest|undefined, {}|undefined + ]>; + getSynonymSet( + request: protos.google.cloud.contentwarehouse.v1.IGetSynonymSetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.contentwarehouse.v1.ISynonymSet, + protos.google.cloud.contentwarehouse.v1.IGetSynonymSetRequest|null|undefined, + {}|null|undefined>): void; + getSynonymSet( + request: protos.google.cloud.contentwarehouse.v1.IGetSynonymSetRequest, + callback: Callback< + protos.google.cloud.contentwarehouse.v1.ISynonymSet, + protos.google.cloud.contentwarehouse.v1.IGetSynonymSetRequest|null|undefined, + {}|null|undefined>): void; + getSynonymSet( + request?: protos.google.cloud.contentwarehouse.v1.IGetSynonymSetRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.contentwarehouse.v1.ISynonymSet, + protos.google.cloud.contentwarehouse.v1.IGetSynonymSetRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.contentwarehouse.v1.ISynonymSet, + protos.google.cloud.contentwarehouse.v1.IGetSynonymSetRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.contentwarehouse.v1.ISynonymSet, + protos.google.cloud.contentwarehouse.v1.IGetSynonymSetRequest|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getSynonymSet request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.contentwarehouse.v1.ISynonymSet, + protos.google.cloud.contentwarehouse.v1.IGetSynonymSetRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getSynonymSet response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getSynonymSet(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.contentwarehouse.v1.ISynonymSet, + protos.google.cloud.contentwarehouse.v1.IGetSynonymSetRequest|undefined, + {}|undefined + ]) => { + this._log.info('getSynonymSet response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Remove the existing SynonymSet for the context and replaces it + * with a new one. + * Throws a NOT_FOUND exception if the SynonymSet is not found. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the synonymSet to update + * Format: + * projects/{project_number}/locations/{location}/synonymSets/{context}. + * @param {google.cloud.contentwarehouse.v1.SynonymSet} request.synonymSet + * Required. The synonymSet to be updated for the customer + * @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 {@link protos.google.cloud.contentwarehouse.v1.SynonymSet|SynonymSet}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/synonym_set_service.update_synonym_set.js + * region_tag:contentwarehouse_v1_generated_SynonymSetService_UpdateSynonymSet_async + */ + updateSynonymSet( + request?: protos.google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.contentwarehouse.v1.ISynonymSet, + protos.google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest|undefined, {}|undefined + ]>; + updateSynonymSet( + request: protos.google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.contentwarehouse.v1.ISynonymSet, + protos.google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest|null|undefined, + {}|null|undefined>): void; + updateSynonymSet( + request: protos.google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest, + callback: Callback< + protos.google.cloud.contentwarehouse.v1.ISynonymSet, + protos.google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest|null|undefined, + {}|null|undefined>): void; + updateSynonymSet( + request?: protos.google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.contentwarehouse.v1.ISynonymSet, + protos.google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.contentwarehouse.v1.ISynonymSet, + protos.google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.contentwarehouse.v1.ISynonymSet, + protos.google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateSynonymSet request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.contentwarehouse.v1.ISynonymSet, + protos.google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateSynonymSet response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateSynonymSet(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.contentwarehouse.v1.ISynonymSet, + protos.google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateSynonymSet response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Deletes a SynonymSet for a given context. + * Throws a NOT_FOUND exception if the SynonymSet is not found. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the synonymSet to delete + * Format: + * projects/{project_number}/locations/{location}/synonymSets/{context}. + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/synonym_set_service.delete_synonym_set.js + * region_tag:contentwarehouse_v1_generated_SynonymSetService_DeleteSynonymSet_async + */ + deleteSynonymSet( + request?: protos.google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest|undefined, {}|undefined + ]>; + deleteSynonymSet( + request: protos.google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest|null|undefined, + {}|null|undefined>): void; + deleteSynonymSet( + request: protos.google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest|null|undefined, + {}|null|undefined>): void; + deleteSynonymSet( + request?: protos.google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deleteSynonymSet request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteSynonymSet response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteSynonymSet(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteSynonymSet response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + + /** + * Returns all SynonymSets (for all contexts) for the specified location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent name. + * Format: projects/{project_number}/locations/{location}. + * @param {number} request.pageSize + * The maximum number of synonymSets to return. The service may return + * fewer than this value. + * If unspecified, at most 50 rule sets will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListSynonymSets` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListSynonymSets` + * must match the call that provided the page token. + * @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 {@link protos.google.cloud.contentwarehouse.v1.SynonymSet|SynonymSet}. + * 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 `listSynonymSetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSynonymSets( + request?: protos.google.cloud.contentwarehouse.v1.IListSynonymSetsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.contentwarehouse.v1.ISynonymSet[], + protos.google.cloud.contentwarehouse.v1.IListSynonymSetsRequest|null, + protos.google.cloud.contentwarehouse.v1.IListSynonymSetsResponse + ]>; + listSynonymSets( + request: protos.google.cloud.contentwarehouse.v1.IListSynonymSetsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.contentwarehouse.v1.IListSynonymSetsRequest, + protos.google.cloud.contentwarehouse.v1.IListSynonymSetsResponse|null|undefined, + protos.google.cloud.contentwarehouse.v1.ISynonymSet>): void; + listSynonymSets( + request: protos.google.cloud.contentwarehouse.v1.IListSynonymSetsRequest, + callback: PaginationCallback< + protos.google.cloud.contentwarehouse.v1.IListSynonymSetsRequest, + protos.google.cloud.contentwarehouse.v1.IListSynonymSetsResponse|null|undefined, + protos.google.cloud.contentwarehouse.v1.ISynonymSet>): void; + listSynonymSets( + request?: protos.google.cloud.contentwarehouse.v1.IListSynonymSetsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.contentwarehouse.v1.IListSynonymSetsRequest, + protos.google.cloud.contentwarehouse.v1.IListSynonymSetsResponse|null|undefined, + protos.google.cloud.contentwarehouse.v1.ISynonymSet>, + callback?: PaginationCallback< + protos.google.cloud.contentwarehouse.v1.IListSynonymSetsRequest, + protos.google.cloud.contentwarehouse.v1.IListSynonymSetsResponse|null|undefined, + protos.google.cloud.contentwarehouse.v1.ISynonymSet>): + Promise<[ + protos.google.cloud.contentwarehouse.v1.ISynonymSet[], + protos.google.cloud.contentwarehouse.v1.IListSynonymSetsRequest|null, + protos.google.cloud.contentwarehouse.v1.IListSynonymSetsResponse + ]>|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.contentwarehouse.v1.IListSynonymSetsRequest, + protos.google.cloud.contentwarehouse.v1.IListSynonymSetsResponse|null|undefined, + protos.google.cloud.contentwarehouse.v1.ISynonymSet>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listSynonymSets values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listSynonymSets request %j', request); + return this.innerApiCalls + .listSynonymSets(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.contentwarehouse.v1.ISynonymSet[], + protos.google.cloud.contentwarehouse.v1.IListSynonymSetsRequest|null, + protos.google.cloud.contentwarehouse.v1.IListSynonymSetsResponse + ]) => { + this._log.info('listSynonymSets values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listSynonymSets`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent name. + * Format: projects/{project_number}/locations/{location}. + * @param {number} request.pageSize + * The maximum number of synonymSets to return. The service may return + * fewer than this value. + * If unspecified, at most 50 rule sets will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListSynonymSets` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListSynonymSets` + * must match the call that provided the page token. + * @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 {@link protos.google.cloud.contentwarehouse.v1.SynonymSet|SynonymSet} 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 `listSynonymSetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSynonymSetsStream( + request?: protos.google.cloud.contentwarehouse.v1.IListSynonymSetsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSynonymSets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listSynonymSets stream %j', request); + return this.descriptors.page.listSynonymSets.createStream( + this.innerApiCalls.listSynonymSets as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listSynonymSets`, 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. The parent name. + * Format: projects/{project_number}/locations/{location}. + * @param {number} request.pageSize + * The maximum number of synonymSets to return. The service may return + * fewer than this value. + * If unspecified, at most 50 rule sets will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListSynonymSets` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListSynonymSets` + * must match the call that provided the page token. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.contentwarehouse.v1.SynonymSet|SynonymSet}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/synonym_set_service.list_synonym_sets.js + * region_tag:contentwarehouse_v1_generated_SynonymSetService_ListSynonymSets_async + */ + listSynonymSetsAsync( + request?: protos.google.cloud.contentwarehouse.v1.IListSynonymSetsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSynonymSets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listSynonymSets iterate %j', request); + return this.descriptors.page.listSynonymSets.asyncIterate( + this.innerApiCalls['listSynonymSets'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified documentLink resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} document + * @param {string} document_link + * @returns {string} Resource name string. + */ + documentLinkPath(project:string,location:string,document:string,documentLink:string) { + return this.pathTemplates.documentLinkPathTemplate.render({ + project: project, + location: location, + document: document, + document_link: documentLink, + }); + } + + /** + * Parse the project from DocumentLink resource. + * + * @param {string} documentLinkName + * A fully-qualified path representing DocumentLink resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDocumentLinkName(documentLinkName: string) { + return this.pathTemplates.documentLinkPathTemplate.match(documentLinkName).project; + } + + /** + * Parse the location from DocumentLink resource. + * + * @param {string} documentLinkName + * A fully-qualified path representing DocumentLink resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDocumentLinkName(documentLinkName: string) { + return this.pathTemplates.documentLinkPathTemplate.match(documentLinkName).location; + } + + /** + * Parse the document from DocumentLink resource. + * + * @param {string} documentLinkName + * A fully-qualified path representing DocumentLink resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromDocumentLinkName(documentLinkName: string) { + return this.pathTemplates.documentLinkPathTemplate.match(documentLinkName).document; + } + + /** + * Parse the document_link from DocumentLink resource. + * + * @param {string} documentLinkName + * A fully-qualified path representing DocumentLink resource. + * @returns {string} A string representing the document_link. + */ + matchDocumentLinkFromDocumentLinkName(documentLinkName: string) { + return this.pathTemplates.documentLinkPathTemplate.match(documentLinkName).document_link; + } + + /** + * Return a fully-qualified documentSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} document_schema + * @returns {string} Resource name string. + */ + documentSchemaPath(project:string,location:string,documentSchema:string) { + return this.pathTemplates.documentSchemaPathTemplate.render({ + project: project, + location: location, + document_schema: documentSchema, + }); + } + + /** + * Parse the project from DocumentSchema resource. + * + * @param {string} documentSchemaName + * A fully-qualified path representing DocumentSchema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDocumentSchemaName(documentSchemaName: string) { + return this.pathTemplates.documentSchemaPathTemplate.match(documentSchemaName).project; + } + + /** + * Parse the location from DocumentSchema resource. + * + * @param {string} documentSchemaName + * A fully-qualified path representing DocumentSchema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDocumentSchemaName(documentSchemaName: string) { + return this.pathTemplates.documentSchemaPathTemplate.match(documentSchemaName).location; + } + + /** + * Parse the document_schema from DocumentSchema resource. + * + * @param {string} documentSchemaName + * A fully-qualified path representing DocumentSchema resource. + * @returns {string} A string representing the document_schema. + */ + matchDocumentSchemaFromDocumentSchemaName(documentSchemaName: string) { + return this.pathTemplates.documentSchemaPathTemplate.match(documentSchemaName).document_schema; + } + + /** + * Return a fully-qualified projectLocationDocument resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} document + * @returns {string} Resource name string. + */ + projectLocationDocumentPath(project:string,location:string,document:string) { + return this.pathTemplates.projectLocationDocumentPathTemplate.render({ + project: project, + location: location, + document: document, + }); + } + + /** + * Parse the project from ProjectLocationDocument resource. + * + * @param {string} projectLocationDocumentName + * A fully-qualified path representing project_location_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationDocumentName(projectLocationDocumentName: string) { + return this.pathTemplates.projectLocationDocumentPathTemplate.match(projectLocationDocumentName).project; + } + + /** + * Parse the location from ProjectLocationDocument resource. + * + * @param {string} projectLocationDocumentName + * A fully-qualified path representing project_location_document resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationDocumentName(projectLocationDocumentName: string) { + return this.pathTemplates.projectLocationDocumentPathTemplate.match(projectLocationDocumentName).location; + } + + /** + * Parse the document from ProjectLocationDocument resource. + * + * @param {string} projectLocationDocumentName + * A fully-qualified path representing project_location_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectLocationDocumentName(projectLocationDocumentName: string) { + return this.pathTemplates.projectLocationDocumentPathTemplate.match(projectLocationDocumentName).document; + } + + /** + * Return a fully-qualified projectLocationDocumentsReferenceId resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} reference_id + * @returns {string} Resource name string. + */ + projectLocationDocumentsReferenceIdPath(project:string,location:string,referenceId:string) { + return this.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.render({ + project: project, + location: location, + reference_id: referenceId, + }); + } + + /** + * Parse the project from ProjectLocationDocumentsReferenceId resource. + * + * @param {string} projectLocationDocumentsReferenceIdName + * A fully-qualified path representing project_location_documents_reference_id resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationDocumentsReferenceIdName(projectLocationDocumentsReferenceIdName: string) { + return this.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match(projectLocationDocumentsReferenceIdName).project; + } + + /** + * Parse the location from ProjectLocationDocumentsReferenceId resource. + * + * @param {string} projectLocationDocumentsReferenceIdName + * A fully-qualified path representing project_location_documents_reference_id resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationDocumentsReferenceIdName(projectLocationDocumentsReferenceIdName: string) { + return this.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match(projectLocationDocumentsReferenceIdName).location; + } + + /** + * Parse the reference_id from ProjectLocationDocumentsReferenceId resource. + * + * @param {string} projectLocationDocumentsReferenceIdName + * A fully-qualified path representing project_location_documents_reference_id resource. + * @returns {string} A string representing the reference_id. + */ + matchReferenceIdFromProjectLocationDocumentsReferenceIdName(projectLocationDocumentsReferenceIdName: string) { + return this.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match(projectLocationDocumentsReferenceIdName).reference_id; + } + + /** + * Return a fully-qualified ruleSet resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rule_set + * @returns {string} Resource name string. + */ + ruleSetPath(project:string,location:string,ruleSet:string) { + return this.pathTemplates.ruleSetPathTemplate.render({ + project: project, + location: location, + rule_set: ruleSet, + }); + } + + /** + * Parse the project from RuleSet resource. + * + * @param {string} ruleSetName + * A fully-qualified path representing RuleSet resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRuleSetName(ruleSetName: string) { + return this.pathTemplates.ruleSetPathTemplate.match(ruleSetName).project; + } + + /** + * Parse the location from RuleSet resource. + * + * @param {string} ruleSetName + * A fully-qualified path representing RuleSet resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRuleSetName(ruleSetName: string) { + return this.pathTemplates.ruleSetPathTemplate.match(ruleSetName).location; + } + + /** + * Parse the rule_set from RuleSet resource. + * + * @param {string} ruleSetName + * A fully-qualified path representing RuleSet resource. + * @returns {string} A string representing the rule_set. + */ + matchRuleSetFromRuleSetName(ruleSetName: string) { + return this.pathTemplates.ruleSetPathTemplate.match(ruleSetName).rule_set; + } + + /** + * Return a fully-qualified synonymSet resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} context + * @returns {string} Resource name string. + */ + synonymSetPath(project:string,location:string,context:string) { + return this.pathTemplates.synonymSetPathTemplate.render({ + project: project, + location: location, + context: context, + }); + } + + /** + * Parse the project from SynonymSet resource. + * + * @param {string} synonymSetName + * A fully-qualified path representing SynonymSet resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSynonymSetName(synonymSetName: string) { + return this.pathTemplates.synonymSetPathTemplate.match(synonymSetName).project; + } + + /** + * Parse the location from SynonymSet resource. + * + * @param {string} synonymSetName + * A fully-qualified path representing SynonymSet resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSynonymSetName(synonymSetName: string) { + return this.pathTemplates.synonymSetPathTemplate.match(synonymSetName).location; + } + + /** + * Parse the context from SynonymSet resource. + * + * @param {string} synonymSetName + * A fully-qualified path representing SynonymSet resource. + * @returns {string} A string representing the context. + */ + matchContextFromSynonymSetName(synonymSetName: string) { + return this.pathTemplates.synonymSetPathTemplate.match(synonymSetName).context; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.synonymSetServiceStub && !this._terminated) { + return this.synonymSetServiceStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/synonym_set_service_client_config.json b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/synonym_set_service_client_config.json new file mode 100644 index 00000000000..3c3408c02f7 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/synonym_set_service_client_config.json @@ -0,0 +1,63 @@ +{ + "interfaces": { + "google.cloud.contentwarehouse.v1.SynonymSetService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "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 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateSynonymSet": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetSynonymSet": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateSynonymSet": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteSynonymSet": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListSynonymSets": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/synonym_set_service_proto_list.json b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/synonym_set_service_proto_list.json new file mode 100644 index 00000000000..a1775b1134d --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/synonym_set_service_proto_list.json @@ -0,0 +1,23 @@ +[ + "../../protos/google/cloud/contentwarehouse/v1/async_document_service_request.proto", + "../../protos/google/cloud/contentwarehouse/v1/common.proto", + "../../protos/google/cloud/contentwarehouse/v1/document.proto", + "../../protos/google/cloud/contentwarehouse/v1/document_link_service.proto", + "../../protos/google/cloud/contentwarehouse/v1/document_schema.proto", + "../../protos/google/cloud/contentwarehouse/v1/document_schema_service.proto", + "../../protos/google/cloud/contentwarehouse/v1/document_service.proto", + "../../protos/google/cloud/contentwarehouse/v1/document_service_request.proto", + "../../protos/google/cloud/contentwarehouse/v1/filters.proto", + "../../protos/google/cloud/contentwarehouse/v1/histogram.proto", + "../../protos/google/cloud/contentwarehouse/v1/pipeline_service.proto", + "../../protos/google/cloud/contentwarehouse/v1/pipelines.proto", + "../../protos/google/cloud/contentwarehouse/v1/rule_engine.proto", + "../../protos/google/cloud/contentwarehouse/v1/ruleset_service.proto", + "../../protos/google/cloud/contentwarehouse/v1/ruleset_service_request.proto", + "../../protos/google/cloud/contentwarehouse/v1/synonymset.proto", + "../../protos/google/cloud/contentwarehouse/v1/synonymset_service.proto", + "../../protos/google/cloud/contentwarehouse/v1/synonymset_service_request.proto", + "../../protos/google/cloud/documentai/v1/barcode.proto", + "../../protos/google/cloud/documentai/v1/document.proto", + "../../protos/google/cloud/documentai/v1/geometry.proto" +] diff --git a/owl-bot-staging/google-cloud-contentwarehouse/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-contentwarehouse/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..55706ecff78 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/system-test/fixtures/sample/src/index.js @@ -0,0 +1,32 @@ +// Copyright 2026 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 contentwarehouse = require('@google-cloud/contentwarehouse'); + +function main() { + const documentLinkServiceClient = new contentwarehouse.DocumentLinkServiceClient(); + const documentSchemaServiceClient = new contentwarehouse.DocumentSchemaServiceClient(); + const documentServiceClient = new contentwarehouse.DocumentServiceClient(); + const pipelineServiceClient = new contentwarehouse.PipelineServiceClient(); + const ruleSetServiceClient = new contentwarehouse.RuleSetServiceClient(); + const synonymSetServiceClient = new contentwarehouse.SynonymSetServiceClient(); +} + +main(); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-contentwarehouse/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..46c47122125 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,62 @@ +// Copyright 2026 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 {DocumentLinkServiceClient, DocumentSchemaServiceClient, DocumentServiceClient, PipelineServiceClient, RuleSetServiceClient, SynonymSetServiceClient} from '@google-cloud/contentwarehouse'; + +// check that the client class type name can be used +function doStuffWithDocumentLinkServiceClient(client: DocumentLinkServiceClient) { + client.close(); +} +function doStuffWithDocumentSchemaServiceClient(client: DocumentSchemaServiceClient) { + client.close(); +} +function doStuffWithDocumentServiceClient(client: DocumentServiceClient) { + client.close(); +} +function doStuffWithPipelineServiceClient(client: PipelineServiceClient) { + client.close(); +} +function doStuffWithRuleSetServiceClient(client: RuleSetServiceClient) { + client.close(); +} +function doStuffWithSynonymSetServiceClient(client: SynonymSetServiceClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const documentLinkServiceClient = new DocumentLinkServiceClient(); + doStuffWithDocumentLinkServiceClient(documentLinkServiceClient); + // check that the client instance can be created + const documentSchemaServiceClient = new DocumentSchemaServiceClient(); + doStuffWithDocumentSchemaServiceClient(documentSchemaServiceClient); + // check that the client instance can be created + const documentServiceClient = new DocumentServiceClient(); + doStuffWithDocumentServiceClient(documentServiceClient); + // check that the client instance can be created + const pipelineServiceClient = new PipelineServiceClient(); + doStuffWithPipelineServiceClient(pipelineServiceClient); + // check that the client instance can be created + const ruleSetServiceClient = new RuleSetServiceClient(); + doStuffWithRuleSetServiceClient(ruleSetServiceClient); + // check that the client instance can be created + const synonymSetServiceClient = new SynonymSetServiceClient(); + doStuffWithSynonymSetServiceClient(synonymSetServiceClient); +} + +main(); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/system-test/install.ts b/owl-bot-staging/google-cloud-contentwarehouse/system-test/install.ts new file mode 100644 index 00000000000..394f3362d20 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/system-test/install.ts @@ -0,0 +1,49 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + + it('TypeScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() + } + }; + await packNTest(options); + }); + + it('JavaScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() + } + }; + await packNTest(options); + }); + +}); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/test/gapic_document_link_service_v1.ts b/owl-bot-staging/google-cloud-contentwarehouse/test/gapic_document_link_service_v1.ts new file mode 100644 index 00000000000..0abededa259 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/test/gapic_document_link_service_v1.ts @@ -0,0 +1,1117 @@ +// Copyright 2026 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 documentlinkserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +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('v1.DocumentLinkServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'contentwarehouse.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = documentlinkserviceModule.v1.DocumentLinkServiceClient.servicePath; + assert.strictEqual(servicePath, 'contentwarehouse.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = documentlinkserviceModule.v1.DocumentLinkServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'contentwarehouse.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'contentwarehouse.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'contentwarehouse.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'contentwarehouse.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'contentwarehouse.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new documentlinkserviceModule.v1.DocumentLinkServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = documentlinkserviceModule.v1.DocumentLinkServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.documentLinkServiceStub, undefined); + await client.initialize(); + assert(client.documentLinkServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.documentLinkServiceStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.documentLinkServiceStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ + 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 documentlinkserviceModule.v1.DocumentLinkServiceClient({ + 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('listLinkedTargets', () => { + it('invokes listLinkedTargets without error', async () => { + const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse() + ); + client.innerApiCalls.listLinkedTargets = stubSimpleCall(expectedResponse); + const [response] = await client.listLinkedTargets(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listLinkedTargets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listLinkedTargets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listLinkedTargets without error using callback', async () => { + const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse() + ); + client.innerApiCalls.listLinkedTargets = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listLinkedTargets( + request, + (err?: Error|null, result?: protos.google.cloud.contentwarehouse.v1.IListLinkedTargetsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listLinkedTargets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listLinkedTargets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listLinkedTargets with error', async () => { + const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listLinkedTargets = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listLinkedTargets(request), expectedError); + const actualRequest = (client.innerApiCalls.listLinkedTargets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listLinkedTargets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listLinkedTargets with closed client', async () => { + const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.listLinkedTargets(request), expectedError); + }); + }); + + describe('createDocumentLink', () => { + it('invokes createDocumentLink without error', async () => { + const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.DocumentLink() + ); + client.innerApiCalls.createDocumentLink = stubSimpleCall(expectedResponse); + const [response] = await client.createDocumentLink(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createDocumentLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDocumentLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDocumentLink without error using callback', async () => { + const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.DocumentLink() + ); + client.innerApiCalls.createDocumentLink = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createDocumentLink( + request, + (err?: Error|null, result?: protos.google.cloud.contentwarehouse.v1.IDocumentLink|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createDocumentLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDocumentLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDocumentLink with error', async () => { + const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDocumentLink = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createDocumentLink(request), expectedError); + const actualRequest = (client.innerApiCalls.createDocumentLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDocumentLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDocumentLink with closed client', async () => { + const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createDocumentLink(request), expectedError); + }); + }); + + describe('deleteDocumentLink', () => { + it('invokes deleteDocumentLink without error', async () => { + const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteDocumentLink = stubSimpleCall(expectedResponse); + const [response] = await client.deleteDocumentLink(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteDocumentLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDocumentLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDocumentLink without error using callback', async () => { + const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteDocumentLink = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteDocumentLink( + 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); + const actualRequest = (client.innerApiCalls.deleteDocumentLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDocumentLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDocumentLink with error', async () => { + const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDocumentLink = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteDocumentLink(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteDocumentLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDocumentLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDocumentLink with closed client', async () => { + const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteDocumentLink(request), expectedError); + }); + }); + + describe('listLinkedSources', () => { + it('invokes listLinkedSources without error', async () => { + const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.DocumentLink()), + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.DocumentLink()), + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.DocumentLink()), + ]; + client.innerApiCalls.listLinkedSources = stubSimpleCall(expectedResponse); + const [response] = await client.listLinkedSources(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listLinkedSources as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listLinkedSources as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listLinkedSources without error using callback', async () => { + const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.DocumentLink()), + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.DocumentLink()), + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.DocumentLink()), + ]; + client.innerApiCalls.listLinkedSources = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listLinkedSources( + request, + (err?: Error|null, result?: protos.google.cloud.contentwarehouse.v1.IDocumentLink[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listLinkedSources as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listLinkedSources as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listLinkedSources with error', async () => { + const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listLinkedSources = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listLinkedSources(request), expectedError); + const actualRequest = (client.innerApiCalls.listLinkedSources as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listLinkedSources as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listLinkedSourcesStream without error', async () => { + const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.DocumentLink()), + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.DocumentLink()), + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.DocumentLink()), + ]; + client.descriptors.page.listLinkedSources.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listLinkedSourcesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.contentwarehouse.v1.DocumentLink[] = []; + stream.on('data', (response: protos.google.cloud.contentwarehouse.v1.DocumentLink) => { + 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.listLinkedSources.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listLinkedSources, request)); + assert( + (client.descriptors.page.listLinkedSources.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listLinkedSourcesStream with error', async () => { + const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listLinkedSources.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listLinkedSourcesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.contentwarehouse.v1.DocumentLink[] = []; + stream.on('data', (response: protos.google.cloud.contentwarehouse.v1.DocumentLink) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listLinkedSources.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listLinkedSources, request)); + assert( + (client.descriptors.page.listLinkedSources.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listLinkedSources without error', async () => { + const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.DocumentLink()), + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.DocumentLink()), + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.DocumentLink()), + ]; + client.descriptors.page.listLinkedSources.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.contentwarehouse.v1.IDocumentLink[] = []; + const iterable = client.listLinkedSourcesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listLinkedSources.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listLinkedSources.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listLinkedSources with error', async () => { + const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listLinkedSources.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLinkedSourcesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.contentwarehouse.v1.IDocumentLink[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listLinkedSources.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listLinkedSources.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + + describe('documentLink', async () => { + const fakePath = "/rendered/path/documentLink"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + document: "documentValue", + document_link: "documentLinkValue", + }; + const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.documentLinkPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.documentLinkPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('documentLinkPath', () => { + const result = client.documentLinkPath("projectValue", "locationValue", "documentValue", "documentLinkValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.documentLinkPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDocumentLinkName', () => { + const result = client.matchProjectFromDocumentLinkName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.documentLinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDocumentLinkName', () => { + const result = client.matchLocationFromDocumentLinkName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.documentLinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDocumentFromDocumentLinkName', () => { + const result = client.matchDocumentFromDocumentLinkName(fakePath); + assert.strictEqual(result, "documentValue"); + assert((client.pathTemplates.documentLinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDocumentLinkFromDocumentLinkName', () => { + const result = client.matchDocumentLinkFromDocumentLinkName(fakePath); + assert.strictEqual(result, "documentLinkValue"); + assert((client.pathTemplates.documentLinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('documentSchema', async () => { + const fakePath = "/rendered/path/documentSchema"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + document_schema: "documentSchemaValue", + }; + const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.documentSchemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.documentSchemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('documentSchemaPath', () => { + const result = client.documentSchemaPath("projectValue", "locationValue", "documentSchemaValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.documentSchemaPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDocumentSchemaName', () => { + const result = client.matchProjectFromDocumentSchemaName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.documentSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDocumentSchemaName', () => { + const result = client.matchLocationFromDocumentSchemaName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.documentSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDocumentSchemaFromDocumentSchemaName', () => { + const result = client.matchDocumentSchemaFromDocumentSchemaName(fakePath); + assert.strictEqual(result, "documentSchemaValue"); + assert((client.pathTemplates.documentSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationDocument', async () => { + const fakePath = "/rendered/path/projectLocationDocument"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + document: "documentValue", + }; + const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationDocumentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationDocumentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationDocumentPath', () => { + const result = client.projectLocationDocumentPath("projectValue", "locationValue", "documentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationDocumentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationDocumentName', () => { + const result = client.matchProjectFromProjectLocationDocumentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationDocumentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationDocumentName', () => { + const result = client.matchLocationFromProjectLocationDocumentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationDocumentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDocumentFromProjectLocationDocumentName', () => { + const result = client.matchDocumentFromProjectLocationDocumentName(fakePath); + assert.strictEqual(result, "documentValue"); + assert((client.pathTemplates.projectLocationDocumentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationDocumentsReferenceId', async () => { + const fakePath = "/rendered/path/projectLocationDocumentsReferenceId"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + reference_id: "referenceIdValue", + }; + const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationDocumentsReferenceIdPath', () => { + const result = client.projectLocationDocumentsReferenceIdPath("projectValue", "locationValue", "referenceIdValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationDocumentsReferenceIdName', () => { + const result = client.matchProjectFromProjectLocationDocumentsReferenceIdName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationDocumentsReferenceIdName', () => { + const result = client.matchLocationFromProjectLocationDocumentsReferenceIdName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchReferenceIdFromProjectLocationDocumentsReferenceIdName', () => { + const result = client.matchReferenceIdFromProjectLocationDocumentsReferenceIdName(fakePath); + assert.strictEqual(result, "referenceIdValue"); + assert((client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('ruleSet', async () => { + const fakePath = "/rendered/path/ruleSet"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + rule_set: "ruleSetValue", + }; + const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.ruleSetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.ruleSetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('ruleSetPath', () => { + const result = client.ruleSetPath("projectValue", "locationValue", "ruleSetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.ruleSetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromRuleSetName', () => { + const result = client.matchProjectFromRuleSetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.ruleSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromRuleSetName', () => { + const result = client.matchLocationFromRuleSetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.ruleSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRuleSetFromRuleSetName', () => { + const result = client.matchRuleSetFromRuleSetName(fakePath); + assert.strictEqual(result, "ruleSetValue"); + assert((client.pathTemplates.ruleSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('synonymSet', async () => { + const fakePath = "/rendered/path/synonymSet"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + context: "contextValue", + }; + const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.synonymSetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.synonymSetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('synonymSetPath', () => { + const result = client.synonymSetPath("projectValue", "locationValue", "contextValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.synonymSetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSynonymSetName', () => { + const result = client.matchProjectFromSynonymSetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.synonymSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSynonymSetName', () => { + const result = client.matchLocationFromSynonymSetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.synonymSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchContextFromSynonymSetName', () => { + const result = client.matchContextFromSynonymSetName(fakePath); + assert.strictEqual(result, "contextValue"); + assert((client.pathTemplates.synonymSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/test/gapic_document_schema_service_v1.ts b/owl-bot-staging/google-cloud-contentwarehouse/test/gapic_document_schema_service_v1.ts new file mode 100644 index 00000000000..86399dc6fee --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/test/gapic_document_schema_service_v1.ts @@ -0,0 +1,1263 @@ +// Copyright 2026 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 documentschemaserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +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('v1.DocumentSchemaServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'contentwarehouse.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = documentschemaserviceModule.v1.DocumentSchemaServiceClient.servicePath; + assert.strictEqual(servicePath, 'contentwarehouse.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = documentschemaserviceModule.v1.DocumentSchemaServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'contentwarehouse.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'contentwarehouse.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'contentwarehouse.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'contentwarehouse.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'contentwarehouse.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new documentschemaserviceModule.v1.DocumentSchemaServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = documentschemaserviceModule.v1.DocumentSchemaServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.documentSchemaServiceStub, undefined); + await client.initialize(); + assert(client.documentSchemaServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.documentSchemaServiceStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.documentSchemaServiceStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ + 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 documentschemaserviceModule.v1.DocumentSchemaServiceClient({ + 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('createDocumentSchema', () => { + it('invokes createDocumentSchema without error', async () => { + const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.DocumentSchema() + ); + client.innerApiCalls.createDocumentSchema = stubSimpleCall(expectedResponse); + const [response] = await client.createDocumentSchema(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createDocumentSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDocumentSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDocumentSchema without error using callback', async () => { + const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.DocumentSchema() + ); + client.innerApiCalls.createDocumentSchema = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createDocumentSchema( + request, + (err?: Error|null, result?: protos.google.cloud.contentwarehouse.v1.IDocumentSchema|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createDocumentSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDocumentSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDocumentSchema with error', async () => { + const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDocumentSchema = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createDocumentSchema(request), expectedError); + const actualRequest = (client.innerApiCalls.createDocumentSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDocumentSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDocumentSchema with closed client', async () => { + const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createDocumentSchema(request), expectedError); + }); + }); + + describe('updateDocumentSchema', () => { + it('invokes updateDocumentSchema without error', async () => { + const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.DocumentSchema() + ); + client.innerApiCalls.updateDocumentSchema = stubSimpleCall(expectedResponse); + const [response] = await client.updateDocumentSchema(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateDocumentSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDocumentSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDocumentSchema without error using callback', async () => { + const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.DocumentSchema() + ); + client.innerApiCalls.updateDocumentSchema = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateDocumentSchema( + request, + (err?: Error|null, result?: protos.google.cloud.contentwarehouse.v1.IDocumentSchema|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateDocumentSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDocumentSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDocumentSchema with error', async () => { + const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDocumentSchema = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateDocumentSchema(request), expectedError); + const actualRequest = (client.innerApiCalls.updateDocumentSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDocumentSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDocumentSchema with closed client', async () => { + const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateDocumentSchema(request), expectedError); + }); + }); + + describe('getDocumentSchema', () => { + it('invokes getDocumentSchema without error', async () => { + const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.DocumentSchema() + ); + client.innerApiCalls.getDocumentSchema = stubSimpleCall(expectedResponse); + const [response] = await client.getDocumentSchema(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getDocumentSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDocumentSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDocumentSchema without error using callback', async () => { + const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.DocumentSchema() + ); + client.innerApiCalls.getDocumentSchema = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDocumentSchema( + request, + (err?: Error|null, result?: protos.google.cloud.contentwarehouse.v1.IDocumentSchema|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getDocumentSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDocumentSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDocumentSchema with error', async () => { + const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDocumentSchema = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getDocumentSchema(request), expectedError); + const actualRequest = (client.innerApiCalls.getDocumentSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDocumentSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDocumentSchema with closed client', async () => { + const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getDocumentSchema(request), expectedError); + }); + }); + + describe('deleteDocumentSchema', () => { + it('invokes deleteDocumentSchema without error', async () => { + const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteDocumentSchema = stubSimpleCall(expectedResponse); + const [response] = await client.deleteDocumentSchema(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteDocumentSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDocumentSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDocumentSchema without error using callback', async () => { + const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteDocumentSchema = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteDocumentSchema( + 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); + const actualRequest = (client.innerApiCalls.deleteDocumentSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDocumentSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDocumentSchema with error', async () => { + const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDocumentSchema = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteDocumentSchema(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteDocumentSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDocumentSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDocumentSchema with closed client', async () => { + const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteDocumentSchema(request), expectedError); + }); + }); + + describe('listDocumentSchemas', () => { + it('invokes listDocumentSchemas without error', async () => { + const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.DocumentSchema()), + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.DocumentSchema()), + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.DocumentSchema()), + ]; + client.innerApiCalls.listDocumentSchemas = stubSimpleCall(expectedResponse); + const [response] = await client.listDocumentSchemas(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listDocumentSchemas as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDocumentSchemas as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDocumentSchemas without error using callback', async () => { + const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.DocumentSchema()), + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.DocumentSchema()), + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.DocumentSchema()), + ]; + client.innerApiCalls.listDocumentSchemas = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDocumentSchemas( + request, + (err?: Error|null, result?: protos.google.cloud.contentwarehouse.v1.IDocumentSchema[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listDocumentSchemas as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDocumentSchemas as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDocumentSchemas with error', async () => { + const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDocumentSchemas = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listDocumentSchemas(request), expectedError); + const actualRequest = (client.innerApiCalls.listDocumentSchemas as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDocumentSchemas as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDocumentSchemasStream without error', async () => { + const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.DocumentSchema()), + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.DocumentSchema()), + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.DocumentSchema()), + ]; + client.descriptors.page.listDocumentSchemas.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listDocumentSchemasStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.contentwarehouse.v1.DocumentSchema[] = []; + stream.on('data', (response: protos.google.cloud.contentwarehouse.v1.DocumentSchema) => { + 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.listDocumentSchemas.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDocumentSchemas, request)); + assert( + (client.descriptors.page.listDocumentSchemas.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listDocumentSchemasStream with error', async () => { + const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listDocumentSchemas.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listDocumentSchemasStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.contentwarehouse.v1.DocumentSchema[] = []; + stream.on('data', (response: protos.google.cloud.contentwarehouse.v1.DocumentSchema) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listDocumentSchemas.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDocumentSchemas, request)); + assert( + (client.descriptors.page.listDocumentSchemas.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDocumentSchemas without error', async () => { + const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.DocumentSchema()), + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.DocumentSchema()), + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.DocumentSchema()), + ]; + client.descriptors.page.listDocumentSchemas.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.contentwarehouse.v1.IDocumentSchema[] = []; + const iterable = client.listDocumentSchemasAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listDocumentSchemas.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listDocumentSchemas.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDocumentSchemas with error', async () => { + const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listDocumentSchemas.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDocumentSchemasAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.contentwarehouse.v1.IDocumentSchema[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listDocumentSchemas.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listDocumentSchemas.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + + describe('documentLink', async () => { + const fakePath = "/rendered/path/documentLink"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + document: "documentValue", + document_link: "documentLinkValue", + }; + const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.documentLinkPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.documentLinkPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('documentLinkPath', () => { + const result = client.documentLinkPath("projectValue", "locationValue", "documentValue", "documentLinkValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.documentLinkPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDocumentLinkName', () => { + const result = client.matchProjectFromDocumentLinkName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.documentLinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDocumentLinkName', () => { + const result = client.matchLocationFromDocumentLinkName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.documentLinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDocumentFromDocumentLinkName', () => { + const result = client.matchDocumentFromDocumentLinkName(fakePath); + assert.strictEqual(result, "documentValue"); + assert((client.pathTemplates.documentLinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDocumentLinkFromDocumentLinkName', () => { + const result = client.matchDocumentLinkFromDocumentLinkName(fakePath); + assert.strictEqual(result, "documentLinkValue"); + assert((client.pathTemplates.documentLinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('documentSchema', async () => { + const fakePath = "/rendered/path/documentSchema"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + document_schema: "documentSchemaValue", + }; + const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.documentSchemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.documentSchemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('documentSchemaPath', () => { + const result = client.documentSchemaPath("projectValue", "locationValue", "documentSchemaValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.documentSchemaPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDocumentSchemaName', () => { + const result = client.matchProjectFromDocumentSchemaName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.documentSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDocumentSchemaName', () => { + const result = client.matchLocationFromDocumentSchemaName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.documentSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDocumentSchemaFromDocumentSchemaName', () => { + const result = client.matchDocumentSchemaFromDocumentSchemaName(fakePath); + assert.strictEqual(result, "documentSchemaValue"); + assert((client.pathTemplates.documentSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', async () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationDocument', async () => { + const fakePath = "/rendered/path/projectLocationDocument"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + document: "documentValue", + }; + const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationDocumentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationDocumentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationDocumentPath', () => { + const result = client.projectLocationDocumentPath("projectValue", "locationValue", "documentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationDocumentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationDocumentName', () => { + const result = client.matchProjectFromProjectLocationDocumentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationDocumentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationDocumentName', () => { + const result = client.matchLocationFromProjectLocationDocumentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationDocumentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDocumentFromProjectLocationDocumentName', () => { + const result = client.matchDocumentFromProjectLocationDocumentName(fakePath); + assert.strictEqual(result, "documentValue"); + assert((client.pathTemplates.projectLocationDocumentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationDocumentsReferenceId', async () => { + const fakePath = "/rendered/path/projectLocationDocumentsReferenceId"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + reference_id: "referenceIdValue", + }; + const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationDocumentsReferenceIdPath', () => { + const result = client.projectLocationDocumentsReferenceIdPath("projectValue", "locationValue", "referenceIdValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationDocumentsReferenceIdName', () => { + const result = client.matchProjectFromProjectLocationDocumentsReferenceIdName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationDocumentsReferenceIdName', () => { + const result = client.matchLocationFromProjectLocationDocumentsReferenceIdName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchReferenceIdFromProjectLocationDocumentsReferenceIdName', () => { + const result = client.matchReferenceIdFromProjectLocationDocumentsReferenceIdName(fakePath); + assert.strictEqual(result, "referenceIdValue"); + assert((client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('ruleSet', async () => { + const fakePath = "/rendered/path/ruleSet"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + rule_set: "ruleSetValue", + }; + const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.ruleSetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.ruleSetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('ruleSetPath', () => { + const result = client.ruleSetPath("projectValue", "locationValue", "ruleSetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.ruleSetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromRuleSetName', () => { + const result = client.matchProjectFromRuleSetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.ruleSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromRuleSetName', () => { + const result = client.matchLocationFromRuleSetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.ruleSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRuleSetFromRuleSetName', () => { + const result = client.matchRuleSetFromRuleSetName(fakePath); + assert.strictEqual(result, "ruleSetValue"); + assert((client.pathTemplates.ruleSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('synonymSet', async () => { + const fakePath = "/rendered/path/synonymSet"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + context: "contextValue", + }; + const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.synonymSetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.synonymSetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('synonymSetPath', () => { + const result = client.synonymSetPath("projectValue", "locationValue", "contextValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.synonymSetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSynonymSetName', () => { + const result = client.matchProjectFromSynonymSetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.synonymSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSynonymSetName', () => { + const result = client.matchLocationFromSynonymSetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.synonymSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchContextFromSynonymSetName', () => { + const result = client.matchContextFromSynonymSetName(fakePath); + assert.strictEqual(result, "contextValue"); + assert((client.pathTemplates.synonymSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/test/gapic_document_service_v1.ts b/owl-bot-staging/google-cloud-contentwarehouse/test/gapic_document_service_v1.ts new file mode 100644 index 00000000000..57a543ea67c --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/test/gapic_document_service_v1.ts @@ -0,0 +1,1549 @@ +// Copyright 2026 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 documentserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +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('v1.DocumentServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new documentserviceModule.v1.DocumentServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'contentwarehouse.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new documentserviceModule.v1.DocumentServiceClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = documentserviceModule.v1.DocumentServiceClient.servicePath; + assert.strictEqual(servicePath, 'contentwarehouse.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = documentserviceModule.v1.DocumentServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'contentwarehouse.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new documentserviceModule.v1.DocumentServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'contentwarehouse.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new documentserviceModule.v1.DocumentServiceClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'contentwarehouse.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new documentserviceModule.v1.DocumentServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'contentwarehouse.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new documentserviceModule.v1.DocumentServiceClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'contentwarehouse.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new documentserviceModule.v1.DocumentServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = documentserviceModule.v1.DocumentServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new documentserviceModule.v1.DocumentServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.documentServiceStub, undefined); + await client.initialize(); + assert(client.documentServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.documentServiceStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.documentServiceStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new documentserviceModule.v1.DocumentServiceClient({ + 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 documentserviceModule.v1.DocumentServiceClient({ + 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('createDocument', () => { + it('invokes createDocument without error', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.CreateDocumentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.CreateDocumentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.CreateDocumentResponse() + ); + client.innerApiCalls.createDocument = stubSimpleCall(expectedResponse); + const [response] = await client.createDocument(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createDocument as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDocument as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDocument without error using callback', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.CreateDocumentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.CreateDocumentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.CreateDocumentResponse() + ); + client.innerApiCalls.createDocument = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createDocument( + request, + (err?: Error|null, result?: protos.google.cloud.contentwarehouse.v1.ICreateDocumentResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createDocument as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDocument as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDocument with error', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.CreateDocumentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.CreateDocumentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDocument = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createDocument(request), expectedError); + const actualRequest = (client.innerApiCalls.createDocument as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDocument as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDocument with closed client', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.CreateDocumentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.CreateDocumentRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createDocument(request), expectedError); + }); + }); + + describe('getDocument', () => { + it('invokes getDocument without error', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.GetDocumentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.GetDocumentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.Document() + ); + client.innerApiCalls.getDocument = stubSimpleCall(expectedResponse); + const [response] = await client.getDocument(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getDocument as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDocument as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDocument without error using callback', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.GetDocumentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.GetDocumentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.Document() + ); + client.innerApiCalls.getDocument = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDocument( + request, + (err?: Error|null, result?: protos.google.cloud.contentwarehouse.v1.IDocument|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getDocument as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDocument as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDocument with error', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.GetDocumentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.GetDocumentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDocument = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getDocument(request), expectedError); + const actualRequest = (client.innerApiCalls.getDocument as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDocument as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDocument with closed client', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.GetDocumentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.GetDocumentRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getDocument(request), expectedError); + }); + }); + + describe('updateDocument', () => { + it('invokes updateDocument without error', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.UpdateDocumentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.UpdateDocumentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.UpdateDocumentResponse() + ); + client.innerApiCalls.updateDocument = stubSimpleCall(expectedResponse); + const [response] = await client.updateDocument(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateDocument as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDocument as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDocument without error using callback', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.UpdateDocumentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.UpdateDocumentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.UpdateDocumentResponse() + ); + client.innerApiCalls.updateDocument = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateDocument( + request, + (err?: Error|null, result?: protos.google.cloud.contentwarehouse.v1.IUpdateDocumentResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateDocument as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDocument as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDocument with error', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.UpdateDocumentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.UpdateDocumentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDocument = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateDocument(request), expectedError); + const actualRequest = (client.innerApiCalls.updateDocument as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDocument as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDocument with closed client', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.UpdateDocumentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.UpdateDocumentRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateDocument(request), expectedError); + }); + }); + + describe('deleteDocument', () => { + it('invokes deleteDocument without error', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.DeleteDocumentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.DeleteDocumentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteDocument = stubSimpleCall(expectedResponse); + const [response] = await client.deleteDocument(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteDocument as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDocument as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDocument without error using callback', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.DeleteDocumentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.DeleteDocumentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteDocument = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteDocument( + 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); + const actualRequest = (client.innerApiCalls.deleteDocument as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDocument as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDocument with error', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.DeleteDocumentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.DeleteDocumentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDocument = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteDocument(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteDocument as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDocument as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDocument with closed client', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.DeleteDocumentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.DeleteDocumentRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteDocument(request), expectedError); + }); + }); + + describe('lockDocument', () => { + it('invokes lockDocument without error', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.LockDocumentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.LockDocumentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.Document() + ); + client.innerApiCalls.lockDocument = stubSimpleCall(expectedResponse); + const [response] = await client.lockDocument(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.lockDocument as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.lockDocument as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes lockDocument without error using callback', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.LockDocumentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.LockDocumentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.Document() + ); + client.innerApiCalls.lockDocument = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.lockDocument( + request, + (err?: Error|null, result?: protos.google.cloud.contentwarehouse.v1.IDocument|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.lockDocument as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.lockDocument as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes lockDocument with error', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.LockDocumentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.LockDocumentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.lockDocument = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.lockDocument(request), expectedError); + const actualRequest = (client.innerApiCalls.lockDocument as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.lockDocument as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes lockDocument with closed client', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.LockDocumentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.LockDocumentRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.lockDocument(request), expectedError); + }); + }); + + describe('fetchAcl', () => { + it('invokes fetchAcl without error', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.FetchAclRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.FetchAclRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.FetchAclResponse() + ); + client.innerApiCalls.fetchAcl = stubSimpleCall(expectedResponse); + const [response] = await client.fetchAcl(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.fetchAcl as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.fetchAcl as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchAcl without error using callback', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.FetchAclRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.FetchAclRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.FetchAclResponse() + ); + client.innerApiCalls.fetchAcl = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.fetchAcl( + request, + (err?: Error|null, result?: protos.google.cloud.contentwarehouse.v1.IFetchAclResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.fetchAcl as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.fetchAcl as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchAcl with error', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.FetchAclRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.FetchAclRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.fetchAcl = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.fetchAcl(request), expectedError); + const actualRequest = (client.innerApiCalls.fetchAcl as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.fetchAcl as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchAcl with closed client', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.FetchAclRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.FetchAclRequest', ['resource']); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.fetchAcl(request), expectedError); + }); + }); + + describe('setAcl', () => { + it('invokes setAcl without error', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.SetAclRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.SetAclRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.SetAclResponse() + ); + client.innerApiCalls.setAcl = stubSimpleCall(expectedResponse); + const [response] = await client.setAcl(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setAcl as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setAcl as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setAcl without error using callback', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.SetAclRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.SetAclRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.SetAclResponse() + ); + client.innerApiCalls.setAcl = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setAcl( + request, + (err?: Error|null, result?: protos.google.cloud.contentwarehouse.v1.ISetAclResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setAcl as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setAcl as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setAcl with error', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.SetAclRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.SetAclRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.setAcl = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setAcl(request), expectedError); + const actualRequest = (client.innerApiCalls.setAcl as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setAcl as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setAcl with closed client', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.SetAclRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.SetAclRequest', ['resource']); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.setAcl(request), expectedError); + }); + }); + + describe('searchDocuments', () => { + it('invokes searchDocuments without error', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.SearchDocumentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.SearchDocumentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument()), + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument()), + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument()), + ]; + client.innerApiCalls.searchDocuments = stubSimpleCall(expectedResponse); + const [response] = await client.searchDocuments(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.searchDocuments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchDocuments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchDocuments without error using callback', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.SearchDocumentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.SearchDocumentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument()), + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument()), + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument()), + ]; + client.innerApiCalls.searchDocuments = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.searchDocuments( + request, + (err?: Error|null, result?: protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.IMatchingDocument[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.searchDocuments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchDocuments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchDocuments with error', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.SearchDocumentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.SearchDocumentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.searchDocuments = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.searchDocuments(request), expectedError); + const actualRequest = (client.innerApiCalls.searchDocuments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchDocuments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchDocumentsStream without error', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.SearchDocumentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.SearchDocumentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument()), + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument()), + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument()), + ]; + client.descriptors.page.searchDocuments.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.searchDocumentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument[] = []; + stream.on('data', (response: protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument) => { + 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.searchDocuments.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.searchDocuments, request)); + assert( + (client.descriptors.page.searchDocuments.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes searchDocumentsStream with error', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.SearchDocumentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.SearchDocumentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.searchDocuments.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.searchDocumentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument[] = []; + stream.on('data', (response: protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.searchDocuments.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.searchDocuments, request)); + assert( + (client.descriptors.page.searchDocuments.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with searchDocuments without error', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.SearchDocumentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.SearchDocumentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument()), + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument()), + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument()), + ]; + client.descriptors.page.searchDocuments.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.IMatchingDocument[] = []; + const iterable = client.searchDocumentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.searchDocuments.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.searchDocuments.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with searchDocuments with error', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.SearchDocumentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.SearchDocumentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.searchDocuments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.searchDocumentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.IMatchingDocument[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.searchDocuments.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.searchDocuments.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + + describe('documentLink', async () => { + const fakePath = "/rendered/path/documentLink"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + document: "documentValue", + document_link: "documentLinkValue", + }; + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.documentLinkPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.documentLinkPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('documentLinkPath', () => { + const result = client.documentLinkPath("projectValue", "locationValue", "documentValue", "documentLinkValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.documentLinkPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDocumentLinkName', () => { + const result = client.matchProjectFromDocumentLinkName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.documentLinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDocumentLinkName', () => { + const result = client.matchLocationFromDocumentLinkName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.documentLinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDocumentFromDocumentLinkName', () => { + const result = client.matchDocumentFromDocumentLinkName(fakePath); + assert.strictEqual(result, "documentValue"); + assert((client.pathTemplates.documentLinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDocumentLinkFromDocumentLinkName', () => { + const result = client.matchDocumentLinkFromDocumentLinkName(fakePath); + assert.strictEqual(result, "documentLinkValue"); + assert((client.pathTemplates.documentLinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('documentSchema', async () => { + const fakePath = "/rendered/path/documentSchema"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + document_schema: "documentSchemaValue", + }; + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.documentSchemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.documentSchemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('documentSchemaPath', () => { + const result = client.documentSchemaPath("projectValue", "locationValue", "documentSchemaValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.documentSchemaPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDocumentSchemaName', () => { + const result = client.matchProjectFromDocumentSchemaName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.documentSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDocumentSchemaName', () => { + const result = client.matchLocationFromDocumentSchemaName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.documentSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDocumentSchemaFromDocumentSchemaName', () => { + const result = client.matchDocumentSchemaFromDocumentSchemaName(fakePath); + assert.strictEqual(result, "documentSchemaValue"); + assert((client.pathTemplates.documentSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationDocument', async () => { + const fakePath = "/rendered/path/projectLocationDocument"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + document: "documentValue", + }; + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationDocumentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationDocumentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationDocumentPath', () => { + const result = client.projectLocationDocumentPath("projectValue", "locationValue", "documentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationDocumentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationDocumentName', () => { + const result = client.matchProjectFromProjectLocationDocumentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationDocumentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationDocumentName', () => { + const result = client.matchLocationFromProjectLocationDocumentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationDocumentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDocumentFromProjectLocationDocumentName', () => { + const result = client.matchDocumentFromProjectLocationDocumentName(fakePath); + assert.strictEqual(result, "documentValue"); + assert((client.pathTemplates.projectLocationDocumentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationDocumentsReferenceId', async () => { + const fakePath = "/rendered/path/projectLocationDocumentsReferenceId"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + reference_id: "referenceIdValue", + }; + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationDocumentsReferenceIdPath', () => { + const result = client.projectLocationDocumentsReferenceIdPath("projectValue", "locationValue", "referenceIdValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationDocumentsReferenceIdName', () => { + const result = client.matchProjectFromProjectLocationDocumentsReferenceIdName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationDocumentsReferenceIdName', () => { + const result = client.matchLocationFromProjectLocationDocumentsReferenceIdName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchReferenceIdFromProjectLocationDocumentsReferenceIdName', () => { + const result = client.matchReferenceIdFromProjectLocationDocumentsReferenceIdName(fakePath); + assert.strictEqual(result, "referenceIdValue"); + assert((client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('ruleSet', async () => { + const fakePath = "/rendered/path/ruleSet"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + rule_set: "ruleSetValue", + }; + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.ruleSetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.ruleSetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('ruleSetPath', () => { + const result = client.ruleSetPath("projectValue", "locationValue", "ruleSetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.ruleSetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromRuleSetName', () => { + const result = client.matchProjectFromRuleSetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.ruleSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromRuleSetName', () => { + const result = client.matchLocationFromRuleSetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.ruleSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRuleSetFromRuleSetName', () => { + const result = client.matchRuleSetFromRuleSetName(fakePath); + assert.strictEqual(result, "ruleSetValue"); + assert((client.pathTemplates.ruleSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('synonymSet', async () => { + const fakePath = "/rendered/path/synonymSet"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + context: "contextValue", + }; + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.synonymSetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.synonymSetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('synonymSetPath', () => { + const result = client.synonymSetPath("projectValue", "locationValue", "contextValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.synonymSetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSynonymSetName', () => { + const result = client.matchProjectFromSynonymSetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.synonymSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSynonymSetName', () => { + const result = client.matchLocationFromSynonymSetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.synonymSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchContextFromSynonymSetName', () => { + const result = client.matchContextFromSynonymSetName(fakePath); + assert.strictEqual(result, "contextValue"); + assert((client.pathTemplates.synonymSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/test/gapic_pipeline_service_v1.ts b/owl-bot-staging/google-cloud-contentwarehouse/test/gapic_pipeline_service_v1.ts new file mode 100644 index 00000000000..f1f22085ea9 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/test/gapic_pipeline_service_v1.ts @@ -0,0 +1,980 @@ +// Copyright 2026 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 pipelineserviceModule from '../src'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +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 stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +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('v1.PipelineServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'contentwarehouse.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = pipelineserviceModule.v1.PipelineServiceClient.servicePath; + assert.strictEqual(servicePath, 'contentwarehouse.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = pipelineserviceModule.v1.PipelineServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'contentwarehouse.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'contentwarehouse.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'contentwarehouse.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new pipelineserviceModule.v1.PipelineServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'contentwarehouse.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new pipelineserviceModule.v1.PipelineServiceClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'contentwarehouse.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new pipelineserviceModule.v1.PipelineServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = pipelineserviceModule.v1.PipelineServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.pipelineServiceStub, undefined); + await client.initialize(); + assert(client.pipelineServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.pipelineServiceStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.pipelineServiceStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + 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 pipelineserviceModule.v1.PipelineServiceClient({ + 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('runPipeline', () => { + it('invokes runPipeline without error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.RunPipelineRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.RunPipelineRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.runPipeline = stubLongRunningCall(expectedResponse); + const [operation] = await client.runPipeline(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.runPipeline as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.runPipeline as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runPipeline without error using callback', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.RunPipelineRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.RunPipelineRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.runPipeline = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.runPipeline( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.runPipeline as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.runPipeline as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runPipeline with call error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.RunPipelineRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.RunPipelineRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.runPipeline = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.runPipeline(request), expectedError); + const actualRequest = (client.innerApiCalls.runPipeline as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.runPipeline as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runPipeline with LRO error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.RunPipelineRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.RunPipelineRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.runPipeline = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.runPipeline(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.runPipeline as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.runPipeline as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkRunPipelineProgress without error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkRunPipelineProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRunPipelineProgress with error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkRunPipelineProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.IOperation[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.IOperation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + describe('Path templates', () => { + + describe('documentLink', async () => { + const fakePath = "/rendered/path/documentLink"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + document: "documentValue", + document_link: "documentLinkValue", + }; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.documentLinkPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.documentLinkPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('documentLinkPath', () => { + const result = client.documentLinkPath("projectValue", "locationValue", "documentValue", "documentLinkValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.documentLinkPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDocumentLinkName', () => { + const result = client.matchProjectFromDocumentLinkName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.documentLinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDocumentLinkName', () => { + const result = client.matchLocationFromDocumentLinkName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.documentLinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDocumentFromDocumentLinkName', () => { + const result = client.matchDocumentFromDocumentLinkName(fakePath); + assert.strictEqual(result, "documentValue"); + assert((client.pathTemplates.documentLinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDocumentLinkFromDocumentLinkName', () => { + const result = client.matchDocumentLinkFromDocumentLinkName(fakePath); + assert.strictEqual(result, "documentLinkValue"); + assert((client.pathTemplates.documentLinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('documentSchema', async () => { + const fakePath = "/rendered/path/documentSchema"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + document_schema: "documentSchemaValue", + }; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.documentSchemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.documentSchemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('documentSchemaPath', () => { + const result = client.documentSchemaPath("projectValue", "locationValue", "documentSchemaValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.documentSchemaPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDocumentSchemaName', () => { + const result = client.matchProjectFromDocumentSchemaName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.documentSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDocumentSchemaName', () => { + const result = client.matchLocationFromDocumentSchemaName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.documentSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDocumentSchemaFromDocumentSchemaName', () => { + const result = client.matchDocumentSchemaFromDocumentSchemaName(fakePath); + assert.strictEqual(result, "documentSchemaValue"); + assert((client.pathTemplates.documentSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', async () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationDocument', async () => { + const fakePath = "/rendered/path/projectLocationDocument"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + document: "documentValue", + }; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationDocumentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationDocumentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationDocumentPath', () => { + const result = client.projectLocationDocumentPath("projectValue", "locationValue", "documentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationDocumentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationDocumentName', () => { + const result = client.matchProjectFromProjectLocationDocumentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationDocumentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationDocumentName', () => { + const result = client.matchLocationFromProjectLocationDocumentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationDocumentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDocumentFromProjectLocationDocumentName', () => { + const result = client.matchDocumentFromProjectLocationDocumentName(fakePath); + assert.strictEqual(result, "documentValue"); + assert((client.pathTemplates.projectLocationDocumentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationDocumentsReferenceId', async () => { + const fakePath = "/rendered/path/projectLocationDocumentsReferenceId"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + reference_id: "referenceIdValue", + }; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationDocumentsReferenceIdPath', () => { + const result = client.projectLocationDocumentsReferenceIdPath("projectValue", "locationValue", "referenceIdValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationDocumentsReferenceIdName', () => { + const result = client.matchProjectFromProjectLocationDocumentsReferenceIdName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationDocumentsReferenceIdName', () => { + const result = client.matchLocationFromProjectLocationDocumentsReferenceIdName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchReferenceIdFromProjectLocationDocumentsReferenceIdName', () => { + const result = client.matchReferenceIdFromProjectLocationDocumentsReferenceIdName(fakePath); + assert.strictEqual(result, "referenceIdValue"); + assert((client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('ruleSet', async () => { + const fakePath = "/rendered/path/ruleSet"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + rule_set: "ruleSetValue", + }; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.ruleSetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.ruleSetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('ruleSetPath', () => { + const result = client.ruleSetPath("projectValue", "locationValue", "ruleSetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.ruleSetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromRuleSetName', () => { + const result = client.matchProjectFromRuleSetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.ruleSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromRuleSetName', () => { + const result = client.matchLocationFromRuleSetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.ruleSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRuleSetFromRuleSetName', () => { + const result = client.matchRuleSetFromRuleSetName(fakePath); + assert.strictEqual(result, "ruleSetValue"); + assert((client.pathTemplates.ruleSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('synonymSet', async () => { + const fakePath = "/rendered/path/synonymSet"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + context: "contextValue", + }; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.synonymSetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.synonymSetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('synonymSetPath', () => { + const result = client.synonymSetPath("projectValue", "locationValue", "contextValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.synonymSetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSynonymSetName', () => { + const result = client.matchProjectFromSynonymSetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.synonymSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSynonymSetName', () => { + const result = client.matchLocationFromSynonymSetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.synonymSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchContextFromSynonymSetName', () => { + const result = client.matchContextFromSynonymSetName(fakePath); + assert.strictEqual(result, "contextValue"); + assert((client.pathTemplates.synonymSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/test/gapic_rule_set_service_v1.ts b/owl-bot-staging/google-cloud-contentwarehouse/test/gapic_rule_set_service_v1.ts new file mode 100644 index 00000000000..229257a6fcb --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/test/gapic_rule_set_service_v1.ts @@ -0,0 +1,1225 @@ +// Copyright 2026 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 rulesetserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +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('v1.RuleSetServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new rulesetserviceModule.v1.RuleSetServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'contentwarehouse.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new rulesetserviceModule.v1.RuleSetServiceClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = rulesetserviceModule.v1.RuleSetServiceClient.servicePath; + assert.strictEqual(servicePath, 'contentwarehouse.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = rulesetserviceModule.v1.RuleSetServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'contentwarehouse.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new rulesetserviceModule.v1.RuleSetServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'contentwarehouse.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new rulesetserviceModule.v1.RuleSetServiceClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'contentwarehouse.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new rulesetserviceModule.v1.RuleSetServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'contentwarehouse.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new rulesetserviceModule.v1.RuleSetServiceClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'contentwarehouse.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new rulesetserviceModule.v1.RuleSetServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = rulesetserviceModule.v1.RuleSetServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new rulesetserviceModule.v1.RuleSetServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new rulesetserviceModule.v1.RuleSetServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new rulesetserviceModule.v1.RuleSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.ruleSetServiceStub, undefined); + await client.initialize(); + assert(client.ruleSetServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new rulesetserviceModule.v1.RuleSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.ruleSetServiceStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new rulesetserviceModule.v1.RuleSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.ruleSetServiceStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new rulesetserviceModule.v1.RuleSetServiceClient({ + 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 rulesetserviceModule.v1.RuleSetServiceClient({ + 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('createRuleSet', () => { + it('invokes createRuleSet without error', async () => { + const client = new rulesetserviceModule.v1.RuleSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.CreateRuleSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.CreateRuleSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.RuleSet() + ); + client.innerApiCalls.createRuleSet = stubSimpleCall(expectedResponse); + const [response] = await client.createRuleSet(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createRuleSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createRuleSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createRuleSet without error using callback', async () => { + const client = new rulesetserviceModule.v1.RuleSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.CreateRuleSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.CreateRuleSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.RuleSet() + ); + client.innerApiCalls.createRuleSet = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createRuleSet( + request, + (err?: Error|null, result?: protos.google.cloud.contentwarehouse.v1.IRuleSet|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createRuleSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createRuleSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createRuleSet with error', async () => { + const client = new rulesetserviceModule.v1.RuleSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.CreateRuleSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.CreateRuleSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createRuleSet = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createRuleSet(request), expectedError); + const actualRequest = (client.innerApiCalls.createRuleSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createRuleSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createRuleSet with closed client', async () => { + const client = new rulesetserviceModule.v1.RuleSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.CreateRuleSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.CreateRuleSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createRuleSet(request), expectedError); + }); + }); + + describe('getRuleSet', () => { + it('invokes getRuleSet without error', async () => { + const client = new rulesetserviceModule.v1.RuleSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.GetRuleSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.GetRuleSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.RuleSet() + ); + client.innerApiCalls.getRuleSet = stubSimpleCall(expectedResponse); + const [response] = await client.getRuleSet(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getRuleSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getRuleSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRuleSet without error using callback', async () => { + const client = new rulesetserviceModule.v1.RuleSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.GetRuleSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.GetRuleSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.RuleSet() + ); + client.innerApiCalls.getRuleSet = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getRuleSet( + request, + (err?: Error|null, result?: protos.google.cloud.contentwarehouse.v1.IRuleSet|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getRuleSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getRuleSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRuleSet with error', async () => { + const client = new rulesetserviceModule.v1.RuleSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.GetRuleSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.GetRuleSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getRuleSet = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getRuleSet(request), expectedError); + const actualRequest = (client.innerApiCalls.getRuleSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getRuleSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRuleSet with closed client', async () => { + const client = new rulesetserviceModule.v1.RuleSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.GetRuleSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.GetRuleSetRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getRuleSet(request), expectedError); + }); + }); + + describe('updateRuleSet', () => { + it('invokes updateRuleSet without error', async () => { + const client = new rulesetserviceModule.v1.RuleSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.RuleSet() + ); + client.innerApiCalls.updateRuleSet = stubSimpleCall(expectedResponse); + const [response] = await client.updateRuleSet(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateRuleSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateRuleSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateRuleSet without error using callback', async () => { + const client = new rulesetserviceModule.v1.RuleSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.RuleSet() + ); + client.innerApiCalls.updateRuleSet = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateRuleSet( + request, + (err?: Error|null, result?: protos.google.cloud.contentwarehouse.v1.IRuleSet|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateRuleSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateRuleSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateRuleSet with error', async () => { + const client = new rulesetserviceModule.v1.RuleSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateRuleSet = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateRuleSet(request), expectedError); + const actualRequest = (client.innerApiCalls.updateRuleSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateRuleSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateRuleSet with closed client', async () => { + const client = new rulesetserviceModule.v1.RuleSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateRuleSet(request), expectedError); + }); + }); + + describe('deleteRuleSet', () => { + it('invokes deleteRuleSet without error', async () => { + const client = new rulesetserviceModule.v1.RuleSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteRuleSet = stubSimpleCall(expectedResponse); + const [response] = await client.deleteRuleSet(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteRuleSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteRuleSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteRuleSet without error using callback', async () => { + const client = new rulesetserviceModule.v1.RuleSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteRuleSet = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteRuleSet( + 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); + const actualRequest = (client.innerApiCalls.deleteRuleSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteRuleSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteRuleSet with error', async () => { + const client = new rulesetserviceModule.v1.RuleSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteRuleSet = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteRuleSet(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteRuleSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteRuleSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteRuleSet with closed client', async () => { + const client = new rulesetserviceModule.v1.RuleSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteRuleSet(request), expectedError); + }); + }); + + describe('listRuleSets', () => { + it('invokes listRuleSets without error', async () => { + const client = new rulesetserviceModule.v1.RuleSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.ListRuleSetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListRuleSetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.RuleSet()), + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.RuleSet()), + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.RuleSet()), + ]; + client.innerApiCalls.listRuleSets = stubSimpleCall(expectedResponse); + const [response] = await client.listRuleSets(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listRuleSets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listRuleSets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRuleSets without error using callback', async () => { + const client = new rulesetserviceModule.v1.RuleSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.ListRuleSetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListRuleSetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.RuleSet()), + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.RuleSet()), + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.RuleSet()), + ]; + client.innerApiCalls.listRuleSets = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listRuleSets( + request, + (err?: Error|null, result?: protos.google.cloud.contentwarehouse.v1.IRuleSet[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listRuleSets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listRuleSets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRuleSets with error', async () => { + const client = new rulesetserviceModule.v1.RuleSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.ListRuleSetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListRuleSetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listRuleSets = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listRuleSets(request), expectedError); + const actualRequest = (client.innerApiCalls.listRuleSets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listRuleSets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRuleSetsStream without error', async () => { + const client = new rulesetserviceModule.v1.RuleSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.ListRuleSetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListRuleSetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.RuleSet()), + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.RuleSet()), + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.RuleSet()), + ]; + client.descriptors.page.listRuleSets.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listRuleSetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.contentwarehouse.v1.RuleSet[] = []; + stream.on('data', (response: protos.google.cloud.contentwarehouse.v1.RuleSet) => { + 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.listRuleSets.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listRuleSets, request)); + assert( + (client.descriptors.page.listRuleSets.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listRuleSetsStream with error', async () => { + const client = new rulesetserviceModule.v1.RuleSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.ListRuleSetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListRuleSetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listRuleSets.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listRuleSetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.contentwarehouse.v1.RuleSet[] = []; + stream.on('data', (response: protos.google.cloud.contentwarehouse.v1.RuleSet) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listRuleSets.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listRuleSets, request)); + assert( + (client.descriptors.page.listRuleSets.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listRuleSets without error', async () => { + const client = new rulesetserviceModule.v1.RuleSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.ListRuleSetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListRuleSetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.RuleSet()), + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.RuleSet()), + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.RuleSet()), + ]; + client.descriptors.page.listRuleSets.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.contentwarehouse.v1.IRuleSet[] = []; + const iterable = client.listRuleSetsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listRuleSets.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listRuleSets.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listRuleSets with error', async () => { + const client = new rulesetserviceModule.v1.RuleSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.ListRuleSetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListRuleSetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listRuleSets.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listRuleSetsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.contentwarehouse.v1.IRuleSet[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listRuleSets.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listRuleSets.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + + describe('documentLink', async () => { + const fakePath = "/rendered/path/documentLink"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + document: "documentValue", + document_link: "documentLinkValue", + }; + const client = new rulesetserviceModule.v1.RuleSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.documentLinkPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.documentLinkPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('documentLinkPath', () => { + const result = client.documentLinkPath("projectValue", "locationValue", "documentValue", "documentLinkValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.documentLinkPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDocumentLinkName', () => { + const result = client.matchProjectFromDocumentLinkName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.documentLinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDocumentLinkName', () => { + const result = client.matchLocationFromDocumentLinkName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.documentLinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDocumentFromDocumentLinkName', () => { + const result = client.matchDocumentFromDocumentLinkName(fakePath); + assert.strictEqual(result, "documentValue"); + assert((client.pathTemplates.documentLinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDocumentLinkFromDocumentLinkName', () => { + const result = client.matchDocumentLinkFromDocumentLinkName(fakePath); + assert.strictEqual(result, "documentLinkValue"); + assert((client.pathTemplates.documentLinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('documentSchema', async () => { + const fakePath = "/rendered/path/documentSchema"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + document_schema: "documentSchemaValue", + }; + const client = new rulesetserviceModule.v1.RuleSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.documentSchemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.documentSchemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('documentSchemaPath', () => { + const result = client.documentSchemaPath("projectValue", "locationValue", "documentSchemaValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.documentSchemaPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDocumentSchemaName', () => { + const result = client.matchProjectFromDocumentSchemaName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.documentSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDocumentSchemaName', () => { + const result = client.matchLocationFromDocumentSchemaName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.documentSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDocumentSchemaFromDocumentSchemaName', () => { + const result = client.matchDocumentSchemaFromDocumentSchemaName(fakePath); + assert.strictEqual(result, "documentSchemaValue"); + assert((client.pathTemplates.documentSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationDocument', async () => { + const fakePath = "/rendered/path/projectLocationDocument"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + document: "documentValue", + }; + const client = new rulesetserviceModule.v1.RuleSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationDocumentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationDocumentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationDocumentPath', () => { + const result = client.projectLocationDocumentPath("projectValue", "locationValue", "documentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationDocumentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationDocumentName', () => { + const result = client.matchProjectFromProjectLocationDocumentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationDocumentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationDocumentName', () => { + const result = client.matchLocationFromProjectLocationDocumentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationDocumentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDocumentFromProjectLocationDocumentName', () => { + const result = client.matchDocumentFromProjectLocationDocumentName(fakePath); + assert.strictEqual(result, "documentValue"); + assert((client.pathTemplates.projectLocationDocumentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationDocumentsReferenceId', async () => { + const fakePath = "/rendered/path/projectLocationDocumentsReferenceId"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + reference_id: "referenceIdValue", + }; + const client = new rulesetserviceModule.v1.RuleSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationDocumentsReferenceIdPath', () => { + const result = client.projectLocationDocumentsReferenceIdPath("projectValue", "locationValue", "referenceIdValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationDocumentsReferenceIdName', () => { + const result = client.matchProjectFromProjectLocationDocumentsReferenceIdName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationDocumentsReferenceIdName', () => { + const result = client.matchLocationFromProjectLocationDocumentsReferenceIdName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchReferenceIdFromProjectLocationDocumentsReferenceIdName', () => { + const result = client.matchReferenceIdFromProjectLocationDocumentsReferenceIdName(fakePath); + assert.strictEqual(result, "referenceIdValue"); + assert((client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('ruleSet', async () => { + const fakePath = "/rendered/path/ruleSet"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + rule_set: "ruleSetValue", + }; + const client = new rulesetserviceModule.v1.RuleSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.ruleSetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.ruleSetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('ruleSetPath', () => { + const result = client.ruleSetPath("projectValue", "locationValue", "ruleSetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.ruleSetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromRuleSetName', () => { + const result = client.matchProjectFromRuleSetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.ruleSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromRuleSetName', () => { + const result = client.matchLocationFromRuleSetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.ruleSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRuleSetFromRuleSetName', () => { + const result = client.matchRuleSetFromRuleSetName(fakePath); + assert.strictEqual(result, "ruleSetValue"); + assert((client.pathTemplates.ruleSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('synonymSet', async () => { + const fakePath = "/rendered/path/synonymSet"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + context: "contextValue", + }; + const client = new rulesetserviceModule.v1.RuleSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.synonymSetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.synonymSetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('synonymSetPath', () => { + const result = client.synonymSetPath("projectValue", "locationValue", "contextValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.synonymSetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSynonymSetName', () => { + const result = client.matchProjectFromSynonymSetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.synonymSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSynonymSetName', () => { + const result = client.matchLocationFromSynonymSetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.synonymSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchContextFromSynonymSetName', () => { + const result = client.matchContextFromSynonymSetName(fakePath); + assert.strictEqual(result, "contextValue"); + assert((client.pathTemplates.synonymSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/test/gapic_synonym_set_service_v1.ts b/owl-bot-staging/google-cloud-contentwarehouse/test/gapic_synonym_set_service_v1.ts new file mode 100644 index 00000000000..13786d043fb --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/test/gapic_synonym_set_service_v1.ts @@ -0,0 +1,1225 @@ +// Copyright 2026 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 synonymsetserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +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('v1.SynonymSetServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new synonymsetserviceModule.v1.SynonymSetServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'contentwarehouse.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new synonymsetserviceModule.v1.SynonymSetServiceClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = synonymsetserviceModule.v1.SynonymSetServiceClient.servicePath; + assert.strictEqual(servicePath, 'contentwarehouse.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = synonymsetserviceModule.v1.SynonymSetServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'contentwarehouse.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'contentwarehouse.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'contentwarehouse.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new synonymsetserviceModule.v1.SynonymSetServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'contentwarehouse.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'contentwarehouse.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new synonymsetserviceModule.v1.SynonymSetServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = synonymsetserviceModule.v1.SynonymSetServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new synonymsetserviceModule.v1.SynonymSetServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.synonymSetServiceStub, undefined); + await client.initialize(); + assert(client.synonymSetServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.synonymSetServiceStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.synonymSetServiceStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ + 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 synonymsetserviceModule.v1.SynonymSetServiceClient({ + 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('createSynonymSet', () => { + it('invokes createSynonymSet without error', async () => { + const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.SynonymSet() + ); + client.innerApiCalls.createSynonymSet = stubSimpleCall(expectedResponse); + const [response] = await client.createSynonymSet(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createSynonymSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSynonymSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSynonymSet without error using callback', async () => { + const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.SynonymSet() + ); + client.innerApiCalls.createSynonymSet = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createSynonymSet( + request, + (err?: Error|null, result?: protos.google.cloud.contentwarehouse.v1.ISynonymSet|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createSynonymSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSynonymSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSynonymSet with error', async () => { + const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSynonymSet = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createSynonymSet(request), expectedError); + const actualRequest = (client.innerApiCalls.createSynonymSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSynonymSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSynonymSet with closed client', async () => { + const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createSynonymSet(request), expectedError); + }); + }); + + describe('getSynonymSet', () => { + it('invokes getSynonymSet without error', async () => { + const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.GetSynonymSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.GetSynonymSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.SynonymSet() + ); + client.innerApiCalls.getSynonymSet = stubSimpleCall(expectedResponse); + const [response] = await client.getSynonymSet(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getSynonymSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSynonymSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSynonymSet without error using callback', async () => { + const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.GetSynonymSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.GetSynonymSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.SynonymSet() + ); + client.innerApiCalls.getSynonymSet = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSynonymSet( + request, + (err?: Error|null, result?: protos.google.cloud.contentwarehouse.v1.ISynonymSet|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getSynonymSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSynonymSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSynonymSet with error', async () => { + const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.GetSynonymSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.GetSynonymSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSynonymSet = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getSynonymSet(request), expectedError); + const actualRequest = (client.innerApiCalls.getSynonymSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSynonymSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSynonymSet with closed client', async () => { + const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.GetSynonymSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.GetSynonymSetRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getSynonymSet(request), expectedError); + }); + }); + + describe('updateSynonymSet', () => { + it('invokes updateSynonymSet without error', async () => { + const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.SynonymSet() + ); + client.innerApiCalls.updateSynonymSet = stubSimpleCall(expectedResponse); + const [response] = await client.updateSynonymSet(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateSynonymSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateSynonymSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSynonymSet without error using callback', async () => { + const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.SynonymSet() + ); + client.innerApiCalls.updateSynonymSet = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateSynonymSet( + request, + (err?: Error|null, result?: protos.google.cloud.contentwarehouse.v1.ISynonymSet|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateSynonymSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateSynonymSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSynonymSet with error', async () => { + const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSynonymSet = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateSynonymSet(request), expectedError); + const actualRequest = (client.innerApiCalls.updateSynonymSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateSynonymSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSynonymSet with closed client', async () => { + const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateSynonymSet(request), expectedError); + }); + }); + + describe('deleteSynonymSet', () => { + it('invokes deleteSynonymSet without error', async () => { + const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteSynonymSet = stubSimpleCall(expectedResponse); + const [response] = await client.deleteSynonymSet(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteSynonymSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSynonymSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSynonymSet without error using callback', async () => { + const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteSynonymSet = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteSynonymSet( + 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); + const actualRequest = (client.innerApiCalls.deleteSynonymSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSynonymSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSynonymSet with error', async () => { + const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSynonymSet = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteSynonymSet(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteSynonymSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSynonymSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSynonymSet with closed client', async () => { + const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteSynonymSet(request), expectedError); + }); + }); + + describe('listSynonymSets', () => { + it('invokes listSynonymSets without error', async () => { + const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.SynonymSet()), + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.SynonymSet()), + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.SynonymSet()), + ]; + client.innerApiCalls.listSynonymSets = stubSimpleCall(expectedResponse); + const [response] = await client.listSynonymSets(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listSynonymSets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSynonymSets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSynonymSets without error using callback', async () => { + const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.SynonymSet()), + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.SynonymSet()), + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.SynonymSet()), + ]; + client.innerApiCalls.listSynonymSets = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSynonymSets( + request, + (err?: Error|null, result?: protos.google.cloud.contentwarehouse.v1.ISynonymSet[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listSynonymSets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSynonymSets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSynonymSets with error', async () => { + const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSynonymSets = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listSynonymSets(request), expectedError); + const actualRequest = (client.innerApiCalls.listSynonymSets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSynonymSets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSynonymSetsStream without error', async () => { + const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.SynonymSet()), + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.SynonymSet()), + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.SynonymSet()), + ]; + client.descriptors.page.listSynonymSets.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listSynonymSetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.contentwarehouse.v1.SynonymSet[] = []; + stream.on('data', (response: protos.google.cloud.contentwarehouse.v1.SynonymSet) => { + 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.listSynonymSets.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSynonymSets, request)); + assert( + (client.descriptors.page.listSynonymSets.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listSynonymSetsStream with error', async () => { + const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listSynonymSets.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listSynonymSetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.contentwarehouse.v1.SynonymSet[] = []; + stream.on('data', (response: protos.google.cloud.contentwarehouse.v1.SynonymSet) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listSynonymSets.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSynonymSets, request)); + assert( + (client.descriptors.page.listSynonymSets.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSynonymSets without error', async () => { + const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.SynonymSet()), + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.SynonymSet()), + generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.SynonymSet()), + ]; + client.descriptors.page.listSynonymSets.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.contentwarehouse.v1.ISynonymSet[] = []; + const iterable = client.listSynonymSetsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listSynonymSets.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listSynonymSets.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSynonymSets with error', async () => { + const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listSynonymSets.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listSynonymSetsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.contentwarehouse.v1.ISynonymSet[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listSynonymSets.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listSynonymSets.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + + describe('documentLink', async () => { + const fakePath = "/rendered/path/documentLink"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + document: "documentValue", + document_link: "documentLinkValue", + }; + const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.documentLinkPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.documentLinkPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('documentLinkPath', () => { + const result = client.documentLinkPath("projectValue", "locationValue", "documentValue", "documentLinkValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.documentLinkPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDocumentLinkName', () => { + const result = client.matchProjectFromDocumentLinkName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.documentLinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDocumentLinkName', () => { + const result = client.matchLocationFromDocumentLinkName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.documentLinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDocumentFromDocumentLinkName', () => { + const result = client.matchDocumentFromDocumentLinkName(fakePath); + assert.strictEqual(result, "documentValue"); + assert((client.pathTemplates.documentLinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDocumentLinkFromDocumentLinkName', () => { + const result = client.matchDocumentLinkFromDocumentLinkName(fakePath); + assert.strictEqual(result, "documentLinkValue"); + assert((client.pathTemplates.documentLinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('documentSchema', async () => { + const fakePath = "/rendered/path/documentSchema"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + document_schema: "documentSchemaValue", + }; + const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.documentSchemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.documentSchemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('documentSchemaPath', () => { + const result = client.documentSchemaPath("projectValue", "locationValue", "documentSchemaValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.documentSchemaPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDocumentSchemaName', () => { + const result = client.matchProjectFromDocumentSchemaName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.documentSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDocumentSchemaName', () => { + const result = client.matchLocationFromDocumentSchemaName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.documentSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDocumentSchemaFromDocumentSchemaName', () => { + const result = client.matchDocumentSchemaFromDocumentSchemaName(fakePath); + assert.strictEqual(result, "documentSchemaValue"); + assert((client.pathTemplates.documentSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationDocument', async () => { + const fakePath = "/rendered/path/projectLocationDocument"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + document: "documentValue", + }; + const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationDocumentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationDocumentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationDocumentPath', () => { + const result = client.projectLocationDocumentPath("projectValue", "locationValue", "documentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationDocumentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationDocumentName', () => { + const result = client.matchProjectFromProjectLocationDocumentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationDocumentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationDocumentName', () => { + const result = client.matchLocationFromProjectLocationDocumentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationDocumentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDocumentFromProjectLocationDocumentName', () => { + const result = client.matchDocumentFromProjectLocationDocumentName(fakePath); + assert.strictEqual(result, "documentValue"); + assert((client.pathTemplates.projectLocationDocumentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationDocumentsReferenceId', async () => { + const fakePath = "/rendered/path/projectLocationDocumentsReferenceId"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + reference_id: "referenceIdValue", + }; + const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationDocumentsReferenceIdPath', () => { + const result = client.projectLocationDocumentsReferenceIdPath("projectValue", "locationValue", "referenceIdValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationDocumentsReferenceIdName', () => { + const result = client.matchProjectFromProjectLocationDocumentsReferenceIdName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationDocumentsReferenceIdName', () => { + const result = client.matchLocationFromProjectLocationDocumentsReferenceIdName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchReferenceIdFromProjectLocationDocumentsReferenceIdName', () => { + const result = client.matchReferenceIdFromProjectLocationDocumentsReferenceIdName(fakePath); + assert.strictEqual(result, "referenceIdValue"); + assert((client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('ruleSet', async () => { + const fakePath = "/rendered/path/ruleSet"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + rule_set: "ruleSetValue", + }; + const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.ruleSetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.ruleSetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('ruleSetPath', () => { + const result = client.ruleSetPath("projectValue", "locationValue", "ruleSetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.ruleSetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromRuleSetName', () => { + const result = client.matchProjectFromRuleSetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.ruleSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromRuleSetName', () => { + const result = client.matchLocationFromRuleSetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.ruleSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRuleSetFromRuleSetName', () => { + const result = client.matchRuleSetFromRuleSetName(fakePath); + assert.strictEqual(result, "ruleSetValue"); + assert((client.pathTemplates.ruleSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('synonymSet', async () => { + const fakePath = "/rendered/path/synonymSet"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + context: "contextValue", + }; + const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.synonymSetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.synonymSetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('synonymSetPath', () => { + const result = client.synonymSetPath("projectValue", "locationValue", "contextValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.synonymSetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSynonymSetName', () => { + const result = client.matchProjectFromSynonymSetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.synonymSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSynonymSetName', () => { + const result = client.matchLocationFromSynonymSetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.synonymSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchContextFromSynonymSetName', () => { + const result = client.matchContextFromSynonymSetName(fakePath); + assert.strictEqual(result, "contextValue"); + assert((client.pathTemplates.synonymSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/tsconfig.json b/owl-bot-staging/google-cloud-contentwarehouse/tsconfig.json new file mode 100644 index 00000000000..ca73e7bfc82 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/tsconfig.json @@ -0,0 +1,22 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2023", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts", + "src/**/*.json", + "samples/**/*.json", + "protos/protos.json" + ] +} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/webpack.config.js b/owl-bot-staging/google-cloud-contentwarehouse/webpack.config.js new file mode 100644 index 00000000000..aa25d4769e1 --- /dev/null +++ b/owl-bot-staging/google-cloud-contentwarehouse/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: 'DocumentLinkService', + filename: './document-link-service.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/ + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader' + }, + ], + }, + mode: 'production', +}; From de1157cc33f7ac0ab8a45e207cdefc6ca651b567 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Mon, 2 Mar 2026 22:32:51 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- .../.OwlBot.yaml | 19 - .../.eslintignore | 7 - .../.eslintrc.json | 3 - .../.gitattributes | 4 - .../google-cloud-contentwarehouse/.gitignore | 14 - .../google-cloud-contentwarehouse/.jsdoc.js | 55 - .../google-cloud-contentwarehouse/.mocharc.js | 33 - .../google-cloud-contentwarehouse/.nycrc | 24 - .../.prettierignore | 6 - .../.prettierrc.js | 22 - .../CODE_OF_CONDUCT.md | 94 - .../CONTRIBUTING.md | 76 - .../google-cloud-contentwarehouse/LICENSE | 202 - .../google-cloud-contentwarehouse/README.md | 142 - .../v1/async_document_service_request.proto | 34 - .../cloud/contentwarehouse/v1/common.proto | 165 - .../cloud/contentwarehouse/v1/document.proto | 356 - .../v1/document_link_service.proto | 237 - .../contentwarehouse/v1/document_schema.proto | 202 - .../v1/document_schema_service.proto | 181 - .../v1/document_service.proto | 279 - .../v1/document_service_request.proto | 355 - .../cloud/contentwarehouse/v1/filters.proto | 290 - .../cloud/contentwarehouse/v1/histogram.proto | 109 - .../v1/pipeline_service.proto | 87 - .../cloud/contentwarehouse/v1/pipelines.proto | 291 - .../contentwarehouse/v1/rule_engine.proto | 289 - .../contentwarehouse/v1/ruleset_service.proto | 81 - .../v1/ruleset_service_request.proto | 121 - .../contentwarehouse/v1/synonymset.proto | 61 - .../v1/synonymset_service.proto | 89 - .../v1/synonymset_service_request.proto | 125 - .../google/cloud/documentai/v1/barcode.proto | 69 - .../google/cloud/documentai/v1/document.proto | 1204 - .../cloud/documentai/v1/document_io.proto | 175 - .../v1/document_processor_service.proto | 1267 - .../cloud/documentai/v1/document_schema.proto | 168 - .../cloud/documentai/v1/evaluation.proto | 182 - .../google/cloud/documentai/v1/geometry.proto | 55 - .../documentai/v1/operation_metadata.proto | 66 - .../cloud/documentai/v1/processor.proto | 297 - .../cloud/documentai/v1/processor_type.proto | 67 - .../protos/protos.d.ts | 30589 ------ .../protos/protos.js | 78298 ---------------- .../protos/protos.json | 7060 -- ...ument_link_service.create_document_link.js | 75 - ...ument_link_service.delete_document_link.js | 68 - ...cument_link_service.list_linked_sources.js | 84 - ...cument_link_service.list_linked_targets.js | 68 - ...t_schema_service.create_document_schema.js | 66 - ...t_schema_service.delete_document_schema.js | 61 - ...ment_schema_service.get_document_schema.js | 61 - ...nt_schema_service.list_document_schemas.js | 78 - ...t_schema_service.update_document_schema.js | 68 - .../v1/document_service.create_document.js | 94 - .../v1/document_service.delete_document.js | 70 - .../v1/document_service.fetch_acl.js | 76 - .../v1/document_service.get_document.js | 69 - .../v1/document_service.lock_document.js | 71 - .../v1/document_service.search_documents.js | 164 - .../generated/v1/document_service.set_acl.js | 95 - .../v1/document_service.update_document.js | 86 - .../v1/pipeline_service.run_pipeline.js | 86 - .../v1/rule_set_service.create_rule_set.js | 67 - .../v1/rule_set_service.delete_rule_set.js | 63 - .../v1/rule_set_service.get_rule_set.js | 63 - .../v1/rule_set_service.list_rule_sets.js | 78 - .../v1/rule_set_service.update_rule_set.js | 68 - ...data_google.cloud.contentwarehouse.v1.json | 1343 - .../synonym_set_service.create_synonym_set.js | 67 - .../synonym_set_service.delete_synonym_set.js | 63 - .../v1/synonym_set_service.get_synonym_set.js | 63 - .../synonym_set_service.list_synonym_sets.js | 78 - .../synonym_set_service.update_synonym_set.js | 68 - .../src/index.ts | 37 - .../src/v1/document_link_service_client.ts | 1214 - .../document_link_service_client_config.json | 46 - .../v1/document_link_service_proto_list.json | 23 - .../src/v1/document_schema_service_client.ts | 1327 - ...document_schema_service_client_config.json | 63 - .../document_schema_service_proto_list.json | 23 - .../src/v1/document_service_client.ts | 1907 - .../v1/document_service_client_config.json | 77 - .../src/v1/document_service_proto_list.json | 23 - .../src/v1/gapic_metadata.json | 393 - .../src/v1/index.ts | 24 - .../src/v1/pipeline_service_client.ts | 1085 - .../v1/pipeline_service_client_config.json | 31 - .../src/v1/pipeline_service_proto_list.json | 23 - .../src/v1/rule_set_service_client.ts | 1285 - .../v1/rule_set_service_client_config.json | 63 - .../src/v1/rule_set_service_proto_list.json | 23 - .../src/v1/synonym_set_service_client.ts | 1291 - .../v1/synonym_set_service_client_config.json | 63 - .../v1/synonym_set_service_proto_list.json | 23 - .../system-test/fixtures/sample/src/index.js | 32 - .../system-test/fixtures/sample/src/index.ts | 62 - .../system-test/install.ts | 49 - .../test/gapic_document_link_service_v1.ts | 1117 - .../test/gapic_document_schema_service_v1.ts | 1263 - .../test/gapic_document_service_v1.ts | 1549 - .../test/gapic_pipeline_service_v1.ts | 980 - .../test/gapic_rule_set_service_v1.ts | 1225 - .../test/gapic_synonym_set_service_v1.ts | 1225 - .../tsconfig.json | 22 - .../webpack.config.js | 64 - .../v1/document_processor_service.proto | 8 +- 107 files changed, 7 insertions(+), 143644 deletions(-) delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/.OwlBot.yaml delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/.eslintignore delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/.eslintrc.json delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/.gitattributes delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/.gitignore delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/.jsdoc.js delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/.mocharc.js delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/.nycrc delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/.prettierignore delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/.prettierrc.js delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/CODE_OF_CONDUCT.md delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/CONTRIBUTING.md delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/LICENSE delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/README.md delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/async_document_service_request.proto delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/common.proto delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/document.proto delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/document_link_service.proto delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/document_schema.proto delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/document_schema_service.proto delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/document_service.proto delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/document_service_request.proto delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/filters.proto delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/histogram.proto delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/pipeline_service.proto delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/pipelines.proto delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/rule_engine.proto delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/ruleset_service.proto delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/ruleset_service_request.proto delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/synonymset.proto delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/synonymset_service.proto delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/synonymset_service_request.proto delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/barcode.proto delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/document.proto delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/document_io.proto delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/document_processor_service.proto delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/document_schema.proto delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/evaluation.proto delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/geometry.proto delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/operation_metadata.proto delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/processor.proto delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/processor_type.proto delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/protos.d.ts delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/protos.js delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/protos/protos.json delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_link_service.create_document_link.js delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_link_service.delete_document_link.js delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_link_service.list_linked_sources.js delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_link_service.list_linked_targets.js delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_schema_service.create_document_schema.js delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_schema_service.delete_document_schema.js delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_schema_service.get_document_schema.js delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_schema_service.list_document_schemas.js delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_schema_service.update_document_schema.js delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.create_document.js delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.delete_document.js delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.fetch_acl.js delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.get_document.js delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.lock_document.js delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.search_documents.js delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.set_acl.js delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.update_document.js delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/pipeline_service.run_pipeline.js delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/rule_set_service.create_rule_set.js delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/rule_set_service.delete_rule_set.js delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/rule_set_service.get_rule_set.js delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/rule_set_service.list_rule_sets.js delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/rule_set_service.update_rule_set.js delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/snippet_metadata_google.cloud.contentwarehouse.v1.json delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/synonym_set_service.create_synonym_set.js delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/synonym_set_service.delete_synonym_set.js delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/synonym_set_service.get_synonym_set.js delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/synonym_set_service.list_synonym_sets.js delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/synonym_set_service.update_synonym_set.js delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_link_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_link_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_link_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_schema_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_schema_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_schema_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/src/v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/src/v1/index.ts delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/src/v1/pipeline_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/src/v1/pipeline_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/src/v1/pipeline_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/src/v1/rule_set_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/src/v1/rule_set_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/src/v1/rule_set_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/src/v1/synonym_set_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/src/v1/synonym_set_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/src/v1/synonym_set_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/system-test/fixtures/sample/src/index.js delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/system-test/fixtures/sample/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/system-test/install.ts delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/test/gapic_document_link_service_v1.ts delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/test/gapic_document_schema_service_v1.ts delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/test/gapic_document_service_v1.ts delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/test/gapic_pipeline_service_v1.ts delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/test/gapic_rule_set_service_v1.ts delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/test/gapic_synonym_set_service_v1.ts delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/tsconfig.json delete mode 100644 owl-bot-staging/google-cloud-contentwarehouse/webpack.config.js diff --git a/owl-bot-staging/google-cloud-contentwarehouse/.OwlBot.yaml b/owl-bot-staging/google-cloud-contentwarehouse/.OwlBot.yaml deleted file mode 100644 index 1db6d4e09d3..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/.OwlBot.yaml +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright 2025 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. - -deep-copy-regex: - - source: /google/cloud/contentwarehouse/google-cloud-contentwarehouse-nodejs - dest: /owl-bot-staging/google-cloud-contentwarehouse - -api-name: contentwarehouse \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-contentwarehouse/.eslintignore b/owl-bot-staging/google-cloud-contentwarehouse/.eslintignore deleted file mode 100644 index cfc348ec4d1..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -**/node_modules -**/.coverage -build/ -docs/ -protos/ -system-test/ -samples/generated/ diff --git a/owl-bot-staging/google-cloud-contentwarehouse/.eslintrc.json b/owl-bot-staging/google-cloud-contentwarehouse/.eslintrc.json deleted file mode 100644 index 78215349546..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/.gitattributes b/owl-bot-staging/google-cloud-contentwarehouse/.gitattributes deleted file mode 100644 index 33739cb74e4..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/.gitattributes +++ /dev/null @@ -1,4 +0,0 @@ -*.ts text eol=lf -*.js text eol=lf -protos/* linguist-generated -**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/owl-bot-staging/google-cloud-contentwarehouse/.gitignore b/owl-bot-staging/google-cloud-contentwarehouse/.gitignore deleted file mode 100644 index d4f03a0df2e..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -**/*.log -**/node_modules -/.coverage -/coverage -/.nyc_output -/docs/ -/out/ -/build/ -system-test/secrets.js -system-test/*key.json -*.lock -.DS_Store -package-lock.json -__pycache__ diff --git a/owl-bot-staging/google-cloud-contentwarehouse/.jsdoc.js b/owl-bot-staging/google-cloud-contentwarehouse/.jsdoc.js deleted file mode 100644 index 2a4b52efad3..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2026 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 2026 Google LLC', - includeDate: false, - sourceFiles: false, - systemName: '@google-cloud/contentwarehouse', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/owl-bot-staging/google-cloud-contentwarehouse/.mocharc.js b/owl-bot-staging/google-cloud-contentwarehouse/.mocharc.js deleted file mode 100644 index 5eb34e86c87..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/.mocharc.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -const config = { - "enable-source-maps": true, - "throw-deprecation": true, - "timeout": 10000 -} -if (process.env.MOCHA_THROW_DEPRECATION === 'false') { - delete config['throw-deprecation']; -} -if (process.env.MOCHA_REPORTER) { - config.reporter = process.env.MOCHA_REPORTER; -} -if (process.env.MOCHA_REPORTER_OUTPUT) { - config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; -} -module.exports = config diff --git a/owl-bot-staging/google-cloud-contentwarehouse/.nycrc b/owl-bot-staging/google-cloud-contentwarehouse/.nycrc deleted file mode 100644 index 81a95fc94b0..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/.nycrc +++ /dev/null @@ -1,24 +0,0 @@ -{ - "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 -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-contentwarehouse/.prettierignore b/owl-bot-staging/google-cloud-contentwarehouse/.prettierignore deleted file mode 100644 index 9340ad9b86d..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/.prettierignore +++ /dev/null @@ -1,6 +0,0 @@ -**/node_modules -**/coverage -test/fixtures -build/ -docs/ -protos/ diff --git a/owl-bot-staging/google-cloud-contentwarehouse/.prettierrc.js b/owl-bot-staging/google-cloud-contentwarehouse/.prettierrc.js deleted file mode 100644 index 7649ee3c254..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -module.exports = { - ...require('gts/.prettierrc.json') -} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/CODE_OF_CONDUCT.md b/owl-bot-staging/google-cloud-contentwarehouse/CODE_OF_CONDUCT.md deleted file mode 100644 index 2add2547a81..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,94 +0,0 @@ - -# 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/owl-bot-staging/google-cloud-contentwarehouse/CONTRIBUTING.md b/owl-bot-staging/google-cloud-contentwarehouse/CONTRIBUTING.md deleted file mode 100644 index f721a03aa09..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/CONTRIBUTING.md +++ /dev/null @@ -1,76 +0,0 @@ -# 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 Contentwarehouse 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=contentwarehouse.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-contentwarehouse/LICENSE b/owl-bot-staging/google-cloud-contentwarehouse/LICENSE deleted file mode 100644 index d6456956733..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - 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/owl-bot-staging/google-cloud-contentwarehouse/README.md b/owl-bot-staging/google-cloud-contentwarehouse/README.md deleted file mode 100644 index a3e8c00728c..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/README.md +++ /dev/null @@ -1,142 +0,0 @@ -[//]: # "This README.md file is auto-generated, all changes to this file will be lost." -[//]: # "The comments you see below are used to generate those parts of the template in later states." -Google Cloud Platform logo - -# [Document AI Warehouse API: Nodejs Client][homepage] - -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 - -[![npm version](https://img.shields.io/npm/v/@google-cloud/contentwarehouse.svg)](https://www.npmjs.org/package/@google-cloud/contentwarehouse) - -Document AI Warehouse API client for Node.js - -[//]: # "partials.introduction" - -A comprehensive list of changes in each version may be found in -[the CHANGELOG][homepage_changelog]. - -* [Document AI Warehouse API Nodejs Client API Reference](https://cloud.google.com/nodejs/docs/reference/contentwarehouse/latest) - - -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) - -* [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 Document AI Warehouse API API][enable_api]. -1. [Set up authentication][auth] so you can access the - API from your local workstation. -### Installing the client library - -```bash -npm install @google-cloud/contentwarehouse -``` - -[//]: # "partials.body" - -## Samples - -Samples are in the [`samples/`][homepage_samples] directory. Each sample's `README.md` has instructions for running its sample. - -| Sample | Source Code | -| --------------------------- | --------------------------------- | -| create document link | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/document_link_service.create_document_link.js) | -| delete document link | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/document_link_service.delete_document_link.js) | -| list linked sources | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/document_link_service.list_linked_sources.js) | -| list linked targets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/document_link_service.list_linked_targets.js) | -| create document schema | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/document_schema_service.create_document_schema.js) | -| delete document schema | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/document_schema_service.delete_document_schema.js) | -| get document schema | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/document_schema_service.get_document_schema.js) | -| list document schemas | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/document_schema_service.list_document_schemas.js) | -| update document schema | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/document_schema_service.update_document_schema.js) | -| create document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/document_service.create_document.js) | -| delete document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/document_service.delete_document.js) | -| fetch acl | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/document_service.fetch_acl.js) | -| get document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/document_service.get_document.js) | -| lock document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/document_service.lock_document.js) | -| search documents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/document_service.search_documents.js) | -| set acl | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/document_service.set_acl.js) | -| update document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/document_service.update_document.js) | -| run pipeline | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/pipeline_service.run_pipeline.js) | -| create rule set | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/rule_set_service.create_rule_set.js) | -| delete rule set | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/rule_set_service.delete_rule_set.js) | -| get rule set | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/rule_set_service.get_rule_set.js) | -| list rule sets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/rule_set_service.list_rule_sets.js) | -| update rule set | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/rule_set_service.update_rule_set.js) | -| cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/snippet_metadata_google.cloud.contentwarehouse.v1.json) | -| create synonym set | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/synonym_set_service.create_synonym_set.js) | -| delete synonym set | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/synonym_set_service.delete_synonym_set.js) | -| get synonym set | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/synonym_set_service.get_synonym_set.js) | -| list synonym sets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/synonym_set_service.list_synonym_sets.js) | -| update synonym set | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples/generated/v1/synonym_set_service.update_synonym_set.js) | - - -## Supported Node.js Versions - -Our client libraries follow the [Node.js release schedule](https://github.com/nodejs/release#release-schedule). -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, `npm install @google-cloud/contentwarehouse@legacy-8` installs client libraries -for versions compatible with Node.js 8. - -## Versioning - -This library follows [Semantic Versioning](http://semver.org/). - -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/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/CONTRIBUTING.md). - -Please note that this `README.md` -and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) -are generated from a central template. - -## License - -Apache Version 2.0 - -See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/LICENSE) - -[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=contentwarehouse.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local -[homepage_samples]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/samples -[homepage_changelog]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse/CHANGELOG.md -[homepage]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contentwarehouse diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/async_document_service_request.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/async_document_service_request.proto deleted file mode 100644 index ef97e474a66..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/async_document_service_request.proto +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2025 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.cloud.contentwarehouse.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; - -option csharp_namespace = "Google.Cloud.ContentWarehouse.V1"; -option go_package = "cloud.google.com/go/contentwarehouse/apiv1/contentwarehousepb;contentwarehousepb"; -option java_multiple_files = true; -option java_outer_classname = "AsyncDocumentServiceRequestProto"; -option java_package = "com.google.cloud.contentwarehouse.v1"; -option php_namespace = "Google\\Cloud\\ContentWarehouse\\V1"; -option ruby_package = "Google::Cloud::ContentWarehouse::V1"; - -// Metadata object for CreateDocument request (currently empty). -message CreateDocumentMetadata {} - -// Metadata object for UpdateDocument request (currently empty). -message UpdateDocumentMetadata {} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/common.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/common.proto deleted file mode 100644 index e6942c28914..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/common.proto +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright 2025 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.cloud.contentwarehouse.v1; - -import "google/api/resource.proto"; -import "google/protobuf/field_mask.proto"; - -option csharp_namespace = "Google.Cloud.ContentWarehouse.V1"; -option go_package = "cloud.google.com/go/contentwarehouse/apiv1/contentwarehousepb;contentwarehousepb"; -option java_multiple_files = true; -option java_outer_classname = "CommonProto"; -option java_package = "com.google.cloud.contentwarehouse.v1"; -option php_namespace = "Google\\Cloud\\ContentWarehouse\\V1"; -option ruby_package = "Google::Cloud::ContentWarehouse::V1"; -option (google.api.resource_definition) = { - type: "contentwarehouse.googleapis.com/Location" - pattern: "projects/{project}/locations/{location}" -}; - -// Meta information is used to improve the performance of the service. -message RequestMetadata { - // Provides user unique identification and groups information. - UserInfo user_info = 1; -} - -// Additional information returned to client, such as debugging information. -message ResponseMetadata { - // A unique id associated with this call. This id is logged for tracking - // purpose. - string request_id = 1; -} - -// The user information. -message UserInfo { - // A unique user identification string, as determined by the client. - // The maximum number of allowed characters is 255. - // Allowed characters include numbers 0 to 9, uppercase and lowercase letters, - // and restricted special symbols (:, @, +, -, _, ~) - // The format is "user:xxxx@example.com"; - string id = 1; - - // The unique group identifications which the user is belong to. - // The format is "group:yyyy@example.com"; - repeated string group_ids = 2; -} - -// Options for Update operations. -message UpdateOptions { - // Type for update. - UpdateType update_type = 1; - - // Field mask for merging Document fields. - // For the `FieldMask` definition, - // see - // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - google.protobuf.FieldMask update_mask = 2; - - // Options for merging. - MergeFieldsOptions merge_fields_options = 3; -} - -// Options for merging updated fields. -message MergeFieldsOptions { - // When merging message fields, the default behavior is to merge - // the content of two message fields together. If you instead want to use - // the field from the source message to replace the corresponding field in - // the destination message, set this flag to true. When this flag is set, - // specified submessage fields that are missing in source will be cleared in - // destination. - optional bool replace_message_fields = 1; - - // When merging repeated fields, the default behavior is to append - // entries from the source repeated field to the destination repeated field. - // If you instead want to keep only the entries from the source repeated - // field, set this flag to true. - // - // If you want to replace a repeated field within a message field on the - // destination message, you must set both replace_repeated_fields and - // replace_message_fields to true, otherwise the repeated fields will be - // appended. - optional bool replace_repeated_fields = 2; -} - -// Update type of the requests. -enum UpdateType { - // Defaults to full replace behavior, ie. FULL_REPLACE. - UPDATE_TYPE_UNSPECIFIED = 0; - - // Fully replace all the fields (including previously linked raw document). - // Any field masks will be ignored. - UPDATE_TYPE_REPLACE = 1; - - // Merge the fields into the existing entities. - UPDATE_TYPE_MERGE = 2; - - // Inserts the properties by names. - UPDATE_TYPE_INSERT_PROPERTIES_BY_NAMES = 3; - - // Replace the properties by names. - UPDATE_TYPE_REPLACE_PROPERTIES_BY_NAMES = 4; - - // Delete the properties by names. - UPDATE_TYPE_DELETE_PROPERTIES_BY_NAMES = 5; - - // For each of the property, replaces the property if the it exists, otherwise - // inserts a new property. And for the rest of the fields, merge them based on - // update mask and merge fields options. - UPDATE_TYPE_MERGE_AND_REPLACE_OR_INSERT_PROPERTIES_BY_NAMES = 6; -} - -// Type of database used by the customer -enum DatabaseType { - // This value is required by protobuf best practices - DB_UNKNOWN = 0; - - // Internal Spanner - DB_INFRA_SPANNER = 1; - - // Cloud Sql with a Postgres Sql instance - DB_CLOUD_SQL_POSTGRES = 2 [deprecated = true]; -} - -// Access Control Mode. -enum AccessControlMode { - // This value is required by protobuf best practices - ACL_MODE_UNKNOWN = 0; - - // Universal Access: No document level access control. - ACL_MODE_UNIVERSAL_ACCESS = 1; - - // Document level access control with customer own Identity Service. - ACL_MODE_DOCUMENT_LEVEL_ACCESS_CONTROL_BYOID = 2; - - // Document level access control using Google Cloud Identity. - ACL_MODE_DOCUMENT_LEVEL_ACCESS_CONTROL_GCI = 3; -} - -// The default role of the document creator. -enum DocumentCreatorDefaultRole { - // Unspecified, will be default to document admin role. - DOCUMENT_CREATOR_DEFAULT_ROLE_UNSPECIFIED = 0; - - // Document Admin, same as contentwarehouse.googleapis.com/documentAdmin. - DOCUMENT_ADMIN = 1; - - // Document Editor, same as contentwarehouse.googleapis.com/documentEditor. - DOCUMENT_EDITOR = 2; - - // Document Viewer, same as contentwarehouse.googleapis.com/documentViewer. - DOCUMENT_VIEWER = 3; -} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/document.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/document.proto deleted file mode 100644 index baaad074dfc..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/document.proto +++ /dev/null @@ -1,356 +0,0 @@ -// Copyright 2025 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.cloud.contentwarehouse.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/documentai/v1/document.proto"; -import "google/protobuf/timestamp.proto"; -import "google/type/datetime.proto"; - -option csharp_namespace = "Google.Cloud.ContentWarehouse.V1"; -option go_package = "cloud.google.com/go/contentwarehouse/apiv1/contentwarehousepb;contentwarehousepb"; -option java_multiple_files = true; -option java_outer_classname = "DocumentProto"; -option java_package = "com.google.cloud.contentwarehouse.v1"; -option php_namespace = "Google\\Cloud\\ContentWarehouse\\V1"; -option ruby_package = "Google::Cloud::ContentWarehouse::V1"; - -// Defines the structure for content warehouse document proto. -message Document { - option (google.api.resource) = { - type: "contentwarehouse.googleapis.com/Document" - pattern: "projects/{project}/locations/{location}/documents/{document}" - pattern: "projects/{project}/locations/{location}/documents/referenceId/{reference_id}" - }; - - // The resource name of the document. - // Format: - // projects/{project_number}/locations/{location}/documents/{document_id}. - // - // The name is ignored when creating a document. - string name = 1; - - // The reference ID set by customers. Must be unique per project and location. - string reference_id = 11; - - // Required. Display name of the document given by the user. This name will be - // displayed in the UI. Customer can populate this field with the name of the - // document. This differs from the 'title' field as 'title' is optional and - // stores the top heading in the document. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // Title that describes the document. - // This can be the top heading or text that describes the document. - string title = 18; - - // Uri to display the document, for example, in the UI. - string display_uri = 17; - - // The Document schema name. - // Format: - // projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}. - string document_schema_name = 3 [(google.api.resource_reference) = { - type: "contentwarehouse.googleapis.com/DocumentSchema" - }]; - - oneof structured_content { - // Other document format, such as PPTX, XLXS - string plain_text = 15; - - // Document AI format to save the structured content, including OCR. - google.cloud.documentai.v1.Document cloud_ai_document = 4; - } - - // A path linked to structured content file. - string structured_content_uri = 16 [deprecated = true]; - - // Raw document file. - oneof raw_document { - // Raw document file in Cloud Storage path. - string raw_document_path = 5; - - // Raw document content. - bytes inline_raw_document = 6; - } - - // List of values that are user supplied metadata. - repeated Property properties = 7; - - // Output only. The time when the document is last updated. - google.protobuf.Timestamp update_time = 8 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time when the document is created. - google.protobuf.Timestamp create_time = 9 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // This is used when DocAI was not used to load the document and parsing/ - // extracting is needed for the inline_raw_document. For example, if - // inline_raw_document is the byte representation of a PDF file, then - // this should be set to: RAW_DOCUMENT_FILE_TYPE_PDF. - RawDocumentFileType raw_document_file_type = 10; - - // If true, makes the document visible to asynchronous policies and rules. - bool async_enabled = 12 [deprecated = true]; - - // Indicates the category (image, audio, video etc.) of the original content. - ContentCategory content_category = 20; - - // If true, text extraction will not be performed. - bool text_extraction_disabled = 19 [deprecated = true]; - - // If true, text extraction will be performed. - bool text_extraction_enabled = 21; - - // The user who creates the document. - string creator = 13; - - // The user who lastly updates the document. - string updater = 14; - - // Output only. If linked to a Collection with RetentionPolicy, the date when - // the document becomes mutable. - google.protobuf.Timestamp disposition_time = 22 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Indicates if the document has a legal hold on it. - bool legal_hold = 23 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// References to the documents. -message DocumentReference { - // Required. Name of the referenced document. - string document_name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "contentwarehouse.googleapis.com/Document" - } - ]; - - // display_name of the referenced document; this name does not need to be - // consistent to the display_name in the Document proto, depending on the ACL - // constraint. - string display_name = 2; - - // Stores the subset of the referenced document's content. - // This is useful to allow user peek the information of the referenced - // document. - string snippet = 3; - - // The document type of the document being referenced. - bool document_is_folder = 4; - - // Output only. The time when the document is last updated. - google.protobuf.Timestamp update_time = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time when the document is created. - google.protobuf.Timestamp create_time = 6 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time when the document is deleted. - google.protobuf.Timestamp delete_time = 7 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Document is a folder with retention policy. - bool document_is_retention_folder = 8; - - // Document is a folder with legal hold. - bool document_is_legal_hold_folder = 9; -} - -// Property of a document. -message Property { - // Required. Must match the name of a PropertyDefinition in the - // DocumentSchema. - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Type of the property. - // Must match the property_options type of the matching PropertyDefinition. - // Value of the Property parsed into a specific data type. - // Specific type value(s) obtained from Document AIs Property.mention_text - // field. - oneof values { - // Integer property values. - IntegerArray integer_values = 2; - - // Float property values. - FloatArray float_values = 3; - - // String/text property values. - TextArray text_values = 4; - - // Enum property values. - EnumArray enum_values = 5; - - // Nested structured data property values. - PropertyArray property_values = 6; - - // Date time property values. - // It is not supported by CMEK compliant deployment. - DateTimeArray date_time_values = 7; - - // Map property values. - MapProperty map_property = 8; - - // Timestamp property values. - // It is not supported by CMEK compliant deployment. - TimestampArray timestamp_values = 9; - } -} - -// Integer values. -message IntegerArray { - // List of integer values. - repeated int32 values = 1; -} - -// Float values. -message FloatArray { - // List of float values. - repeated float values = 1; -} - -// String/text values. -message TextArray { - // List of text values. - repeated string values = 1; -} - -// Enum values. -message EnumArray { - // List of enum values. - repeated string values = 1; -} - -// DateTime values. -message DateTimeArray { - // List of datetime values. - // Both OffsetDateTime and ZonedDateTime are supported. - repeated google.type.DateTime values = 1; -} - -// Timestamp values. -message TimestampArray { - // List of timestamp values. - repeated TimestampValue values = 1; -} - -// Timestamp value type. -message TimestampValue { - oneof value { - // Timestamp value - google.protobuf.Timestamp timestamp_value = 1; - - // The string must represent a valid instant in UTC and is parsed using - // java.time.format.DateTimeFormatter.ISO_INSTANT. - // e.g. "2013-09-29T18:46:19Z" - string text_value = 2; - } -} - -// Property values. -message PropertyArray { - // List of property values. - repeated Property properties = 1; -} - -// Map property value. -// Represents a structured entries of key value pairs, consisting of field names -// which map to dynamically typed values. -message MapProperty { - // Unordered map of dynamically typed values. - map fields = 1; -} - -// `Value` represents a dynamically typed value which can be either be -// a float, a integer, a string, or a datetime value. A producer of value is -// expected to set one of these variants. Absence of any variant indicates an -// error. -message Value { - // The kind of value. - oneof kind { - // Represents a float value. - float float_value = 1; - - // Represents a integer value. - int32 int_value = 2; - - // Represents a string value. - string string_value = 3; - - // Represents an enum value. - EnumValue enum_value = 4; - - // Represents a datetime value. - google.type.DateTime datetime_value = 5; - - // Represents a timestamp value. - TimestampValue timestamp_value = 6; - - // Represents a boolean value. - bool boolean_value = 7; - } -} - -// Represents the string value of the enum field. -message EnumValue { - // String value of the enum field. This must match defined set of enums - // in document schema using EnumTypeOptions. - string value = 1; -} - -// When a raw document is supplied, this indicates the file format -enum RawDocumentFileType { - // No raw document specified or it is non-parsable - RAW_DOCUMENT_FILE_TYPE_UNSPECIFIED = 0; - - // Adobe PDF format - RAW_DOCUMENT_FILE_TYPE_PDF = 1; - - // Microsoft Word format - RAW_DOCUMENT_FILE_TYPE_DOCX = 2; - - // Microsoft Excel format - RAW_DOCUMENT_FILE_TYPE_XLSX = 3; - - // Microsoft Powerpoint format - RAW_DOCUMENT_FILE_TYPE_PPTX = 4; - - // UTF-8 encoded text format - RAW_DOCUMENT_FILE_TYPE_TEXT = 5; - - // TIFF or TIF image file format - RAW_DOCUMENT_FILE_TYPE_TIFF = 6; -} - -// When a raw document or structured content is supplied, this stores the -// content category. -enum ContentCategory { - // No category is specified. - CONTENT_CATEGORY_UNSPECIFIED = 0; - - // Content is of image type. - CONTENT_CATEGORY_IMAGE = 1; - - // Content is of audio type. - CONTENT_CATEGORY_AUDIO = 2; - - // Content is of video type. - CONTENT_CATEGORY_VIDEO = 3; -} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/document_link_service.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/document_link_service.proto deleted file mode 100644 index 16af6fc1f4c..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/document_link_service.proto +++ /dev/null @@ -1,237 +0,0 @@ -// Copyright 2025 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.cloud.contentwarehouse.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/contentwarehouse/v1/common.proto"; -import "google/cloud/contentwarehouse/v1/document.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.ContentWarehouse.V1"; -option go_package = "cloud.google.com/go/contentwarehouse/apiv1/contentwarehousepb;contentwarehousepb"; -option java_multiple_files = true; -option java_outer_classname = "DocumentLinkServiceProto"; -option java_package = "com.google.cloud.contentwarehouse.v1"; -option php_namespace = "Google\\Cloud\\ContentWarehouse\\V1"; -option ruby_package = "Google::Cloud::ContentWarehouse::V1"; - -// This service lets you manage document-links. -// Document-Links are treated as sub-resources under source documents. -service DocumentLinkService { - option (google.api.default_host) = "contentwarehouse.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Return all target document-links from the document. - rpc ListLinkedTargets(ListLinkedTargetsRequest) - returns (ListLinkedTargetsResponse) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*/documents/*}/linkedTargets" - body: "*" - }; - option (google.api.method_signature) = "parent"; - } - - // Return all source document-links from the document. - rpc ListLinkedSources(ListLinkedSourcesRequest) - returns (ListLinkedSourcesResponse) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*/documents/*}/linkedSources" - body: "*" - }; - option (google.api.method_signature) = "parent"; - } - - // Create a link between a source document and a target document. - rpc CreateDocumentLink(CreateDocumentLinkRequest) returns (DocumentLink) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*/documents/*}/documentLinks" - body: "*" - }; - option (google.api.method_signature) = "parent,document_link"; - } - - // Remove the link between the source and target documents. - rpc DeleteDocumentLink(DeleteDocumentLinkRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/documents/*/documentLinks/*}:delete" - body: "*" - }; - option (google.api.method_signature) = "name"; - } -} - -// Response message for DocumentLinkService.ListLinkedTargets. -message ListLinkedTargetsResponse { - // Target document-links. - repeated DocumentLink document_links = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Request message for DocumentLinkService.ListLinkedTargets. -message ListLinkedTargetsRequest { - // Required. The name of the document, for which all target links are - // returned. Format: - // projects/{project_number}/locations/{location}/documents/{target_document_id}. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "contentwarehouse.googleapis.com/Document" - } - ]; - - // The meta information collected about the document creator, used to enforce - // access control for the service. - RequestMetadata request_metadata = 2; -} - -// Response message for DocumentLinkService.ListLinkedSources. -message ListLinkedSourcesResponse { - // Source document-links. - repeated DocumentLink document_links = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Response message for DocumentLinkService.ListLinkedSources. -message ListLinkedSourcesRequest { - // Required. The name of the document, for which all source links are - // returned. Format: - // projects/{project_number}/locations/{location}/documents/{source_document_id}. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "contentwarehouse.googleapis.com/Document" - } - ]; - - // The maximum number of document-links to return. The service may return - // fewer than this value. - // - // If unspecified, at most 50 document-links will be returned. - // The maximum value is 1000; values above 1000 will be coerced to 1000. - int32 page_size = 3; - - // A page token, received from a previous `ListLinkedSources` call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to `ListLinkedSources` - // must match the call that provided the page token. - string page_token = 4; - - // The meta information collected about the document creator, used to enforce - // access control for the service. - RequestMetadata request_metadata = 2; -} - -// A document-link between source and target document. -message DocumentLink { - option (google.api.resource) = { - type: "contentwarehouse.googleapis.com/DocumentLink" - pattern: "projects/{project}/locations/{location}/documents/{document}/documentLinks/{document_link}" - }; - - // The state of a document-link. - enum State { - // Unknown state of documentlink. - STATE_UNSPECIFIED = 0; - - // The documentlink has both source and target documents detected. - ACTIVE = 1; - - // Target document is deleted, and mark the documentlink as soft-deleted. - SOFT_DELETED = 2; - } - - // Name of this document-link. - // It is required that the parent derived form the name to be consistent with - // the source document reference. Otherwise an exception will be thrown. - // Format: - // projects/{project_number}/locations/{location}/documents/{source_document_id}/documentLinks/{document_link_id}. - string name = 1; - - // Document references of the source document. - DocumentReference source_document_reference = 2; - - // Document references of the target document. - DocumentReference target_document_reference = 3; - - // Description of this document-link. - string description = 4; - - // Output only. The time when the documentLink is last updated. - google.protobuf.Timestamp update_time = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time when the documentLink is created. - google.protobuf.Timestamp create_time = 6 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The state of the documentlink. If target node has been deleted, the - // link is marked as invalid. Removing a source node will result in removal - // of all associated links. - State state = 7; -} - -// Request message for DocumentLinkService.CreateDocumentLink. -message CreateDocumentLinkRequest { - // Required. Parent of the document-link to be created. - // parent of document-link should be a document. - // Format: - // projects/{project_number}/locations/{location}/documents/{source_document_id}. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "contentwarehouse.googleapis.com/Document" - } - ]; - - // Required. Document links associated with the source documents - // (source_document_id). - DocumentLink document_link = 2 [(google.api.field_behavior) = REQUIRED]; - - // The meta information collected about the document creator, used to enforce - // access control for the service. - RequestMetadata request_metadata = 3; -} - -// Request message for DocumentLinkService.DeleteDocumentLink. -message DeleteDocumentLinkRequest { - // Required. The name of the document-link to be deleted. - // Format: - // projects/{project_number}/locations/{location}/documents/{source_document_id}/documentLinks/{document_link_id}. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "contentwarehouse.googleapis.com/DocumentLink" - } - ]; - - // The meta information collected about the document creator, used to enforce - // access control for the service. - RequestMetadata request_metadata = 2; -} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/document_schema.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/document_schema.proto deleted file mode 100644 index c9ee6699fb4..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/document_schema.proto +++ /dev/null @@ -1,202 +0,0 @@ -// Copyright 2025 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.cloud.contentwarehouse.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.ContentWarehouse.V1"; -option go_package = "cloud.google.com/go/contentwarehouse/apiv1/contentwarehousepb;contentwarehousepb"; -option java_multiple_files = true; -option java_outer_classname = "DocumentSchemaProto"; -option java_package = "com.google.cloud.contentwarehouse.v1"; -option php_namespace = "Google\\Cloud\\ContentWarehouse\\V1"; -option ruby_package = "Google::Cloud::ContentWarehouse::V1"; - -// A document schema used to define document structure. -message DocumentSchema { - option (google.api.resource) = { - type: "contentwarehouse.googleapis.com/DocumentSchema" - pattern: "projects/{project}/locations/{location}/documentSchemas/{document_schema}" - }; - - // The resource name of the document schema. - // Format: - // projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}. - // - // The name is ignored when creating a document schema. - string name = 1; - - // Required. Name of the schema given by the user. Must be unique per project. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // Document details. - repeated PropertyDefinition property_definitions = 3; - - // Document Type, true refers the document is a folder, otherwise it is - // a typical document. - bool document_is_folder = 4; - - // Output only. The time when the document schema is last updated. - google.protobuf.Timestamp update_time = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time when the document schema is created. - google.protobuf.Timestamp create_time = 6 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Schema description. - string description = 7; -} - -// Defines the metadata for a schema property. -message PropertyDefinition { - // Stores the retrieval importance. - enum RetrievalImportance { - // No importance specified. Default medium importance. - RETRIEVAL_IMPORTANCE_UNSPECIFIED = 0; - - // Highest importance. - HIGHEST = 1; - - // Higher importance. - HIGHER = 2; - - // High importance. - HIGH = 3; - - // Medium importance. - MEDIUM = 4; - - // Low importance (negative). - LOW = 5; - - // Lowest importance (negative). - LOWEST = 6; - } - - // The schema source information. - message SchemaSource { - // The schema name in the source. - string name = 1; - - // The Doc AI processor type name. - string processor_type = 2; - } - - // Required. The name of the metadata property. - // Must be unique within a document schema and is case insensitive. - // Names must be non-blank, start with a letter, and can contain alphanumeric - // characters and: /, :, -, _, and . - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // The display-name for the property, used for front-end. - string display_name = 12; - - // Whether the property can have multiple values. - bool is_repeatable = 2; - - // Whether the property can be filtered. If this is a sub-property, all the - // parent properties must be marked filterable. - bool is_filterable = 3; - - // Indicates that the property should be included in a global search. - bool is_searchable = 4; - - // Whether the property is user supplied metadata. - // This out-of-the box placeholder setting can be used to tag derived - // properties. Its value and interpretation logic should be implemented by API - // user. - bool is_metadata = 5; - - // Whether the property is mandatory. - // Default is 'false', i.e. populating property value can be skipped. - // If 'true' then user must populate the value for this property. - bool is_required = 14; - - // The retrieval importance of the property during search. - RetrievalImportance retrieval_importance = 18; - - // Type of the property. - oneof value_type_options { - // Integer property. - IntegerTypeOptions integer_type_options = 7; - - // Float property. - FloatTypeOptions float_type_options = 8; - - // Text/string property. - TextTypeOptions text_type_options = 9; - - // Nested structured data property. - PropertyTypeOptions property_type_options = 10; - - // Enum/categorical property. - EnumTypeOptions enum_type_options = 11; - - // Date time property. - // It is not supported by CMEK compliant deployment. - DateTimeTypeOptions date_time_type_options = 13; - - // Map property. - MapTypeOptions map_type_options = 15; - - // Timestamp property. - // It is not supported by CMEK compliant deployment. - TimestampTypeOptions timestamp_type_options = 16; - } - - // The mapping information between this property to another schema source. - repeated SchemaSource schema_sources = 19; -} - -// Configurations for an integer property. -message IntegerTypeOptions {} - -// Configurations for a float property. -message FloatTypeOptions {} - -// Configurations for a text property. -message TextTypeOptions {} - -// Configurations for a date time property. -message DateTimeTypeOptions {} - -// Configurations for a Map property. -message MapTypeOptions {} - -// Configurations for a timestamp property. -message TimestampTypeOptions {} - -// Configurations for a nested structured data property. -message PropertyTypeOptions { - // Required. List of property definitions. - repeated PropertyDefinition property_definitions = 1 - [(google.api.field_behavior) = REQUIRED]; -} - -// Configurations for an enum/categorical property. -message EnumTypeOptions { - // Required. List of possible enum values. - repeated string possible_values = 1 [(google.api.field_behavior) = REQUIRED]; - - // Make sure the Enum property value provided in the document is in the - // possile value list during document creation. The validation check runs by - // default. - bool validation_check_disabled = 2; -} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/document_schema_service.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/document_schema_service.proto deleted file mode 100644 index ba570f044d9..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/document_schema_service.proto +++ /dev/null @@ -1,181 +0,0 @@ -// Copyright 2025 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.cloud.contentwarehouse.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/contentwarehouse/v1/document_schema.proto"; -import "google/protobuf/empty.proto"; - -option csharp_namespace = "Google.Cloud.ContentWarehouse.V1"; -option go_package = "cloud.google.com/go/contentwarehouse/apiv1/contentwarehousepb;contentwarehousepb"; -option java_multiple_files = true; -option java_outer_classname = "DocumentSchemaServiceProto"; -option java_package = "com.google.cloud.contentwarehouse.v1"; -option php_namespace = "Google\\Cloud\\ContentWarehouse\\V1"; -option ruby_package = "Google::Cloud::ContentWarehouse::V1"; - -// This service lets you manage document schema. -service DocumentSchemaService { - option (google.api.default_host) = "contentwarehouse.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Creates a document schema. - rpc CreateDocumentSchema(CreateDocumentSchemaRequest) - returns (DocumentSchema) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/documentSchemas" - body: "document_schema" - }; - option (google.api.method_signature) = "parent,document_schema"; - } - - // Updates a Document Schema. Returns INVALID_ARGUMENT if the name of the - // Document Schema is non-empty and does not equal the existing name. - // Supports only appending new properties, adding new ENUM possible values, - // and updating the - // [EnumTypeOptions.validation_check_disabled][google.cloud.contentwarehouse.v1.EnumTypeOptions.validation_check_disabled] - // flag for ENUM possible values. Updating existing properties will result - // into INVALID_ARGUMENT. - rpc UpdateDocumentSchema(UpdateDocumentSchemaRequest) - returns (DocumentSchema) { - option (google.api.http) = { - patch: "/v1/{name=projects/*/locations/*/documentSchemas/*}" - body: "*" - }; - option (google.api.method_signature) = "name,document_schema"; - } - - // Gets a document schema. Returns NOT_FOUND if the document schema does not - // exist. - rpc GetDocumentSchema(GetDocumentSchemaRequest) returns (DocumentSchema) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/documentSchemas/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Deletes a document schema. Returns NOT_FOUND if the document schema does - // not exist. Returns BAD_REQUEST if the document schema has documents - // depending on it. - rpc DeleteDocumentSchema(DeleteDocumentSchemaRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/documentSchemas/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists document schemas. - rpc ListDocumentSchemas(ListDocumentSchemasRequest) - returns (ListDocumentSchemasResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/documentSchemas" - }; - option (google.api.method_signature) = "parent"; - } -} - -// Request message for DocumentSchemaService.CreateDocumentSchema. -message CreateDocumentSchemaRequest { - // Required. The parent name. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "contentwarehouse.googleapis.com/Location" - } - ]; - - // Required. The document schema to create. - DocumentSchema document_schema = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for DocumentSchemaService.GetDocumentSchema. -message GetDocumentSchemaRequest { - // Required. The name of the document schema to retrieve. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "contentwarehouse.googleapis.com/DocumentSchema" - } - ]; -} - -// Request message for DocumentSchemaService.UpdateDocumentSchema. -message UpdateDocumentSchemaRequest { - // Required. The name of the document schema to update. - // Format: - // projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "contentwarehouse.googleapis.com/DocumentSchema" - } - ]; - - // Required. The document schema to update with. - DocumentSchema document_schema = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for DocumentSchemaService.DeleteDocumentSchema. -message DeleteDocumentSchemaRequest { - // Required. The name of the document schema to delete. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "contentwarehouse.googleapis.com/DocumentSchema" - } - ]; -} - -// Request message for DocumentSchemaService.ListDocumentSchemas. -message ListDocumentSchemasRequest { - // Required. The parent, which owns this collection of document schemas. - // Format: projects/{project_number}/locations/{location}. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "contentwarehouse.googleapis.com/Location" - } - ]; - - // The maximum number of document schemas to return. The service may return - // fewer than this value. - // If unspecified, at most 50 document schemas will be returned. - // The maximum value is 1000; values above 1000 will be coerced to 1000. - int32 page_size = 2; - - // A page token, received from a previous `ListDocumentSchemas` call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to `ListDocumentSchemas` - // must match the call that provided the page token. - string page_token = 3; -} - -// Response message for DocumentSchemaService.ListDocumentSchemas. -message ListDocumentSchemasResponse { - // The document schemas from the specified parent. - repeated DocumentSchema document_schemas = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/document_service.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/document_service.proto deleted file mode 100644 index 78e4a2b3817..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/document_service.proto +++ /dev/null @@ -1,279 +0,0 @@ -// Copyright 2025 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.cloud.contentwarehouse.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/resource.proto"; -import "google/cloud/contentwarehouse/v1/common.proto"; -import "google/cloud/contentwarehouse/v1/document.proto"; -import "google/cloud/contentwarehouse/v1/document_service_request.proto"; -import "google/cloud/contentwarehouse/v1/histogram.proto"; -import "google/cloud/contentwarehouse/v1/rule_engine.proto"; -import "google/iam/v1/policy.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/empty.proto"; - -option csharp_namespace = "Google.Cloud.ContentWarehouse.V1"; -option go_package = "cloud.google.com/go/contentwarehouse/apiv1/contentwarehousepb;contentwarehousepb"; -option java_multiple_files = true; -option java_outer_classname = "DocumentServiceProto"; -option java_package = "com.google.cloud.contentwarehouse.v1"; -option php_namespace = "Google\\Cloud\\ContentWarehouse\\V1"; -option ruby_package = "Google::Cloud::ContentWarehouse::V1"; - -// This service lets you manage document. -service DocumentService { - option (google.api.default_host) = "contentwarehouse.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Creates a document. - rpc CreateDocument(CreateDocumentRequest) returns (CreateDocumentResponse) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/documents" - body: "*" - }; - option (google.api.method_signature) = "parent,document"; - } - - // Gets a document. Returns NOT_FOUND if the document does not exist. - rpc GetDocument(GetDocumentRequest) returns (Document) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/documents/*}:get" - body: "*" - additional_bindings { - post: "/v1/{name=projects/*/locations/*/documents/referenceId/*}:get" - body: "*" - } - }; - option (google.api.method_signature) = "name"; - } - - // Updates a document. Returns INVALID_ARGUMENT if the name of the document - // is non-empty and does not equal the existing name. - rpc UpdateDocument(UpdateDocumentRequest) returns (UpdateDocumentResponse) { - option (google.api.http) = { - patch: "/v1/{name=projects/*/locations/*/documents/*}" - body: "*" - additional_bindings { - patch: "/v1/{name=projects/*/locations/*/documents/referenceId/*}" - body: "*" - } - }; - option (google.api.method_signature) = "name,document"; - } - - // Deletes a document. Returns NOT_FOUND if the document does not exist. - rpc DeleteDocument(DeleteDocumentRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/documents/*}:delete" - body: "*" - additional_bindings { - post: "/v1/{name=projects/*/locations/*/documents/referenceId/*}:delete" - body: "*" - } - }; - option (google.api.method_signature) = "name"; - } - - // Searches for documents using provided - // [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest]. - // This call only returns documents that the caller has permission to search - // against. - rpc SearchDocuments(SearchDocumentsRequest) - returns (SearchDocumentsResponse) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/documents:search" - body: "*" - }; - option (google.api.method_signature) = "parent"; - } - - // Lock the document so the document cannot be updated by other users. - rpc LockDocument(LockDocumentRequest) returns (Document) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/documents/*}:lock" - body: "*" - }; - option (google.api.method_signature) = "name"; - } - - // Gets the access control policy for a resource. Returns NOT_FOUND error if - // the resource does not exist. Returns an empty policy if the resource exists - // but does not have a policy set. - rpc FetchAcl(FetchAclRequest) returns (FetchAclResponse) { - option (google.api.http) = { - post: "/v1/{resource=projects/*/locations/*/documents/*}:fetchAcl" - body: "*" - additional_bindings { - post: "/v1/{resource=projects/*}:fetchAcl" - body: "*" - } - }; - option (google.api.method_signature) = "resource"; - } - - // Sets the access control policy for a resource. Replaces any existing - // policy. - rpc SetAcl(SetAclRequest) returns (SetAclResponse) { - option (google.api.http) = { - post: "/v1/{resource=projects/*/locations/*/documents/*}:setAcl" - body: "*" - additional_bindings { post: "/v1/{resource=projects/*}:setAcl" body: "*" } - }; - option (google.api.method_signature) = "resource,policy"; - } -} - -// Response message for DocumentService.CreateDocument. -message CreateDocumentResponse { - // Document created after executing create request. - Document document = 1; - - // Output from Rule Engine recording the rule evaluator and action executor's - // output. - // - // Refer format in: google/cloud/contentwarehouse/v1/rule_engine.proto - RuleEngineOutput rule_engine_output = 2; - - // Additional information for the API invocation, such as the request tracking - // id. - ResponseMetadata metadata = 3; - - // post-processing LROs - repeated google.longrunning.Operation long_running_operations = 4; -} - -// Response message for DocumentService.UpdateDocument. -message UpdateDocumentResponse { - // Updated document after executing update request. - Document document = 1; - - // Output from Rule Engine recording the rule evaluator and action executor's - // output. - // - // Refer format in: google/cloud/contentwarehouse/v1/rule_engine.proto - RuleEngineOutput rule_engine_output = 2; - - // Additional information for the API invocation, such as the request tracking - // id. - ResponseMetadata metadata = 3; -} - -// Additional result info for the question-answering feature. -message QAResult { - // A text span in the search text snippet that represents a highlighted - // section (answer context, highly relevant sentence, etc.). - message Highlight { - // Start index of the highlight. - int32 start_index = 1; - - // End index of the highlight, exclusive. - int32 end_index = 2; - } - - // Highlighted sections in the snippet. - repeated Highlight highlights = 1; - - // The calibrated confidence score for this document, in the range - // [0., 1.]. This represents the confidence level for whether the returned - // document and snippet answers the user's query. - float confidence_score = 2; -} - -// Response message for DocumentService.SearchDocuments. -message SearchDocumentsResponse { - // Document entry with metadata inside - // [SearchDocumentsResponse][google.cloud.contentwarehouse.v1.SearchDocumentsResponse] - message MatchingDocument { - // Document that matches the specified - // [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest]. - // This document only contains indexed metadata information. - Document document = 1; - - // Contains snippets of text from the document full raw text that most - // closely match a search query's keywords, if available. All HTML tags in - // the original fields are stripped when returned in this field, and - // matching query keywords are enclosed in HTML bold tags. - // - // If the question-answering feature is enabled, this field will instead - // contain a snippet that answers the user's natural-language query. No HTML - // bold tags will be present, and highlights in the answer snippet can be - // found in - // [QAResult.highlights][google.cloud.contentwarehouse.v1.QAResult.highlights]. - string search_text_snippet = 2; - - // Experimental. - // Additional result info if the question-answering feature is enabled. - QAResult qa_result = 3; - - // Return the 1-based page indices where those pages have one or more - // matched tokens. - repeated int64 matched_token_page_indices = 4; - } - - // The document entities that match the specified - // [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest]. - repeated MatchingDocument matching_documents = 1; - - // The token that specifies the starting position of the next page of results. - // This field is empty if there are no more results. - string next_page_token = 2; - - // The total number of matched documents which is available only if the client - // set - // [SearchDocumentsRequest.require_total_size][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.require_total_size] - // to `true` or set - // [SearchDocumentsRequest.total_result_size][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.total_result_size] - // to `ESTIMATED_SIZE` or `ACTUAL_SIZE`. Otherwise, the value will be `-1`. - // Typically a UI would handle this condition by displaying "of - // many", for example: "Displaying 10 of many". - int32 total_size = 3; - - // Additional information for the API invocation, such as the request tracking - // id. - ResponseMetadata metadata = 4; - - // The histogram results that match with the specified - // [SearchDocumentsRequest.histogram_queries][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.histogram_queries]. - repeated HistogramQueryResult histogram_query_results = 6; - - // Experimental. - // Question answer from the query against the document. - string question_answer = 7; -} - -// Response message for DocumentService.FetchAcl. -message FetchAclResponse { - // The IAM policy. - google.iam.v1.Policy policy = 1; - - // Additional information for the API invocation, such as the request tracking - // id. - ResponseMetadata metadata = 2; -} - -// Response message for DocumentService.SetAcl. -message SetAclResponse { - // The policy will be attached to a resource (e.g. projecct, document). - google.iam.v1.Policy policy = 1; - - // Additional information for the API invocation, such as the request tracking - // id. - ResponseMetadata metadata = 2; -} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/document_service_request.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/document_service_request.proto deleted file mode 100644 index 2611e1a39a6..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/document_service_request.proto +++ /dev/null @@ -1,355 +0,0 @@ -// Copyright 2025 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.cloud.contentwarehouse.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/contentwarehouse/v1/common.proto"; -import "google/cloud/contentwarehouse/v1/document.proto"; -import "google/cloud/contentwarehouse/v1/filters.proto"; -import "google/cloud/contentwarehouse/v1/histogram.proto"; -import "google/iam/v1/policy.proto"; -import "google/protobuf/field_mask.proto"; - -option csharp_namespace = "Google.Cloud.ContentWarehouse.V1"; -option go_package = "cloud.google.com/go/contentwarehouse/apiv1/contentwarehousepb;contentwarehousepb"; -option java_multiple_files = true; -option java_outer_classname = "DocumentServiceRequestProto"; -option java_package = "com.google.cloud.contentwarehouse.v1"; -option php_namespace = "Google\\Cloud\\ContentWarehouse\\V1"; -option ruby_package = "Google::Cloud::ContentWarehouse::V1"; - -// Request Option for processing Cloud AI Document in CW Document. -message CloudAIDocumentOption { - // Whether to convert all the entities to properties. - bool enable_entities_conversions = 1; - - // If set, only selected entities will be converted to properties. - map customized_entities_properties_conversions = 2; -} - -// Request message for DocumentService.CreateDocument. -message CreateDocumentRequest { - // Required. The parent name. - // Format: projects/{project_number}/locations/{location}. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "contentwarehouse.googleapis.com/Location" - } - ]; - - // Required. The document to create. - Document document = 2 [(google.api.field_behavior) = REQUIRED]; - - // The meta information collected about the end user, used to enforce access - // control for the service. - RequestMetadata request_metadata = 3; - - // Default document policy during creation. - // This refers to an Identity and Access (IAM) policy, which specifies access - // controls for the Document. - // Conditions defined in the policy will be ignored. - google.iam.v1.Policy policy = 4; - - // Request Option for processing Cloud AI Document in Document Warehouse. - // This field offers limited support for mapping entities from Cloud AI - // Document to Warehouse Document. Please consult with product team before - // using this field and other available options. - CloudAIDocumentOption cloud_ai_document_option = 5; - - // Field mask for creating Document fields. If mask path is empty, - // it means all fields are masked. - // For the `FieldMask` definition, - // see - // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask. - google.protobuf.FieldMask create_mask = 6; -} - -// Request message for DocumentService.GetDocument. -message GetDocumentRequest { - // Required. The name of the document to retrieve. - // Format: - // projects/{project_number}/locations/{location}/documents/{document_id} or - // projects/{project_number}/locations/{location}/documents/referenceId/{reference_id}. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "contentwarehouse.googleapis.com/Document" - } - ]; - - // The meta information collected about the end user, used to enforce access - // control for the service. - RequestMetadata request_metadata = 2; -} - -// Request message for DocumentService.UpdateDocument. -message UpdateDocumentRequest { - // Required. The name of the document to update. - // Format: - // projects/{project_number}/locations/{location}/documents/{document_id} - // or - // projects/{project_number}/locations/{location}/documents/referenceId/{reference_id}. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "contentwarehouse.googleapis.com/Document" - } - ]; - - // Required. The document to update. - Document document = 2 [(google.api.field_behavior) = REQUIRED]; - - // The meta information collected about the end user, used to enforce access - // control for the service. - RequestMetadata request_metadata = 3; - - // Request Option for processing Cloud AI Document in Document Warehouse. - // This field offers limited support for mapping entities from Cloud AI - // Document to Warehouse Document. Please consult with product team before - // using this field and other available options. - CloudAIDocumentOption cloud_ai_document_option = 5; - - // Options for the update operation. - UpdateOptions update_options = 6; -} - -// Request message for DocumentService.DeleteDocument. -message DeleteDocumentRequest { - // Required. The name of the document to delete. - // Format: - // projects/{project_number}/locations/{location}/documents/{document_id} - // or - // projects/{project_number}/locations/{location}/documents/referenceId/{reference_id}. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "contentwarehouse.googleapis.com/Document" - } - ]; - - // The meta information collected about the end user, used to enforce access - // control for the service. - RequestMetadata request_metadata = 2; -} - -// Request message for DocumentService.SearchDocuments. -message SearchDocumentsRequest { - // The total number of matching documents. - enum TotalResultSize { - // Total number calculation will be skipped. - TOTAL_RESULT_SIZE_UNSPECIFIED = 0; - - // Estimate total number. The total result size will be accurated up to - // 10,000. This option will add cost and latency to your request. - ESTIMATED_SIZE = 1; - - // It may adversely impact performance. The limit is 1000,000. - ACTUAL_SIZE = 2; - } - - // Required. The parent, which owns this collection of documents. - // Format: projects/{project_number}/locations/{location}. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "contentwarehouse.googleapis.com/Location" - } - ]; - - // The meta information collected about the end user, used to enforce access - // control and improve the search quality of the service. - RequestMetadata request_metadata = 3; - - // Query used to search against documents (keyword, filters, etc.). - DocumentQuery document_query = 4; - - // An integer that specifies the current offset (that is, starting result - // location, amongst the documents deemed by the API as relevant) in search - // results. This field is only considered if - // [page_token][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.page_token] - // is unset. - // - // The maximum allowed value is 5000. Otherwise an error is thrown. - // - // For example, 0 means to return results starting from the first matching - // document, and 10 means to return from the 11th document. This can be used - // for pagination, (for example, pageSize = 10 and offset = 10 means to return - // from the second page). - int32 offset = 5; - - // A limit on the number of documents returned in the search results. - // Increasing this value above the default value of 10 can increase search - // response time. The value can be between 1 and 100. - int32 page_size = 6; - - // The token specifying the current offset within search results. - // See - // [SearchDocumentsResponse.next_page_token][google.cloud.contentwarehouse.v1.SearchDocumentsResponse.next_page_token] - // for an explanation of how to obtain the next set of query results. - string page_token = 7; - - // The criteria determining how search results are sorted. For non-empty - // query, default is `"relevance desc"`. For empty query, default is - // `"upload_date desc"`. - // - // Supported options are: - // - // * `"relevance desc"`: By relevance descending, as determined by the API - // algorithms. - // * `"upload_date desc"`: By upload date descending. - // * `"upload_date"`: By upload date ascending. - // * `"update_date desc"`: By last updated date descending. - // * `"update_date"`: By last updated date ascending. - // * `"retrieval_importance desc"`: By retrieval importance of properties - // descending. This feature is still under development, please do not use - // unless otherwise instructed to do so. - string order_by = 8; - - // An expression specifying a histogram request against matching - // documents. Expression syntax is an aggregation function call with - // histogram facets and other options. - // - // The following aggregation functions are supported: - // - // * `count(string_histogram_facet)`: Count the number of matching entities - // for each distinct attribute value. - // - // Data types: - // - // * Histogram facet (aka filterable properties): Facet names with format - // <schema id>.<facet>. Facets will have the - // format of: `[a-zA-Z][a-zA-Z0-9_:/-.]`. If the facet is a child - // facet, then the parent hierarchy needs to be specified separated by - // dots in the prefix after the schema id. Thus, the format for a multi- - // level facet is: <schema id>.<parent facet name>. - // <child facet name>. Example: - // schema123.root_parent_facet.middle_facet.child_facet - // * DocumentSchemaId: (with no schema id prefix) to get - // histograms for each document type (returns the schema id path, e.g. - // projects/12345/locations/us-west/documentSchemas/abc123). - // - // Example expression: - // - // * Document type counts: - // count('DocumentSchemaId') - // - // * For schema id, abc123, get the counts for MORTGAGE_TYPE: - // count('abc123.MORTGAGE_TYPE') - repeated HistogramQuery histogram_queries = 9; - - // Controls if the search document request requires the return of a total size - // of matched documents. See - // [SearchDocumentsResponse.total_size][google.cloud.contentwarehouse.v1.SearchDocumentsResponse.total_size]. - // - // Enabling this flag may adversely impact performance. Hint: If this is - // used with pagination, set this flag on the initial query but set this - // to false on subsequent page calls (keep the total count locally). - // - // Defaults to false. - bool require_total_size = 10; - - // Controls if the search document request requires the return of a total size - // of matched documents. See - // [SearchDocumentsResponse.total_size][google.cloud.contentwarehouse.v1.SearchDocumentsResponse.total_size]. - TotalResultSize total_result_size = 12; - - // Experimental, do not use. - // The limit on the number of documents returned for the question-answering - // feature. To enable the question-answering feature, set - // [DocumentQuery].[is_nl_query][] to true. - int32 qa_size_limit = 11; -} - -// Request message for DocumentService.LockDocument. -message LockDocumentRequest { - // Required. The name of the document to lock. - // Format: - // projects/{project_number}/locations/{location}/documents/{document}. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "contentwarehouse.googleapis.com/Document" - } - ]; - - // The collection the document connects to. - string collection_id = 2; - - // The user information who locks the document. - UserInfo locking_user = 3; -} - -// Request message for DocumentService.FetchAcl -message FetchAclRequest { - // Required. REQUIRED: The resource for which the policy is being requested. - // Format for document: - // projects/{project_number}/locations/{location}/documents/{document_id}. - // Format for collection: - // projects/{project_number}/locations/{location}/collections/{collection_id}. - // Format for project: projects/{project_number}. - string resource = 1 [(google.api.field_behavior) = REQUIRED]; - - // The meta information collected about the end user, used to enforce access - // control for the service. - RequestMetadata request_metadata = 2; - - // For Get Project ACL only. Authorization check for end user will be ignored - // when project_owner=true. - bool project_owner = 3; -} - -// Request message for DocumentService.SetAcl. -message SetAclRequest { - // Required. REQUIRED: The resource for which the policy is being requested. - // Format for document: - // projects/{project_number}/locations/{location}/documents/{document_id}. - // Format for collection: - // projects/{project_number}/locations/{location}/collections/{collection_id}. - // Format for project: projects/{project_number}. - string resource = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. REQUIRED: The complete policy to be applied to the `resource`. - // The size of the policy is limited to a few 10s of KB. This refers to an - // Identity and Access (IAM) policy, which specifies access controls for the - // Document. - // - // You can set ACL with condition for projects only. - // - // Supported operators are: `=`, `!=`, `<`, `<=`, `>`, and `>=` where - // the left of the operator is `DocumentSchemaId` or property name and the - // right of the operator is a number or a quoted string. You must escape - // backslash (\\) and quote (\") characters. - // - // Boolean expressions (AND/OR) are supported up to 3 levels of nesting (for - // example, "((A AND B AND C) OR D) AND E"), a maximum of 10 comparisons are - // allowed in the expression. The expression must be < 6000 bytes in length. - // - // Sample condition: - // `"DocumentSchemaId = \"some schema id\" OR SchemaId.floatPropertyName - // >= 10"` - google.iam.v1.Policy policy = 2 [(google.api.field_behavior) = REQUIRED]; - - // The meta information collected about the end user, used to enforce access - // control for the service. - RequestMetadata request_metadata = 3; - - // For Set Project ACL only. Authorization check for end user will be ignored - // when project_owner=true. - bool project_owner = 4; -} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/filters.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/filters.proto deleted file mode 100644 index 269d2d07bc8..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/filters.proto +++ /dev/null @@ -1,290 +0,0 @@ -// Copyright 2025 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.cloud.contentwarehouse.v1; - -import "google/api/resource.proto"; -import "google/type/interval.proto"; - -option csharp_namespace = "Google.Cloud.ContentWarehouse.V1"; -option go_package = "cloud.google.com/go/contentwarehouse/apiv1/contentwarehousepb;contentwarehousepb"; -option java_multiple_files = true; -option java_outer_classname = "FiltersProto"; -option java_package = "com.google.cloud.contentwarehouse.v1"; -option php_namespace = "Google\\Cloud\\ContentWarehouse\\V1"; -option ruby_package = "Google::Cloud::ContentWarehouse::V1"; - -message DocumentQuery { - // The query string that matches against the full text of the document and - // the searchable properties. - // - // The query partially supports [Google AIP style - // syntax](https://google.aip.dev/160). Specifically, the query supports - // literals, logical operators, negation operators, comparison operators, and - // functions. - // - // Literals: A bare literal value (examples: "42", "Hugo") is a value to be - // matched against. It searches over the full text of the document and the - // searchable properties. - // - // Logical operators: "AND", "and", "OR", and "or" are binary logical - // operators (example: "engineer OR developer"). - // - // Negation operators: "NOT" and "!" are negation operators (example: "NOT - // software"). - // - // Comparison operators: support the binary comparison operators =, !=, <, >, - // <= and >= for string, numeric, enum, boolean. Also support like operator - // `~~` for string. It provides semantic search functionality by parsing, - // stemming and doing synonyms expansion against the input query. - // - // To specify a property in the query, the left hand side expression in the - // comparison must be the property ID including the parent. The right hand - // side must be literals. For example: - // "\"projects/123/locations/us\".property_a < 1" matches results whose - // "property_a" is less than 1 in project 123 and us location. - // The literals and comparison expression can be connected in a single query - // (example: "software engineer \"projects/123/locations/us\".salary > 100"). - // - // Functions: supported functions are `LOWER([property_name])` to perform a - // case insensitive match and `EMPTY([property_name])` to filter on the - // existence of a key. - // - // Support nested expressions connected using parenthesis and logical - // operators. The default logical operators is `AND` if there is no operators - // between expressions. - // - // The query can be used with other filters e.g. `time_filters` and - // `folder_name_filter`. They are connected with `AND` operator under the - // hood. - // - // The maximum number of allowed characters is 255. - string query = 1; - - // Experimental, do not use. - // If the query is a natural language question. False by default. If true, - // then the question-answering feature will be used instead of search, and - // `result_count` in - // [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest] - // must be set. In addition, all other input fields related to search - // (pagination, histograms, etc.) will be ignored. - bool is_nl_query = 12; - - // This filter specifies a structured syntax to match against the - // [PropertyDefinition].[is_filterable][] marked as `true`. The syntax for - // this expression is a subset of SQL syntax. - // - // Supported operators are: `=`, `!=`, `<`, `<=`, `>`, and `>=` where the left - // of the operator is a property name and the right of the operator is a - // number or a quoted string. You must escape backslash (\\) and quote (\") - // characters. Supported functions are `LOWER([property_name])` to perform a - // case insensitive match and `EMPTY([property_name])` to filter on the - // existence of a key. - // - // Boolean expressions (AND/OR/NOT) are supported up to 3 levels of nesting - // (for example, "((A AND B AND C) OR NOT D) AND E"), a maximum of 100 - // comparisons or functions are allowed in the expression. The expression must - // be < 6000 bytes in length. - // - // Sample Query: - // `(LOWER(driving_license)="class \"a\"" OR EMPTY(driving_license)) AND - // driving_years > 10` - string custom_property_filter = 4 [deprecated = true]; - - // Documents created/updated within a range specified by this filter are - // searched against. - repeated TimeFilter time_filters = 5; - - // This filter specifies the exact document schema - // [Document.document_schema_name][google.cloud.contentwarehouse.v1.Document.document_schema_name] - // of the documents to search against. - // - // If a value isn't specified, documents within the search results are - // associated with any schema. If multiple values are specified, documents - // within the search results may be associated with any of the specified - // schemas. - // - // At most 20 document schema names are allowed. - repeated string document_schema_names = 6; - - // This filter specifies a structured syntax to match against the - // [PropertyDefinition.is_filterable][google.cloud.contentwarehouse.v1.PropertyDefinition.is_filterable] - // marked as `true`. The relationship between the PropertyFilters is OR. - repeated PropertyFilter property_filter = 7; - - // This filter specifies the types of files to return: ALL, FOLDER, or FILE. - // If FOLDER or FILE is specified, then only either folders or files will be - // returned, respectively. If ALL is specified, both folders and files will be - // returned. - // - // If no value is specified, ALL files will be returned. - FileTypeFilter file_type_filter = 8; - - // Search all the documents under this specified folder. - // Format: - // projects/{project_number}/locations/{location}/documents/{document_id}. - string folder_name_filter = 9; - - // Search the documents in the list. - // Format: - // projects/{project_number}/locations/{location}/documents/{document_id}. - repeated string document_name_filter = 14; - - // For custom synonyms. - // Customers provide the synonyms based on context. One customer can provide - // multiple set of synonyms based on different context. The search query will - // be expanded based on the custom synonyms of the query context set. - // By default, no custom synonyms wll be applied if no query context is - // provided. - // It is not supported for CMEK compliant deployment. - repeated string query_context = 10; - - // The exact creator(s) of the documents to search against. - // - // If a value isn't specified, documents within the search results are - // associated with any creator. If multiple values are specified, documents - // within the search results may be associated with any of the specified - // creators. - repeated string document_creator_filter = 11; - - // To support the custom weighting across document schemas, customers need to - // provide the properties to be used to boost the ranking in the search - // request. For a search query with CustomWeightsMetadata specified, only the - // RetrievalImportance for the properties in the CustomWeightsMetadata will - // be honored. - CustomWeightsMetadata custom_weights_metadata = 13; -} - -// Filter on create timestamp or update timestamp of documents. -message TimeFilter { - // Time field used in TimeFilter. - enum TimeField { - // Default value. - TIME_FIELD_UNSPECIFIED = 0; - - // Earliest document create time. - CREATE_TIME = 1; - - // Latest document update time. - UPDATE_TIME = 2; - - // Time when document becomes mutable again. - DISPOSITION_TIME = 3; - } - - google.type.Interval time_range = 1; - - // Specifies which time field to filter documents on. - // - // Defaults to [TimeField.UPLOAD_TIME][]. - TimeField time_field = 2; -} - -message PropertyFilter { - // The Document schema name - // [Document.document_schema_name][google.cloud.contentwarehouse.v1.Document.document_schema_name]. - // Format: - // projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}. - string document_schema_name = 1 [(google.api.resource_reference) = { - type: "contentwarehouse.googleapis.com/DocumentSchema" - }]; - - // The filter condition. - // The syntax for this expression is a subset of SQL syntax. - // - // Supported operators are: `=`, `!=`, `<`, `<=`, `>`, `>=`, and `~~` where - // the left of the operator is a property name and the right of the operator - // is a number or a quoted string. You must escape backslash (\\) and quote - // (\") characters. - // - // `~~` is the LIKE operator. The right of the operator must be a string. The - // only supported property data type for LIKE is text_values. It provides - // semantic search functionality by parsing, stemming and doing synonyms - // expansion against the input query. It matches if the property contains - // semantic similar content to the query. It is not regex matching or wildcard - // matching. For example, "property.company ~~ \"google\"" will match records - // whose property `property.compnay` have values like "Google Inc.", "Google - // LLC" or "Google Company". - // - // Supported functions are `LOWER([property_name])` to perform a - // case insensitive match and `EMPTY([property_name])` to filter on the - // existence of a key. - // - // Boolean expressions (AND/OR/NOT) are supported up to 3 levels of nesting - // (for example, "((A AND B AND C) OR NOT D) AND E"), a maximum of 100 - // comparisons or functions are allowed in the expression. The expression must - // be < 6000 bytes in length. - // - // Only properties that are marked filterable are allowed - // ([PropertyDefinition.is_filterable][google.cloud.contentwarehouse.v1.PropertyDefinition.is_filterable]). - // Property names do not need to be prefixed by the document schema id (as is - // the case with histograms), however property names will need to be prefixed - // by its parent hierarchy, if any. For example: - // top_property_name.sub_property_name. - // - // Sample Query: - // `(LOWER(driving_license)="class \"a\"" OR EMPTY(driving_license)) AND - // driving_years > 10` - // - // - // CMEK compliant deployment only supports: - // - // * Operators: `=`, `<`, `<=`, `>`, and `>=`. - // * Boolean expressions: AND and OR. - string condition = 2; -} - -// Filter for the specific types of documents returned. -message FileTypeFilter { - // Representation of the types of files. - enum FileType { - // Default document type. If set, disables the filter. - FILE_TYPE_UNSPECIFIED = 0; - - // Returns all document types, including folders. - ALL = 1; - - // Returns only folders. - FOLDER = 2; - - // Returns only non-folder documents. - DOCUMENT = 3; - - // Returns only root folders - ROOT_FOLDER = 4; - } - - // The type of files to return. - FileType file_type = 1; -} - -// To support the custom weighting across document schemas. -message CustomWeightsMetadata { - // List of schema and property name. Allows a maximum of 10 schemas to be - // specified for relevance boosting. - repeated WeightedSchemaProperty weighted_schema_properties = 1; -} - -// Specifies the schema property name. -message WeightedSchemaProperty { - // The document schema name. - string document_schema_name = 1 [(google.api.resource_reference) = { - type: "contentwarehouse.googleapis.com/DocumentSchema" - }]; - - // The property definition names in the schema. - repeated string property_names = 2; -} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/histogram.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/histogram.proto deleted file mode 100644 index 5b64748ce47..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/histogram.proto +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright 2025 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.cloud.contentwarehouse.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; - -option csharp_namespace = "Google.Cloud.ContentWarehouse.V1"; -option go_package = "cloud.google.com/go/contentwarehouse/apiv1/contentwarehousepb;contentwarehousepb"; -option java_multiple_files = true; -option java_outer_classname = "HistogramProto"; -option java_package = "com.google.cloud.contentwarehouse.v1"; -option php_namespace = "Google\\Cloud\\ContentWarehouse\\V1"; -option ruby_package = "Google::Cloud::ContentWarehouse::V1"; - -// The histogram request. -message HistogramQuery { - // An expression specifies a histogram request against matching documents for - // searches. - // - // See - // [SearchDocumentsRequest.histogram_queries][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.histogram_queries] - // for details about syntax. - string histogram_query = 1; - - // Controls if the histogram query requires the return of a precise count. - // Enable this flag may adversely impact performance. - // - // Defaults to true. - bool require_precise_result_size = 2; - - // Optional. Filter the result of histogram query by the property names. It - // only works with histogram query count('FilterableProperties'). It is an - // optional. It will perform histogram on all the property names for all the - // document schemas. Setting this field will have a better performance. - HistogramQueryPropertyNameFilter filters = 3 - [(google.api.field_behavior) = OPTIONAL]; -} - -message HistogramQueryPropertyNameFilter { - // The result of the histogram query count('FilterableProperties') using - // HISTOGRAM_YAXIS_DOCUMENT will be: - // invoice_id: 2 - // address: 1 - // payment_method: 2 - // line_item_description: 1 - enum HistogramYAxis { - // Count the documents per property name. - HISTOGRAM_YAXIS_DOCUMENT = 0; - - // Count the properties per property name. - HISTOGRAM_YAXIS_PROPERTY = 1; - } - - // This filter specifies the exact document schema(s) - // [Document.document_schema_name][google.cloud.contentwarehouse.v1.Document.document_schema_name] - // to run histogram query against. It is optional. It will perform histogram - // for property names for all the document schemas if it is not set. - // - // At most 10 document schema names are allowed. - // Format: - // projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}. - repeated string document_schemas = 1 [(google.api.resource_reference) = { - type: "contentwarehouse.googleapis.com/DocumentSchema" - }]; - - // It is optional. It will perform histogram for all the property names if it - // is not set. - // The properties need to be defined with the is_filterable flag set to - // true and the name of the property should be in the format: - // "schemaId.propertyName". The property needs to be defined in the schema. - // Example: the schema id is abc. Then the name of property for property - // MORTGAGE_TYPE will be "abc.MORTGAGE_TYPE". - repeated string property_names = 2; - - // By default, the y_axis is HISTOGRAM_YAXIS_DOCUMENT if this field is not - // set. - HistogramYAxis y_axis = 3; -} - -// Histogram result that matches -// [HistogramQuery][google.cloud.contentwarehouse.v1.HistogramQuery] specified -// in searches. -message HistogramQueryResult { - // Requested histogram expression. - string histogram_query = 1; - - // A map from the values of the facet associated with distinct values to the - // number of matching entries with corresponding value. - // - // The key format is: - // - // * (for string histogram) string values stored in the field. - map histogram = 2; -} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/pipeline_service.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/pipeline_service.proto deleted file mode 100644 index 0da21292a83..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/pipeline_service.proto +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright 2025 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.cloud.contentwarehouse.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/contentwarehouse/v1/common.proto"; -import "google/cloud/contentwarehouse/v1/pipelines.proto"; -import "google/longrunning/operations.proto"; - -option csharp_namespace = "Google.Cloud.ContentWarehouse.V1"; -option go_package = "cloud.google.com/go/contentwarehouse/apiv1/contentwarehousepb;contentwarehousepb"; -option java_multiple_files = true; -option java_outer_classname = "PipelineServiceProto"; -option java_package = "com.google.cloud.contentwarehouse.v1"; -option php_namespace = "Google\\Cloud\\ContentWarehouse\\V1"; -option ruby_package = "Google::Cloud::ContentWarehouse::V1"; - -// This service lets you manage pipelines. -service PipelineService { - option (google.api.default_host) = "contentwarehouse.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Run a predefined pipeline. - rpc RunPipeline(RunPipelineRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*}:runPipeline" - body: "*" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "RunPipelineResponse" - metadata_type: "RunPipelineMetadata" - }; - } -} - -// Request message for DocumentService.RunPipeline. -message RunPipelineRequest { - // Required. The resource name which owns the resources of the pipeline. - // Format: projects/{project_number}/locations/{location}. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "contentwarehouse.googleapis.com/Location" - } - ]; - - // The predefined pipelines. - oneof pipeline { - // Cloud Storage ingestion pipeline. - GcsIngestPipeline gcs_ingest_pipeline = 2; - - // Use DocAI processors to process documents in Cloud Storage and ingest - // them to Document Warehouse. - GcsIngestWithDocAiProcessorsPipeline - gcs_ingest_with_doc_ai_processors_pipeline = 3; - - // Export docuemnts from Document Warehouse to CDW for training purpose. - ExportToCdwPipeline export_cdw_pipeline = 4; - - // Use a DocAI processor to process documents in Document Warehouse, and - // re-ingest the updated results into Document Warehouse. - ProcessWithDocAiPipeline process_with_doc_ai_pipeline = 5; - } - - // The meta information collected about the end user, used to enforce access - // control for the service. - RequestMetadata request_metadata = 6; -} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/pipelines.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/pipelines.proto deleted file mode 100644 index d316b45e15a..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/pipelines.proto +++ /dev/null @@ -1,291 +0,0 @@ -// Copyright 2025 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.cloud.contentwarehouse.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/contentwarehouse/v1/common.proto"; -import "google/iam/v1/policy.proto"; -import "google/rpc/status.proto"; - -option csharp_namespace = "Google.Cloud.ContentWarehouse.V1"; -option go_package = "cloud.google.com/go/contentwarehouse/apiv1/contentwarehousepb;contentwarehousepb"; -option java_multiple_files = true; -option java_outer_classname = "PipelinesProto"; -option java_package = "com.google.cloud.contentwarehouse.v1"; -option php_namespace = "Google\\Cloud\\ContentWarehouse\\V1"; -option ruby_package = "Google::Cloud::ContentWarehouse::V1"; -option (google.api.resource_definition) = { - type: "cloudfunctions.googleapis.com/CloudFunction" - pattern: "projects/{project}/locations/{location}/functions/{function}" -}; - -// Response message of RunPipeline method. -message RunPipelineResponse {} - -// Metadata message of RunPipeline method. -message RunPipelineMetadata { - // The metadata message for GcsIngest pipeline. - message GcsIngestPipelineMetadata { - // The input Cloud Storage folder in this pipeline. - // Format: `gs:///`. - string input_path = 1; - } - - // The metadata message for Export-to-CDW pipeline. - message ExportToCdwPipelineMetadata { - // The input list of all the resource names of the documents to be exported. - repeated string documents = 1; - - // The output CDW dataset resource name. - string doc_ai_dataset = 2; - - // The output Cloud Storage folder in this pipeline. - string output_path = 3; - } - - // The metadata message for Process-with-DocAi pipeline. - message ProcessWithDocAiPipelineMetadata { - // The input list of all the resource names of the documents to be - // processed. - repeated string documents = 1; - - // The DocAI processor to process the documents with. - ProcessorInfo processor_info = 2; - } - - // The status of processing a document. - message IndividualDocumentStatus { - // Document identifier of an existing document. - string document_id = 1; - - // The status processing the document. - google.rpc.Status status = 2; - } - - // Number of files that were processed by the pipeline. - int32 total_file_count = 1; - - // Number of files that have failed at some point in the pipeline. - int32 failed_file_count = 2; - - // User unique identification and groups information. - UserInfo user_info = 3; - - // The pipeline metadata. - oneof pipeline_metadata { - // The pipeline metadata for GcsIngest pipeline. - GcsIngestPipelineMetadata gcs_ingest_pipeline_metadata = 4; - - // The pipeline metadata for Export-to-CDW pipeline. - ExportToCdwPipelineMetadata export_to_cdw_pipeline_metadata = 6; - - // The pipeline metadata for Process-with-DocAi pipeline. - ProcessWithDocAiPipelineMetadata process_with_doc_ai_pipeline_metadata = 7; - } - - // The list of response details of each document. - repeated IndividualDocumentStatus individual_document_statuses = 5; -} - -// The DocAI processor information. -message ProcessorInfo { - // The processor resource name. - // Format is `projects/{project}/locations/{location}/processors/{processor}`, - // or - // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - string processor_name = 1; - - // The processor will process the documents with this document type. - string document_type = 2; - - // The Document schema resource name. All documents processed by this - // processor will use this schema. - // Format: - // projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}. - string schema_name = 3; -} - -// The ingestion pipeline config. -message IngestPipelineConfig { - // The document level acl policy config. - // This refers to an Identity and Access (IAM) policy, which specifies access - // controls for all documents ingested by the pipeline. The - // [role][google.iam.v1.Binding.role] and - // [members][google.iam.v1.Binding.role] under the policy needs to be - // specified. - // - // The following roles are supported for document level acl control: - // * roles/contentwarehouse.documentAdmin - // * roles/contentwarehouse.documentEditor - // * roles/contentwarehouse.documentViewer - // - // The following members are supported for document level acl control: - // * user:user-email@example.com - // * group:group-email@example.com - // Note that for documents searched with LLM, only single level user or group - // acl check is supported. - google.iam.v1.Policy document_acl_policy = 1; - - // The document text extraction enabled flag. - // If the flag is set to true, DWH will perform text extraction on the raw - // document. - bool enable_document_text_extraction = 2; - - // Optional. The name of the folder to which all ingested documents will be - // linked during ingestion process. Format is - // `projects/{project}/locations/{location}/documents/{folder_id}` - string folder = 3 [(google.api.field_behavior) = OPTIONAL]; - - // The Cloud Function resource name. The Cloud Function needs to live inside - // consumer project and is accessible to Document AI Warehouse P4SA. - // Only Cloud Functions V2 is supported. Cloud function execution should - // complete within 5 minutes or this file ingestion may fail due to timeout. - // Format: `https://{region}-{project_id}.cloudfunctions.net/{cloud_function}` - // The following keys are available the request json payload. - // * display_name - // * properties - // * plain_text - // * reference_id - // * document_schema_name - // * raw_document_path - // * raw_document_file_type - // - // The following keys from the cloud function json response payload will be - // ingested to the Document AI Warehouse as part of Document proto content - // and/or related information. The original values will be overridden if any - // key is present in the response. - // * display_name - // * properties - // * plain_text - // * document_acl_policy - // * folder - string cloud_function = 4 [(google.api.resource_reference) = { - type: "cloudfunctions.googleapis.com/CloudFunction" - }]; -} - -// The configuration of the Cloud Storage Ingestion pipeline. -message GcsIngestPipeline { - // The input Cloud Storage folder. All files under this folder will be - // imported to Document Warehouse. - // Format: `gs:///`. - string input_path = 1; - - // The Document Warehouse schema resource name. All documents processed by - // this pipeline will use this schema. - // Format: - // projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}. - string schema_name = 2; - - // The Doc AI processor type name. Only used when the format of ingested - // files is Doc AI Document proto format. - string processor_type = 3; - - // The flag whether to skip ingested documents. - // If it is set to true, documents in Cloud Storage contains key "status" with - // value "status=ingested" in custom metadata will be skipped to ingest. - bool skip_ingested_documents = 4; - - // Optional. The config for the Cloud Storage Ingestion pipeline. - // It provides additional customization options to run the pipeline and can be - // skipped if it is not applicable. - IngestPipelineConfig pipeline_config = 5 - [(google.api.field_behavior) = OPTIONAL]; -} - -// The configuration of the Cloud Storage Ingestion with DocAI Processors -// pipeline. -message GcsIngestWithDocAiProcessorsPipeline { - // The input Cloud Storage folder. All files under this folder will be - // imported to Document Warehouse. - // Format: `gs:///`. - string input_path = 1; - - // The split and classify processor information. - // The split and classify result will be used to find a matched extract - // processor. - ProcessorInfo split_classify_processor_info = 2; - - // The extract processors information. - // One matched extract processor will be used to process documents based on - // the classify processor result. If no classify processor is specified, the - // first extract processor will be used. - repeated ProcessorInfo extract_processor_infos = 3; - - // The Cloud Storage folder path used to store the raw results from - // processors. - // Format: `gs:///`. - string processor_results_folder_path = 4; - - // The flag whether to skip ingested documents. - // If it is set to true, documents in Cloud Storage contains key "status" with - // value "status=ingested" in custom metadata will be skipped to ingest. - bool skip_ingested_documents = 5; - - // Optional. The config for the Cloud Storage Ingestion with DocAI Processors - // pipeline. It provides additional customization options to run the pipeline - // and can be skipped if it is not applicable. - IngestPipelineConfig pipeline_config = 6 - [(google.api.field_behavior) = OPTIONAL]; -} - -// The configuration of exporting documents from the Document Warehouse to CDW -// pipeline. -message ExportToCdwPipeline { - // The list of all the resource names of the documents to be processed. - // Format: - // projects/{project_number}/locations/{location}/documents/{document_id}. - repeated string documents = 1; - - // The Cloud Storage folder path used to store the exported documents before - // being sent to CDW. - // Format: `gs:///`. - string export_folder_path = 2; - - // Optional. The CDW dataset resource name. This field is optional. If not - // set, the documents will be exported to Cloud Storage only. Format: - // projects/{project}/locations/{location}/processors/{processor}/dataset - string doc_ai_dataset = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Ratio of training dataset split. When importing into Document AI Workbench, - // documents will be automatically split into training and test split category - // with the specified ratio. This field is required if doc_ai_dataset is set. - float training_split_ratio = 4; -} - -// The configuration of processing documents in Document Warehouse with DocAi -// processors pipeline. -message ProcessWithDocAiPipeline { - // The list of all the resource names of the documents to be processed. - // Format: - // projects/{project_number}/locations/{location}/documents/{document_id}. - repeated string documents = 1; - - // The Cloud Storage folder path used to store the exported documents before - // being sent to CDW. - // Format: `gs:///`. - string export_folder_path = 2; - - // The CDW processor information. - ProcessorInfo processor_info = 3; - - // The Cloud Storage folder path used to store the raw results from - // processors. - // Format: `gs:///`. - string processor_results_folder_path = 4; -} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/rule_engine.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/rule_engine.proto deleted file mode 100644 index 6beedad8d40..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/rule_engine.proto +++ /dev/null @@ -1,289 +0,0 @@ -// Copyright 2025 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.cloud.contentwarehouse.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/iam/v1/policy.proto"; - -option csharp_namespace = "Google.Cloud.ContentWarehouse.V1"; -option go_package = "cloud.google.com/go/contentwarehouse/apiv1/contentwarehousepb;contentwarehousepb"; -option java_multiple_files = true; -option java_outer_classname = "RuleEngineProto"; -option java_package = "com.google.cloud.contentwarehouse.v1"; -option php_namespace = "Google\\Cloud\\ContentWarehouse\\V1"; -option ruby_package = "Google::Cloud::ContentWarehouse::V1"; - -// Represents a set of rules from a single customer. -message RuleSet { - option (google.api.resource) = { - type: "contentwarehouse.googleapis.com/RuleSet" - pattern: "projects/{project}/locations/{location}/ruleSets/{rule_set}" - }; - - // The resource name of the rule set. Managed internally. - // Format: - // projects/{project_number}/locations/{location}/ruleSet/{rule_set_id}. - // - // The name is ignored when creating a rule set. - string name = 6; - - // Short description of the rule-set. - string description = 1; - - // Source of the rules i.e., customer name. - string source = 2; - - // List of rules given by the customer. - repeated Rule rules = 3; -} - -// Represents the rule for a content warehouse trigger. -message Rule { - // The trigger types for actions. - enum TriggerType { - // Trigger for unknown action. - UNKNOWN = 0; - - // Trigger for create document action. - ON_CREATE = 1; - - // Trigger for update document action. - ON_UPDATE = 4; - - // Trigger for create link action. - ON_CREATE_LINK = 7; - - // Trigger for delete link action. - ON_DELETE_LINK = 8; - } - - // Short description of the rule and its context. - string description = 1; - - // ID of the rule. It has to be unique across all the examples. - // This is managed internally. - string rule_id = 2; - - // Identifies the trigger type for running the policy. - TriggerType trigger_type = 3; - - // Represents the conditional expression to be evaluated. - // Expression should evaluate to a boolean result. - // When the condition is true actions are executed. - // Example: user_role = "hsbc_role_1" AND doc.salary > 20000 - string condition = 4; - - // List of actions that are executed when the rule is satisfied. - repeated Action actions = 5; -} - -// Represents the action triggered by Rule Engine when the rule is true. -message Action { - // ID of the action. Managed internally. - string action_id = 1; - - oneof action { - // Action triggering access control operations. - AccessControlAction access_control = 2; - - // Action triggering data validation operations. - DataValidationAction data_validation = 3; - - // Action triggering data update operations. - DataUpdateAction data_update = 4; - - // Action triggering create document link operation. - AddToFolderAction add_to_folder = 5; - - // Action publish to Pub/Sub operation. - PublishAction publish_to_pub_sub = 6; - - // Action removing a document from a folder. - RemoveFromFolderAction remove_from_folder_action = 9; - - // Action deleting the document. - DeleteDocumentAction delete_document_action = 10; - } -} - -// Represents the action responsible for access control list management -// operations. -message AccessControlAction { - // Type of ACL modification operation. - enum OperationType { - // The unknown operation type. - UNKNOWN = 0; - - // Adds newly given policy bindings in the existing bindings list. - ADD_POLICY_BINDING = 1; - - // Removes newly given policy bindings from the existing bindings list. - REMOVE_POLICY_BINDING = 2; - - // Replaces existing policy bindings with the given policy binding list - REPLACE_POLICY_BINDING = 3; - } - - // Identifies the type of operation. - OperationType operation_type = 1; - - // Represents the new policy from which bindings are added, removed or - // replaced based on the type of the operation. the policy is limited to a few - // 10s of KB. - google.iam.v1.Policy policy = 2; -} - -// Represents the action responsible for data validation operations. -message DataValidationAction { - // Map of (K, V) -> (field, string condition to be evaluated on the field) - // E.g., ("age", "age > 18 && age < 60") entry triggers validation of field - // age with the given condition. Map entries will be ANDed during validation. - map conditions = 1; -} - -// Represents the action responsible for properties update operations. -message DataUpdateAction { - // Map of (K, V) -> (valid name of the field, new value of the field) - // E.g., ("age", "60") entry triggers update of field age with a value of 60. - // If the field is not present then new entry is added. - // During update action execution, value strings will be casted to - // appropriate types. - map entries = 1; -} - -// Represents the action responsible for adding document under a folder. -message AddToFolderAction { - // Names of the folder under which new document is to be added. - // Format: - // projects/{project_number}/locations/{location}/documents/{document_id}. - repeated string folders = 1 [(google.api.resource_reference) = { - type: "contentwarehouse.googleapis.com/Document" - }]; -} - -// Represents the action responsible for remove a document from a specific -// folder. -message RemoveFromFolderAction { - // Condition of the action to be executed. - string condition = 1; - - // Name of the folder under which new document is to be added. - // Format: - // projects/{project_number}/locations/{location}/documents/{document_id}. - string folder = 2 [(google.api.resource_reference) = { - type: "contentwarehouse.googleapis.com/Document" - }]; -} - -// Represents the action responsible for publishing messages to a Pub/Sub topic. -message PublishAction { - // The topic id in the Pub/Sub service for which messages will be published - // to. - string topic_id = 1; - - // Messages to be published. - repeated string messages = 2; -} - -// Represents the action responsible for deleting the document. -message DeleteDocumentAction { - // Boolean field to select between hard vs soft delete options. - // Set 'true' for 'hard delete' and 'false' for 'soft delete'. - bool enable_hard_delete = 1; -} - -// Records the output of Rule Engine including rule evaluation and actions -// result. -message RuleEngineOutput { - // Name of the document against which the rules and actions were evaluated. - string document_name = 3; - - // Output from Rule Evaluator containing matched, unmatched and invalid rules. - RuleEvaluatorOutput rule_evaluator_output = 1; - - // Output from Action Executor containing rule and corresponding actions - // execution result. - ActionExecutorOutput action_executor_output = 2; -} - -// Represents the output of the Rule Evaluator. -message RuleEvaluatorOutput { - // List of rules fetched from database for the given request trigger type. - repeated Rule triggered_rules = 1; - - // A subset of triggered rules that are evaluated true for a given request. - repeated Rule matched_rules = 2; - - // A subset of triggered rules that failed the validation check(s) after - // parsing. - repeated InvalidRule invalid_rules = 3; -} - -// A triggered rule that failed the validation check(s) after parsing. -message InvalidRule { - // Triggered rule. - Rule rule = 1; - - // Validation error on a parsed expression. - string error = 2; -} - -// Represents the output of the Action Executor. -message ActionExecutorOutput { - // List of rule and corresponding actions result. - repeated RuleActionsPair rule_actions_pairs = 1; -} - -// Represents a rule and outputs of associated actions. -message RuleActionsPair { - // Represents the rule. - Rule rule = 1; - - // Outputs of executing the actions associated with the above rule. - repeated ActionOutput action_outputs = 2; -} - -// Represents the result of executing an action. -message ActionOutput { - // Represents execution state of the action. - enum State { - // The unknown state. - UNKNOWN = 0; - - // State indicating action executed successfully. - ACTION_SUCCEEDED = 1; - - // State indicating action failed. - ACTION_FAILED = 2; - - // State indicating action timed out. - ACTION_TIMED_OUT = 3; - - // State indicating action is pending. - ACTION_PENDING = 4; - } - - // ID of the action. - string action_id = 1; - - // State of an action. - State action_state = 2; - - // Action execution output message. - string output_message = 3; -} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/ruleset_service.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/ruleset_service.proto deleted file mode 100644 index b7f102c75c9..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/ruleset_service.proto +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2025 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.cloud.contentwarehouse.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/cloud/contentwarehouse/v1/rule_engine.proto"; -import "google/cloud/contentwarehouse/v1/ruleset_service_request.proto"; -import "google/protobuf/empty.proto"; - -option csharp_namespace = "Google.Cloud.ContentWarehouse.V1"; -option go_package = "cloud.google.com/go/contentwarehouse/apiv1/contentwarehousepb;contentwarehousepb"; -option java_multiple_files = true; -option java_outer_classname = "RuleSetServiceProto"; -option java_package = "com.google.cloud.contentwarehouse.v1"; -option php_namespace = "Google\\Cloud\\ContentWarehouse\\V1"; -option ruby_package = "Google::Cloud::ContentWarehouse::V1"; - -// Service to manage customer specific RuleSets. -service RuleSetService { - option (google.api.default_host) = "contentwarehouse.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Creates a ruleset. - rpc CreateRuleSet(CreateRuleSetRequest) returns (RuleSet) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/ruleSets" - body: "rule_set" - }; - option (google.api.method_signature) = "parent,rule_set"; - } - - // Gets a ruleset. Returns NOT_FOUND if the ruleset does not exist. - rpc GetRuleSet(GetRuleSetRequest) returns (RuleSet) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/ruleSets/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Updates a ruleset. Returns INVALID_ARGUMENT if the name of the ruleset - // is non-empty and does not equal the existing name. - rpc UpdateRuleSet(UpdateRuleSetRequest) returns (RuleSet) { - option (google.api.http) = { - patch: "/v1/{name=projects/*/locations/*/ruleSets/*}" - body: "*" - }; - option (google.api.method_signature) = "name,rule_set"; - } - - // Deletes a ruleset. Returns NOT_FOUND if the document does not exist. - rpc DeleteRuleSet(DeleteRuleSetRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/ruleSets/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists rulesets. - rpc ListRuleSets(ListRuleSetsRequest) returns (ListRuleSetsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/ruleSets" - }; - option (google.api.method_signature) = "parent"; - } -} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/ruleset_service_request.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/ruleset_service_request.proto deleted file mode 100644 index bb9e50a59b9..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/ruleset_service_request.proto +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright 2025 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.cloud.contentwarehouse.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/contentwarehouse/v1/rule_engine.proto"; - -option csharp_namespace = "Google.Cloud.ContentWarehouse.V1"; -option go_package = "cloud.google.com/go/contentwarehouse/apiv1/contentwarehousepb;contentwarehousepb"; -option java_multiple_files = true; -option java_outer_classname = "RuleSetServiceRequestProto"; -option java_package = "com.google.cloud.contentwarehouse.v1"; -option php_namespace = "Google\\Cloud\\ContentWarehouse\\V1"; -option ruby_package = "Google::Cloud::ContentWarehouse::V1"; - -// Request message for RuleSetService.CreateRuleSet. -message CreateRuleSetRequest { - // Required. The parent name. - // Format: projects/{project_number}/locations/{location}. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "contentwarehouse.googleapis.com/Location" - } - ]; - - // Required. The rule set to create. - RuleSet rule_set = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for RuleSetService.GetRuleSet. -message GetRuleSetRequest { - // Required. The name of the rule set to retrieve. - // Format: - // projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "contentwarehouse.googleapis.com/RuleSet" - } - ]; -} - -// Request message for RuleSetService.UpdateRuleSet. -message UpdateRuleSetRequest { - // Required. The name of the rule set to update. - // Format: - // projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "contentwarehouse.googleapis.com/RuleSet" - } - ]; - - // Required. The rule set to update. - RuleSet rule_set = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for RuleSetService.DeleteRuleSet. -message DeleteRuleSetRequest { - // Required. The name of the rule set to delete. - // Format: - // projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "contentwarehouse.googleapis.com/RuleSet" - } - ]; -} - -// Request message for RuleSetService.ListRuleSets. -message ListRuleSetsRequest { - // Required. The parent, which owns this collection of document. - // Format: projects/{project_number}/locations/{location}. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "contentwarehouse.googleapis.com/Location" - } - ]; - - // The maximum number of rule sets to return. The service may return - // fewer than this value. - // If unspecified, at most 50 rule sets will be returned. - // The maximum value is 1000; values above 1000 will be coerced to 1000. - int32 page_size = 2; - - // A page token, received from a previous `ListRuleSets` call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to `ListRuleSets` - // must match the call that provided the page token. - string page_token = 3; -} - -// Response message for RuleSetService.ListRuleSets. -message ListRuleSetsResponse { - // The rule sets from the specified parent. - repeated RuleSet rule_sets = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/synonymset.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/synonymset.proto deleted file mode 100644 index a6e968e8aa0..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/synonymset.proto +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2025 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.cloud.contentwarehouse.v1; - -import "google/api/resource.proto"; - -option csharp_namespace = "Google.Cloud.ContentWarehouse.V1"; -option go_package = "cloud.google.com/go/contentwarehouse/apiv1/contentwarehousepb;contentwarehousepb"; -option java_multiple_files = true; -option java_outer_classname = "SynonymSetProto"; -option java_package = "com.google.cloud.contentwarehouse.v1"; -option php_namespace = "Google\\Cloud\\ContentWarehouse\\V1"; -option ruby_package = "Google::Cloud::ContentWarehouse::V1"; - -// Represents a list of synonyms for a given context. -// For example a context "sales" could contain: -// Synonym 1: sale, invoice, bill, order -// Synonym 2: money, credit, finance, payment -// Synonym 3: shipping, freight, transport -// Each SynonymSets should be disjoint -message SynonymSet { - option (google.api.resource) = { - type: "contentwarehouse.googleapis.com/SynonymSet" - pattern: "projects/{project}/locations/{location}/synonymSets/{context}" - }; - - // Represents a list of words given by the customer - // All these words are synonyms of each other. - message Synonym { - // For example: sale, invoice, bill, order - repeated string words = 1; - } - - // The resource name of the SynonymSet - // This is mandatory for google.api.resource. - // Format: - // projects/{project_number}/locations/{location}/synonymSets/{context}. - string name = 1; - - // This is a freeform field. Example contexts can be "sales," "engineering," - // "real estate," "accounting," etc. - // The context can be supplied during search requests. - string context = 2; - - // List of Synonyms for the context. - repeated Synonym synonyms = 3; -} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/synonymset_service.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/synonymset_service.proto deleted file mode 100644 index 4bc0f5781b9..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/synonymset_service.proto +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright 2025 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.cloud.contentwarehouse.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/cloud/contentwarehouse/v1/synonymset.proto"; -import "google/cloud/contentwarehouse/v1/synonymset_service_request.proto"; -import "google/protobuf/empty.proto"; - -option csharp_namespace = "Google.Cloud.ContentWarehouse.V1"; -option go_package = "cloud.google.com/go/contentwarehouse/apiv1/contentwarehousepb;contentwarehousepb"; -option java_multiple_files = true; -option java_outer_classname = "SynonymSetServiceProto"; -option java_package = "com.google.cloud.contentwarehouse.v1"; -option php_namespace = "Google\\Cloud\\ContentWarehouse\\V1"; -option ruby_package = "Google::Cloud::ContentWarehouse::V1"; - -// A Service that manage/custom customer specified SynonymSets. -service SynonymSetService { - option (google.api.default_host) = "contentwarehouse.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Creates a SynonymSet for a single context. - // Throws an ALREADY_EXISTS exception if a synonymset already exists - // for the context. - rpc CreateSynonymSet(CreateSynonymSetRequest) returns (SynonymSet) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/synonymSets" - body: "synonym_set" - }; - option (google.api.method_signature) = "parent,synonym_set"; - } - - // Gets a SynonymSet for a particular context. - // Throws a NOT_FOUND exception if the Synonymset - // does not exist - rpc GetSynonymSet(GetSynonymSetRequest) returns (SynonymSet) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/synonymSets/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Remove the existing SynonymSet for the context and replaces it - // with a new one. - // Throws a NOT_FOUND exception if the SynonymSet is not found. - rpc UpdateSynonymSet(UpdateSynonymSetRequest) returns (SynonymSet) { - option (google.api.http) = { - patch: "/v1/{name=projects/*/locations/*/synonymSets/*}" - body: "synonym_set" - }; - option (google.api.method_signature) = "name,synonym_set"; - } - - // Deletes a SynonymSet for a given context. - // Throws a NOT_FOUND exception if the SynonymSet is not found. - rpc DeleteSynonymSet(DeleteSynonymSetRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/synonymSets/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Returns all SynonymSets (for all contexts) for the specified location. - rpc ListSynonymSets(ListSynonymSetsRequest) - returns (ListSynonymSetsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/synonymSets" - }; - option (google.api.method_signature) = "parent"; - } -} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/synonymset_service_request.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/synonymset_service_request.proto deleted file mode 100644 index 48d35603cfb..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/synonymset_service_request.proto +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright 2025 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.cloud.contentwarehouse.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/contentwarehouse/v1/synonymset.proto"; - -option csharp_namespace = "Google.Cloud.ContentWarehouse.V1"; -option go_package = "cloud.google.com/go/contentwarehouse/apiv1/contentwarehousepb;contentwarehousepb"; -option java_multiple_files = true; -option java_outer_classname = "SynonymSetServiceRequestProto"; -option java_package = "com.google.cloud.contentwarehouse.v1"; -option php_namespace = "Google\\Cloud\\ContentWarehouse\\V1"; -option ruby_package = "Google::Cloud::ContentWarehouse::V1"; - -// Request message for SynonymSetService.CreateSynonymSet. -message CreateSynonymSetRequest { - // Required. The parent name. - // Format: projects/{project_number}/locations/{location}. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "contentwarehouse.googleapis.com/Location" - } - ]; - - // Required. The synonymSet to be created for a context - SynonymSet synonym_set = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for SynonymSetService.GetSynonymSet. -// Will return synonymSet for a certain context. -message GetSynonymSetRequest { - // Required. The name of the synonymSet to retrieve - // Format: - // projects/{project_number}/locations/{location}/synonymSets/{context}. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "contentwarehouse.googleapis.com/SynonymSet" - } - ]; -} - -// Request message for SynonymSetService.ListSynonymSets. -// Will return all synonymSets belonging to the customer project. -message ListSynonymSetsRequest { - // Required. The parent name. - // Format: projects/{project_number}/locations/{location}. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "contentwarehouse.googleapis.com/Location" - } - ]; - - // The maximum number of synonymSets to return. The service may return - // fewer than this value. - // If unspecified, at most 50 rule sets will be returned. - // The maximum value is 1000; values above 1000 will be coerced to 1000. - int32 page_size = 2; - - // A page token, received from a previous `ListSynonymSets` call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to `ListSynonymSets` - // must match the call that provided the page token. - string page_token = 3; -} - -// Response message for SynonymSetService.ListSynonymSets. -message ListSynonymSetsResponse { - // The synonymSets from the specified parent. - repeated SynonymSet synonym_sets = 1; - - // A page token, received from a previous `ListSynonymSets` call. - // Provide this to retrieve the subsequent page. - string next_page_token = 2; -} - -// Request message for SynonymSetService.UpdateSynonymSet. -// Removes the SynonymSet for the specified context and replaces -// it with the SynonymSet in this request. -message UpdateSynonymSetRequest { - // Required. The name of the synonymSet to update - // Format: - // projects/{project_number}/locations/{location}/synonymSets/{context}. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "contentwarehouse.googleapis.com/SynonymSet" - } - ]; - - // Required. The synonymSet to be updated for the customer - SynonymSet synonym_set = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for SynonymSetService.DeleteSynonymSet. -message DeleteSynonymSetRequest { - // Required. The name of the synonymSet to delete - // Format: - // projects/{project_number}/locations/{location}/synonymSets/{context}. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "contentwarehouse.googleapis.com/SynonymSet" - } - ]; -} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/barcode.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/barcode.proto deleted file mode 100644 index ba6672a0873..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/barcode.proto +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2025 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.cloud.documentai.v1; - -option csharp_namespace = "Google.Cloud.DocumentAI.V1"; -option go_package = "cloud.google.com/go/documentai/apiv1/documentaipb;documentaipb"; -option java_multiple_files = true; -option java_outer_classname = "BarcodeProto"; -option java_package = "com.google.cloud.documentai.v1"; -option php_namespace = "Google\\Cloud\\DocumentAI\\V1"; -option ruby_package = "Google::Cloud::DocumentAI::V1"; - -// Encodes the detailed information of a barcode. -message Barcode { - // Format of a barcode. - // The supported formats are: - // - // - `CODE_128`: Code 128 type. - // - `CODE_39`: Code 39 type. - // - `CODE_93`: Code 93 type. - // - `CODABAR`: Codabar type. - // - `DATA_MATRIX`: 2D Data Matrix type. - // - `ITF`: ITF type. - // - `EAN_13`: EAN-13 type. - // - `EAN_8`: EAN-8 type. - // - `QR_CODE`: 2D QR code type. - // - `UPC_A`: UPC-A type. - // - `UPC_E`: UPC-E type. - // - `PDF417`: PDF417 type. - // - `AZTEC`: 2D Aztec code type. - // - `DATABAR`: GS1 DataBar code type. - string format = 1; - - // Value format describes the format of the value that a barcode - // encodes. - // The supported formats are: - // - // - `CONTACT_INFO`: Contact information. - // - `EMAIL`: Email address. - // - `ISBN`: ISBN identifier. - // - `PHONE`: Phone number. - // - `PRODUCT`: Product. - // - `SMS`: SMS message. - // - `TEXT`: Text string. - // - `URL`: URL address. - // - `WIFI`: Wifi information. - // - `GEO`: Geo-localization. - // - `CALENDAR_EVENT`: Calendar event. - // - `DRIVER_LICENSE`: Driver's license. - string value_format = 2; - - // Raw value encoded in the barcode. - // For example: `'MEBKM:TITLE:Google;URL:https://www.google.com;;'`. - string raw_value = 3; -} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/document.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/document.proto deleted file mode 100644 index 1eaad2a3c54..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/document.proto +++ /dev/null @@ -1,1204 +0,0 @@ -// Copyright 2025 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.cloud.documentai.v1; - -import "google/api/field_behavior.proto"; -import "google/cloud/documentai/v1/barcode.proto"; -import "google/cloud/documentai/v1/geometry.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; -import "google/type/color.proto"; -import "google/type/date.proto"; -import "google/type/datetime.proto"; -import "google/type/money.proto"; -import "google/type/postal_address.proto"; - -option csharp_namespace = "Google.Cloud.DocumentAI.V1"; -option go_package = "cloud.google.com/go/documentai/apiv1/documentaipb;documentaipb"; -option java_multiple_files = true; -option java_outer_classname = "DocumentProto"; -option java_package = "com.google.cloud.documentai.v1"; -option php_namespace = "Google\\Cloud\\DocumentAI\\V1"; -option ruby_package = "Google::Cloud::DocumentAI::V1"; - -// Document represents the canonical document resource in Document AI. It is an -// interchange format that provides insights into documents and allows for -// collaboration between users and Document AI to iterate and optimize for -// quality. -message Document { - // For a large document, sharding may be performed to produce several - // document shards. Each document shard contains this field to detail which - // shard it is. - message ShardInfo { - // The 0-based index of this shard. - int64 shard_index = 1; - - // Total number of shards. - int64 shard_count = 2; - - // The index of the first character in - // [Document.text][google.cloud.documentai.v1.Document.text] in the overall - // document global text. - int64 text_offset = 3; - } - - // Annotation for common text style attributes. This adheres to CSS - // conventions as much as possible. - message Style { - // Font size with unit. - message FontSize { - // Font size for the text. - float size = 1; - - // Unit for the font size. Follows CSS naming (such as `in`, `px`, and - // `pt`). - string unit = 2; - } - - // Text anchor indexing into the - // [Document.text][google.cloud.documentai.v1.Document.text]. - TextAnchor text_anchor = 1; - - // Text color. - google.type.Color color = 2; - - // Text background color. - google.type.Color background_color = 3; - - // [Font weight](https://www.w3schools.com/cssref/pr_font_weight.asp). - // Possible values are `normal`, `bold`, `bolder`, and `lighter`. - string font_weight = 4; - - // [Text style](https://www.w3schools.com/cssref/pr_font_font-style.asp). - // Possible values are `normal`, `italic`, and `oblique`. - string text_style = 5; - - // [Text - // decoration](https://www.w3schools.com/cssref/pr_text_text-decoration.asp). - // Follows CSS standard. - // - string text_decoration = 6; - - // Font size. - FontSize font_size = 7; - - // Font family such as `Arial`, `Times New Roman`. - // https://www.w3schools.com/cssref/pr_font_font-family.asp - string font_family = 8; - } - - // A page in a [Document][google.cloud.documentai.v1.Document]. - message Page { - // Dimension for the page. - message Dimension { - // Page width. - float width = 1; - - // Page height. - float height = 2; - - // Dimension unit. - string unit = 3; - } - - // Rendered image contents for this page. - message Image { - // Raw byte content of the image. - bytes content = 1; - - // Encoding [media type (MIME - // type)](https://www.iana.org/assignments/media-types/media-types.xhtml) - // for the image. - string mime_type = 2; - - // Width of the image in pixels. - int32 width = 3; - - // Height of the image in pixels. - int32 height = 4; - } - - // Representation for transformation matrix, intended to be compatible and - // used with OpenCV format for image manipulation. - message Matrix { - // Number of rows in the matrix. - int32 rows = 1; - - // Number of columns in the matrix. - int32 cols = 2; - - // This encodes information about what data type the matrix uses. - // For example, 0 (CV_8U) is an unsigned 8-bit image. For the full list - // of OpenCV primitive data types, please refer to - // https://docs.opencv.org/4.3.0/d1/d1b/group__core__hal__interface.html - int32 type = 3; - - // The matrix data. - bytes data = 4; - } - - // Visual element describing a layout unit on a page. - message Layout { - // Detected human reading orientation. - enum Orientation { - // Unspecified orientation. - ORIENTATION_UNSPECIFIED = 0; - - // Orientation is aligned with page up. - PAGE_UP = 1; - - // Orientation is aligned with page right. - // Turn the head 90 degrees clockwise from upright to read. - PAGE_RIGHT = 2; - - // Orientation is aligned with page down. - // Turn the head 180 degrees from upright to read. - PAGE_DOWN = 3; - - // Orientation is aligned with page left. - // Turn the head 90 degrees counterclockwise from upright to read. - PAGE_LEFT = 4; - } - - // Text anchor indexing into the - // [Document.text][google.cloud.documentai.v1.Document.text]. - TextAnchor text_anchor = 1; - - // Confidence of the current - // [Layout][google.cloud.documentai.v1.Document.Page.Layout] within - // context of the object this layout is for. e.g. confidence can be for a - // single token, a table, a visual element, etc. depending on context. - // Range `[0, 1]`. - float confidence = 2; - - // The bounding polygon for the - // [Layout][google.cloud.documentai.v1.Document.Page.Layout]. - BoundingPoly bounding_poly = 3; - - // Detected orientation for the - // [Layout][google.cloud.documentai.v1.Document.Page.Layout]. - Orientation orientation = 4; - } - - // A block has a set of lines (collected into paragraphs) that have a - // common line-spacing and orientation. - message Block { - // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - // [Block][google.cloud.documentai.v1.Document.Page.Block]. - Layout layout = 1; - - // A list of detected languages together with confidence. - repeated DetectedLanguage detected_languages = 2; - - // The history of this annotation. - Provenance provenance = 3 [deprecated = true]; - } - - // A collection of lines that a human would perceive as a paragraph. - message Paragraph { - // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - // [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph]. - Layout layout = 1; - - // A list of detected languages together with confidence. - repeated DetectedLanguage detected_languages = 2; - - // The history of this annotation. - Provenance provenance = 3 [deprecated = true]; - } - - // A collection of tokens that a human would perceive as a line. - // Does not cross column boundaries, can be horizontal, vertical, etc. - message Line { - // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - // [Line][google.cloud.documentai.v1.Document.Page.Line]. - Layout layout = 1; - - // A list of detected languages together with confidence. - repeated DetectedLanguage detected_languages = 2; - - // The history of this annotation. - Provenance provenance = 3 [deprecated = true]; - } - - // A detected token. - message Token { - // Detected break at the end of a - // [Token][google.cloud.documentai.v1.Document.Page.Token]. - message DetectedBreak { - // Enum to denote the type of break found. - enum Type { - // Unspecified break type. - TYPE_UNSPECIFIED = 0; - - // A single whitespace. - SPACE = 1; - - // A wider whitespace. - WIDE_SPACE = 2; - - // A hyphen that indicates that a token has been split across lines. - HYPHEN = 3; - } - - // Detected break type. - Type type = 1; - } - - // Font and other text style attributes. - message StyleInfo { - // Font size in points (`1` point is `¹⁄₇₂` inches). - int32 font_size = 1; - - // Font size in pixels, equal to _unrounded - // [font_size][google.cloud.documentai.v1.Document.Page.Token.StyleInfo.font_size]_ - // * _resolution_ ÷ `72.0`. - double pixel_font_size = 2; - - // Letter spacing in points. - double letter_spacing = 3; - - // Name or style of the font. - string font_type = 4; - - // Whether the text is bold (equivalent to - // [font_weight][google.cloud.documentai.v1.Document.Page.Token.StyleInfo.font_weight] - // is at least `700`). - bool bold = 5; - - // Whether the text is italic. - bool italic = 6; - - // Whether the text is underlined. - bool underlined = 7; - - // Whether the text is strikethrough. This feature is not supported yet. - bool strikeout = 8; - - // Whether the text is a subscript. This feature is not supported yet. - bool subscript = 9; - - // Whether the text is a superscript. This feature is not supported yet. - bool superscript = 10; - - // Whether the text is in small caps. This feature is not supported yet. - bool smallcaps = 11; - - // TrueType weight on a scale `100` (thin) to `1000` (ultra-heavy). - // Normal is `400`, bold is `700`. - int32 font_weight = 12; - - // Whether the text is handwritten. - bool handwritten = 13; - - // Color of the text. - google.type.Color text_color = 14; - - // Color of the background. - google.type.Color background_color = 15; - } - - // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - // [Token][google.cloud.documentai.v1.Document.Page.Token]. - Layout layout = 1; - - // Detected break at the end of a - // [Token][google.cloud.documentai.v1.Document.Page.Token]. - DetectedBreak detected_break = 2; - - // A list of detected languages together with confidence. - repeated DetectedLanguage detected_languages = 3; - - // The history of this annotation. - Provenance provenance = 4 [deprecated = true]; - - // Text style attributes. - StyleInfo style_info = 5; - } - - // A detected symbol. - message Symbol { - // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - // [Symbol][google.cloud.documentai.v1.Document.Page.Symbol]. - Layout layout = 1; - - // A list of detected languages together with confidence. - repeated DetectedLanguage detected_languages = 2; - } - - // Detected non-text visual elements e.g. checkbox, signature etc. on the - // page. - message VisualElement { - // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - // [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement]. - Layout layout = 1; - - // Type of the - // [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement]. - string type = 2; - - // A list of detected languages together with confidence. - repeated DetectedLanguage detected_languages = 3; - } - - // A table representation similar to HTML table structure. - message Table { - // A row of table cells. - message TableRow { - // Cells that make up this row. - repeated TableCell cells = 1; - } - - // A cell representation inside the table. - message TableCell { - // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - // [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell]. - Layout layout = 1; - - // How many rows this cell spans. - int32 row_span = 2; - - // How many columns this cell spans. - int32 col_span = 3; - - // A list of detected languages together with confidence. - repeated DetectedLanguage detected_languages = 4; - } - - // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - // [Table][google.cloud.documentai.v1.Document.Page.Table]. - Layout layout = 1; - - // Header rows of the table. - repeated TableRow header_rows = 2; - - // Body rows of the table. - repeated TableRow body_rows = 3; - - // A list of detected languages together with confidence. - repeated DetectedLanguage detected_languages = 4; - - // The history of this table. - Provenance provenance = 5 [deprecated = true]; - } - - // A form field detected on the page. - message FormField { - // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the - // [FormField][google.cloud.documentai.v1.Document.Page.FormField] name. - // e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc. - Layout field_name = 1; - - // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the - // [FormField][google.cloud.documentai.v1.Document.Page.FormField] value. - Layout field_value = 2; - - // A list of detected languages for name together with confidence. - repeated DetectedLanguage name_detected_languages = 3; - - // A list of detected languages for value together with confidence. - repeated DetectedLanguage value_detected_languages = 4; - - // If the value is non-textual, this field represents the type. Current - // valid values are: - // - // - blank (this indicates the `field_value` is normal text) - // - `unfilled_checkbox` - // - `filled_checkbox` - string value_type = 5; - - // Created for Labeling UI to export key text. - // If corrections were made to the text identified by the - // `field_name.text_anchor`, this field will contain the correction. - string corrected_key_text = 6; - - // Created for Labeling UI to export value text. - // If corrections were made to the text identified by the - // `field_value.text_anchor`, this field will contain the correction. - string corrected_value_text = 7; - - // The history of this annotation. - Provenance provenance = 8; - } - - // A detected barcode. - message DetectedBarcode { - // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - // [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode]. - Layout layout = 1; - - // Detailed barcode information of the - // [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode]. - Barcode barcode = 2; - } - - // Detected language for a structural component. - message DetectedLanguage { - // The [BCP-47 language - // code](https://www.unicode.org/reports/tr35/#Unicode_locale_identifier), - // such as `en-US` or `sr-Latn`. - string language_code = 1; - - // Confidence of detected language. Range `[0, 1]`. - float confidence = 2; - } - - // Image quality scores for the page image. - message ImageQualityScores { - // Image Quality Defects - message DetectedDefect { - // Name of the defect type. Supported values are: - // - // - `quality/defect_blurry` - // - `quality/defect_noisy` - // - `quality/defect_dark` - // - `quality/defect_faint` - // - `quality/defect_text_too_small` - // - `quality/defect_document_cutoff` - // - `quality/defect_text_cutoff` - // - `quality/defect_glare` - string type = 1; - - // Confidence of detected defect. Range `[0, 1]` where `1` indicates - // strong confidence that the defect exists. - float confidence = 2; - } - - // The overall quality score. Range `[0, 1]` where `1` is perfect quality. - float quality_score = 1; - - // A list of detected defects. - repeated DetectedDefect detected_defects = 2; - } - - // 1-based index for current - // [Page][google.cloud.documentai.v1.Document.Page] in a parent - // [Document][google.cloud.documentai.v1.Document]. Useful when a page is - // taken out of a [Document][google.cloud.documentai.v1.Document] for - // individual processing. - int32 page_number = 1; - - // Rendered image for this page. This image is preprocessed to remove any - // skew, rotation, and distortions such that the annotation bounding boxes - // can be upright and axis-aligned. - Image image = 13; - - // Transformation matrices that were applied to the original document image - // to produce [Page.image][google.cloud.documentai.v1.Document.Page.image]. - repeated Matrix transforms = 14; - - // Physical dimension of the page. - Dimension dimension = 2; - - // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the page. - Layout layout = 3; - - // A list of detected languages together with confidence. - repeated DetectedLanguage detected_languages = 4; - - // A list of visually detected text blocks on the page. - // A block has a set of lines (collected into paragraphs) that have a common - // line-spacing and orientation. - repeated Block blocks = 5; - - // A list of visually detected text paragraphs on the page. - // A collection of lines that a human would perceive as a paragraph. - repeated Paragraph paragraphs = 6; - - // A list of visually detected text lines on the page. - // A collection of tokens that a human would perceive as a line. - repeated Line lines = 7; - - // A list of visually detected tokens on the page. - repeated Token tokens = 8; - - // A list of detected non-text visual elements e.g. checkbox, - // signature etc. on the page. - repeated VisualElement visual_elements = 9; - - // A list of visually detected tables on the page. - repeated Table tables = 10; - - // A list of visually detected form fields on the page. - repeated FormField form_fields = 11; - - // A list of visually detected symbols on the page. - repeated Symbol symbols = 12; - - // A list of detected barcodes. - repeated DetectedBarcode detected_barcodes = 15; - - // Image quality scores. - ImageQualityScores image_quality_scores = 17; - - // The history of this page. - Provenance provenance = 16 [deprecated = true]; - } - - // An entity that could be a phrase in the text or a property that belongs to - // the document. It is a known entity type, such as a person, an organization, - // or location. - message Entity { - // Parsed and normalized entity value. - message NormalizedValue { - // An optional structured entity value. - // Must match entity type defined in schema if - // known. If this field is present, the `text` field could also be - // populated. - oneof structured_value { - // Money value. See also: - // https://github.com/googleapis/googleapis/blob/master/google/type/money.proto - google.type.Money money_value = 2; - - // Date value. Includes year, month, day. See also: - // https://github.com/googleapis/googleapis/blob/master/google/type/date.proto - google.type.Date date_value = 3; - - // DateTime value. Includes date, time, and timezone. See also: - // https://github.com/googleapis/googleapis/blob/master/google/type/datetime.proto - google.type.DateTime datetime_value = 4; - - // Postal address. See also: - // https://github.com/googleapis/googleapis/blob/master/google/type/postal_address.proto - google.type.PostalAddress address_value = 5; - - // Boolean value. Can be used for entities with binary values, or for - // checkboxes. - bool boolean_value = 6; - - // Integer value. - int32 integer_value = 7; - - // Float value. - float float_value = 8; - - bool signature_value = 10; - } - - // Optional. An optional field to store a normalized string. - // For some entity types, one of respective `structured_value` fields may - // also be populated. Also not all the types of `structured_value` will be - // normalized. For example, some processors may not generate `float` - // or `integer` normalized text by default. - // - // Below are sample formats mapped to structured values. - // - // - Money/Currency type (`money_value`) is in the ISO 4217 text format. - // - Date type (`date_value`) is in the ISO 8601 text format. - // - Datetime type (`datetime_value`) is in the ISO 8601 text format. - string text = 1 [(google.api.field_behavior) = OPTIONAL]; - } - - // Specifies how the entity's value is obtained. - enum Method { - // When the method is not specified, it should be treated as `EXTRACT`. - METHOD_UNSPECIFIED = 0; - - // The entity's value is directly extracted as-is from the document - // text. - EXTRACT = 1; - - // The entity's value is derived through inference and is not - // necessarily an exact text extraction from the document. - DERIVE = 2; - } - - // Optional. Provenance of the entity. - // Text anchor indexing into the - // [Document.text][google.cloud.documentai.v1.Document.text]. - TextAnchor text_anchor = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Required. Entity type from a schema e.g. `Address`. - string type = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Text value of the entity e.g. `1600 Amphitheatre Pkwy`. - string mention_text = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Deprecated. Use `id` field instead. - string mention_id = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Confidence of detected Schema entity. Range `[0, 1]`. - float confidence = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Represents the provenance of this entity wrt. the location on - // the page where it was found. - PageAnchor page_anchor = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Canonical id. This will be a unique value in the entity list - // for this document. - string id = 7 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Normalized entity value. Absent if the extracted value could - // not be converted or the type (e.g. address) is not supported for certain - // parsers. This field is also only populated for certain supported document - // types. - NormalizedValue normalized_value = 9 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Entities can be nested to form a hierarchical data structure - // representing the content in the document. - repeated Entity properties = 10 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The history of this annotation. - Provenance provenance = 11 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Whether the entity will be redacted for de-identification - // purposes. - bool redacted = 12 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specifies how the entity's value is obtained. - Method method = 15 [(google.api.field_behavior) = OPTIONAL]; - } - - // Relationship between - // [Entities][google.cloud.documentai.v1.Document.Entity]. - message EntityRelation { - // Subject entity id. - string subject_id = 1; - - // Object entity id. - string object_id = 2; - - // Relationship description. - string relation = 3; - } - - // Text reference indexing into the - // [Document.text][google.cloud.documentai.v1.Document.text]. - message TextAnchor { - // A text segment in the - // [Document.text][google.cloud.documentai.v1.Document.text]. The indices - // may be out of bounds which indicate that the text extends into another - // document shard for large sharded documents. See - // [ShardInfo.text_offset][google.cloud.documentai.v1.Document.ShardInfo.text_offset] - message TextSegment { - // [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] - // start UTF-8 char index in the - // [Document.text][google.cloud.documentai.v1.Document.text]. - int64 start_index = 1; - - // [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] - // half open end UTF-8 char index in the - // [Document.text][google.cloud.documentai.v1.Document.text]. - int64 end_index = 2; - } - - // The text segments from the - // [Document.text][google.cloud.documentai.v1.Document.text]. - repeated TextSegment text_segments = 1; - - // Contains the content of the text span so that users do - // not have to look it up in the text_segments. It is always - // populated for formFields. - string content = 2; - } - - // Referencing the visual context of the entity in the - // [Document.pages][google.cloud.documentai.v1.Document.pages]. Page anchors - // can be cross-page, consist of multiple bounding polygons and optionally - // reference specific layout element types. - message PageAnchor { - // Represents a weak reference to a page element within a document. - message PageRef { - // The type of layout that is being referenced. - enum LayoutType { - // Layout Unspecified. - LAYOUT_TYPE_UNSPECIFIED = 0; - - // References a - // [Page.blocks][google.cloud.documentai.v1.Document.Page.blocks] - // element. - BLOCK = 1; - - // References a - // [Page.paragraphs][google.cloud.documentai.v1.Document.Page.paragraphs] - // element. - PARAGRAPH = 2; - - // References a - // [Page.lines][google.cloud.documentai.v1.Document.Page.lines] element. - LINE = 3; - - // References a - // [Page.tokens][google.cloud.documentai.v1.Document.Page.tokens] - // element. - TOKEN = 4; - - // References a - // [Page.visual_elements][google.cloud.documentai.v1.Document.Page.visual_elements] - // element. - VISUAL_ELEMENT = 5; - - // Refrrences a - // [Page.tables][google.cloud.documentai.v1.Document.Page.tables] - // element. - TABLE = 6; - - // References a - // [Page.form_fields][google.cloud.documentai.v1.Document.Page.form_fields] - // element. - FORM_FIELD = 7; - } - - // Required. Index into the - // [Document.pages][google.cloud.documentai.v1.Document.pages] element, - // for example using - // `[Document.pages][page_refs.page]` to locate the related page element. - // This field is skipped when its value is the default `0`. See - // https://developers.google.com/protocol-buffers/docs/proto3#json. - int64 page = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The type of the layout element that is being referenced if - // any. - LayoutType layout_type = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Deprecated. Use - // [PageRef.bounding_poly][google.cloud.documentai.v1.Document.PageAnchor.PageRef.bounding_poly] - // instead. - string layout_id = 3 - [deprecated = true, (google.api.field_behavior) = OPTIONAL]; - - // Optional. Identifies the bounding polygon of a layout element on the - // page. If `layout_type` is set, the bounding polygon must be exactly the - // same to the layout element it's referring to. - BoundingPoly bounding_poly = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Confidence of detected page element, if applicable. Range - // `[0, 1]`. - float confidence = 5 [(google.api.field_behavior) = OPTIONAL]; - } - - // One or more references to visual page elements - repeated PageRef page_refs = 1; - } - - // Structure to identify provenance relationships between annotations in - // different revisions. - message Provenance { - // The parent element the current element is based on. Used for - // referencing/aligning, removal and replacement operations. - message Parent { - // The index of the index into current revision's parent_ids list. - int32 revision = 1; - - // The index of the parent item in the corresponding item list (eg. list - // of entities, properties within entities, etc.) in the parent revision. - int32 index = 3; - - // The id of the parent provenance. - int32 id = 2 [deprecated = true]; - } - - // If a processor or agent does an explicit operation on existing elements. - enum OperationType { - // Operation type unspecified. If no operation is specified a provenance - // entry is simply used to match against a `parent`. - OPERATION_TYPE_UNSPECIFIED = 0; - - // Add an element. - ADD = 1; - - // Remove an element identified by `parent`. - REMOVE = 2; - - // Updates any fields within the given provenance scope of the message. It - // overwrites the fields rather than replacing them. Use this when you - // want to update a field value of an entity without also updating all the - // child properties. - UPDATE = 7; - - // Currently unused. Replace an element identified by `parent`. - REPLACE = 3; - - // Deprecated. Request human review for the element identified by - // `parent`. - EVAL_REQUESTED = 4 [deprecated = true]; - - // Deprecated. Element is reviewed and approved at human review, - // confidence will be set to 1.0. - EVAL_APPROVED = 5 [deprecated = true]; - - // Deprecated. Element is skipped in the validation process. - EVAL_SKIPPED = 6 [deprecated = true]; - } - - // The index of the revision that produced this element. - int32 revision = 1 [deprecated = true]; - - // The Id of this operation. Needs to be unique within the scope of the - // revision. - int32 id = 2 [deprecated = true]; - - // References to the original elements that are replaced. - repeated Parent parents = 3; - - // The type of provenance operation. - OperationType type = 4; - } - - // Contains past or forward revisions of this document. - message Revision { - // Human Review information of the document. - message HumanReview { - // Human review state. e.g. `requested`, `succeeded`, `rejected`. - string state = 1; - - // A message providing more details about the current state of processing. - // For example, the rejection reason when the state is `rejected`. - string state_message = 2; - } - - // Who/what made the change - oneof source { - // If the change was made by a person specify the name or id of that - // person. - string agent = 4; - - // If the annotation was made by processor identify the processor by its - // resource name. - string processor = 5; - } - - // Id of the revision, internally generated by doc proto storage. - // Unique within the context of the document. - string id = 1; - - // The revisions that this revision is based on. This can include one or - // more parent (when documents are merged.) This field represents the - // index into the `revisions` field. - repeated int32 parent = 2 [deprecated = true]; - - // The revisions that this revision is based on. Must include all the ids - // that have anything to do with this revision - eg. there are - // `provenance.parent.revision` fields that index into this field. - repeated string parent_ids = 7; - - // The time that the revision was created, internally generated by - // doc proto storage at the time of create. - google.protobuf.Timestamp create_time = 3; - - // Human Review information of this revision. - HumanReview human_review = 6; - } - - // This message is used for text changes aka. OCR corrections. - message TextChange { - // Provenance of the correction. - // Text anchor indexing into the - // [Document.text][google.cloud.documentai.v1.Document.text]. There can - // only be a single `TextAnchor.text_segments` element. If the start and - // end index of the text segment are the same, the text change is inserted - // before that index. - TextAnchor text_anchor = 1; - - // The text that replaces the text identified in the `text_anchor`. - string changed_text = 2; - - // The history of this annotation. - repeated Provenance provenance = 3 [deprecated = true]; - } - - // Represents the parsed layout of a document as a collection of blocks that - // the document is divided into. - message DocumentLayout { - // Represents a block. A block could be one of the various types (text, - // table, list) supported. - message DocumentLayoutBlock { - // Represents where the block starts and ends in the document. - message LayoutPageSpan { - // Page where block starts in the document. - int32 page_start = 1; - - // Page where block ends in the document. - int32 page_end = 2; - } - - // Represents a text type block. - message LayoutTextBlock { - // Text content stored in the block. - string text = 1; - - // Type of the text in the block. Available options are: `paragraph`, - // `subtitle`, `heading-1`, `heading-2`, `heading-3`, `heading-4`, - // `heading-5`, `header`, `footer`. - string type = 2; - - // A text block could further have child blocks. - // Repeated blocks support further hierarchies and nested blocks. - repeated DocumentLayoutBlock blocks = 3; - } - - // Represents a table type block. - message LayoutTableBlock { - // Header rows at the top of the table. - repeated LayoutTableRow header_rows = 1; - - // Body rows containing main table content. - repeated LayoutTableRow body_rows = 2; - - // Table caption/title. - string caption = 3; - } - - // Represents a row in a table. - message LayoutTableRow { - // A table row is a list of table cells. - repeated LayoutTableCell cells = 1; - } - - // Represents a cell in a table row. - message LayoutTableCell { - // A table cell is a list of blocks. - // Repeated blocks support further hierarchies and nested blocks. - repeated DocumentLayoutBlock blocks = 1; - - // How many rows this cell spans. - int32 row_span = 2; - - // How many columns this cell spans. - int32 col_span = 3; - } - - // Represents a list type block. - message LayoutListBlock { - // List entries that constitute a list block. - repeated LayoutListEntry list_entries = 1; - - // Type of the list_entries (if exist). Available options are `ordered` - // and `unordered`. - string type = 2; - } - - // Represents an entry in the list. - message LayoutListEntry { - // A list entry is a list of blocks. - // Repeated blocks support further hierarchies and nested blocks. - repeated DocumentLayoutBlock blocks = 1; - } - - oneof block { - // Block consisting of text content. - LayoutTextBlock text_block = 2; - - // Block consisting of table content/structure. - LayoutTableBlock table_block = 3; - - // Block consisting of list content/structure. - LayoutListBlock list_block = 4; - } - - // ID of the block. - string block_id = 1; - - // Page span of the block. - LayoutPageSpan page_span = 5; - - // Identifies the bounding box for the block. - BoundingPoly bounding_box = 6; - } - - // List of blocks in the document. - repeated DocumentLayoutBlock blocks = 1; - } - - // Represents the chunks that the document is divided into. - message ChunkedDocument { - // Represents a chunk. - message Chunk { - // Represents where the chunk starts and ends in the document. - message ChunkPageSpan { - // Page where chunk starts in the document. - int32 page_start = 1; - - // Page where chunk ends in the document. - int32 page_end = 2; - } - - // Represents the page header associated with the chunk. - message ChunkPageHeader { - // Header in text format. - string text = 1; - - // Page span of the header. - ChunkPageSpan page_span = 2; - } - - // Represents the page footer associated with the chunk. - message ChunkPageFooter { - // Footer in text format. - string text = 1; - - // Page span of the footer. - ChunkPageSpan page_span = 2; - } - - // ID of the chunk. - string chunk_id = 1; - - // Unused. - repeated string source_block_ids = 2; - - // Text content of the chunk. - string content = 3; - - // Page span of the chunk. - ChunkPageSpan page_span = 4; - - // Page headers associated with the chunk. - repeated ChunkPageHeader page_headers = 5; - - // Page footers associated with the chunk. - repeated ChunkPageFooter page_footers = 6; - } - - // List of chunks. - repeated Chunk chunks = 1; - } - - // The output of the validation given the document and the validation rules. - message EntityValidationOutput { - // Validation result for a single validation rule. - message ValidationResult { - // The result of the validation rule. - enum ValidationResultType { - // The validation result type is unspecified. - VALIDATION_RESULT_TYPE_UNSPECIFIED = 0; - - // The validation is valid. - VALIDATION_RESULT_TYPE_VALID = 1; - - // The validation is invalid. - VALIDATION_RESULT_TYPE_INVALID = 2; - - // The validation is skipped. - VALIDATION_RESULT_TYPE_SKIPPED = 3; - - // The validation is not applicable. - VALIDATION_RESULT_TYPE_NOT_APPLICABLE = 4; - } - - // The name of the validation rule. - string rule_name = 1; - - // The description of the validation rule. - string rule_description = 2; - - // The result of the validation rule. - ValidationResultType validation_result_type = 3; - - // The detailed information of the running the validation process using - // the entity from the document based on the validation rule. - string validation_details = 4; - } - - // The result of each validation rule. - repeated ValidationResult validation_results = 1; - - // The overall result of the validation, true if all applicable rules are - // valid. - bool pass_all_rules = 2; - } - - // Entity revision. - message EntitiesRevision { - // The revision id. - string revision_id = 1; - - // The entities in this revision. - repeated Entity entities = 2; - - // The entity validation output for this revision. - EntityValidationOutput entity_validation_output = 3; - } - - // Original source document from the user. - oneof source { - // Optional. Currently supports Google Cloud Storage URI of the form - // `gs://bucket_name/object_name`. Object versioning is not supported. - // For more information, refer to [Google Cloud Storage Request - // URIs](https://cloud.google.com/storage/docs/reference-uris). - string uri = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Inline document content, represented as a stream of bytes. - // Note: As with all `bytes` fields, protobuffers use a pure binary - // representation, whereas JSON representations use base64. - bytes content = 2 [(google.api.field_behavior) = OPTIONAL]; - } - - // Optional. An internal identifier for document. Should be loggable (no PII). - string docid = 15 [(google.api.field_behavior) = OPTIONAL]; - - // An IANA published [media type (MIME - // type)](https://www.iana.org/assignments/media-types/media-types.xhtml). - string mime_type = 3; - - // Optional. UTF-8 encoded text in reading order from the document. - string text = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Styles for the [Document.text][google.cloud.documentai.v1.Document.text]. - repeated Style text_styles = 5 [deprecated = true]; - - // Visual page layout for the [Document][google.cloud.documentai.v1.Document]. - repeated Page pages = 6; - - // A list of entities detected on - // [Document.text][google.cloud.documentai.v1.Document.text]. For document - // shards, entities in this list may cross shard boundaries. - repeated Entity entities = 7; - - // Placeholder. Relationship among - // [Document.entities][google.cloud.documentai.v1.Document.entities]. - repeated EntityRelation entity_relations = 8; - - // Placeholder. A list of text corrections made to - // [Document.text][google.cloud.documentai.v1.Document.text]. This is usually - // used for annotating corrections to OCR mistakes. Text changes for a given - // revision may not overlap with each other. - repeated TextChange text_changes = 14; - - // Information about the sharding if this document is sharded part of a larger - // document. If the document is not sharded, this message is not specified. - ShardInfo shard_info = 9; - - // Any error that occurred while processing this document. - google.rpc.Status error = 10; - - // Placeholder. Revision history of this document. - repeated Revision revisions = 13; - - // Parsed layout of the document. - DocumentLayout document_layout = 17; - - // Document chunked based on chunking config. - ChunkedDocument chunked_document = 18; - - // The entity validation output for the document. This is the validation - // output for `document.entities` field. - EntityValidationOutput entity_validation_output = 21; - - // A list of entity revisions. The entity revisions are appended to the - // document in the processing order. This field can be used for comparing the - // entity extraction results at different stages of the processing. - repeated EntitiesRevision entities_revisions = 22; - - // The entity revision ID that `document.entities` field is based on. - // If this field is set and `entities_revisions` is not empty, the entities in - // `document.entities` field are the entities in the entity revision with this - // ID and `document.entity_validation_output` field is the - // `entity_validation_output` field in this entity revision. - string entities_revision_id = 23; -} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/document_io.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/document_io.proto deleted file mode 100644 index 65e7ed447d8..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/document_io.proto +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright 2025 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.cloud.documentai.v1; - -import "google/protobuf/field_mask.proto"; - -option csharp_namespace = "Google.Cloud.DocumentAI.V1"; -option go_package = "cloud.google.com/go/documentai/apiv1/documentaipb;documentaipb"; -option java_multiple_files = true; -option java_outer_classname = "DocumentIoProto"; -option java_package = "com.google.cloud.documentai.v1"; -option php_namespace = "Google\\Cloud\\DocumentAI\\V1"; -option ruby_package = "Google::Cloud::DocumentAI::V1"; - -// Payload message of raw document content (bytes). -message RawDocument { - // Inline document content. - bytes content = 1; - - // An IANA MIME type (RFC6838) indicating the nature and format of the - // [content][google.cloud.documentai.v1.RawDocument.content]. - string mime_type = 2; - - // The display name of the document, it supports all Unicode characters except - // the following: - // `*`, `?`, `[`, `]`, `%`, `{`, `}`,`'`, `\"`, `,` - // `~`, `=` and `:` are reserved. - // If not specified, a default ID is generated. - string display_name = 3; -} - -// Specifies a document stored on Cloud Storage. -message GcsDocument { - // The Cloud Storage object uri. - string gcs_uri = 1; - - // An IANA MIME type (RFC6838) of the content. - string mime_type = 2; -} - -// Specifies a set of documents on Cloud Storage. -message GcsDocuments { - // The list of documents. - repeated GcsDocument documents = 1; -} - -// Specifies all documents on Cloud Storage with a common prefix. -message GcsPrefix { - // The URI prefix. - string gcs_uri_prefix = 1; -} - -// The common config to specify a set of documents used as input. -message BatchDocumentsInputConfig { - // The source. Make sure that the caller of the API has storage.objects.get - // access to the buckets. - oneof source { - // The set of documents that match the specified Cloud Storage `gcs_prefix`. - GcsPrefix gcs_prefix = 1; - - // The set of documents individually specified on Cloud Storage. - GcsDocuments gcs_documents = 2; - } -} - -// Config that controls the output of documents. All documents will be written -// as a JSON file. -message DocumentOutputConfig { - // The configuration used when outputting documents. - message GcsOutputConfig { - // The sharding config for the output document. - message ShardingConfig { - // The number of pages per shard. - int32 pages_per_shard = 1; - - // The number of overlapping pages between consecutive shards. - int32 pages_overlap = 2; - } - - // The Cloud Storage uri (a directory) of the output. - string gcs_uri = 1; - - // Specifies which fields to include in the output documents. - // Only supports top level document and pages field so it must be in the - // form of `{document_field_name}` or `pages.{page_field_name}`. - google.protobuf.FieldMask field_mask = 2; - - // Specifies the sharding config for the output document. - ShardingConfig sharding_config = 3; - } - - // The destination of the results. - oneof destination { - // Output config to write the results to Cloud Storage. - GcsOutputConfig gcs_output_config = 1; - } -} - -// Config for Document OCR. -message OcrConfig { - // Hints for OCR Engine - message Hints { - // List of BCP-47 language codes to use for OCR. In most cases, not - // specifying it yields the best results since it enables automatic language - // detection. For languages based on the Latin alphabet, setting hints is - // not needed. In rare cases, when the language of the text in the - // image is known, setting a hint will help get better results (although it - // will be a significant hindrance if the hint is wrong). - repeated string language_hints = 1; - } - - // Configurations for premium OCR features. - message PremiumFeatures { - // Turn on selection mark detector in OCR engine. Only available in OCR 2.0 - // (and later) processors. - bool enable_selection_mark_detection = 3; - - // Turn on font identification model and return font style information. - bool compute_style_info = 4; - - // Turn on the model that can extract LaTeX math formulas. - bool enable_math_ocr = 5; - } - - // Hints for the OCR model. - Hints hints = 2; - - // Enables special handling for PDFs with existing text information. Results - // in better text extraction quality in such PDF inputs. - bool enable_native_pdf_parsing = 3; - - // Enables intelligent document quality scores after OCR. Can help with - // diagnosing why OCR responses are of poor quality for a given input. - // Adds additional latency comparable to regular OCR to the process call. - bool enable_image_quality_scores = 4; - - // A list of advanced OCR options to further fine-tune OCR behavior. Current - // valid values are: - // - // - `legacy_layout`: a heuristics layout detection algorithm, which serves as - // an alternative to the current ML-based layout detection algorithm. - // Customers can choose the best suitable layout algorithm based on their - // situation. - repeated string advanced_ocr_options = 5; - - // Includes symbol level OCR information if set to true. - bool enable_symbol = 6; - - // Turn on font identification model and return font style information. - // Deprecated, use - // [PremiumFeatures.compute_style_info][google.cloud.documentai.v1.OcrConfig.PremiumFeatures.compute_style_info] - // instead. - bool compute_style_info = 8 [deprecated = true]; - - // Turn off character box detector in OCR engine. Character box detection is - // enabled by default in OCR 2.0 (and later) processors. - bool disable_character_boxes_detection = 10; - - // Configurations for premium OCR features. - PremiumFeatures premium_features = 11; -} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/document_processor_service.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/document_processor_service.proto deleted file mode 100644 index ffd175f036c..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/document_processor_service.proto +++ /dev/null @@ -1,1267 +0,0 @@ -// Copyright 2026 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.cloud.documentai.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/documentai/v1/document.proto"; -import "google/cloud/documentai/v1/document_io.proto"; -import "google/cloud/documentai/v1/document_schema.proto"; -import "google/cloud/documentai/v1/evaluation.proto"; -import "google/cloud/documentai/v1/operation_metadata.proto"; -import "google/cloud/documentai/v1/processor.proto"; -import "google/cloud/documentai/v1/processor_type.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; - -option csharp_namespace = "Google.Cloud.DocumentAI.V1"; -option go_package = "cloud.google.com/go/documentai/apiv1/documentaipb;documentaipb"; -option java_multiple_files = true; -option java_outer_classname = "DocumentAiProcessorService"; -option java_package = "com.google.cloud.documentai.v1"; -option php_namespace = "Google\\Cloud\\DocumentAI\\V1"; -option ruby_package = "Google::Cloud::DocumentAI::V1"; -option (google.api.resource_definition) = { - type: "documentai.googleapis.com/HumanReviewConfig" - pattern: "projects/{project}/locations/{location}/processors/{processor}/humanReviewConfig" -}; -option (google.api.resource_definition) = { - type: "documentai.googleapis.com/Location" - pattern: "projects/{project}/locations/{location}" -}; - -// Service to call Document AI to process documents according to the -// processor's definition. Processors are built using state-of-the-art Google -// AI such as natural language, computer vision, and translation to extract -// structured information from unstructured or semi-structured documents. -service DocumentProcessorService { - option (google.api.default_host) = "documentai.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Processes a single document. - rpc ProcessDocument(ProcessRequest) returns (ProcessResponse) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/processors/*}:process" - body: "*" - additional_bindings { - post: "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:process" - body: "*" - } - }; - option (google.api.method_signature) = "name"; - } - - // LRO endpoint to batch process many documents. The output is written - // to Cloud Storage as JSON in the [Document] format. - rpc BatchProcessDocuments(BatchProcessRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/processors/*}:batchProcess" - body: "*" - additional_bindings { - post: "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:batchProcess" - body: "*" - } - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "BatchProcessResponse" - metadata_type: "BatchProcessMetadata" - }; - } - - // Fetches processor types. Note that we don't use - // [ListProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes] - // here, because it isn't paginated. - rpc FetchProcessorTypes(FetchProcessorTypesRequest) - returns (FetchProcessorTypesResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}:fetchProcessorTypes" - }; - option (google.api.method_signature) = "parent"; - } - - // Lists the processor types that exist. - rpc ListProcessorTypes(ListProcessorTypesRequest) - returns (ListProcessorTypesResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/processorTypes" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets a processor type detail. - rpc GetProcessorType(GetProcessorTypeRequest) returns (ProcessorType) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/processorTypes/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists all processors which belong to this project. - rpc ListProcessors(ListProcessorsRequest) returns (ListProcessorsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/processors" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets a processor detail. - rpc GetProcessor(GetProcessorRequest) returns (Processor) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/processors/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Trains a new processor version. - // Operation metadata is returned as - // [TrainProcessorVersionMetadata][google.cloud.documentai.v1.TrainProcessorVersionMetadata]. - rpc TrainProcessorVersion(TrainProcessorVersionRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*/processors/*}/processorVersions:train" - body: "*" - }; - option (google.api.method_signature) = "parent,processor_version"; - option (google.longrunning.operation_info) = { - response_type: "TrainProcessorVersionResponse" - metadata_type: "TrainProcessorVersionMetadata" - }; - } - - // Gets a processor version detail. - rpc GetProcessorVersion(GetProcessorVersionRequest) - returns (ProcessorVersion) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists all versions of a processor. - rpc ListProcessorVersions(ListProcessorVersionsRequest) - returns (ListProcessorVersionsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/processors/*}/processorVersions" - }; - option (google.api.method_signature) = "parent"; - } - - // Deletes the processor version, all artifacts under the processor version - // will be deleted. - rpc DeleteProcessorVersion(DeleteProcessorVersionRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteProcessorVersionMetadata" - }; - } - - // Deploys the processor version. - rpc DeployProcessorVersion(DeployProcessorVersionRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:deploy" - body: "*" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "DeployProcessorVersionResponse" - metadata_type: "DeployProcessorVersionMetadata" - }; - } - - // Undeploys the processor version. - rpc UndeployProcessorVersion(UndeployProcessorVersionRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:undeploy" - body: "*" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "UndeployProcessorVersionResponse" - metadata_type: "UndeployProcessorVersionMetadata" - }; - } - - // Creates a processor from the - // [ProcessorType][google.cloud.documentai.v1.ProcessorType] provided. The - // processor will be at `ENABLED` state by default after its creation. Note - // that this method requires the `documentai.processors.create` permission on - // the project, which is highly privileged. A user or service account with - // this permission can create new processors that can interact with any gcs - // bucket in your project. - rpc CreateProcessor(CreateProcessorRequest) returns (Processor) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/processors" - body: "processor" - }; - option (google.api.method_signature) = "parent,processor"; - } - - // Deletes the processor, unloads all deployed model artifacts if it was - // enabled and then deletes all artifacts associated with this processor. - rpc DeleteProcessor(DeleteProcessorRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/processors/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteProcessorMetadata" - }; - } - - // Enables a processor - rpc EnableProcessor(EnableProcessorRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/processors/*}:enable" - body: "*" - }; - option (google.longrunning.operation_info) = { - response_type: "EnableProcessorResponse" - metadata_type: "EnableProcessorMetadata" - }; - } - - // Disables a processor - rpc DisableProcessor(DisableProcessorRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/processors/*}:disable" - body: "*" - }; - option (google.longrunning.operation_info) = { - response_type: "DisableProcessorResponse" - metadata_type: "DisableProcessorMetadata" - }; - } - - // Set the default (active) version of a - // [Processor][google.cloud.documentai.v1.Processor] that will be used in - // [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument] - // and - // [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]. - rpc SetDefaultProcessorVersion(SetDefaultProcessorVersionRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{processor=projects/*/locations/*/processors/*}:setDefaultProcessorVersion" - body: "*" - }; - option (google.longrunning.operation_info) = { - response_type: "SetDefaultProcessorVersionResponse" - metadata_type: "SetDefaultProcessorVersionMetadata" - }; - } - - // Send a document for Human Review. The input document should be processed by - // the specified processor. - rpc ReviewDocument(ReviewDocumentRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{human_review_config=projects/*/locations/*/processors/*/humanReviewConfig}:reviewDocument" - body: "*" - }; - option (google.api.method_signature) = "human_review_config"; - option (google.longrunning.operation_info) = { - response_type: "ReviewDocumentResponse" - metadata_type: "ReviewDocumentOperationMetadata" - }; - } - - // Evaluates a ProcessorVersion against annotated documents, producing an - // Evaluation. - rpc EvaluateProcessorVersion(EvaluateProcessorVersionRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{processor_version=projects/*/locations/*/processors/*/processorVersions/*}:evaluateProcessorVersion" - body: "*" - }; - option (google.api.method_signature) = "processor_version"; - option (google.longrunning.operation_info) = { - response_type: "EvaluateProcessorVersionResponse" - metadata_type: "EvaluateProcessorVersionMetadata" - }; - } - - // Retrieves a specific evaluation. - rpc GetEvaluation(GetEvaluationRequest) returns (Evaluation) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*/evaluations/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Retrieves a set of evaluations for a given processor version. - rpc ListEvaluations(ListEvaluationsRequest) - returns (ListEvaluationsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/processors/*/processorVersions/*}/evaluations" - }; - option (google.api.method_signature) = "parent"; - } -} - -// Options for Process API -message ProcessOptions { - // Serving config for layout parser processor. - message LayoutConfig { - // Serving config for chunking. - message ChunkingConfig { - // Optional. The chunk sizes to use when splitting documents, in order of - // level. - int32 chunk_size = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Whether or not to include ancestor headings when splitting. - bool include_ancestor_headings = 2 - [(google.api.field_behavior) = OPTIONAL]; - } - - // Optional. Config for chunking in layout parser processor. - ChunkingConfig chunking_config = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Whether to include images in layout parser processor response. - bool return_images = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Whether to include bounding boxes in layout parser processor - // response. - bool return_bounding_boxes = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Whether to include image annotations in layout parser response. - bool enable_image_annotation = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Whether to include table annotations in layout parser response. - bool enable_table_annotation = 6 [(google.api.field_behavior) = OPTIONAL]; - } - - // A list of individual page numbers. - message IndividualPageSelector { - // Optional. Indices of the pages (starting from 1). - repeated int32 pages = 1 [(google.api.field_behavior) = OPTIONAL]; - } - - // A subset of pages to process. If not specified, all pages are processed. - // If a page range is set, only the given pages are extracted and processed - // from the document. In the output document, - // [Document.Page.page_number][google.cloud.documentai.v1.Document.Page.page_number] - // refers to the page number in the original document. - // This configuration only applies to online processing with - // [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument]. - oneof page_range { - // Which pages to process (1-indexed). - IndividualPageSelector individual_page_selector = 5; - - // Only process certain pages from the start. Process all if the document - // has fewer pages. - int32 from_start = 6; - - // Only process certain pages from the end, same as above. - int32 from_end = 7; - } - - // Only applicable to `OCR_PROCESSOR` and `FORM_PARSER_PROCESSOR`. - // Returns error if set on other processor types. - OcrConfig ocr_config = 1; - - // Optional. Only applicable to `LAYOUT_PARSER_PROCESSOR`. - // Returns error if set on other processor types. - LayoutConfig layout_config = 9 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Override the schema of the - // [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. Will - // return an Invalid Argument error if this field is set when the underlying - // [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] doesn't - // support schema override. - DocumentSchema schema_override = 8 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for the -// [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument] -// method. -message ProcessRequest { - // The document payload. - oneof source { - // An inline document proto. - Document inline_document = 4; - - // A raw document content (bytes). - RawDocument raw_document = 5; - - // A raw document on Google Cloud Storage. - GcsDocument gcs_document = 8; - } - - // Required. The resource name of the - // [Processor][google.cloud.documentai.v1.Processor] or - // [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] - // to use for processing. If a - // [Processor][google.cloud.documentai.v1.Processor] is specified, the server - // will use its [default - // version][google.cloud.documentai.v1.Processor.default_processor_version]. - // Format: `projects/{project}/locations/{location}/processors/{processor}`, - // or - // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "*" } - ]; - - // Whether human review should be skipped for this request. Default to - // `false`. - bool skip_human_review = 3; - - // Specifies which fields to include in the - // [ProcessResponse.document][google.cloud.documentai.v1.ProcessResponse.document] - // output. Only supports top-level document and pages field, so it must be in - // the form of `{document_field_name}` or `pages.{page_field_name}`. - google.protobuf.FieldMask field_mask = 6; - - // Inference-time options for the process API - ProcessOptions process_options = 7; - - // Optional. The labels with user-defined metadata for the request. - // - // Label keys and values can be no longer than 63 characters - // (Unicode codepoints) and can only contain lowercase letters, numeric - // characters, underscores, and dashes. International characters are allowed. - // Label values are optional. Label keys must start with a letter. - map labels = 10 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Option to remove images from the document. - bool imageless_mode = 11 [(google.api.field_behavior) = OPTIONAL]; -} - -// The status of human review on a processed document. -message HumanReviewStatus { - // The final state of human review on a processed document. - enum State { - // Human review state is unspecified. Most likely due to an internal error. - STATE_UNSPECIFIED = 0; - - // Human review is skipped for the document. This can happen because human - // review isn't enabled on the processor or the processing request has - // been set to skip this document. - SKIPPED = 1; - - // Human review validation is triggered and passed, so no review is needed. - VALIDATION_PASSED = 2; - - // Human review validation is triggered and the document is under review. - IN_PROGRESS = 3; - - // Some error happened during triggering human review, see the - // [state_message][google.cloud.documentai.v1.HumanReviewStatus.state_message] - // for details. - ERROR = 4; - } - - // The state of human review on the processing request. - State state = 1; - - // A message providing more details about the human review state. - string state_message = 2; - - // The name of the operation triggered by the processed document. This field - // is populated only when the - // [state][google.cloud.documentai.v1.HumanReviewStatus.state] is - // `HUMAN_REVIEW_IN_PROGRESS`. It has the same response type and metadata as - // the long-running operation returned by - // [ReviewDocument][google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument]. - string human_review_operation = 3; -} - -// Response message for the -// [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument] -// method. -message ProcessResponse { - // The document payload, will populate fields based on the processor's - // behavior. - Document document = 1; - - // The status of human review on the processed document. - HumanReviewStatus human_review_status = 3; -} - -// Request message for -// [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]. -message BatchProcessRequest { - // Required. The resource name of - // [Processor][google.cloud.documentai.v1.Processor] or - // [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. - // Format: `projects/{project}/locations/{location}/processors/{processor}`, - // or - // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "*" } - ]; - - // The input documents for the - // [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments] - // method. - BatchDocumentsInputConfig input_documents = 5; - - // The output configuration for the - // [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments] - // method. - DocumentOutputConfig document_output_config = 6; - - // Whether human review should be skipped for this request. Default to - // `false`. - bool skip_human_review = 4; - - // Inference-time options for the process API - ProcessOptions process_options = 7; - - // Optional. The labels with user-defined metadata for the request. - // - // Label keys and values can be no longer than 63 characters - // (Unicode codepoints) and can only contain lowercase letters, numeric - // characters, underscores, and dashes. International characters are allowed. - // Label values are optional. Label keys must start with a letter. - map labels = 9 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for -// [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]. -message BatchProcessResponse {} - -// The long-running operation metadata for -// [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]. -message BatchProcessMetadata { - // The status of a each individual document in the batch process. - message IndividualProcessStatus { - // The source of the document, same as the - // [input_gcs_source][google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.input_gcs_source] - // field in the request when the batch process started. - string input_gcs_source = 1; - - // The status processing the document. - google.rpc.Status status = 2; - - // The Cloud Storage output destination (in the request as - // [DocumentOutputConfig.GcsOutputConfig.gcs_uri][google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.gcs_uri]) - // of the processed document if it was successful, otherwise empty. - string output_gcs_destination = 3; - - // The status of human review on the processed document. - HumanReviewStatus human_review_status = 5; - } - - // Possible states of the batch processing operation. - enum State { - // The default value. This value is used if the state is omitted. - STATE_UNSPECIFIED = 0; - - // Request operation is waiting for scheduling. - WAITING = 1; - - // Request is being processed. - RUNNING = 2; - - // The batch processing completed successfully. - SUCCEEDED = 3; - - // The batch processing was being cancelled. - CANCELLING = 4; - - // The batch processing was cancelled. - CANCELLED = 5; - - // The batch processing has failed. - FAILED = 6; - } - - // The state of the current batch processing. - State state = 1; - - // A message providing more details about the current state of processing. - // For example, the error message if the operation is failed. - string state_message = 2; - - // The creation time of the operation. - google.protobuf.Timestamp create_time = 3; - - // The last update time of the operation. - google.protobuf.Timestamp update_time = 4; - - // The list of response details of each document. - repeated IndividualProcessStatus individual_process_statuses = 5; -} - -// Request message for the -// [FetchProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypes] -// method. Some processor types may require the project be added to an -// allowlist. -message FetchProcessorTypesRequest { - // Required. The location of processor types to list. - // Format: `projects/{project}/locations/{location}`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "documentai.googleapis.com/ProcessorType" - } - ]; -} - -// Response message for the -// [FetchProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypes] -// method. -message FetchProcessorTypesResponse { - // The list of processor types. - repeated ProcessorType processor_types = 1; -} - -// Request message for the -// [ListProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes] -// method. Some processor types may require the project be added to an -// allowlist. -message ListProcessorTypesRequest { - // Required. The location of processor types to list. - // Format: `projects/{project}/locations/{location}`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "documentai.googleapis.com/ProcessorType" - } - ]; - - // The maximum number of processor types to return. - // If unspecified, at most `100` processor types will be returned. - // The maximum value is `500`. Values above `500` will be coerced to `500`. - int32 page_size = 2; - - // Used to retrieve the next page of results, empty if at the end of the list. - string page_token = 3; -} - -// Response message for the -// [ListProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes] -// method. -message ListProcessorTypesResponse { - // The processor types. - repeated ProcessorType processor_types = 1; - - // Points to the next page, otherwise empty. - string next_page_token = 2; -} - -// Request message for list all processors belongs to a project. -message ListProcessorsRequest { - // Required. The parent (project and location) which owns this collection of - // Processors. Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "documentai.googleapis.com/Processor" - } - ]; - - // The maximum number of processors to return. - // If unspecified, at most `50` processors will be returned. - // The maximum value is `100`. Values above `100` will be coerced to `100`. - int32 page_size = 2; - - // We will return the processors sorted by creation time. The page token - // will point to the next processor. - string page_token = 3; -} - -// Response message for the -// [ListProcessors][google.cloud.documentai.v1.DocumentProcessorService.ListProcessors] -// method. -message ListProcessorsResponse { - // The list of processors. - repeated Processor processors = 1; - - // Points to the next processor, otherwise empty. - string next_page_token = 2; -} - -// Request message for the -// [GetProcessorType][google.cloud.documentai.v1.DocumentProcessorService.GetProcessorType] -// method. -message GetProcessorTypeRequest { - // Required. The processor type resource name. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "documentai.googleapis.com/ProcessorType" - } - ]; -} - -// Request message for the -// [GetProcessor][google.cloud.documentai.v1.DocumentProcessorService.GetProcessor] -// method. -message GetProcessorRequest { - // Required. The processor resource name. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "documentai.googleapis.com/Processor" - } - ]; -} - -// Request message for the -// [GetProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.GetProcessorVersion] -// method. -message GetProcessorVersionRequest { - // Required. The processor resource name. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "documentai.googleapis.com/ProcessorVersion" - } - ]; -} - -// Request message for list all processor versions belongs to a processor. -message ListProcessorVersionsRequest { - // Required. The parent (project, location and processor) to list all - // versions. Format: - // `projects/{project}/locations/{location}/processors/{processor}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "documentai.googleapis.com/ProcessorVersion" - } - ]; - - // The maximum number of processor versions to return. - // If unspecified, at most `10` processor versions will be returned. - // The maximum value is `20`. Values above `20` will be coerced to `20`. - int32 page_size = 2; - - // We will return the processor versions sorted by creation time. The page - // token will point to the next processor version. - string page_token = 3; -} - -// Response message for the -// [ListProcessorVersions][google.cloud.documentai.v1.DocumentProcessorService.ListProcessorVersions] -// method. -message ListProcessorVersionsResponse { - // The list of processors. - repeated ProcessorVersion processor_versions = 1; - - // Points to the next processor, otherwise empty. - string next_page_token = 2; -} - -// Request message for the -// [DeleteProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessorVersion] -// method. -message DeleteProcessorVersionRequest { - // Required. The processor version resource name to be deleted. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "documentai.googleapis.com/ProcessorVersion" - } - ]; -} - -// The long-running operation metadata for the -// [DeleteProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessorVersion] -// method. -message DeleteProcessorVersionMetadata { - // The basic metadata of the long-running operation. - CommonOperationMetadata common_metadata = 1; -} - -// Request message for the -// [DeployProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.DeployProcessorVersion] -// method. -message DeployProcessorVersionRequest { - // Required. The processor version resource name to be deployed. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "documentai.googleapis.com/ProcessorVersion" - } - ]; -} - -// Response message for the -// [DeployProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.DeployProcessorVersion] -// method. -message DeployProcessorVersionResponse {} - -// The long-running operation metadata for the -// [DeployProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.DeployProcessorVersion] -// method. -message DeployProcessorVersionMetadata { - // The basic metadata of the long-running operation. - CommonOperationMetadata common_metadata = 1; -} - -// Request message for the -// [UndeployProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.UndeployProcessorVersion] -// method. -message UndeployProcessorVersionRequest { - // Required. The processor version resource name to be undeployed. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "documentai.googleapis.com/ProcessorVersion" - } - ]; -} - -// Response message for the -// [UndeployProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.UndeployProcessorVersion] -// method. -message UndeployProcessorVersionResponse {} - -// The long-running operation metadata for the -// [UndeployProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.UndeployProcessorVersion] -// method. -message UndeployProcessorVersionMetadata { - // The basic metadata of the long-running operation. - CommonOperationMetadata common_metadata = 1; -} - -// Request message for the -// [CreateProcessor][google.cloud.documentai.v1.DocumentProcessorService.CreateProcessor] -// method. Notice this request is sent to a regionalized backend service. If the -// [ProcessorType][google.cloud.documentai.v1.ProcessorType] isn't available in -// that region, the creation fails. -message CreateProcessorRequest { - // Required. The parent (project and location) under which to create the - // processor. Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "documentai.googleapis.com/Processor" - } - ]; - - // Required. The processor to be created, requires - // [Processor.type][google.cloud.documentai.v1.Processor.type] and - // [Processor.display_name][google.cloud.documentai.v1.Processor.display_name] - // to be set. Also, the - // [Processor.kms_key_name][google.cloud.documentai.v1.Processor.kms_key_name] - // field must be set if the processor is under CMEK. - Processor processor = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for the -// [DeleteProcessor][google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessor] -// method. -message DeleteProcessorRequest { - // Required. The processor resource name to be deleted. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "documentai.googleapis.com/Processor" - } - ]; -} - -// The long-running operation metadata for the -// [DeleteProcessor][google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessor] -// method. -message DeleteProcessorMetadata { - // The basic metadata of the long-running operation. - CommonOperationMetadata common_metadata = 5; -} - -// Request message for the -// [EnableProcessor][google.cloud.documentai.v1.DocumentProcessorService.EnableProcessor] -// method. -message EnableProcessorRequest { - // Required. The processor resource name to be enabled. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "documentai.googleapis.com/Processor" - } - ]; -} - -// Response message for the -// [EnableProcessor][google.cloud.documentai.v1.DocumentProcessorService.EnableProcessor] -// method. Intentionally empty proto for adding fields in future. -message EnableProcessorResponse {} - -// The long-running operation metadata for the -// [EnableProcessor][google.cloud.documentai.v1.DocumentProcessorService.EnableProcessor] -// method. -message EnableProcessorMetadata { - // The basic metadata of the long-running operation. - CommonOperationMetadata common_metadata = 5; -} - -// Request message for the -// [DisableProcessor][google.cloud.documentai.v1.DocumentProcessorService.DisableProcessor] -// method. -message DisableProcessorRequest { - // Required. The processor resource name to be disabled. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "documentai.googleapis.com/Processor" - } - ]; -} - -// Response message for the -// [DisableProcessor][google.cloud.documentai.v1.DocumentProcessorService.DisableProcessor] -// method. Intentionally empty proto for adding fields in future. -message DisableProcessorResponse {} - -// The long-running operation metadata for the -// [DisableProcessor][google.cloud.documentai.v1.DocumentProcessorService.DisableProcessor] -// method. -message DisableProcessorMetadata { - // The basic metadata of the long-running operation. - CommonOperationMetadata common_metadata = 5; -} - -// Request message for the -// [SetDefaultProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.SetDefaultProcessorVersion] -// method. -message SetDefaultProcessorVersionRequest { - // Required. The resource name of the - // [Processor][google.cloud.documentai.v1.Processor] to change default - // version. - string processor = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "documentai.googleapis.com/Processor" - } - ]; - - // Required. The resource name of child - // [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to use as - // default. Format: - // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}` - string default_processor_version = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "documentai.googleapis.com/ProcessorVersion" - } - ]; -} - -// Response message for the -// [SetDefaultProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.SetDefaultProcessorVersion] -// method. -message SetDefaultProcessorVersionResponse {} - -// The long-running operation metadata for the -// [SetDefaultProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.SetDefaultProcessorVersion] -// method. -message SetDefaultProcessorVersionMetadata { - // The basic metadata of the long-running operation. - CommonOperationMetadata common_metadata = 1; -} - -// Request message for the -// [TrainProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.TrainProcessorVersion] -// method. -message TrainProcessorVersionRequest { - // The input data used to train a new - // [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. - message InputData { - // The documents used for training the new version. - BatchDocumentsInputConfig training_documents = 3; - - // The documents used for testing the trained version. - BatchDocumentsInputConfig test_documents = 4; - } - - // Options to control the training of the Custom Document Extraction (CDE) - // Processor. - message CustomDocumentExtractionOptions { - // Training Method for CDE. `TRAINING_METHOD_UNSPECIFIED` will fall back to - // `MODEL_BASED`. - enum TrainingMethod { - TRAINING_METHOD_UNSPECIFIED = 0; - - MODEL_BASED = 1; - - TEMPLATE_BASED = 2; - } - - // Optional. Training method to use for CDE training. - TrainingMethod training_method = 3 [(google.api.field_behavior) = OPTIONAL]; - } - - // Options to control foundation model tuning of the processor. - message FoundationModelTuningOptions { - // Optional. The number of steps to run for model tuning. Valid values are - // between 1 and 400. If not provided, recommended steps will be used. - int32 train_steps = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The multiplier to apply to the recommended learning rate. Valid - // values are between 0.1 and 10. If not provided, recommended learning rate - // will be used. - float learning_rate_multiplier = 3 [(google.api.field_behavior) = OPTIONAL]; - } - - oneof processor_flags { - // Options to control Custom Document Extraction (CDE) Processor. - CustomDocumentExtractionOptions custom_document_extraction_options = 5; - - // Options to control foundation model tuning of a processor. - FoundationModelTuningOptions foundation_model_tuning_options = 12; - } - - // Required. The parent (project, location and processor) to create the new - // version for. Format: - // `projects/{project}/locations/{location}/processors/{processor}`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "documentai.googleapis.com/Processor" - } - ]; - - // Required. The processor version to be created. - ProcessorVersion processor_version = 2 - [(google.api.field_behavior) = REQUIRED]; - - // Optional. The schema the processor version will be trained with. - DocumentSchema document_schema = 10 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The input data used to train the - // [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. - InputData input_data = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The processor version to use as a base for training. This - // processor version must be a child of `parent`. Format: - // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`. - string base_processor_version = 8 [(google.api.field_behavior) = OPTIONAL]; -} - -// The response for -// [TrainProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.TrainProcessorVersion]. -message TrainProcessorVersionResponse { - // The resource name of the processor version produced by training. - string processor_version = 1; -} - -// The metadata that represents a processor version being created. -message TrainProcessorVersionMetadata { - // The dataset validation information. - // This includes any and all errors with documents and the dataset. - message DatasetValidation { - // The total number of document errors. - int32 document_error_count = 3; - - // The total number of dataset errors. - int32 dataset_error_count = 4; - - // Error information pertaining to specific documents. A maximum of 10 - // document errors will be returned. - // Any document with errors will not be used throughout training. - repeated google.rpc.Status document_errors = 1; - - // Error information for the dataset as a whole. A maximum of 10 dataset - // errors will be returned. - // A single dataset error is terminal for training. - repeated google.rpc.Status dataset_errors = 2; - } - - // The basic metadata of the long-running operation. - CommonOperationMetadata common_metadata = 1; - - // The training dataset validation information. - DatasetValidation training_dataset_validation = 2; - - // The test dataset validation information. - DatasetValidation test_dataset_validation = 3; -} - -// Request message for the -// [ReviewDocument][google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument] -// method. -message ReviewDocumentRequest { - // The priority level of the human review task. - enum Priority { - // The default priority level. - DEFAULT = 0; - - // The urgent priority level. The labeling manager should allocate labeler - // resource to the urgent task queue to respect this priority level. - URGENT = 1; - } - - // The document payload. - oneof source { - // An inline document proto. - Document inline_document = 4; - } - - // Required. The resource name of the - // [HumanReviewConfig][google.cloud.documentai.v1.HumanReviewConfig] that the - // document will be reviewed with. - string human_review_config = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "documentai.googleapis.com/HumanReviewConfig" - } - ]; - - // Whether the validation should be performed on the ad-hoc review request. - bool enable_schema_validation = 3; - - // The priority of the human review task. - Priority priority = 5; - - // The document schema of the human review task. - DocumentSchema document_schema = 6; -} - -// Response message for the -// [ReviewDocument][google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument] -// method. -message ReviewDocumentResponse { - // Possible states of the review operation. - enum State { - // The default value. This value is used if the state is omitted. - STATE_UNSPECIFIED = 0; - - // The review operation is rejected by the reviewer. - REJECTED = 1; - - // The review operation is succeeded. - SUCCEEDED = 2; - } - - // The Cloud Storage uri for the human reviewed document if the review is - // succeeded. - string gcs_destination = 1; - - // The state of the review operation. - State state = 2; - - // The reason why the review is rejected by reviewer. - string rejection_reason = 3; -} - -// The long-running operation metadata for the -// [ReviewDocument][google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument] -// method. -message ReviewDocumentOperationMetadata { - // The basic metadata of the long-running operation. - CommonOperationMetadata common_metadata = 5; - - // The Crowd Compute question ID. - string question_id = 6; -} - -// Evaluates the given -// [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] against the -// supplied documents. -message EvaluateProcessorVersionRequest { - // Required. The resource name of the - // [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to - // evaluate. - // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - string processor_version = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "documentai.googleapis.com/ProcessorVersion" - } - ]; - - // Optional. The documents used in the evaluation. If unspecified, use the - // processor's dataset as evaluation input. - BatchDocumentsInputConfig evaluation_documents = 3 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Metadata of the -// [EvaluateProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.EvaluateProcessorVersion] -// method. -message EvaluateProcessorVersionMetadata { - // The basic metadata of the long-running operation. - CommonOperationMetadata common_metadata = 1; -} - -// Response of the -// [EvaluateProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.EvaluateProcessorVersion] -// method. -message EvaluateProcessorVersionResponse { - // The resource name of the created evaluation. - string evaluation = 2; -} - -// Retrieves a specific Evaluation. -message GetEvaluationRequest { - // Required. The resource name of the - // [Evaluation][google.cloud.documentai.v1.Evaluation] to get. - // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "documentai.googleapis.com/Evaluation" - } - ]; -} - -// Retrieves a list of evaluations for a given -// [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. -message ListEvaluationsRequest { - // Required. The resource name of the - // [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to list - // evaluations for. - // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "documentai.googleapis.com/ProcessorVersion" - } - ]; - - // The standard list page size. - // If unspecified, at most `5` evaluations are returned. - // The maximum value is `100`. Values above `100` are coerced to `100`. - int32 page_size = 2; - - // A page token, received from a previous `ListEvaluations` call. - // Provide this to retrieve the subsequent page. - string page_token = 3; -} - -// The response from `ListEvaluations`. -message ListEvaluationsResponse { - // The evaluations requested. - repeated Evaluation evaluations = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/document_schema.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/document_schema.proto deleted file mode 100644 index ad721141a6d..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/document_schema.proto +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright 2025 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.cloud.documentai.v1; - -option csharp_namespace = "Google.Cloud.DocumentAI.V1"; -option go_package = "cloud.google.com/go/documentai/apiv1/documentaipb;documentaipb"; -option java_multiple_files = true; -option java_outer_classname = "DocumentAiDocumentSchema"; -option java_package = "com.google.cloud.documentai.v1"; -option php_namespace = "Google\\Cloud\\DocumentAI\\V1"; -option ruby_package = "Google::Cloud::DocumentAI::V1"; - -// The schema defines the output of the processed document by a processor. -message DocumentSchema { - // EntityType is the wrapper of a label of the corresponding model with - // detailed attributes and limitations for entity-based processors. Multiple - // types can also compose a dependency tree to represent nested types. - message EntityType { - // Defines the a list of enum values. - message EnumValues { - // The individual values that this enum values type can include. - repeated string values = 1; - } - - // Defines properties that can be part of the entity type. - message Property { - // Types of occurrences of the entity type in the document. This - // represents the number of instances, not mentions, of an entity. - // For example, a bank statement might only have one - // `account_number`, but this account number can be mentioned in several - // places on the document. In this case, the `account_number` is - // considered a `REQUIRED_ONCE` entity type. If, on the other hand, we - // expect a bank statement to contain the status of multiple different - // accounts for the customers, the occurrence type is set to - // `REQUIRED_MULTIPLE`. - enum OccurrenceType { - // Unspecified occurrence type. - OCCURRENCE_TYPE_UNSPECIFIED = 0; - - // There will be zero or one instance of this entity type. The same - // entity instance may be mentioned multiple times. - OPTIONAL_ONCE = 1; - - // The entity type will appear zero or multiple times. - OPTIONAL_MULTIPLE = 2; - - // The entity type will only appear exactly once. The same - // entity instance may be mentioned multiple times. - REQUIRED_ONCE = 3; - - // The entity type will appear once or more times. - REQUIRED_MULTIPLE = 4; - } - - // Specifies how the entity's value is obtained from the document. - enum Method { - // Unspecified method. It defaults to `EXTRACT`. - METHOD_UNSPECIFIED = 0; - - // The entity's value is directly extracted as-is from the document - // text. - EXTRACT = 1; - - // The entity's value is derived through inference and is not - // necessarily an exact text extraction from the document. - DERIVE = 2; - } - - // The name of the property. Follows the same guidelines as the - // EntityType name. - string name = 1; - - // User defined name for the property. - string display_name = 6; - - // A reference to the value type of the property. This type is subject - // to the same conventions as the `Entity.base_types` field. - string value_type = 2; - - // Occurrence type limits the number of instances an entity type appears - // in the document. - OccurrenceType occurrence_type = 3; - - // Specifies how the entity's value is obtained. - Method method = 8; - } - - oneof value_source { - // If specified, lists all the possible values for this entity. This - // should not be more than a handful of values. If the number of values - // is >10 or could change frequently use the `EntityType.value_ontology` - // field and specify a list of all possible values in a value ontology - // file. - EnumValues enum_values = 14; - } - - // User defined name for the type. - string display_name = 13; - - // Name of the type. It must be unique within the schema file and - // cannot be a "Common Type". The following naming conventions are used: - // - // - Use `snake_casing`. - // - Name matching is case-sensitive. - // - Maximum 64 characters. - // - Must start with a letter. - // - Allowed characters: ASCII letters `[a-z0-9_-]`. (For backward - // compatibility internal infrastructure and tooling can handle any ascii - // character.) - // - The `/` is sometimes used to denote a property of a type. For example - // `line_item/amount`. This convention is deprecated, but will still be - // honored for backward compatibility. - string name = 1; - - // The entity type that this type is derived from. For now, one and only - // one should be set. - repeated string base_types = 2; - - // Description the nested structure, or composition of an entity. - repeated Property properties = 6; - } - - // Metadata for global schema behavior. - message Metadata { - // If true, a `document` entity type can be applied to subdocument - // (splitting). Otherwise, it can only be applied to the entire document - // (classification). - bool document_splitter = 1; - - // If true, on a given page, there can be multiple `document` annotations - // covering it. - bool document_allow_multiple_labels = 2; - - // If set, all the nested entities must be prefixed with the parents. - bool prefixed_naming_on_properties = 6; - - // If set, we will skip the naming format validation in the schema. So the - // string values in `DocumentSchema.EntityType.name` and - // `DocumentSchema.EntityType.Property.name` will not be checked. - bool skip_naming_validation = 7; - } - - // Display name to show to users. - string display_name = 1; - - // Description of the schema. - string description = 2; - - // Entity types of the schema. - repeated EntityType entity_types = 3; - - // Metadata of the schema. - Metadata metadata = 4; -} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/evaluation.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/evaluation.proto deleted file mode 100644 index 3ffc570703a..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/evaluation.proto +++ /dev/null @@ -1,182 +0,0 @@ -// Copyright 2025 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.cloud.documentai.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.DocumentAI.V1"; -option go_package = "cloud.google.com/go/documentai/apiv1/documentaipb;documentaipb"; -option java_multiple_files = true; -option java_outer_classname = "DocumentAiEvaluation"; -option java_package = "com.google.cloud.documentai.v1"; -option php_namespace = "Google\\Cloud\\DocumentAI\\V1"; -option ruby_package = "Google::Cloud::DocumentAI::V1"; - -// Gives a short summary of an evaluation, and links to the evaluation itself. -message EvaluationReference { - // The resource name of the Long Running Operation for the evaluation. - string operation = 1; - - // The resource name of the evaluation. - string evaluation = 2 [(google.api.resource_reference) = { - type: "documentai.googleapis.com/Evaluation" - }]; - - // An aggregate of the statistics for the evaluation with fuzzy matching on. - Evaluation.Metrics aggregate_metrics = 4; - - // An aggregate of the statistics for the evaluation with fuzzy matching off. - Evaluation.Metrics aggregate_metrics_exact = 5; -} - -// An evaluation of a ProcessorVersion's performance. -message Evaluation { - option (google.api.resource) = { - type: "documentai.googleapis.com/Evaluation" - pattern: "projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}" - }; - - // Evaluation counters for the documents that were used. - message Counters { - // How many documents were sent for evaluation. - int32 input_documents_count = 1; - - // How many documents were not included in the evaluation as they didn't - // pass validation. - int32 invalid_documents_count = 2; - - // How many documents were not included in the evaluation as Document AI - // failed to process them. - int32 failed_documents_count = 3; - - // How many documents were used in the evaluation. - int32 evaluated_documents_count = 4; - } - - // Evaluation metrics, either in aggregate or about a specific entity. - message Metrics { - // The calculated precision. - float precision = 1; - - // The calculated recall. - float recall = 2; - - // The calculated f1 score. - float f1_score = 3; - - // The amount of occurrences in predicted documents. - int32 predicted_occurrences_count = 4; - - // The amount of occurrences in ground truth documents. - int32 ground_truth_occurrences_count = 5; - - // The amount of documents with a predicted occurrence. - int32 predicted_document_count = 10; - - // The amount of documents with a ground truth occurrence. - int32 ground_truth_document_count = 11; - - // The amount of true positives. - int32 true_positives_count = 6; - - // The amount of false positives. - int32 false_positives_count = 7; - - // The amount of false negatives. - int32 false_negatives_count = 8; - - // The amount of documents that had an occurrence of this label. - int32 total_documents_count = 9; - } - - // Evaluations metrics, at a specific confidence level. - message ConfidenceLevelMetrics { - // The confidence level. - float confidence_level = 1; - - // The metrics at the specific confidence level. - Metrics metrics = 2; - } - - // Metrics across multiple confidence levels. - message MultiConfidenceMetrics { - // A type that determines how metrics should be interpreted. - enum MetricsType { - // The metrics type is unspecified. By default, metrics without a - // particular specification are for leaf entity types (i.e., top-level - // entity types without child types, or child types which are not - // parent types themselves). - METRICS_TYPE_UNSPECIFIED = 0; - - // Indicates whether metrics for this particular label type represent an - // aggregate of metrics for other types instead of being based on actual - // TP/FP/FN values for the label type. Metrics for parent (i.e., non-leaf) - // entity types are an aggregate of metrics for their children. - AGGREGATE = 1; - } - - // Metrics across confidence levels with fuzzy matching enabled. - repeated ConfidenceLevelMetrics confidence_level_metrics = 1; - - // Metrics across confidence levels with only exact matching. - repeated ConfidenceLevelMetrics confidence_level_metrics_exact = 4; - - // The calculated area under the precision recall curve (AUPRC), computed by - // integrating over all confidence thresholds. - float auprc = 2; - - // The Estimated Calibration Error (ECE) of the confidence of the predicted - // entities. - float estimated_calibration_error = 3; - - // The AUPRC for metrics with fuzzy matching disabled, i.e., exact matching - // only. - float auprc_exact = 5; - - // The ECE for the predicted entities with fuzzy matching disabled, i.e., - // exact matching only. - float estimated_calibration_error_exact = 6; - - // The metrics type for the label. - MetricsType metrics_type = 7; - } - - // The resource name of the evaluation. - // Format: - // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}` - string name = 1; - - // The time that the evaluation was created. - google.protobuf.Timestamp create_time = 2; - - // Counters for the documents used in the evaluation. - Counters document_counters = 5; - - // Metrics for all the entities in aggregate. - MultiConfidenceMetrics all_entities_metrics = 3; - - // Metrics across confidence levels, for different entities. - map entity_metrics = 4; - - // The KMS key name used for encryption. - string kms_key_name = 6; - - // The KMS key version with which data is encrypted. - string kms_key_version_name = 7; -} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/geometry.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/geometry.proto deleted file mode 100644 index b6715431b18..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/geometry.proto +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2025 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.cloud.documentai.v1; - -option csharp_namespace = "Google.Cloud.DocumentAI.V1"; -option go_package = "cloud.google.com/go/documentai/apiv1/documentaipb;documentaipb"; -option java_multiple_files = true; -option java_outer_classname = "GeometryProto"; -option java_package = "com.google.cloud.documentai.v1"; -option php_namespace = "Google\\Cloud\\DocumentAI\\V1"; -option ruby_package = "Google::Cloud::DocumentAI::V1"; - -// A vertex represents a 2D point in the image. -// NOTE: the vertex coordinates are in the same scale as the original image. -message Vertex { - // X coordinate. - int32 x = 1; - - // Y coordinate (starts from the top of the image). - int32 y = 2; -} - -// A vertex represents a 2D point in the image. -// NOTE: the normalized vertex coordinates are relative to the original image -// and range from 0 to 1. -message NormalizedVertex { - // X coordinate. - float x = 1; - - // Y coordinate (starts from the top of the image). - float y = 2; -} - -// A bounding polygon for the detected image annotation. -message BoundingPoly { - // The bounding polygon vertices. - repeated Vertex vertices = 1; - - // The bounding polygon normalized vertices. - repeated NormalizedVertex normalized_vertices = 2; -} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/operation_metadata.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/operation_metadata.proto deleted file mode 100644 index 0853e38ea8c..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/operation_metadata.proto +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2025 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.cloud.documentai.v1; - -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.DocumentAI.V1"; -option go_package = "cloud.google.com/go/documentai/apiv1/documentaipb;documentaipb"; -option java_multiple_files = true; -option java_outer_classname = "OperationMetadataProto"; -option java_package = "com.google.cloud.documentai.v1"; -option php_namespace = "Google\\Cloud\\DocumentAI\\V1"; -option ruby_package = "Google::Cloud::DocumentAI::V1"; - -// The common metadata for long running operations. -message CommonOperationMetadata { - // State of the longrunning operation. - enum State { - // Unspecified state. - STATE_UNSPECIFIED = 0; - - // Operation is still running. - RUNNING = 1; - - // Operation is being cancelled. - CANCELLING = 2; - - // Operation succeeded. - SUCCEEDED = 3; - - // Operation failed. - FAILED = 4; - - // Operation is cancelled. - CANCELLED = 5; - } - - // The state of the operation. - State state = 1; - - // A message providing more details about the current state of processing. - string state_message = 2; - - // A related resource to this operation. - string resource = 5; - - // The creation time of the operation. - google.protobuf.Timestamp create_time = 3; - - // The last update time of the operation. - google.protobuf.Timestamp update_time = 4; -} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/processor.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/processor.proto deleted file mode 100644 index 2306252d163..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/processor.proto +++ /dev/null @@ -1,297 +0,0 @@ -// Copyright 2025 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.cloud.documentai.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/documentai/v1/document_schema.proto"; -import "google/cloud/documentai/v1/evaluation.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.DocumentAI.V1"; -option go_package = "cloud.google.com/go/documentai/apiv1/documentaipb;documentaipb"; -option java_multiple_files = true; -option java_outer_classname = "DocumentAiProcessor"; -option java_package = "com.google.cloud.documentai.v1"; -option php_namespace = "Google\\Cloud\\DocumentAI\\V1"; -option ruby_package = "Google::Cloud::DocumentAI::V1"; - -// A processor version is an implementation of a processor. Each processor -// can have multiple versions, pretrained by Google internally or uptrained -// by the customer. A processor can only have one default version at a time. -// Its document-processing behavior is defined by that version. -message ProcessorVersion { - option (google.api.resource) = { - type: "documentai.googleapis.com/ProcessorVersion" - pattern: "projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}" - }; - - // Information about the upcoming deprecation of this processor version. - message DeprecationInfo { - // The time at which this processor version will be deprecated. - google.protobuf.Timestamp deprecation_time = 1; - - // If set, the processor version that will be used as a replacement. - string replacement_processor_version = 2 - [(google.api.resource_reference) = { - type: "documentai.googleapis.com/ProcessorVersion" - }]; - } - - // Information about Generative AI model-based processor versions. - message GenAiModelInfo { - // Information for a pretrained Google-managed foundation model. - message FoundationGenAiModelInfo { - // Whether finetuning is allowed for this base processor version. - bool finetuning_allowed = 1; - - // The minimum number of labeled documents in the training dataset - // required for finetuning. - int32 min_train_labeled_documents = 2; - } - - // Information for a custom Generative AI model created by the user. These - // are created with `Create New Version` in either the `Call foundation - // model` or `Fine tuning` tabs. - message CustomGenAiModelInfo { - // The type of custom model created by the user. - enum CustomModelType { - // The model type is unspecified. - CUSTOM_MODEL_TYPE_UNSPECIFIED = 0; - - // The model is a versioned foundation model. - VERSIONED_FOUNDATION = 1; - - // The model is a finetuned foundation model. - FINE_TUNED = 2; - } - - // The type of custom model created by the user. - CustomModelType custom_model_type = 1; - - // The base processor version ID for the custom model. - string base_processor_version_id = 2; - } - - // The processor version is either a pretrained Google-managed foundation - // model or a custom Generative AI model created by the user. - oneof model_info { - // Information for a pretrained Google-managed foundation model. - FoundationGenAiModelInfo foundation_gen_ai_model_info = 1; - - // Information for a custom Generative AI model created by the user. - CustomGenAiModelInfo custom_gen_ai_model_info = 2; - } - } - - // The possible states of the processor version. - enum State { - // The processor version is in an unspecified state. - STATE_UNSPECIFIED = 0; - - // The processor version is deployed and can be used for processing. - DEPLOYED = 1; - - // The processor version is being deployed. - DEPLOYING = 2; - - // The processor version is not deployed and cannot be used for processing. - UNDEPLOYED = 3; - - // The processor version is being undeployed. - UNDEPLOYING = 4; - - // The processor version is being created. - CREATING = 5; - - // The processor version is being deleted. - DELETING = 6; - - // The processor version failed and is in an indeterminate state. - FAILED = 7; - - // The processor version is being imported. - IMPORTING = 8; - } - - // The possible model types of the processor version. - enum ModelType { - // The processor version has unspecified model type. - MODEL_TYPE_UNSPECIFIED = 0; - - // The processor version has generative model type. - MODEL_TYPE_GENERATIVE = 1; - - // The processor version has custom model type. - MODEL_TYPE_CUSTOM = 2; - } - - // Identifier. The resource name of the processor version. - // Format: - // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}` - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // The display name of the processor version. - string display_name = 2; - - // Output only. The schema of the processor version. Describes the output. - DocumentSchema document_schema = 12 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The state of the processor version. - State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time the processor version was created. - google.protobuf.Timestamp create_time = 7 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The most recently invoked evaluation for the processor - // version. - EvaluationReference latest_evaluation = 8 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The KMS key name used for encryption. - string kms_key_name = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The KMS key version with which data is encrypted. - string kms_key_version_name = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Denotes that this `ProcessorVersion` is managed by Google. - bool google_managed = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. If set, information about the eventual deprecation of this - // version. - DeprecationInfo deprecation_info = 13 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The model type of this processor version. - ModelType model_type = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Reserved for future use. - bool satisfies_pzs = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Reserved for future use. - bool satisfies_pzi = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Information about Generative AI model-based processor - // versions. - GenAiModelInfo gen_ai_model_info = 18 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Contains the alias and the aliased resource name of processor version. -message ProcessorVersionAlias { - // The alias in the form of `processor_version` resource name. - string alias = 1; - - // The resource name of aliased processor version. - string processor_version = 2 [(google.api.resource_reference) = { - type: "documentai.googleapis.com/ProcessorVersion" - }]; -} - -// The first-class citizen for Document AI. Each processor defines how to -// extract structural information from a document. -message Processor { - option (google.api.resource) = { - type: "documentai.googleapis.com/Processor" - pattern: "projects/{project}/locations/{location}/processors/{processor}" - }; - - // The possible states of the processor. - enum State { - // The processor is in an unspecified state. - STATE_UNSPECIFIED = 0; - - // The processor is enabled, i.e., has an enabled version which can - // currently serve processing requests and all the feature dependencies have - // been successfully initialized. - ENABLED = 1; - - // The processor is disabled. - DISABLED = 2; - - // The processor is being enabled, will become `ENABLED` if successful. - ENABLING = 3; - - // The processor is being disabled, will become `DISABLED` if successful. - DISABLING = 4; - - // The processor is being created, will become either `ENABLED` (for - // successful creation) or `FAILED` (for failed ones). - // Once a processor is in this state, it can then be used for document - // processing, but the feature dependencies of the processor might not be - // fully created yet. - CREATING = 5; - - // The processor failed during creation or initialization of feature - // dependencies. The user should delete the processor and recreate one as - // all the functionalities of the processor are disabled. - FAILED = 6; - - // The processor is being deleted, will be removed if successful. - DELETING = 7; - } - - // Output only. Immutable. The resource name of the processor. - // Format: `projects/{project}/locations/{location}/processors/{processor}` - string name = 1 [ - (google.api.field_behavior) = IMMUTABLE, - (google.api.field_behavior) = OUTPUT_ONLY - ]; - - // The processor type, such as: `OCR_PROCESSOR`, `INVOICE_PROCESSOR`. - // To get a list of processor types, see - // [FetchProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypes]. - string type = 2; - - // The display name of the processor. - string display_name = 3; - - // Output only. The state of the processor. - State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The default processor version. - string default_processor_version = 9 [(google.api.resource_reference) = { - type: "documentai.googleapis.com/ProcessorVersion" - }]; - - // Output only. The processor version aliases. - repeated ProcessorVersionAlias processor_version_aliases = 10 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Immutable. The http endpoint that can be called to invoke - // processing. - string process_endpoint = 6 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.field_behavior) = IMMUTABLE - ]; - - // Output only. The time the processor was created. - google.protobuf.Timestamp create_time = 7 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The [KMS key](https://cloud.google.com/security-key-management) used for - // encryption and decryption in CMEK scenarios. - string kms_key_name = 8; - - // Output only. Reserved for future use. - bool satisfies_pzs = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Reserved for future use. - bool satisfies_pzi = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/processor_type.proto b/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/processor_type.proto deleted file mode 100644 index 19ae44ee1f8..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/processor_type.proto +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2025 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.cloud.documentai.v1; - -import "google/api/launch_stage.proto"; -import "google/api/resource.proto"; - -option csharp_namespace = "Google.Cloud.DocumentAI.V1"; -option go_package = "cloud.google.com/go/documentai/apiv1/documentaipb;documentaipb"; -option java_multiple_files = true; -option java_outer_classname = "DocumentAiProcessorType"; -option java_package = "com.google.cloud.documentai.v1"; -option php_namespace = "Google\\Cloud\\DocumentAI\\V1"; -option ruby_package = "Google::Cloud::DocumentAI::V1"; - -// A processor type is responsible for performing a certain document -// understanding task on a certain type of document. -message ProcessorType { - option (google.api.resource) = { - type: "documentai.googleapis.com/ProcessorType" - pattern: "projects/{project}/locations/{location}/processorTypes/{processor_type}" - }; - - // The location information about where the processor is available. - message LocationInfo { - // The location ID. For supported locations, refer to [regional and - // multi-regional support](/document-ai/docs/regions). - string location_id = 1; - } - - // The resource name of the processor type. - // Format: `projects/{project}/processorTypes/{processor_type}` - string name = 1; - - // The processor type, such as: `OCR_PROCESSOR`, `INVOICE_PROCESSOR`. - string type = 2; - - // The processor category, used by UI to group processor types. - string category = 3; - - // The locations in which this processor is available. - repeated LocationInfo available_locations = 4; - - // Whether the processor type allows creation. If true, users can create a - // processor of this processor type. Otherwise, users need to request access. - bool allow_creation = 6; - - // Launch stage of the processor type - google.api.LaunchStage launch_stage = 8; - - // A set of Cloud Storage URIs of sample documents for this processor. - repeated string sample_document_uris = 9; -} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/protos.d.ts b/owl-bot-staging/google-cloud-contentwarehouse/protos/protos.d.ts deleted file mode 100644 index 1c4cee39fe7..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/protos/protos.d.ts +++ /dev/null @@ -1,30589 +0,0 @@ -// Copyright 2026 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 type {protobuf as $protobuf} from "google-gax"; -import Long = require("long"); -/** Namespace google. */ -export namespace google { - - /** Namespace cloud. */ - namespace cloud { - - /** Namespace contentwarehouse. */ - namespace contentwarehouse { - - /** Namespace v1. */ - namespace v1 { - - /** Properties of a CreateDocumentMetadata. */ - interface ICreateDocumentMetadata { - } - - /** Represents a CreateDocumentMetadata. */ - class CreateDocumentMetadata implements ICreateDocumentMetadata { - - /** - * Constructs a new CreateDocumentMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.ICreateDocumentMetadata); - - /** - * Creates a new CreateDocumentMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateDocumentMetadata instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.ICreateDocumentMetadata): google.cloud.contentwarehouse.v1.CreateDocumentMetadata; - - /** - * Encodes the specified CreateDocumentMetadata message. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateDocumentMetadata.verify|verify} messages. - * @param message CreateDocumentMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.ICreateDocumentMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateDocumentMetadata message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateDocumentMetadata.verify|verify} messages. - * @param message CreateDocumentMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.ICreateDocumentMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateDocumentMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateDocumentMetadata - * @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.cloud.contentwarehouse.v1.CreateDocumentMetadata; - - /** - * Decodes a CreateDocumentMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateDocumentMetadata - * @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.cloud.contentwarehouse.v1.CreateDocumentMetadata; - - /** - * Verifies a CreateDocumentMetadata 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 CreateDocumentMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateDocumentMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.CreateDocumentMetadata; - - /** - * Creates a plain object from a CreateDocumentMetadata message. Also converts values to other types if specified. - * @param message CreateDocumentMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.CreateDocumentMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateDocumentMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateDocumentMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateDocumentMetadata. */ - interface IUpdateDocumentMetadata { - } - - /** Represents an UpdateDocumentMetadata. */ - class UpdateDocumentMetadata implements IUpdateDocumentMetadata { - - /** - * Constructs a new UpdateDocumentMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IUpdateDocumentMetadata); - - /** - * Creates a new UpdateDocumentMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateDocumentMetadata instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IUpdateDocumentMetadata): google.cloud.contentwarehouse.v1.UpdateDocumentMetadata; - - /** - * Encodes the specified UpdateDocumentMetadata message. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateDocumentMetadata.verify|verify} messages. - * @param message UpdateDocumentMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IUpdateDocumentMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateDocumentMetadata message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateDocumentMetadata.verify|verify} messages. - * @param message UpdateDocumentMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IUpdateDocumentMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateDocumentMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateDocumentMetadata - * @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.cloud.contentwarehouse.v1.UpdateDocumentMetadata; - - /** - * Decodes an UpdateDocumentMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateDocumentMetadata - * @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.cloud.contentwarehouse.v1.UpdateDocumentMetadata; - - /** - * Verifies an UpdateDocumentMetadata 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 UpdateDocumentMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateDocumentMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.UpdateDocumentMetadata; - - /** - * Creates a plain object from an UpdateDocumentMetadata message. Also converts values to other types if specified. - * @param message UpdateDocumentMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.UpdateDocumentMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateDocumentMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateDocumentMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RequestMetadata. */ - interface IRequestMetadata { - - /** RequestMetadata userInfo */ - userInfo?: (google.cloud.contentwarehouse.v1.IUserInfo|null); - } - - /** Represents a RequestMetadata. */ - class RequestMetadata implements IRequestMetadata { - - /** - * Constructs a new RequestMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IRequestMetadata); - - /** RequestMetadata userInfo. */ - public userInfo?: (google.cloud.contentwarehouse.v1.IUserInfo|null); - - /** - * Creates a new RequestMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns RequestMetadata instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IRequestMetadata): google.cloud.contentwarehouse.v1.RequestMetadata; - - /** - * Encodes the specified RequestMetadata message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RequestMetadata.verify|verify} messages. - * @param message RequestMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IRequestMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RequestMetadata message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RequestMetadata.verify|verify} messages. - * @param message RequestMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IRequestMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RequestMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RequestMetadata - * @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.cloud.contentwarehouse.v1.RequestMetadata; - - /** - * Decodes a RequestMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RequestMetadata - * @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.cloud.contentwarehouse.v1.RequestMetadata; - - /** - * Verifies a RequestMetadata 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 RequestMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RequestMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.RequestMetadata; - - /** - * Creates a plain object from a RequestMetadata message. Also converts values to other types if specified. - * @param message RequestMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.RequestMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RequestMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RequestMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ResponseMetadata. */ - interface IResponseMetadata { - - /** ResponseMetadata requestId */ - requestId?: (string|null); - } - - /** Represents a ResponseMetadata. */ - class ResponseMetadata implements IResponseMetadata { - - /** - * Constructs a new ResponseMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IResponseMetadata); - - /** ResponseMetadata requestId. */ - public requestId: string; - - /** - * Creates a new ResponseMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns ResponseMetadata instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IResponseMetadata): google.cloud.contentwarehouse.v1.ResponseMetadata; - - /** - * Encodes the specified ResponseMetadata message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ResponseMetadata.verify|verify} messages. - * @param message ResponseMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IResponseMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResponseMetadata message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ResponseMetadata.verify|verify} messages. - * @param message ResponseMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IResponseMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResponseMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResponseMetadata - * @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.cloud.contentwarehouse.v1.ResponseMetadata; - - /** - * Decodes a ResponseMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResponseMetadata - * @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.cloud.contentwarehouse.v1.ResponseMetadata; - - /** - * Verifies a ResponseMetadata 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 ResponseMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResponseMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.ResponseMetadata; - - /** - * Creates a plain object from a ResponseMetadata message. Also converts values to other types if specified. - * @param message ResponseMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.ResponseMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResponseMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResponseMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a UserInfo. */ - interface IUserInfo { - - /** UserInfo id */ - id?: (string|null); - - /** UserInfo groupIds */ - groupIds?: (string[]|null); - } - - /** Represents a UserInfo. */ - class UserInfo implements IUserInfo { - - /** - * Constructs a new UserInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IUserInfo); - - /** UserInfo id. */ - public id: string; - - /** UserInfo groupIds. */ - public groupIds: string[]; - - /** - * Creates a new UserInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns UserInfo instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IUserInfo): google.cloud.contentwarehouse.v1.UserInfo; - - /** - * Encodes the specified UserInfo message. Does not implicitly {@link google.cloud.contentwarehouse.v1.UserInfo.verify|verify} messages. - * @param message UserInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IUserInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UserInfo message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.UserInfo.verify|verify} messages. - * @param message UserInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IUserInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a UserInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UserInfo - * @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.cloud.contentwarehouse.v1.UserInfo; - - /** - * Decodes a UserInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UserInfo - * @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.cloud.contentwarehouse.v1.UserInfo; - - /** - * Verifies a UserInfo 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 UserInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UserInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.UserInfo; - - /** - * Creates a plain object from a UserInfo message. Also converts values to other types if specified. - * @param message UserInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.UserInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UserInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UserInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateOptions. */ - interface IUpdateOptions { - - /** UpdateOptions updateType */ - updateType?: (google.cloud.contentwarehouse.v1.UpdateType|keyof typeof google.cloud.contentwarehouse.v1.UpdateType|null); - - /** UpdateOptions updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateOptions mergeFieldsOptions */ - mergeFieldsOptions?: (google.cloud.contentwarehouse.v1.IMergeFieldsOptions|null); - } - - /** Represents an UpdateOptions. */ - class UpdateOptions implements IUpdateOptions { - - /** - * Constructs a new UpdateOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IUpdateOptions); - - /** UpdateOptions updateType. */ - public updateType: (google.cloud.contentwarehouse.v1.UpdateType|keyof typeof google.cloud.contentwarehouse.v1.UpdateType); - - /** UpdateOptions updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateOptions mergeFieldsOptions. */ - public mergeFieldsOptions?: (google.cloud.contentwarehouse.v1.IMergeFieldsOptions|null); - - /** - * Creates a new UpdateOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateOptions instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IUpdateOptions): google.cloud.contentwarehouse.v1.UpdateOptions; - - /** - * Encodes the specified UpdateOptions message. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateOptions.verify|verify} messages. - * @param message UpdateOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IUpdateOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateOptions message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateOptions.verify|verify} messages. - * @param message UpdateOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IUpdateOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateOptions - * @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.cloud.contentwarehouse.v1.UpdateOptions; - - /** - * Decodes an UpdateOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateOptions - * @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.cloud.contentwarehouse.v1.UpdateOptions; - - /** - * Verifies an UpdateOptions 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 UpdateOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateOptions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.UpdateOptions; - - /** - * Creates a plain object from an UpdateOptions message. Also converts values to other types if specified. - * @param message UpdateOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.UpdateOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MergeFieldsOptions. */ - interface IMergeFieldsOptions { - - /** MergeFieldsOptions replaceMessageFields */ - replaceMessageFields?: (boolean|null); - - /** MergeFieldsOptions replaceRepeatedFields */ - replaceRepeatedFields?: (boolean|null); - } - - /** Represents a MergeFieldsOptions. */ - class MergeFieldsOptions implements IMergeFieldsOptions { - - /** - * Constructs a new MergeFieldsOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IMergeFieldsOptions); - - /** MergeFieldsOptions replaceMessageFields. */ - public replaceMessageFields?: (boolean|null); - - /** MergeFieldsOptions replaceRepeatedFields. */ - public replaceRepeatedFields?: (boolean|null); - - /** - * Creates a new MergeFieldsOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns MergeFieldsOptions instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IMergeFieldsOptions): google.cloud.contentwarehouse.v1.MergeFieldsOptions; - - /** - * Encodes the specified MergeFieldsOptions message. Does not implicitly {@link google.cloud.contentwarehouse.v1.MergeFieldsOptions.verify|verify} messages. - * @param message MergeFieldsOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IMergeFieldsOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MergeFieldsOptions message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.MergeFieldsOptions.verify|verify} messages. - * @param message MergeFieldsOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IMergeFieldsOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MergeFieldsOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MergeFieldsOptions - * @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.cloud.contentwarehouse.v1.MergeFieldsOptions; - - /** - * Decodes a MergeFieldsOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MergeFieldsOptions - * @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.cloud.contentwarehouse.v1.MergeFieldsOptions; - - /** - * Verifies a MergeFieldsOptions 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 MergeFieldsOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MergeFieldsOptions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.MergeFieldsOptions; - - /** - * Creates a plain object from a MergeFieldsOptions message. Also converts values to other types if specified. - * @param message MergeFieldsOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.MergeFieldsOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MergeFieldsOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MergeFieldsOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** UpdateType enum. */ - enum UpdateType { - UPDATE_TYPE_UNSPECIFIED = 0, - UPDATE_TYPE_REPLACE = 1, - UPDATE_TYPE_MERGE = 2, - UPDATE_TYPE_INSERT_PROPERTIES_BY_NAMES = 3, - UPDATE_TYPE_REPLACE_PROPERTIES_BY_NAMES = 4, - UPDATE_TYPE_DELETE_PROPERTIES_BY_NAMES = 5, - UPDATE_TYPE_MERGE_AND_REPLACE_OR_INSERT_PROPERTIES_BY_NAMES = 6 - } - - /** DatabaseType enum. */ - enum DatabaseType { - DB_UNKNOWN = 0, - DB_INFRA_SPANNER = 1, - DB_CLOUD_SQL_POSTGRES = 2 - } - - /** AccessControlMode enum. */ - enum AccessControlMode { - ACL_MODE_UNKNOWN = 0, - ACL_MODE_UNIVERSAL_ACCESS = 1, - ACL_MODE_DOCUMENT_LEVEL_ACCESS_CONTROL_BYOID = 2, - ACL_MODE_DOCUMENT_LEVEL_ACCESS_CONTROL_GCI = 3 - } - - /** DocumentCreatorDefaultRole enum. */ - enum DocumentCreatorDefaultRole { - DOCUMENT_CREATOR_DEFAULT_ROLE_UNSPECIFIED = 0, - DOCUMENT_ADMIN = 1, - DOCUMENT_EDITOR = 2, - DOCUMENT_VIEWER = 3 - } - - /** Properties of a Document. */ - interface IDocument { - - /** Document name */ - name?: (string|null); - - /** Document referenceId */ - referenceId?: (string|null); - - /** Document displayName */ - displayName?: (string|null); - - /** Document title */ - title?: (string|null); - - /** Document displayUri */ - displayUri?: (string|null); - - /** Document documentSchemaName */ - documentSchemaName?: (string|null); - - /** Document plainText */ - plainText?: (string|null); - - /** Document cloudAiDocument */ - cloudAiDocument?: (google.cloud.documentai.v1.IDocument|null); - - /** Document structuredContentUri */ - structuredContentUri?: (string|null); - - /** Document rawDocumentPath */ - rawDocumentPath?: (string|null); - - /** Document inlineRawDocument */ - inlineRawDocument?: (Uint8Array|Buffer|string|null); - - /** Document properties */ - properties?: (google.cloud.contentwarehouse.v1.IProperty[]|null); - - /** Document updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Document createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Document rawDocumentFileType */ - rawDocumentFileType?: (google.cloud.contentwarehouse.v1.RawDocumentFileType|keyof typeof google.cloud.contentwarehouse.v1.RawDocumentFileType|null); - - /** Document asyncEnabled */ - asyncEnabled?: (boolean|null); - - /** Document contentCategory */ - contentCategory?: (google.cloud.contentwarehouse.v1.ContentCategory|keyof typeof google.cloud.contentwarehouse.v1.ContentCategory|null); - - /** Document textExtractionDisabled */ - textExtractionDisabled?: (boolean|null); - - /** Document textExtractionEnabled */ - textExtractionEnabled?: (boolean|null); - - /** Document creator */ - creator?: (string|null); - - /** Document updater */ - updater?: (string|null); - - /** Document dispositionTime */ - dispositionTime?: (google.protobuf.ITimestamp|null); - - /** Document legalHold */ - legalHold?: (boolean|null); - } - - /** Represents a Document. */ - class Document implements IDocument { - - /** - * Constructs a new Document. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IDocument); - - /** Document name. */ - public name: string; - - /** Document referenceId. */ - public referenceId: string; - - /** Document displayName. */ - public displayName: string; - - /** Document title. */ - public title: string; - - /** Document displayUri. */ - public displayUri: string; - - /** Document documentSchemaName. */ - public documentSchemaName: string; - - /** Document plainText. */ - public plainText?: (string|null); - - /** Document cloudAiDocument. */ - public cloudAiDocument?: (google.cloud.documentai.v1.IDocument|null); - - /** Document structuredContentUri. */ - public structuredContentUri: string; - - /** Document rawDocumentPath. */ - public rawDocumentPath?: (string|null); - - /** Document inlineRawDocument. */ - public inlineRawDocument?: (Uint8Array|Buffer|string|null); - - /** Document properties. */ - public properties: google.cloud.contentwarehouse.v1.IProperty[]; - - /** Document updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Document createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Document rawDocumentFileType. */ - public rawDocumentFileType: (google.cloud.contentwarehouse.v1.RawDocumentFileType|keyof typeof google.cloud.contentwarehouse.v1.RawDocumentFileType); - - /** Document asyncEnabled. */ - public asyncEnabled: boolean; - - /** Document contentCategory. */ - public contentCategory: (google.cloud.contentwarehouse.v1.ContentCategory|keyof typeof google.cloud.contentwarehouse.v1.ContentCategory); - - /** Document textExtractionDisabled. */ - public textExtractionDisabled: boolean; - - /** Document textExtractionEnabled. */ - public textExtractionEnabled: boolean; - - /** Document creator. */ - public creator: string; - - /** Document updater. */ - public updater: string; - - /** Document dispositionTime. */ - public dispositionTime?: (google.protobuf.ITimestamp|null); - - /** Document legalHold. */ - public legalHold: boolean; - - /** Document structuredContent. */ - public structuredContent?: ("plainText"|"cloudAiDocument"); - - /** Document rawDocument. */ - public rawDocument?: ("rawDocumentPath"|"inlineRawDocument"); - - /** - * Creates a new Document instance using the specified properties. - * @param [properties] Properties to set - * @returns Document instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IDocument): google.cloud.contentwarehouse.v1.Document; - - /** - * Encodes the specified Document message. Does not implicitly {@link google.cloud.contentwarehouse.v1.Document.verify|verify} messages. - * @param message Document message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IDocument, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Document message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.Document.verify|verify} messages. - * @param message Document message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IDocument, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Document message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Document - * @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.cloud.contentwarehouse.v1.Document; - - /** - * Decodes a Document message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Document - * @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.cloud.contentwarehouse.v1.Document; - - /** - * Verifies a Document 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 Document message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Document - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.Document; - - /** - * Creates a plain object from a Document message. Also converts values to other types if specified. - * @param message Document - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.Document, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Document to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Document - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DocumentReference. */ - interface IDocumentReference { - - /** DocumentReference documentName */ - documentName?: (string|null); - - /** DocumentReference displayName */ - displayName?: (string|null); - - /** DocumentReference snippet */ - snippet?: (string|null); - - /** DocumentReference documentIsFolder */ - documentIsFolder?: (boolean|null); - - /** DocumentReference updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** DocumentReference createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** DocumentReference deleteTime */ - deleteTime?: (google.protobuf.ITimestamp|null); - - /** DocumentReference documentIsRetentionFolder */ - documentIsRetentionFolder?: (boolean|null); - - /** DocumentReference documentIsLegalHoldFolder */ - documentIsLegalHoldFolder?: (boolean|null); - } - - /** Represents a DocumentReference. */ - class DocumentReference implements IDocumentReference { - - /** - * Constructs a new DocumentReference. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IDocumentReference); - - /** DocumentReference documentName. */ - public documentName: string; - - /** DocumentReference displayName. */ - public displayName: string; - - /** DocumentReference snippet. */ - public snippet: string; - - /** DocumentReference documentIsFolder. */ - public documentIsFolder: boolean; - - /** DocumentReference updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** DocumentReference createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** DocumentReference deleteTime. */ - public deleteTime?: (google.protobuf.ITimestamp|null); - - /** DocumentReference documentIsRetentionFolder. */ - public documentIsRetentionFolder: boolean; - - /** DocumentReference documentIsLegalHoldFolder. */ - public documentIsLegalHoldFolder: boolean; - - /** - * Creates a new DocumentReference instance using the specified properties. - * @param [properties] Properties to set - * @returns DocumentReference instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IDocumentReference): google.cloud.contentwarehouse.v1.DocumentReference; - - /** - * Encodes the specified DocumentReference message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DocumentReference.verify|verify} messages. - * @param message DocumentReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IDocumentReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DocumentReference message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DocumentReference.verify|verify} messages. - * @param message DocumentReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IDocumentReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DocumentReference message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DocumentReference - * @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.cloud.contentwarehouse.v1.DocumentReference; - - /** - * Decodes a DocumentReference message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DocumentReference - * @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.cloud.contentwarehouse.v1.DocumentReference; - - /** - * Verifies a DocumentReference 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 DocumentReference message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DocumentReference - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.DocumentReference; - - /** - * Creates a plain object from a DocumentReference message. Also converts values to other types if specified. - * @param message DocumentReference - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.DocumentReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DocumentReference to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DocumentReference - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Property. */ - interface IProperty { - - /** Property name */ - name?: (string|null); - - /** Property integerValues */ - integerValues?: (google.cloud.contentwarehouse.v1.IIntegerArray|null); - - /** Property floatValues */ - floatValues?: (google.cloud.contentwarehouse.v1.IFloatArray|null); - - /** Property textValues */ - textValues?: (google.cloud.contentwarehouse.v1.ITextArray|null); - - /** Property enumValues */ - enumValues?: (google.cloud.contentwarehouse.v1.IEnumArray|null); - - /** Property propertyValues */ - propertyValues?: (google.cloud.contentwarehouse.v1.IPropertyArray|null); - - /** Property dateTimeValues */ - dateTimeValues?: (google.cloud.contentwarehouse.v1.IDateTimeArray|null); - - /** Property mapProperty */ - mapProperty?: (google.cloud.contentwarehouse.v1.IMapProperty|null); - - /** Property timestampValues */ - timestampValues?: (google.cloud.contentwarehouse.v1.ITimestampArray|null); - } - - /** Represents a Property. */ - class Property implements IProperty { - - /** - * Constructs a new Property. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IProperty); - - /** Property name. */ - public name: string; - - /** Property integerValues. */ - public integerValues?: (google.cloud.contentwarehouse.v1.IIntegerArray|null); - - /** Property floatValues. */ - public floatValues?: (google.cloud.contentwarehouse.v1.IFloatArray|null); - - /** Property textValues. */ - public textValues?: (google.cloud.contentwarehouse.v1.ITextArray|null); - - /** Property enumValues. */ - public enumValues?: (google.cloud.contentwarehouse.v1.IEnumArray|null); - - /** Property propertyValues. */ - public propertyValues?: (google.cloud.contentwarehouse.v1.IPropertyArray|null); - - /** Property dateTimeValues. */ - public dateTimeValues?: (google.cloud.contentwarehouse.v1.IDateTimeArray|null); - - /** Property mapProperty. */ - public mapProperty?: (google.cloud.contentwarehouse.v1.IMapProperty|null); - - /** Property timestampValues. */ - public timestampValues?: (google.cloud.contentwarehouse.v1.ITimestampArray|null); - - /** Property values. */ - public values?: ("integerValues"|"floatValues"|"textValues"|"enumValues"|"propertyValues"|"dateTimeValues"|"mapProperty"|"timestampValues"); - - /** - * Creates a new Property instance using the specified properties. - * @param [properties] Properties to set - * @returns Property instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IProperty): google.cloud.contentwarehouse.v1.Property; - - /** - * Encodes the specified Property message. Does not implicitly {@link google.cloud.contentwarehouse.v1.Property.verify|verify} messages. - * @param message Property message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IProperty, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Property message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.Property.verify|verify} messages. - * @param message Property message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IProperty, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Property message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Property - * @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.cloud.contentwarehouse.v1.Property; - - /** - * Decodes a Property message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Property - * @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.cloud.contentwarehouse.v1.Property; - - /** - * Verifies a Property 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 Property message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Property - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.Property; - - /** - * Creates a plain object from a Property message. Also converts values to other types if specified. - * @param message Property - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.Property, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Property to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Property - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an IntegerArray. */ - interface IIntegerArray { - - /** IntegerArray values */ - values?: (number[]|null); - } - - /** Represents an IntegerArray. */ - class IntegerArray implements IIntegerArray { - - /** - * Constructs a new IntegerArray. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IIntegerArray); - - /** IntegerArray values. */ - public values: number[]; - - /** - * Creates a new IntegerArray instance using the specified properties. - * @param [properties] Properties to set - * @returns IntegerArray instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IIntegerArray): google.cloud.contentwarehouse.v1.IntegerArray; - - /** - * Encodes the specified IntegerArray message. Does not implicitly {@link google.cloud.contentwarehouse.v1.IntegerArray.verify|verify} messages. - * @param message IntegerArray message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IIntegerArray, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified IntegerArray message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.IntegerArray.verify|verify} messages. - * @param message IntegerArray message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IIntegerArray, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an IntegerArray message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IntegerArray - * @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.cloud.contentwarehouse.v1.IntegerArray; - - /** - * Decodes an IntegerArray message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IntegerArray - * @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.cloud.contentwarehouse.v1.IntegerArray; - - /** - * Verifies an IntegerArray 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 IntegerArray message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IntegerArray - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.IntegerArray; - - /** - * Creates a plain object from an IntegerArray message. Also converts values to other types if specified. - * @param message IntegerArray - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.IntegerArray, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IntegerArray to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for IntegerArray - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FloatArray. */ - interface IFloatArray { - - /** FloatArray values */ - values?: (number[]|null); - } - - /** Represents a FloatArray. */ - class FloatArray implements IFloatArray { - - /** - * Constructs a new FloatArray. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IFloatArray); - - /** FloatArray values. */ - public values: number[]; - - /** - * Creates a new FloatArray instance using the specified properties. - * @param [properties] Properties to set - * @returns FloatArray instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IFloatArray): google.cloud.contentwarehouse.v1.FloatArray; - - /** - * Encodes the specified FloatArray message. Does not implicitly {@link google.cloud.contentwarehouse.v1.FloatArray.verify|verify} messages. - * @param message FloatArray message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IFloatArray, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FloatArray message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.FloatArray.verify|verify} messages. - * @param message FloatArray message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IFloatArray, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FloatArray message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FloatArray - * @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.cloud.contentwarehouse.v1.FloatArray; - - /** - * Decodes a FloatArray message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FloatArray - * @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.cloud.contentwarehouse.v1.FloatArray; - - /** - * Verifies a FloatArray 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 FloatArray message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FloatArray - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.FloatArray; - - /** - * Creates a plain object from a FloatArray message. Also converts values to other types if specified. - * @param message FloatArray - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.FloatArray, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FloatArray to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FloatArray - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TextArray. */ - interface ITextArray { - - /** TextArray values */ - values?: (string[]|null); - } - - /** Represents a TextArray. */ - class TextArray implements ITextArray { - - /** - * Constructs a new TextArray. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.ITextArray); - - /** TextArray values. */ - public values: string[]; - - /** - * Creates a new TextArray instance using the specified properties. - * @param [properties] Properties to set - * @returns TextArray instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.ITextArray): google.cloud.contentwarehouse.v1.TextArray; - - /** - * Encodes the specified TextArray message. Does not implicitly {@link google.cloud.contentwarehouse.v1.TextArray.verify|verify} messages. - * @param message TextArray message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.ITextArray, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TextArray message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.TextArray.verify|verify} messages. - * @param message TextArray message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.ITextArray, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TextArray message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TextArray - * @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.cloud.contentwarehouse.v1.TextArray; - - /** - * Decodes a TextArray message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TextArray - * @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.cloud.contentwarehouse.v1.TextArray; - - /** - * Verifies a TextArray 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 TextArray message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TextArray - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.TextArray; - - /** - * Creates a plain object from a TextArray message. Also converts values to other types if specified. - * @param message TextArray - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.TextArray, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TextArray to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TextArray - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumArray. */ - interface IEnumArray { - - /** EnumArray values */ - values?: (string[]|null); - } - - /** Represents an EnumArray. */ - class EnumArray implements IEnumArray { - - /** - * Constructs a new EnumArray. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IEnumArray); - - /** EnumArray values. */ - public values: string[]; - - /** - * Creates a new EnumArray instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumArray instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IEnumArray): google.cloud.contentwarehouse.v1.EnumArray; - - /** - * Encodes the specified EnumArray message. Does not implicitly {@link google.cloud.contentwarehouse.v1.EnumArray.verify|verify} messages. - * @param message EnumArray message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IEnumArray, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumArray message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.EnumArray.verify|verify} messages. - * @param message EnumArray message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IEnumArray, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumArray message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumArray - * @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.cloud.contentwarehouse.v1.EnumArray; - - /** - * Decodes an EnumArray message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumArray - * @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.cloud.contentwarehouse.v1.EnumArray; - - /** - * Verifies an EnumArray 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 EnumArray message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumArray - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.EnumArray; - - /** - * Creates a plain object from an EnumArray message. Also converts values to other types if specified. - * @param message EnumArray - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.EnumArray, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumArray to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumArray - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DateTimeArray. */ - interface IDateTimeArray { - - /** DateTimeArray values */ - values?: (google.type.IDateTime[]|null); - } - - /** Represents a DateTimeArray. */ - class DateTimeArray implements IDateTimeArray { - - /** - * Constructs a new DateTimeArray. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IDateTimeArray); - - /** DateTimeArray values. */ - public values: google.type.IDateTime[]; - - /** - * Creates a new DateTimeArray instance using the specified properties. - * @param [properties] Properties to set - * @returns DateTimeArray instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IDateTimeArray): google.cloud.contentwarehouse.v1.DateTimeArray; - - /** - * Encodes the specified DateTimeArray message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DateTimeArray.verify|verify} messages. - * @param message DateTimeArray message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IDateTimeArray, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DateTimeArray message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DateTimeArray.verify|verify} messages. - * @param message DateTimeArray message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IDateTimeArray, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DateTimeArray message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DateTimeArray - * @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.cloud.contentwarehouse.v1.DateTimeArray; - - /** - * Decodes a DateTimeArray message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DateTimeArray - * @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.cloud.contentwarehouse.v1.DateTimeArray; - - /** - * Verifies a DateTimeArray 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 DateTimeArray message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DateTimeArray - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.DateTimeArray; - - /** - * Creates a plain object from a DateTimeArray message. Also converts values to other types if specified. - * @param message DateTimeArray - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.DateTimeArray, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DateTimeArray to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DateTimeArray - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TimestampArray. */ - interface ITimestampArray { - - /** TimestampArray values */ - values?: (google.cloud.contentwarehouse.v1.ITimestampValue[]|null); - } - - /** Represents a TimestampArray. */ - class TimestampArray implements ITimestampArray { - - /** - * Constructs a new TimestampArray. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.ITimestampArray); - - /** TimestampArray values. */ - public values: google.cloud.contentwarehouse.v1.ITimestampValue[]; - - /** - * Creates a new TimestampArray instance using the specified properties. - * @param [properties] Properties to set - * @returns TimestampArray instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.ITimestampArray): google.cloud.contentwarehouse.v1.TimestampArray; - - /** - * Encodes the specified TimestampArray message. Does not implicitly {@link google.cloud.contentwarehouse.v1.TimestampArray.verify|verify} messages. - * @param message TimestampArray message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.ITimestampArray, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TimestampArray message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.TimestampArray.verify|verify} messages. - * @param message TimestampArray message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.ITimestampArray, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TimestampArray message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TimestampArray - * @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.cloud.contentwarehouse.v1.TimestampArray; - - /** - * Decodes a TimestampArray message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TimestampArray - * @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.cloud.contentwarehouse.v1.TimestampArray; - - /** - * Verifies a TimestampArray 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 TimestampArray message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TimestampArray - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.TimestampArray; - - /** - * Creates a plain object from a TimestampArray message. Also converts values to other types if specified. - * @param message TimestampArray - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.TimestampArray, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TimestampArray to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TimestampArray - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TimestampValue. */ - interface ITimestampValue { - - /** TimestampValue timestampValue */ - timestampValue?: (google.protobuf.ITimestamp|null); - - /** TimestampValue textValue */ - textValue?: (string|null); - } - - /** Represents a TimestampValue. */ - class TimestampValue implements ITimestampValue { - - /** - * Constructs a new TimestampValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.ITimestampValue); - - /** TimestampValue timestampValue. */ - public timestampValue?: (google.protobuf.ITimestamp|null); - - /** TimestampValue textValue. */ - public textValue?: (string|null); - - /** TimestampValue value. */ - public value?: ("timestampValue"|"textValue"); - - /** - * Creates a new TimestampValue instance using the specified properties. - * @param [properties] Properties to set - * @returns TimestampValue instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.ITimestampValue): google.cloud.contentwarehouse.v1.TimestampValue; - - /** - * Encodes the specified TimestampValue message. Does not implicitly {@link google.cloud.contentwarehouse.v1.TimestampValue.verify|verify} messages. - * @param message TimestampValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.ITimestampValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TimestampValue message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.TimestampValue.verify|verify} messages. - * @param message TimestampValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.ITimestampValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TimestampValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TimestampValue - * @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.cloud.contentwarehouse.v1.TimestampValue; - - /** - * Decodes a TimestampValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TimestampValue - * @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.cloud.contentwarehouse.v1.TimestampValue; - - /** - * Verifies a TimestampValue 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 TimestampValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TimestampValue - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.TimestampValue; - - /** - * Creates a plain object from a TimestampValue message. Also converts values to other types if specified. - * @param message TimestampValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.TimestampValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TimestampValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TimestampValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PropertyArray. */ - interface IPropertyArray { - - /** PropertyArray properties */ - properties?: (google.cloud.contentwarehouse.v1.IProperty[]|null); - } - - /** Represents a PropertyArray. */ - class PropertyArray implements IPropertyArray { - - /** - * Constructs a new PropertyArray. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IPropertyArray); - - /** PropertyArray properties. */ - public properties: google.cloud.contentwarehouse.v1.IProperty[]; - - /** - * Creates a new PropertyArray instance using the specified properties. - * @param [properties] Properties to set - * @returns PropertyArray instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IPropertyArray): google.cloud.contentwarehouse.v1.PropertyArray; - - /** - * Encodes the specified PropertyArray message. Does not implicitly {@link google.cloud.contentwarehouse.v1.PropertyArray.verify|verify} messages. - * @param message PropertyArray message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IPropertyArray, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PropertyArray message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.PropertyArray.verify|verify} messages. - * @param message PropertyArray message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IPropertyArray, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PropertyArray message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PropertyArray - * @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.cloud.contentwarehouse.v1.PropertyArray; - - /** - * Decodes a PropertyArray message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PropertyArray - * @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.cloud.contentwarehouse.v1.PropertyArray; - - /** - * Verifies a PropertyArray 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 PropertyArray message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PropertyArray - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.PropertyArray; - - /** - * Creates a plain object from a PropertyArray message. Also converts values to other types if specified. - * @param message PropertyArray - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.PropertyArray, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PropertyArray to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PropertyArray - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MapProperty. */ - interface IMapProperty { - - /** MapProperty fields */ - fields?: ({ [k: string]: google.cloud.contentwarehouse.v1.IValue }|null); - } - - /** Represents a MapProperty. */ - class MapProperty implements IMapProperty { - - /** - * Constructs a new MapProperty. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IMapProperty); - - /** MapProperty fields. */ - public fields: { [k: string]: google.cloud.contentwarehouse.v1.IValue }; - - /** - * Creates a new MapProperty instance using the specified properties. - * @param [properties] Properties to set - * @returns MapProperty instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IMapProperty): google.cloud.contentwarehouse.v1.MapProperty; - - /** - * Encodes the specified MapProperty message. Does not implicitly {@link google.cloud.contentwarehouse.v1.MapProperty.verify|verify} messages. - * @param message MapProperty message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IMapProperty, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MapProperty message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.MapProperty.verify|verify} messages. - * @param message MapProperty message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IMapProperty, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MapProperty message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MapProperty - * @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.cloud.contentwarehouse.v1.MapProperty; - - /** - * Decodes a MapProperty message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MapProperty - * @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.cloud.contentwarehouse.v1.MapProperty; - - /** - * Verifies a MapProperty 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 MapProperty message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MapProperty - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.MapProperty; - - /** - * Creates a plain object from a MapProperty message. Also converts values to other types if specified. - * @param message MapProperty - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.MapProperty, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MapProperty to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MapProperty - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Value. */ - interface IValue { - - /** Value floatValue */ - floatValue?: (number|null); - - /** Value intValue */ - intValue?: (number|null); - - /** Value stringValue */ - stringValue?: (string|null); - - /** Value enumValue */ - enumValue?: (google.cloud.contentwarehouse.v1.IEnumValue|null); - - /** Value datetimeValue */ - datetimeValue?: (google.type.IDateTime|null); - - /** Value timestampValue */ - timestampValue?: (google.cloud.contentwarehouse.v1.ITimestampValue|null); - - /** Value booleanValue */ - booleanValue?: (boolean|null); - } - - /** Represents a Value. */ - class Value implements IValue { - - /** - * Constructs a new Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IValue); - - /** Value floatValue. */ - public floatValue?: (number|null); - - /** Value intValue. */ - public intValue?: (number|null); - - /** Value stringValue. */ - public stringValue?: (string|null); - - /** Value enumValue. */ - public enumValue?: (google.cloud.contentwarehouse.v1.IEnumValue|null); - - /** Value datetimeValue. */ - public datetimeValue?: (google.type.IDateTime|null); - - /** Value timestampValue. */ - public timestampValue?: (google.cloud.contentwarehouse.v1.ITimestampValue|null); - - /** Value booleanValue. */ - public booleanValue?: (boolean|null); - - /** Value kind. */ - public kind?: ("floatValue"|"intValue"|"stringValue"|"enumValue"|"datetimeValue"|"timestampValue"|"booleanValue"); - - /** - * Creates a new Value instance using the specified properties. - * @param [properties] Properties to set - * @returns Value instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IValue): google.cloud.contentwarehouse.v1.Value; - - /** - * Encodes the specified Value message. Does not implicitly {@link google.cloud.contentwarehouse.v1.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.cloud.contentwarehouse.v1.IValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Value message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.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.cloud.contentwarehouse.v1.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.cloud.contentwarehouse.v1.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.cloud.contentwarehouse.v1.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.cloud.contentwarehouse.v1.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.cloud.contentwarehouse.v1.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Value - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumValue. */ - interface IEnumValue { - - /** EnumValue value */ - value?: (string|null); - } - - /** Represents an EnumValue. */ - class EnumValue implements IEnumValue { - - /** - * Constructs a new EnumValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IEnumValue); - - /** EnumValue value. */ - public value: string; - - /** - * Creates a new EnumValue instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumValue instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IEnumValue): google.cloud.contentwarehouse.v1.EnumValue; - - /** - * Encodes the specified EnumValue message. Does not implicitly {@link google.cloud.contentwarehouse.v1.EnumValue.verify|verify} messages. - * @param message EnumValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IEnumValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumValue message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.EnumValue.verify|verify} messages. - * @param message EnumValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IEnumValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumValue - * @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.cloud.contentwarehouse.v1.EnumValue; - - /** - * Decodes an EnumValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumValue - * @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.cloud.contentwarehouse.v1.EnumValue; - - /** - * Verifies an EnumValue 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 EnumValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValue - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.EnumValue; - - /** - * Creates a plain object from an EnumValue message. Also converts values to other types if specified. - * @param message EnumValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.EnumValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** RawDocumentFileType enum. */ - enum RawDocumentFileType { - RAW_DOCUMENT_FILE_TYPE_UNSPECIFIED = 0, - RAW_DOCUMENT_FILE_TYPE_PDF = 1, - RAW_DOCUMENT_FILE_TYPE_DOCX = 2, - RAW_DOCUMENT_FILE_TYPE_XLSX = 3, - RAW_DOCUMENT_FILE_TYPE_PPTX = 4, - RAW_DOCUMENT_FILE_TYPE_TEXT = 5, - RAW_DOCUMENT_FILE_TYPE_TIFF = 6 - } - - /** ContentCategory enum. */ - enum ContentCategory { - CONTENT_CATEGORY_UNSPECIFIED = 0, - CONTENT_CATEGORY_IMAGE = 1, - CONTENT_CATEGORY_AUDIO = 2, - CONTENT_CATEGORY_VIDEO = 3 - } - - /** Represents a DocumentLinkService */ - class DocumentLinkService extends $protobuf.rpc.Service { - - /** - * Constructs a new DocumentLinkService 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 DocumentLinkService 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): DocumentLinkService; - - /** - * Calls ListLinkedTargets. - * @param request ListLinkedTargetsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListLinkedTargetsResponse - */ - public listLinkedTargets(request: google.cloud.contentwarehouse.v1.IListLinkedTargetsRequest, callback: google.cloud.contentwarehouse.v1.DocumentLinkService.ListLinkedTargetsCallback): void; - - /** - * Calls ListLinkedTargets. - * @param request ListLinkedTargetsRequest message or plain object - * @returns Promise - */ - public listLinkedTargets(request: google.cloud.contentwarehouse.v1.IListLinkedTargetsRequest): Promise; - - /** - * Calls ListLinkedSources. - * @param request ListLinkedSourcesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListLinkedSourcesResponse - */ - public listLinkedSources(request: google.cloud.contentwarehouse.v1.IListLinkedSourcesRequest, callback: google.cloud.contentwarehouse.v1.DocumentLinkService.ListLinkedSourcesCallback): void; - - /** - * Calls ListLinkedSources. - * @param request ListLinkedSourcesRequest message or plain object - * @returns Promise - */ - public listLinkedSources(request: google.cloud.contentwarehouse.v1.IListLinkedSourcesRequest): Promise; - - /** - * Calls CreateDocumentLink. - * @param request CreateDocumentLinkRequest message or plain object - * @param callback Node-style callback called with the error, if any, and DocumentLink - */ - public createDocumentLink(request: google.cloud.contentwarehouse.v1.ICreateDocumentLinkRequest, callback: google.cloud.contentwarehouse.v1.DocumentLinkService.CreateDocumentLinkCallback): void; - - /** - * Calls CreateDocumentLink. - * @param request CreateDocumentLinkRequest message or plain object - * @returns Promise - */ - public createDocumentLink(request: google.cloud.contentwarehouse.v1.ICreateDocumentLinkRequest): Promise; - - /** - * Calls DeleteDocumentLink. - * @param request DeleteDocumentLinkRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteDocumentLink(request: google.cloud.contentwarehouse.v1.IDeleteDocumentLinkRequest, callback: google.cloud.contentwarehouse.v1.DocumentLinkService.DeleteDocumentLinkCallback): void; - - /** - * Calls DeleteDocumentLink. - * @param request DeleteDocumentLinkRequest message or plain object - * @returns Promise - */ - public deleteDocumentLink(request: google.cloud.contentwarehouse.v1.IDeleteDocumentLinkRequest): Promise; - } - - namespace DocumentLinkService { - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentLinkService|listLinkedTargets}. - * @param error Error, if any - * @param [response] ListLinkedTargetsResponse - */ - type ListLinkedTargetsCallback = (error: (Error|null), response?: google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse) => void; - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentLinkService|listLinkedSources}. - * @param error Error, if any - * @param [response] ListLinkedSourcesResponse - */ - type ListLinkedSourcesCallback = (error: (Error|null), response?: google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse) => void; - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentLinkService|createDocumentLink}. - * @param error Error, if any - * @param [response] DocumentLink - */ - type CreateDocumentLinkCallback = (error: (Error|null), response?: google.cloud.contentwarehouse.v1.DocumentLink) => void; - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentLinkService|deleteDocumentLink}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteDocumentLinkCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - } - - /** Properties of a ListLinkedTargetsResponse. */ - interface IListLinkedTargetsResponse { - - /** ListLinkedTargetsResponse documentLinks */ - documentLinks?: (google.cloud.contentwarehouse.v1.IDocumentLink[]|null); - - /** ListLinkedTargetsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListLinkedTargetsResponse. */ - class ListLinkedTargetsResponse implements IListLinkedTargetsResponse { - - /** - * Constructs a new ListLinkedTargetsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IListLinkedTargetsResponse); - - /** ListLinkedTargetsResponse documentLinks. */ - public documentLinks: google.cloud.contentwarehouse.v1.IDocumentLink[]; - - /** ListLinkedTargetsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListLinkedTargetsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListLinkedTargetsResponse instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IListLinkedTargetsResponse): google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse; - - /** - * Encodes the specified ListLinkedTargetsResponse message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse.verify|verify} messages. - * @param message ListLinkedTargetsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IListLinkedTargetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListLinkedTargetsResponse message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse.verify|verify} messages. - * @param message ListLinkedTargetsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IListLinkedTargetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListLinkedTargetsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListLinkedTargetsResponse - * @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.cloud.contentwarehouse.v1.ListLinkedTargetsResponse; - - /** - * Decodes a ListLinkedTargetsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListLinkedTargetsResponse - * @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.cloud.contentwarehouse.v1.ListLinkedTargetsResponse; - - /** - * Verifies a ListLinkedTargetsResponse 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 ListLinkedTargetsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListLinkedTargetsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse; - - /** - * Creates a plain object from a ListLinkedTargetsResponse message. Also converts values to other types if specified. - * @param message ListLinkedTargetsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListLinkedTargetsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListLinkedTargetsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListLinkedTargetsRequest. */ - interface IListLinkedTargetsRequest { - - /** ListLinkedTargetsRequest parent */ - parent?: (string|null); - - /** ListLinkedTargetsRequest requestMetadata */ - requestMetadata?: (google.cloud.contentwarehouse.v1.IRequestMetadata|null); - } - - /** Represents a ListLinkedTargetsRequest. */ - class ListLinkedTargetsRequest implements IListLinkedTargetsRequest { - - /** - * Constructs a new ListLinkedTargetsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IListLinkedTargetsRequest); - - /** ListLinkedTargetsRequest parent. */ - public parent: string; - - /** ListLinkedTargetsRequest requestMetadata. */ - public requestMetadata?: (google.cloud.contentwarehouse.v1.IRequestMetadata|null); - - /** - * Creates a new ListLinkedTargetsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListLinkedTargetsRequest instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IListLinkedTargetsRequest): google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest; - - /** - * Encodes the specified ListLinkedTargetsRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest.verify|verify} messages. - * @param message ListLinkedTargetsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IListLinkedTargetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListLinkedTargetsRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest.verify|verify} messages. - * @param message ListLinkedTargetsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IListLinkedTargetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListLinkedTargetsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListLinkedTargetsRequest - * @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.cloud.contentwarehouse.v1.ListLinkedTargetsRequest; - - /** - * Decodes a ListLinkedTargetsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListLinkedTargetsRequest - * @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.cloud.contentwarehouse.v1.ListLinkedTargetsRequest; - - /** - * Verifies a ListLinkedTargetsRequest 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 ListLinkedTargetsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListLinkedTargetsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest; - - /** - * Creates a plain object from a ListLinkedTargetsRequest message. Also converts values to other types if specified. - * @param message ListLinkedTargetsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListLinkedTargetsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListLinkedTargetsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListLinkedSourcesResponse. */ - interface IListLinkedSourcesResponse { - - /** ListLinkedSourcesResponse documentLinks */ - documentLinks?: (google.cloud.contentwarehouse.v1.IDocumentLink[]|null); - - /** ListLinkedSourcesResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListLinkedSourcesResponse. */ - class ListLinkedSourcesResponse implements IListLinkedSourcesResponse { - - /** - * Constructs a new ListLinkedSourcesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IListLinkedSourcesResponse); - - /** ListLinkedSourcesResponse documentLinks. */ - public documentLinks: google.cloud.contentwarehouse.v1.IDocumentLink[]; - - /** ListLinkedSourcesResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListLinkedSourcesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListLinkedSourcesResponse instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IListLinkedSourcesResponse): google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse; - - /** - * Encodes the specified ListLinkedSourcesResponse message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse.verify|verify} messages. - * @param message ListLinkedSourcesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IListLinkedSourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListLinkedSourcesResponse message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse.verify|verify} messages. - * @param message ListLinkedSourcesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IListLinkedSourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListLinkedSourcesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListLinkedSourcesResponse - * @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.cloud.contentwarehouse.v1.ListLinkedSourcesResponse; - - /** - * Decodes a ListLinkedSourcesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListLinkedSourcesResponse - * @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.cloud.contentwarehouse.v1.ListLinkedSourcesResponse; - - /** - * Verifies a ListLinkedSourcesResponse 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 ListLinkedSourcesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListLinkedSourcesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse; - - /** - * Creates a plain object from a ListLinkedSourcesResponse message. Also converts values to other types if specified. - * @param message ListLinkedSourcesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListLinkedSourcesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListLinkedSourcesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListLinkedSourcesRequest. */ - interface IListLinkedSourcesRequest { - - /** ListLinkedSourcesRequest parent */ - parent?: (string|null); - - /** ListLinkedSourcesRequest pageSize */ - pageSize?: (number|null); - - /** ListLinkedSourcesRequest pageToken */ - pageToken?: (string|null); - - /** ListLinkedSourcesRequest requestMetadata */ - requestMetadata?: (google.cloud.contentwarehouse.v1.IRequestMetadata|null); - } - - /** Represents a ListLinkedSourcesRequest. */ - class ListLinkedSourcesRequest implements IListLinkedSourcesRequest { - - /** - * Constructs a new ListLinkedSourcesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IListLinkedSourcesRequest); - - /** ListLinkedSourcesRequest parent. */ - public parent: string; - - /** ListLinkedSourcesRequest pageSize. */ - public pageSize: number; - - /** ListLinkedSourcesRequest pageToken. */ - public pageToken: string; - - /** ListLinkedSourcesRequest requestMetadata. */ - public requestMetadata?: (google.cloud.contentwarehouse.v1.IRequestMetadata|null); - - /** - * Creates a new ListLinkedSourcesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListLinkedSourcesRequest instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IListLinkedSourcesRequest): google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest; - - /** - * Encodes the specified ListLinkedSourcesRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest.verify|verify} messages. - * @param message ListLinkedSourcesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IListLinkedSourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListLinkedSourcesRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest.verify|verify} messages. - * @param message ListLinkedSourcesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IListLinkedSourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListLinkedSourcesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListLinkedSourcesRequest - * @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.cloud.contentwarehouse.v1.ListLinkedSourcesRequest; - - /** - * Decodes a ListLinkedSourcesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListLinkedSourcesRequest - * @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.cloud.contentwarehouse.v1.ListLinkedSourcesRequest; - - /** - * Verifies a ListLinkedSourcesRequest 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 ListLinkedSourcesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListLinkedSourcesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest; - - /** - * Creates a plain object from a ListLinkedSourcesRequest message. Also converts values to other types if specified. - * @param message ListLinkedSourcesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListLinkedSourcesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListLinkedSourcesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DocumentLink. */ - interface IDocumentLink { - - /** DocumentLink name */ - name?: (string|null); - - /** DocumentLink sourceDocumentReference */ - sourceDocumentReference?: (google.cloud.contentwarehouse.v1.IDocumentReference|null); - - /** DocumentLink targetDocumentReference */ - targetDocumentReference?: (google.cloud.contentwarehouse.v1.IDocumentReference|null); - - /** DocumentLink description */ - description?: (string|null); - - /** DocumentLink updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** DocumentLink createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** DocumentLink state */ - state?: (google.cloud.contentwarehouse.v1.DocumentLink.State|keyof typeof google.cloud.contentwarehouse.v1.DocumentLink.State|null); - } - - /** Represents a DocumentLink. */ - class DocumentLink implements IDocumentLink { - - /** - * Constructs a new DocumentLink. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IDocumentLink); - - /** DocumentLink name. */ - public name: string; - - /** DocumentLink sourceDocumentReference. */ - public sourceDocumentReference?: (google.cloud.contentwarehouse.v1.IDocumentReference|null); - - /** DocumentLink targetDocumentReference. */ - public targetDocumentReference?: (google.cloud.contentwarehouse.v1.IDocumentReference|null); - - /** DocumentLink description. */ - public description: string; - - /** DocumentLink updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** DocumentLink createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** DocumentLink state. */ - public state: (google.cloud.contentwarehouse.v1.DocumentLink.State|keyof typeof google.cloud.contentwarehouse.v1.DocumentLink.State); - - /** - * Creates a new DocumentLink instance using the specified properties. - * @param [properties] Properties to set - * @returns DocumentLink instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IDocumentLink): google.cloud.contentwarehouse.v1.DocumentLink; - - /** - * Encodes the specified DocumentLink message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DocumentLink.verify|verify} messages. - * @param message DocumentLink message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IDocumentLink, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DocumentLink message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DocumentLink.verify|verify} messages. - * @param message DocumentLink message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IDocumentLink, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DocumentLink message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DocumentLink - * @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.cloud.contentwarehouse.v1.DocumentLink; - - /** - * Decodes a DocumentLink message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DocumentLink - * @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.cloud.contentwarehouse.v1.DocumentLink; - - /** - * Verifies a DocumentLink 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 DocumentLink message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DocumentLink - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.DocumentLink; - - /** - * Creates a plain object from a DocumentLink message. Also converts values to other types if specified. - * @param message DocumentLink - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.DocumentLink, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DocumentLink to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DocumentLink - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace DocumentLink { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - ACTIVE = 1, - SOFT_DELETED = 2 - } - } - - /** Properties of a CreateDocumentLinkRequest. */ - interface ICreateDocumentLinkRequest { - - /** CreateDocumentLinkRequest parent */ - parent?: (string|null); - - /** CreateDocumentLinkRequest documentLink */ - documentLink?: (google.cloud.contentwarehouse.v1.IDocumentLink|null); - - /** CreateDocumentLinkRequest requestMetadata */ - requestMetadata?: (google.cloud.contentwarehouse.v1.IRequestMetadata|null); - } - - /** Represents a CreateDocumentLinkRequest. */ - class CreateDocumentLinkRequest implements ICreateDocumentLinkRequest { - - /** - * Constructs a new CreateDocumentLinkRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.ICreateDocumentLinkRequest); - - /** CreateDocumentLinkRequest parent. */ - public parent: string; - - /** CreateDocumentLinkRequest documentLink. */ - public documentLink?: (google.cloud.contentwarehouse.v1.IDocumentLink|null); - - /** CreateDocumentLinkRequest requestMetadata. */ - public requestMetadata?: (google.cloud.contentwarehouse.v1.IRequestMetadata|null); - - /** - * Creates a new CreateDocumentLinkRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateDocumentLinkRequest instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.ICreateDocumentLinkRequest): google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest; - - /** - * Encodes the specified CreateDocumentLinkRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest.verify|verify} messages. - * @param message CreateDocumentLinkRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.ICreateDocumentLinkRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateDocumentLinkRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest.verify|verify} messages. - * @param message CreateDocumentLinkRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.ICreateDocumentLinkRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateDocumentLinkRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateDocumentLinkRequest - * @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.cloud.contentwarehouse.v1.CreateDocumentLinkRequest; - - /** - * Decodes a CreateDocumentLinkRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateDocumentLinkRequest - * @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.cloud.contentwarehouse.v1.CreateDocumentLinkRequest; - - /** - * Verifies a CreateDocumentLinkRequest 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 CreateDocumentLinkRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateDocumentLinkRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest; - - /** - * Creates a plain object from a CreateDocumentLinkRequest message. Also converts values to other types if specified. - * @param message CreateDocumentLinkRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateDocumentLinkRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateDocumentLinkRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteDocumentLinkRequest. */ - interface IDeleteDocumentLinkRequest { - - /** DeleteDocumentLinkRequest name */ - name?: (string|null); - - /** DeleteDocumentLinkRequest requestMetadata */ - requestMetadata?: (google.cloud.contentwarehouse.v1.IRequestMetadata|null); - } - - /** Represents a DeleteDocumentLinkRequest. */ - class DeleteDocumentLinkRequest implements IDeleteDocumentLinkRequest { - - /** - * Constructs a new DeleteDocumentLinkRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IDeleteDocumentLinkRequest); - - /** DeleteDocumentLinkRequest name. */ - public name: string; - - /** DeleteDocumentLinkRequest requestMetadata. */ - public requestMetadata?: (google.cloud.contentwarehouse.v1.IRequestMetadata|null); - - /** - * Creates a new DeleteDocumentLinkRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteDocumentLinkRequest instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IDeleteDocumentLinkRequest): google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest; - - /** - * Encodes the specified DeleteDocumentLinkRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest.verify|verify} messages. - * @param message DeleteDocumentLinkRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IDeleteDocumentLinkRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteDocumentLinkRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest.verify|verify} messages. - * @param message DeleteDocumentLinkRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IDeleteDocumentLinkRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteDocumentLinkRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteDocumentLinkRequest - * @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.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest; - - /** - * Decodes a DeleteDocumentLinkRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteDocumentLinkRequest - * @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.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest; - - /** - * Verifies a DeleteDocumentLinkRequest 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 DeleteDocumentLinkRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteDocumentLinkRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest; - - /** - * Creates a plain object from a DeleteDocumentLinkRequest message. Also converts values to other types if specified. - * @param message DeleteDocumentLinkRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteDocumentLinkRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteDocumentLinkRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DocumentSchema. */ - interface IDocumentSchema { - - /** DocumentSchema name */ - name?: (string|null); - - /** DocumentSchema displayName */ - displayName?: (string|null); - - /** DocumentSchema propertyDefinitions */ - propertyDefinitions?: (google.cloud.contentwarehouse.v1.IPropertyDefinition[]|null); - - /** DocumentSchema documentIsFolder */ - documentIsFolder?: (boolean|null); - - /** DocumentSchema updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** DocumentSchema createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** DocumentSchema description */ - description?: (string|null); - } - - /** Represents a DocumentSchema. */ - class DocumentSchema implements IDocumentSchema { - - /** - * Constructs a new DocumentSchema. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IDocumentSchema); - - /** DocumentSchema name. */ - public name: string; - - /** DocumentSchema displayName. */ - public displayName: string; - - /** DocumentSchema propertyDefinitions. */ - public propertyDefinitions: google.cloud.contentwarehouse.v1.IPropertyDefinition[]; - - /** DocumentSchema documentIsFolder. */ - public documentIsFolder: boolean; - - /** DocumentSchema updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** DocumentSchema createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** DocumentSchema description. */ - public description: string; - - /** - * Creates a new DocumentSchema instance using the specified properties. - * @param [properties] Properties to set - * @returns DocumentSchema instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IDocumentSchema): google.cloud.contentwarehouse.v1.DocumentSchema; - - /** - * Encodes the specified DocumentSchema message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DocumentSchema.verify|verify} messages. - * @param message DocumentSchema message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IDocumentSchema, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DocumentSchema message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DocumentSchema.verify|verify} messages. - * @param message DocumentSchema message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IDocumentSchema, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DocumentSchema message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DocumentSchema - * @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.cloud.contentwarehouse.v1.DocumentSchema; - - /** - * Decodes a DocumentSchema message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DocumentSchema - * @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.cloud.contentwarehouse.v1.DocumentSchema; - - /** - * Verifies a DocumentSchema 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 DocumentSchema message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DocumentSchema - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.DocumentSchema; - - /** - * Creates a plain object from a DocumentSchema message. Also converts values to other types if specified. - * @param message DocumentSchema - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.DocumentSchema, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DocumentSchema to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DocumentSchema - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PropertyDefinition. */ - interface IPropertyDefinition { - - /** PropertyDefinition name */ - name?: (string|null); - - /** PropertyDefinition displayName */ - displayName?: (string|null); - - /** PropertyDefinition isRepeatable */ - isRepeatable?: (boolean|null); - - /** PropertyDefinition isFilterable */ - isFilterable?: (boolean|null); - - /** PropertyDefinition isSearchable */ - isSearchable?: (boolean|null); - - /** PropertyDefinition isMetadata */ - isMetadata?: (boolean|null); - - /** PropertyDefinition isRequired */ - isRequired?: (boolean|null); - - /** PropertyDefinition retrievalImportance */ - retrievalImportance?: (google.cloud.contentwarehouse.v1.PropertyDefinition.RetrievalImportance|keyof typeof google.cloud.contentwarehouse.v1.PropertyDefinition.RetrievalImportance|null); - - /** PropertyDefinition integerTypeOptions */ - integerTypeOptions?: (google.cloud.contentwarehouse.v1.IIntegerTypeOptions|null); - - /** PropertyDefinition floatTypeOptions */ - floatTypeOptions?: (google.cloud.contentwarehouse.v1.IFloatTypeOptions|null); - - /** PropertyDefinition textTypeOptions */ - textTypeOptions?: (google.cloud.contentwarehouse.v1.ITextTypeOptions|null); - - /** PropertyDefinition propertyTypeOptions */ - propertyTypeOptions?: (google.cloud.contentwarehouse.v1.IPropertyTypeOptions|null); - - /** PropertyDefinition enumTypeOptions */ - enumTypeOptions?: (google.cloud.contentwarehouse.v1.IEnumTypeOptions|null); - - /** PropertyDefinition dateTimeTypeOptions */ - dateTimeTypeOptions?: (google.cloud.contentwarehouse.v1.IDateTimeTypeOptions|null); - - /** PropertyDefinition mapTypeOptions */ - mapTypeOptions?: (google.cloud.contentwarehouse.v1.IMapTypeOptions|null); - - /** PropertyDefinition timestampTypeOptions */ - timestampTypeOptions?: (google.cloud.contentwarehouse.v1.ITimestampTypeOptions|null); - - /** PropertyDefinition schemaSources */ - schemaSources?: (google.cloud.contentwarehouse.v1.PropertyDefinition.ISchemaSource[]|null); - } - - /** Represents a PropertyDefinition. */ - class PropertyDefinition implements IPropertyDefinition { - - /** - * Constructs a new PropertyDefinition. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IPropertyDefinition); - - /** PropertyDefinition name. */ - public name: string; - - /** PropertyDefinition displayName. */ - public displayName: string; - - /** PropertyDefinition isRepeatable. */ - public isRepeatable: boolean; - - /** PropertyDefinition isFilterable. */ - public isFilterable: boolean; - - /** PropertyDefinition isSearchable. */ - public isSearchable: boolean; - - /** PropertyDefinition isMetadata. */ - public isMetadata: boolean; - - /** PropertyDefinition isRequired. */ - public isRequired: boolean; - - /** PropertyDefinition retrievalImportance. */ - public retrievalImportance: (google.cloud.contentwarehouse.v1.PropertyDefinition.RetrievalImportance|keyof typeof google.cloud.contentwarehouse.v1.PropertyDefinition.RetrievalImportance); - - /** PropertyDefinition integerTypeOptions. */ - public integerTypeOptions?: (google.cloud.contentwarehouse.v1.IIntegerTypeOptions|null); - - /** PropertyDefinition floatTypeOptions. */ - public floatTypeOptions?: (google.cloud.contentwarehouse.v1.IFloatTypeOptions|null); - - /** PropertyDefinition textTypeOptions. */ - public textTypeOptions?: (google.cloud.contentwarehouse.v1.ITextTypeOptions|null); - - /** PropertyDefinition propertyTypeOptions. */ - public propertyTypeOptions?: (google.cloud.contentwarehouse.v1.IPropertyTypeOptions|null); - - /** PropertyDefinition enumTypeOptions. */ - public enumTypeOptions?: (google.cloud.contentwarehouse.v1.IEnumTypeOptions|null); - - /** PropertyDefinition dateTimeTypeOptions. */ - public dateTimeTypeOptions?: (google.cloud.contentwarehouse.v1.IDateTimeTypeOptions|null); - - /** PropertyDefinition mapTypeOptions. */ - public mapTypeOptions?: (google.cloud.contentwarehouse.v1.IMapTypeOptions|null); - - /** PropertyDefinition timestampTypeOptions. */ - public timestampTypeOptions?: (google.cloud.contentwarehouse.v1.ITimestampTypeOptions|null); - - /** PropertyDefinition schemaSources. */ - public schemaSources: google.cloud.contentwarehouse.v1.PropertyDefinition.ISchemaSource[]; - - /** PropertyDefinition valueTypeOptions. */ - public valueTypeOptions?: ("integerTypeOptions"|"floatTypeOptions"|"textTypeOptions"|"propertyTypeOptions"|"enumTypeOptions"|"dateTimeTypeOptions"|"mapTypeOptions"|"timestampTypeOptions"); - - /** - * Creates a new PropertyDefinition instance using the specified properties. - * @param [properties] Properties to set - * @returns PropertyDefinition instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IPropertyDefinition): google.cloud.contentwarehouse.v1.PropertyDefinition; - - /** - * Encodes the specified PropertyDefinition message. Does not implicitly {@link google.cloud.contentwarehouse.v1.PropertyDefinition.verify|verify} messages. - * @param message PropertyDefinition message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IPropertyDefinition, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PropertyDefinition message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.PropertyDefinition.verify|verify} messages. - * @param message PropertyDefinition message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IPropertyDefinition, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PropertyDefinition message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PropertyDefinition - * @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.cloud.contentwarehouse.v1.PropertyDefinition; - - /** - * Decodes a PropertyDefinition message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PropertyDefinition - * @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.cloud.contentwarehouse.v1.PropertyDefinition; - - /** - * Verifies a PropertyDefinition 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 PropertyDefinition message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PropertyDefinition - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.PropertyDefinition; - - /** - * Creates a plain object from a PropertyDefinition message. Also converts values to other types if specified. - * @param message PropertyDefinition - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.PropertyDefinition, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PropertyDefinition to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PropertyDefinition - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace PropertyDefinition { - - /** RetrievalImportance enum. */ - enum RetrievalImportance { - RETRIEVAL_IMPORTANCE_UNSPECIFIED = 0, - HIGHEST = 1, - HIGHER = 2, - HIGH = 3, - MEDIUM = 4, - LOW = 5, - LOWEST = 6 - } - - /** Properties of a SchemaSource. */ - interface ISchemaSource { - - /** SchemaSource name */ - name?: (string|null); - - /** SchemaSource processorType */ - processorType?: (string|null); - } - - /** Represents a SchemaSource. */ - class SchemaSource implements ISchemaSource { - - /** - * Constructs a new SchemaSource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.PropertyDefinition.ISchemaSource); - - /** SchemaSource name. */ - public name: string; - - /** SchemaSource processorType. */ - public processorType: string; - - /** - * Creates a new SchemaSource instance using the specified properties. - * @param [properties] Properties to set - * @returns SchemaSource instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.PropertyDefinition.ISchemaSource): google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource; - - /** - * Encodes the specified SchemaSource message. Does not implicitly {@link google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource.verify|verify} messages. - * @param message SchemaSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.PropertyDefinition.ISchemaSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SchemaSource message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource.verify|verify} messages. - * @param message SchemaSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.PropertyDefinition.ISchemaSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SchemaSource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SchemaSource - * @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.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource; - - /** - * Decodes a SchemaSource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SchemaSource - * @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.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource; - - /** - * Verifies a SchemaSource 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 SchemaSource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SchemaSource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource; - - /** - * Creates a plain object from a SchemaSource message. Also converts values to other types if specified. - * @param message SchemaSource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SchemaSource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SchemaSource - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an IntegerTypeOptions. */ - interface IIntegerTypeOptions { - } - - /** Represents an IntegerTypeOptions. */ - class IntegerTypeOptions implements IIntegerTypeOptions { - - /** - * Constructs a new IntegerTypeOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IIntegerTypeOptions); - - /** - * Creates a new IntegerTypeOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns IntegerTypeOptions instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IIntegerTypeOptions): google.cloud.contentwarehouse.v1.IntegerTypeOptions; - - /** - * Encodes the specified IntegerTypeOptions message. Does not implicitly {@link google.cloud.contentwarehouse.v1.IntegerTypeOptions.verify|verify} messages. - * @param message IntegerTypeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IIntegerTypeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified IntegerTypeOptions message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.IntegerTypeOptions.verify|verify} messages. - * @param message IntegerTypeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IIntegerTypeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an IntegerTypeOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IntegerTypeOptions - * @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.cloud.contentwarehouse.v1.IntegerTypeOptions; - - /** - * Decodes an IntegerTypeOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IntegerTypeOptions - * @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.cloud.contentwarehouse.v1.IntegerTypeOptions; - - /** - * Verifies an IntegerTypeOptions 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 IntegerTypeOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IntegerTypeOptions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.IntegerTypeOptions; - - /** - * Creates a plain object from an IntegerTypeOptions message. Also converts values to other types if specified. - * @param message IntegerTypeOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.IntegerTypeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IntegerTypeOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for IntegerTypeOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FloatTypeOptions. */ - interface IFloatTypeOptions { - } - - /** Represents a FloatTypeOptions. */ - class FloatTypeOptions implements IFloatTypeOptions { - - /** - * Constructs a new FloatTypeOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IFloatTypeOptions); - - /** - * Creates a new FloatTypeOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns FloatTypeOptions instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IFloatTypeOptions): google.cloud.contentwarehouse.v1.FloatTypeOptions; - - /** - * Encodes the specified FloatTypeOptions message. Does not implicitly {@link google.cloud.contentwarehouse.v1.FloatTypeOptions.verify|verify} messages. - * @param message FloatTypeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IFloatTypeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FloatTypeOptions message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.FloatTypeOptions.verify|verify} messages. - * @param message FloatTypeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IFloatTypeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FloatTypeOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FloatTypeOptions - * @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.cloud.contentwarehouse.v1.FloatTypeOptions; - - /** - * Decodes a FloatTypeOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FloatTypeOptions - * @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.cloud.contentwarehouse.v1.FloatTypeOptions; - - /** - * Verifies a FloatTypeOptions 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 FloatTypeOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FloatTypeOptions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.FloatTypeOptions; - - /** - * Creates a plain object from a FloatTypeOptions message. Also converts values to other types if specified. - * @param message FloatTypeOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.FloatTypeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FloatTypeOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FloatTypeOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TextTypeOptions. */ - interface ITextTypeOptions { - } - - /** Represents a TextTypeOptions. */ - class TextTypeOptions implements ITextTypeOptions { - - /** - * Constructs a new TextTypeOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.ITextTypeOptions); - - /** - * Creates a new TextTypeOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns TextTypeOptions instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.ITextTypeOptions): google.cloud.contentwarehouse.v1.TextTypeOptions; - - /** - * Encodes the specified TextTypeOptions message. Does not implicitly {@link google.cloud.contentwarehouse.v1.TextTypeOptions.verify|verify} messages. - * @param message TextTypeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.ITextTypeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TextTypeOptions message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.TextTypeOptions.verify|verify} messages. - * @param message TextTypeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.ITextTypeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TextTypeOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TextTypeOptions - * @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.cloud.contentwarehouse.v1.TextTypeOptions; - - /** - * Decodes a TextTypeOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TextTypeOptions - * @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.cloud.contentwarehouse.v1.TextTypeOptions; - - /** - * Verifies a TextTypeOptions 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 TextTypeOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TextTypeOptions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.TextTypeOptions; - - /** - * Creates a plain object from a TextTypeOptions message. Also converts values to other types if specified. - * @param message TextTypeOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.TextTypeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TextTypeOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TextTypeOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DateTimeTypeOptions. */ - interface IDateTimeTypeOptions { - } - - /** Represents a DateTimeTypeOptions. */ - class DateTimeTypeOptions implements IDateTimeTypeOptions { - - /** - * Constructs a new DateTimeTypeOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IDateTimeTypeOptions); - - /** - * Creates a new DateTimeTypeOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns DateTimeTypeOptions instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IDateTimeTypeOptions): google.cloud.contentwarehouse.v1.DateTimeTypeOptions; - - /** - * Encodes the specified DateTimeTypeOptions message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DateTimeTypeOptions.verify|verify} messages. - * @param message DateTimeTypeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IDateTimeTypeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DateTimeTypeOptions message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DateTimeTypeOptions.verify|verify} messages. - * @param message DateTimeTypeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IDateTimeTypeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DateTimeTypeOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DateTimeTypeOptions - * @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.cloud.contentwarehouse.v1.DateTimeTypeOptions; - - /** - * Decodes a DateTimeTypeOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DateTimeTypeOptions - * @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.cloud.contentwarehouse.v1.DateTimeTypeOptions; - - /** - * Verifies a DateTimeTypeOptions 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 DateTimeTypeOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DateTimeTypeOptions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.DateTimeTypeOptions; - - /** - * Creates a plain object from a DateTimeTypeOptions message. Also converts values to other types if specified. - * @param message DateTimeTypeOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.DateTimeTypeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DateTimeTypeOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DateTimeTypeOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MapTypeOptions. */ - interface IMapTypeOptions { - } - - /** Represents a MapTypeOptions. */ - class MapTypeOptions implements IMapTypeOptions { - - /** - * Constructs a new MapTypeOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IMapTypeOptions); - - /** - * Creates a new MapTypeOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns MapTypeOptions instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IMapTypeOptions): google.cloud.contentwarehouse.v1.MapTypeOptions; - - /** - * Encodes the specified MapTypeOptions message. Does not implicitly {@link google.cloud.contentwarehouse.v1.MapTypeOptions.verify|verify} messages. - * @param message MapTypeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IMapTypeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MapTypeOptions message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.MapTypeOptions.verify|verify} messages. - * @param message MapTypeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IMapTypeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MapTypeOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MapTypeOptions - * @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.cloud.contentwarehouse.v1.MapTypeOptions; - - /** - * Decodes a MapTypeOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MapTypeOptions - * @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.cloud.contentwarehouse.v1.MapTypeOptions; - - /** - * Verifies a MapTypeOptions 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 MapTypeOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MapTypeOptions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.MapTypeOptions; - - /** - * Creates a plain object from a MapTypeOptions message. Also converts values to other types if specified. - * @param message MapTypeOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.MapTypeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MapTypeOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MapTypeOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TimestampTypeOptions. */ - interface ITimestampTypeOptions { - } - - /** Represents a TimestampTypeOptions. */ - class TimestampTypeOptions implements ITimestampTypeOptions { - - /** - * Constructs a new TimestampTypeOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.ITimestampTypeOptions); - - /** - * Creates a new TimestampTypeOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns TimestampTypeOptions instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.ITimestampTypeOptions): google.cloud.contentwarehouse.v1.TimestampTypeOptions; - - /** - * Encodes the specified TimestampTypeOptions message. Does not implicitly {@link google.cloud.contentwarehouse.v1.TimestampTypeOptions.verify|verify} messages. - * @param message TimestampTypeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.ITimestampTypeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TimestampTypeOptions message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.TimestampTypeOptions.verify|verify} messages. - * @param message TimestampTypeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.ITimestampTypeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TimestampTypeOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TimestampTypeOptions - * @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.cloud.contentwarehouse.v1.TimestampTypeOptions; - - /** - * Decodes a TimestampTypeOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TimestampTypeOptions - * @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.cloud.contentwarehouse.v1.TimestampTypeOptions; - - /** - * Verifies a TimestampTypeOptions 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 TimestampTypeOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TimestampTypeOptions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.TimestampTypeOptions; - - /** - * Creates a plain object from a TimestampTypeOptions message. Also converts values to other types if specified. - * @param message TimestampTypeOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.TimestampTypeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TimestampTypeOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TimestampTypeOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PropertyTypeOptions. */ - interface IPropertyTypeOptions { - - /** PropertyTypeOptions propertyDefinitions */ - propertyDefinitions?: (google.cloud.contentwarehouse.v1.IPropertyDefinition[]|null); - } - - /** Represents a PropertyTypeOptions. */ - class PropertyTypeOptions implements IPropertyTypeOptions { - - /** - * Constructs a new PropertyTypeOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IPropertyTypeOptions); - - /** PropertyTypeOptions propertyDefinitions. */ - public propertyDefinitions: google.cloud.contentwarehouse.v1.IPropertyDefinition[]; - - /** - * Creates a new PropertyTypeOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns PropertyTypeOptions instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IPropertyTypeOptions): google.cloud.contentwarehouse.v1.PropertyTypeOptions; - - /** - * Encodes the specified PropertyTypeOptions message. Does not implicitly {@link google.cloud.contentwarehouse.v1.PropertyTypeOptions.verify|verify} messages. - * @param message PropertyTypeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IPropertyTypeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PropertyTypeOptions message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.PropertyTypeOptions.verify|verify} messages. - * @param message PropertyTypeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IPropertyTypeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PropertyTypeOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PropertyTypeOptions - * @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.cloud.contentwarehouse.v1.PropertyTypeOptions; - - /** - * Decodes a PropertyTypeOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PropertyTypeOptions - * @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.cloud.contentwarehouse.v1.PropertyTypeOptions; - - /** - * Verifies a PropertyTypeOptions 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 PropertyTypeOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PropertyTypeOptions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.PropertyTypeOptions; - - /** - * Creates a plain object from a PropertyTypeOptions message. Also converts values to other types if specified. - * @param message PropertyTypeOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.PropertyTypeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PropertyTypeOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PropertyTypeOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumTypeOptions. */ - interface IEnumTypeOptions { - - /** EnumTypeOptions possibleValues */ - possibleValues?: (string[]|null); - - /** EnumTypeOptions validationCheckDisabled */ - validationCheckDisabled?: (boolean|null); - } - - /** Represents an EnumTypeOptions. */ - class EnumTypeOptions implements IEnumTypeOptions { - - /** - * Constructs a new EnumTypeOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IEnumTypeOptions); - - /** EnumTypeOptions possibleValues. */ - public possibleValues: string[]; - - /** EnumTypeOptions validationCheckDisabled. */ - public validationCheckDisabled: boolean; - - /** - * Creates a new EnumTypeOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumTypeOptions instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IEnumTypeOptions): google.cloud.contentwarehouse.v1.EnumTypeOptions; - - /** - * Encodes the specified EnumTypeOptions message. Does not implicitly {@link google.cloud.contentwarehouse.v1.EnumTypeOptions.verify|verify} messages. - * @param message EnumTypeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IEnumTypeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumTypeOptions message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.EnumTypeOptions.verify|verify} messages. - * @param message EnumTypeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IEnumTypeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumTypeOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumTypeOptions - * @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.cloud.contentwarehouse.v1.EnumTypeOptions; - - /** - * Decodes an EnumTypeOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumTypeOptions - * @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.cloud.contentwarehouse.v1.EnumTypeOptions; - - /** - * Verifies an EnumTypeOptions 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 EnumTypeOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumTypeOptions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.EnumTypeOptions; - - /** - * Creates a plain object from an EnumTypeOptions message. Also converts values to other types if specified. - * @param message EnumTypeOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.EnumTypeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumTypeOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumTypeOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents a DocumentSchemaService */ - class DocumentSchemaService extends $protobuf.rpc.Service { - - /** - * Constructs a new DocumentSchemaService 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 DocumentSchemaService 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): DocumentSchemaService; - - /** - * Calls CreateDocumentSchema. - * @param request CreateDocumentSchemaRequest message or plain object - * @param callback Node-style callback called with the error, if any, and DocumentSchema - */ - public createDocumentSchema(request: google.cloud.contentwarehouse.v1.ICreateDocumentSchemaRequest, callback: google.cloud.contentwarehouse.v1.DocumentSchemaService.CreateDocumentSchemaCallback): void; - - /** - * Calls CreateDocumentSchema. - * @param request CreateDocumentSchemaRequest message or plain object - * @returns Promise - */ - public createDocumentSchema(request: google.cloud.contentwarehouse.v1.ICreateDocumentSchemaRequest): Promise; - - /** - * Calls UpdateDocumentSchema. - * @param request UpdateDocumentSchemaRequest message or plain object - * @param callback Node-style callback called with the error, if any, and DocumentSchema - */ - public updateDocumentSchema(request: google.cloud.contentwarehouse.v1.IUpdateDocumentSchemaRequest, callback: google.cloud.contentwarehouse.v1.DocumentSchemaService.UpdateDocumentSchemaCallback): void; - - /** - * Calls UpdateDocumentSchema. - * @param request UpdateDocumentSchemaRequest message or plain object - * @returns Promise - */ - public updateDocumentSchema(request: google.cloud.contentwarehouse.v1.IUpdateDocumentSchemaRequest): Promise; - - /** - * Calls GetDocumentSchema. - * @param request GetDocumentSchemaRequest message or plain object - * @param callback Node-style callback called with the error, if any, and DocumentSchema - */ - public getDocumentSchema(request: google.cloud.contentwarehouse.v1.IGetDocumentSchemaRequest, callback: google.cloud.contentwarehouse.v1.DocumentSchemaService.GetDocumentSchemaCallback): void; - - /** - * Calls GetDocumentSchema. - * @param request GetDocumentSchemaRequest message or plain object - * @returns Promise - */ - public getDocumentSchema(request: google.cloud.contentwarehouse.v1.IGetDocumentSchemaRequest): Promise; - - /** - * Calls DeleteDocumentSchema. - * @param request DeleteDocumentSchemaRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteDocumentSchema(request: google.cloud.contentwarehouse.v1.IDeleteDocumentSchemaRequest, callback: google.cloud.contentwarehouse.v1.DocumentSchemaService.DeleteDocumentSchemaCallback): void; - - /** - * Calls DeleteDocumentSchema. - * @param request DeleteDocumentSchemaRequest message or plain object - * @returns Promise - */ - public deleteDocumentSchema(request: google.cloud.contentwarehouse.v1.IDeleteDocumentSchemaRequest): Promise; - - /** - * Calls ListDocumentSchemas. - * @param request ListDocumentSchemasRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListDocumentSchemasResponse - */ - public listDocumentSchemas(request: google.cloud.contentwarehouse.v1.IListDocumentSchemasRequest, callback: google.cloud.contentwarehouse.v1.DocumentSchemaService.ListDocumentSchemasCallback): void; - - /** - * Calls ListDocumentSchemas. - * @param request ListDocumentSchemasRequest message or plain object - * @returns Promise - */ - public listDocumentSchemas(request: google.cloud.contentwarehouse.v1.IListDocumentSchemasRequest): Promise; - } - - namespace DocumentSchemaService { - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentSchemaService|createDocumentSchema}. - * @param error Error, if any - * @param [response] DocumentSchema - */ - type CreateDocumentSchemaCallback = (error: (Error|null), response?: google.cloud.contentwarehouse.v1.DocumentSchema) => void; - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentSchemaService|updateDocumentSchema}. - * @param error Error, if any - * @param [response] DocumentSchema - */ - type UpdateDocumentSchemaCallback = (error: (Error|null), response?: google.cloud.contentwarehouse.v1.DocumentSchema) => void; - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentSchemaService|getDocumentSchema}. - * @param error Error, if any - * @param [response] DocumentSchema - */ - type GetDocumentSchemaCallback = (error: (Error|null), response?: google.cloud.contentwarehouse.v1.DocumentSchema) => void; - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentSchemaService|deleteDocumentSchema}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteDocumentSchemaCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentSchemaService|listDocumentSchemas}. - * @param error Error, if any - * @param [response] ListDocumentSchemasResponse - */ - type ListDocumentSchemasCallback = (error: (Error|null), response?: google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse) => void; - } - - /** Properties of a CreateDocumentSchemaRequest. */ - interface ICreateDocumentSchemaRequest { - - /** CreateDocumentSchemaRequest parent */ - parent?: (string|null); - - /** CreateDocumentSchemaRequest documentSchema */ - documentSchema?: (google.cloud.contentwarehouse.v1.IDocumentSchema|null); - } - - /** Represents a CreateDocumentSchemaRequest. */ - class CreateDocumentSchemaRequest implements ICreateDocumentSchemaRequest { - - /** - * Constructs a new CreateDocumentSchemaRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.ICreateDocumentSchemaRequest); - - /** CreateDocumentSchemaRequest parent. */ - public parent: string; - - /** CreateDocumentSchemaRequest documentSchema. */ - public documentSchema?: (google.cloud.contentwarehouse.v1.IDocumentSchema|null); - - /** - * Creates a new CreateDocumentSchemaRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateDocumentSchemaRequest instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.ICreateDocumentSchemaRequest): google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest; - - /** - * Encodes the specified CreateDocumentSchemaRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest.verify|verify} messages. - * @param message CreateDocumentSchemaRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.ICreateDocumentSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateDocumentSchemaRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest.verify|verify} messages. - * @param message CreateDocumentSchemaRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.ICreateDocumentSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateDocumentSchemaRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateDocumentSchemaRequest - * @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.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest; - - /** - * Decodes a CreateDocumentSchemaRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateDocumentSchemaRequest - * @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.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest; - - /** - * Verifies a CreateDocumentSchemaRequest 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 CreateDocumentSchemaRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateDocumentSchemaRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest; - - /** - * Creates a plain object from a CreateDocumentSchemaRequest message. Also converts values to other types if specified. - * @param message CreateDocumentSchemaRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateDocumentSchemaRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateDocumentSchemaRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetDocumentSchemaRequest. */ - interface IGetDocumentSchemaRequest { - - /** GetDocumentSchemaRequest name */ - name?: (string|null); - } - - /** Represents a GetDocumentSchemaRequest. */ - class GetDocumentSchemaRequest implements IGetDocumentSchemaRequest { - - /** - * Constructs a new GetDocumentSchemaRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IGetDocumentSchemaRequest); - - /** GetDocumentSchemaRequest name. */ - public name: string; - - /** - * Creates a new GetDocumentSchemaRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetDocumentSchemaRequest instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IGetDocumentSchemaRequest): google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest; - - /** - * Encodes the specified GetDocumentSchemaRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest.verify|verify} messages. - * @param message GetDocumentSchemaRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IGetDocumentSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetDocumentSchemaRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest.verify|verify} messages. - * @param message GetDocumentSchemaRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IGetDocumentSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetDocumentSchemaRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetDocumentSchemaRequest - * @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.cloud.contentwarehouse.v1.GetDocumentSchemaRequest; - - /** - * Decodes a GetDocumentSchemaRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetDocumentSchemaRequest - * @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.cloud.contentwarehouse.v1.GetDocumentSchemaRequest; - - /** - * Verifies a GetDocumentSchemaRequest 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 GetDocumentSchemaRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetDocumentSchemaRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest; - - /** - * Creates a plain object from a GetDocumentSchemaRequest message. Also converts values to other types if specified. - * @param message GetDocumentSchemaRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetDocumentSchemaRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetDocumentSchemaRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateDocumentSchemaRequest. */ - interface IUpdateDocumentSchemaRequest { - - /** UpdateDocumentSchemaRequest name */ - name?: (string|null); - - /** UpdateDocumentSchemaRequest documentSchema */ - documentSchema?: (google.cloud.contentwarehouse.v1.IDocumentSchema|null); - } - - /** Represents an UpdateDocumentSchemaRequest. */ - class UpdateDocumentSchemaRequest implements IUpdateDocumentSchemaRequest { - - /** - * Constructs a new UpdateDocumentSchemaRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IUpdateDocumentSchemaRequest); - - /** UpdateDocumentSchemaRequest name. */ - public name: string; - - /** UpdateDocumentSchemaRequest documentSchema. */ - public documentSchema?: (google.cloud.contentwarehouse.v1.IDocumentSchema|null); - - /** - * Creates a new UpdateDocumentSchemaRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateDocumentSchemaRequest instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IUpdateDocumentSchemaRequest): google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest; - - /** - * Encodes the specified UpdateDocumentSchemaRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest.verify|verify} messages. - * @param message UpdateDocumentSchemaRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IUpdateDocumentSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateDocumentSchemaRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest.verify|verify} messages. - * @param message UpdateDocumentSchemaRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IUpdateDocumentSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateDocumentSchemaRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateDocumentSchemaRequest - * @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.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest; - - /** - * Decodes an UpdateDocumentSchemaRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateDocumentSchemaRequest - * @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.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest; - - /** - * Verifies an UpdateDocumentSchemaRequest 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 UpdateDocumentSchemaRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateDocumentSchemaRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest; - - /** - * Creates a plain object from an UpdateDocumentSchemaRequest message. Also converts values to other types if specified. - * @param message UpdateDocumentSchemaRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateDocumentSchemaRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateDocumentSchemaRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteDocumentSchemaRequest. */ - interface IDeleteDocumentSchemaRequest { - - /** DeleteDocumentSchemaRequest name */ - name?: (string|null); - } - - /** Represents a DeleteDocumentSchemaRequest. */ - class DeleteDocumentSchemaRequest implements IDeleteDocumentSchemaRequest { - - /** - * Constructs a new DeleteDocumentSchemaRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IDeleteDocumentSchemaRequest); - - /** DeleteDocumentSchemaRequest name. */ - public name: string; - - /** - * Creates a new DeleteDocumentSchemaRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteDocumentSchemaRequest instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IDeleteDocumentSchemaRequest): google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest; - - /** - * Encodes the specified DeleteDocumentSchemaRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest.verify|verify} messages. - * @param message DeleteDocumentSchemaRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IDeleteDocumentSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteDocumentSchemaRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest.verify|verify} messages. - * @param message DeleteDocumentSchemaRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IDeleteDocumentSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteDocumentSchemaRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteDocumentSchemaRequest - * @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.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest; - - /** - * Decodes a DeleteDocumentSchemaRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteDocumentSchemaRequest - * @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.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest; - - /** - * Verifies a DeleteDocumentSchemaRequest 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 DeleteDocumentSchemaRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteDocumentSchemaRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest; - - /** - * Creates a plain object from a DeleteDocumentSchemaRequest message. Also converts values to other types if specified. - * @param message DeleteDocumentSchemaRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteDocumentSchemaRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteDocumentSchemaRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListDocumentSchemasRequest. */ - interface IListDocumentSchemasRequest { - - /** ListDocumentSchemasRequest parent */ - parent?: (string|null); - - /** ListDocumentSchemasRequest pageSize */ - pageSize?: (number|null); - - /** ListDocumentSchemasRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListDocumentSchemasRequest. */ - class ListDocumentSchemasRequest implements IListDocumentSchemasRequest { - - /** - * Constructs a new ListDocumentSchemasRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IListDocumentSchemasRequest); - - /** ListDocumentSchemasRequest parent. */ - public parent: string; - - /** ListDocumentSchemasRequest pageSize. */ - public pageSize: number; - - /** ListDocumentSchemasRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListDocumentSchemasRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListDocumentSchemasRequest instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IListDocumentSchemasRequest): google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest; - - /** - * Encodes the specified ListDocumentSchemasRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest.verify|verify} messages. - * @param message ListDocumentSchemasRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IListDocumentSchemasRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListDocumentSchemasRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest.verify|verify} messages. - * @param message ListDocumentSchemasRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IListDocumentSchemasRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListDocumentSchemasRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListDocumentSchemasRequest - * @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.cloud.contentwarehouse.v1.ListDocumentSchemasRequest; - - /** - * Decodes a ListDocumentSchemasRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListDocumentSchemasRequest - * @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.cloud.contentwarehouse.v1.ListDocumentSchemasRequest; - - /** - * Verifies a ListDocumentSchemasRequest 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 ListDocumentSchemasRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListDocumentSchemasRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest; - - /** - * Creates a plain object from a ListDocumentSchemasRequest message. Also converts values to other types if specified. - * @param message ListDocumentSchemasRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListDocumentSchemasRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListDocumentSchemasRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListDocumentSchemasResponse. */ - interface IListDocumentSchemasResponse { - - /** ListDocumentSchemasResponse documentSchemas */ - documentSchemas?: (google.cloud.contentwarehouse.v1.IDocumentSchema[]|null); - - /** ListDocumentSchemasResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListDocumentSchemasResponse. */ - class ListDocumentSchemasResponse implements IListDocumentSchemasResponse { - - /** - * Constructs a new ListDocumentSchemasResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IListDocumentSchemasResponse); - - /** ListDocumentSchemasResponse documentSchemas. */ - public documentSchemas: google.cloud.contentwarehouse.v1.IDocumentSchema[]; - - /** ListDocumentSchemasResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListDocumentSchemasResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListDocumentSchemasResponse instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IListDocumentSchemasResponse): google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse; - - /** - * Encodes the specified ListDocumentSchemasResponse message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse.verify|verify} messages. - * @param message ListDocumentSchemasResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IListDocumentSchemasResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListDocumentSchemasResponse message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse.verify|verify} messages. - * @param message ListDocumentSchemasResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IListDocumentSchemasResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListDocumentSchemasResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListDocumentSchemasResponse - * @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.cloud.contentwarehouse.v1.ListDocumentSchemasResponse; - - /** - * Decodes a ListDocumentSchemasResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListDocumentSchemasResponse - * @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.cloud.contentwarehouse.v1.ListDocumentSchemasResponse; - - /** - * Verifies a ListDocumentSchemasResponse 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 ListDocumentSchemasResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListDocumentSchemasResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse; - - /** - * Creates a plain object from a ListDocumentSchemasResponse message. Also converts values to other types if specified. - * @param message ListDocumentSchemasResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListDocumentSchemasResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListDocumentSchemasResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents a DocumentService */ - class DocumentService extends $protobuf.rpc.Service { - - /** - * Constructs a new DocumentService 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 DocumentService 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): DocumentService; - - /** - * Calls CreateDocument. - * @param request CreateDocumentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and CreateDocumentResponse - */ - public createDocument(request: google.cloud.contentwarehouse.v1.ICreateDocumentRequest, callback: google.cloud.contentwarehouse.v1.DocumentService.CreateDocumentCallback): void; - - /** - * Calls CreateDocument. - * @param request CreateDocumentRequest message or plain object - * @returns Promise - */ - public createDocument(request: google.cloud.contentwarehouse.v1.ICreateDocumentRequest): Promise; - - /** - * Calls GetDocument. - * @param request GetDocumentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Document - */ - public getDocument(request: google.cloud.contentwarehouse.v1.IGetDocumentRequest, callback: google.cloud.contentwarehouse.v1.DocumentService.GetDocumentCallback): void; - - /** - * Calls GetDocument. - * @param request GetDocumentRequest message or plain object - * @returns Promise - */ - public getDocument(request: google.cloud.contentwarehouse.v1.IGetDocumentRequest): Promise; - - /** - * Calls UpdateDocument. - * @param request UpdateDocumentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and UpdateDocumentResponse - */ - public updateDocument(request: google.cloud.contentwarehouse.v1.IUpdateDocumentRequest, callback: google.cloud.contentwarehouse.v1.DocumentService.UpdateDocumentCallback): void; - - /** - * Calls UpdateDocument. - * @param request UpdateDocumentRequest message or plain object - * @returns Promise - */ - public updateDocument(request: google.cloud.contentwarehouse.v1.IUpdateDocumentRequest): Promise; - - /** - * Calls DeleteDocument. - * @param request DeleteDocumentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteDocument(request: google.cloud.contentwarehouse.v1.IDeleteDocumentRequest, callback: google.cloud.contentwarehouse.v1.DocumentService.DeleteDocumentCallback): void; - - /** - * Calls DeleteDocument. - * @param request DeleteDocumentRequest message or plain object - * @returns Promise - */ - public deleteDocument(request: google.cloud.contentwarehouse.v1.IDeleteDocumentRequest): Promise; - - /** - * Calls SearchDocuments. - * @param request SearchDocumentsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and SearchDocumentsResponse - */ - public searchDocuments(request: google.cloud.contentwarehouse.v1.ISearchDocumentsRequest, callback: google.cloud.contentwarehouse.v1.DocumentService.SearchDocumentsCallback): void; - - /** - * Calls SearchDocuments. - * @param request SearchDocumentsRequest message or plain object - * @returns Promise - */ - public searchDocuments(request: google.cloud.contentwarehouse.v1.ISearchDocumentsRequest): Promise; - - /** - * Calls LockDocument. - * @param request LockDocumentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Document - */ - public lockDocument(request: google.cloud.contentwarehouse.v1.ILockDocumentRequest, callback: google.cloud.contentwarehouse.v1.DocumentService.LockDocumentCallback): void; - - /** - * Calls LockDocument. - * @param request LockDocumentRequest message or plain object - * @returns Promise - */ - public lockDocument(request: google.cloud.contentwarehouse.v1.ILockDocumentRequest): Promise; - - /** - * Calls FetchAcl. - * @param request FetchAclRequest message or plain object - * @param callback Node-style callback called with the error, if any, and FetchAclResponse - */ - public fetchAcl(request: google.cloud.contentwarehouse.v1.IFetchAclRequest, callback: google.cloud.contentwarehouse.v1.DocumentService.FetchAclCallback): void; - - /** - * Calls FetchAcl. - * @param request FetchAclRequest message or plain object - * @returns Promise - */ - public fetchAcl(request: google.cloud.contentwarehouse.v1.IFetchAclRequest): Promise; - - /** - * Calls SetAcl. - * @param request SetAclRequest message or plain object - * @param callback Node-style callback called with the error, if any, and SetAclResponse - */ - public setAcl(request: google.cloud.contentwarehouse.v1.ISetAclRequest, callback: google.cloud.contentwarehouse.v1.DocumentService.SetAclCallback): void; - - /** - * Calls SetAcl. - * @param request SetAclRequest message or plain object - * @returns Promise - */ - public setAcl(request: google.cloud.contentwarehouse.v1.ISetAclRequest): Promise; - } - - namespace DocumentService { - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentService|createDocument}. - * @param error Error, if any - * @param [response] CreateDocumentResponse - */ - type CreateDocumentCallback = (error: (Error|null), response?: google.cloud.contentwarehouse.v1.CreateDocumentResponse) => void; - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentService|getDocument}. - * @param error Error, if any - * @param [response] Document - */ - type GetDocumentCallback = (error: (Error|null), response?: google.cloud.contentwarehouse.v1.Document) => void; - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentService|updateDocument}. - * @param error Error, if any - * @param [response] UpdateDocumentResponse - */ - type UpdateDocumentCallback = (error: (Error|null), response?: google.cloud.contentwarehouse.v1.UpdateDocumentResponse) => void; - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentService|deleteDocument}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteDocumentCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentService|searchDocuments}. - * @param error Error, if any - * @param [response] SearchDocumentsResponse - */ - type SearchDocumentsCallback = (error: (Error|null), response?: google.cloud.contentwarehouse.v1.SearchDocumentsResponse) => void; - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentService|lockDocument}. - * @param error Error, if any - * @param [response] Document - */ - type LockDocumentCallback = (error: (Error|null), response?: google.cloud.contentwarehouse.v1.Document) => void; - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentService|fetchAcl}. - * @param error Error, if any - * @param [response] FetchAclResponse - */ - type FetchAclCallback = (error: (Error|null), response?: google.cloud.contentwarehouse.v1.FetchAclResponse) => void; - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentService|setAcl}. - * @param error Error, if any - * @param [response] SetAclResponse - */ - type SetAclCallback = (error: (Error|null), response?: google.cloud.contentwarehouse.v1.SetAclResponse) => void; - } - - /** Properties of a CreateDocumentResponse. */ - interface ICreateDocumentResponse { - - /** CreateDocumentResponse document */ - document?: (google.cloud.contentwarehouse.v1.IDocument|null); - - /** CreateDocumentResponse ruleEngineOutput */ - ruleEngineOutput?: (google.cloud.contentwarehouse.v1.IRuleEngineOutput|null); - - /** CreateDocumentResponse metadata */ - metadata?: (google.cloud.contentwarehouse.v1.IResponseMetadata|null); - - /** CreateDocumentResponse longRunningOperations */ - longRunningOperations?: (google.longrunning.IOperation[]|null); - } - - /** Represents a CreateDocumentResponse. */ - class CreateDocumentResponse implements ICreateDocumentResponse { - - /** - * Constructs a new CreateDocumentResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.ICreateDocumentResponse); - - /** CreateDocumentResponse document. */ - public document?: (google.cloud.contentwarehouse.v1.IDocument|null); - - /** CreateDocumentResponse ruleEngineOutput. */ - public ruleEngineOutput?: (google.cloud.contentwarehouse.v1.IRuleEngineOutput|null); - - /** CreateDocumentResponse metadata. */ - public metadata?: (google.cloud.contentwarehouse.v1.IResponseMetadata|null); - - /** CreateDocumentResponse longRunningOperations. */ - public longRunningOperations: google.longrunning.IOperation[]; - - /** - * Creates a new CreateDocumentResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateDocumentResponse instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.ICreateDocumentResponse): google.cloud.contentwarehouse.v1.CreateDocumentResponse; - - /** - * Encodes the specified CreateDocumentResponse message. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateDocumentResponse.verify|verify} messages. - * @param message CreateDocumentResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.ICreateDocumentResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateDocumentResponse message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateDocumentResponse.verify|verify} messages. - * @param message CreateDocumentResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.ICreateDocumentResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateDocumentResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateDocumentResponse - * @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.cloud.contentwarehouse.v1.CreateDocumentResponse; - - /** - * Decodes a CreateDocumentResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateDocumentResponse - * @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.cloud.contentwarehouse.v1.CreateDocumentResponse; - - /** - * Verifies a CreateDocumentResponse 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 CreateDocumentResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateDocumentResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.CreateDocumentResponse; - - /** - * Creates a plain object from a CreateDocumentResponse message. Also converts values to other types if specified. - * @param message CreateDocumentResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.CreateDocumentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateDocumentResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateDocumentResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateDocumentResponse. */ - interface IUpdateDocumentResponse { - - /** UpdateDocumentResponse document */ - document?: (google.cloud.contentwarehouse.v1.IDocument|null); - - /** UpdateDocumentResponse ruleEngineOutput */ - ruleEngineOutput?: (google.cloud.contentwarehouse.v1.IRuleEngineOutput|null); - - /** UpdateDocumentResponse metadata */ - metadata?: (google.cloud.contentwarehouse.v1.IResponseMetadata|null); - } - - /** Represents an UpdateDocumentResponse. */ - class UpdateDocumentResponse implements IUpdateDocumentResponse { - - /** - * Constructs a new UpdateDocumentResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IUpdateDocumentResponse); - - /** UpdateDocumentResponse document. */ - public document?: (google.cloud.contentwarehouse.v1.IDocument|null); - - /** UpdateDocumentResponse ruleEngineOutput. */ - public ruleEngineOutput?: (google.cloud.contentwarehouse.v1.IRuleEngineOutput|null); - - /** UpdateDocumentResponse metadata. */ - public metadata?: (google.cloud.contentwarehouse.v1.IResponseMetadata|null); - - /** - * Creates a new UpdateDocumentResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateDocumentResponse instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IUpdateDocumentResponse): google.cloud.contentwarehouse.v1.UpdateDocumentResponse; - - /** - * Encodes the specified UpdateDocumentResponse message. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateDocumentResponse.verify|verify} messages. - * @param message UpdateDocumentResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IUpdateDocumentResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateDocumentResponse message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateDocumentResponse.verify|verify} messages. - * @param message UpdateDocumentResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IUpdateDocumentResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateDocumentResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateDocumentResponse - * @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.cloud.contentwarehouse.v1.UpdateDocumentResponse; - - /** - * Decodes an UpdateDocumentResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateDocumentResponse - * @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.cloud.contentwarehouse.v1.UpdateDocumentResponse; - - /** - * Verifies an UpdateDocumentResponse 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 UpdateDocumentResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateDocumentResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.UpdateDocumentResponse; - - /** - * Creates a plain object from an UpdateDocumentResponse message. Also converts values to other types if specified. - * @param message UpdateDocumentResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.UpdateDocumentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateDocumentResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateDocumentResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a QAResult. */ - interface IQAResult { - - /** QAResult highlights */ - highlights?: (google.cloud.contentwarehouse.v1.QAResult.IHighlight[]|null); - - /** QAResult confidenceScore */ - confidenceScore?: (number|null); - } - - /** Represents a QAResult. */ - class QAResult implements IQAResult { - - /** - * Constructs a new QAResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IQAResult); - - /** QAResult highlights. */ - public highlights: google.cloud.contentwarehouse.v1.QAResult.IHighlight[]; - - /** QAResult confidenceScore. */ - public confidenceScore: number; - - /** - * Creates a new QAResult instance using the specified properties. - * @param [properties] Properties to set - * @returns QAResult instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IQAResult): google.cloud.contentwarehouse.v1.QAResult; - - /** - * Encodes the specified QAResult message. Does not implicitly {@link google.cloud.contentwarehouse.v1.QAResult.verify|verify} messages. - * @param message QAResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IQAResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QAResult message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.QAResult.verify|verify} messages. - * @param message QAResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IQAResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QAResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QAResult - * @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.cloud.contentwarehouse.v1.QAResult; - - /** - * Decodes a QAResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QAResult - * @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.cloud.contentwarehouse.v1.QAResult; - - /** - * Verifies a QAResult 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 QAResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QAResult - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.QAResult; - - /** - * Creates a plain object from a QAResult message. Also converts values to other types if specified. - * @param message QAResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.QAResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QAResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for QAResult - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace QAResult { - - /** Properties of a Highlight. */ - interface IHighlight { - - /** Highlight startIndex */ - startIndex?: (number|null); - - /** Highlight endIndex */ - endIndex?: (number|null); - } - - /** Represents a Highlight. */ - class Highlight implements IHighlight { - - /** - * Constructs a new Highlight. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.QAResult.IHighlight); - - /** Highlight startIndex. */ - public startIndex: number; - - /** Highlight endIndex. */ - public endIndex: number; - - /** - * Creates a new Highlight instance using the specified properties. - * @param [properties] Properties to set - * @returns Highlight instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.QAResult.IHighlight): google.cloud.contentwarehouse.v1.QAResult.Highlight; - - /** - * Encodes the specified Highlight message. Does not implicitly {@link google.cloud.contentwarehouse.v1.QAResult.Highlight.verify|verify} messages. - * @param message Highlight message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.QAResult.IHighlight, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Highlight message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.QAResult.Highlight.verify|verify} messages. - * @param message Highlight message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.QAResult.IHighlight, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Highlight message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Highlight - * @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.cloud.contentwarehouse.v1.QAResult.Highlight; - - /** - * Decodes a Highlight message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Highlight - * @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.cloud.contentwarehouse.v1.QAResult.Highlight; - - /** - * Verifies a Highlight 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 Highlight message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Highlight - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.QAResult.Highlight; - - /** - * Creates a plain object from a Highlight message. Also converts values to other types if specified. - * @param message Highlight - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.QAResult.Highlight, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Highlight to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Highlight - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a SearchDocumentsResponse. */ - interface ISearchDocumentsResponse { - - /** SearchDocumentsResponse matchingDocuments */ - matchingDocuments?: (google.cloud.contentwarehouse.v1.SearchDocumentsResponse.IMatchingDocument[]|null); - - /** SearchDocumentsResponse nextPageToken */ - nextPageToken?: (string|null); - - /** SearchDocumentsResponse totalSize */ - totalSize?: (number|null); - - /** SearchDocumentsResponse metadata */ - metadata?: (google.cloud.contentwarehouse.v1.IResponseMetadata|null); - - /** SearchDocumentsResponse histogramQueryResults */ - histogramQueryResults?: (google.cloud.contentwarehouse.v1.IHistogramQueryResult[]|null); - - /** SearchDocumentsResponse questionAnswer */ - questionAnswer?: (string|null); - } - - /** Represents a SearchDocumentsResponse. */ - class SearchDocumentsResponse implements ISearchDocumentsResponse { - - /** - * Constructs a new SearchDocumentsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.ISearchDocumentsResponse); - - /** SearchDocumentsResponse matchingDocuments. */ - public matchingDocuments: google.cloud.contentwarehouse.v1.SearchDocumentsResponse.IMatchingDocument[]; - - /** SearchDocumentsResponse nextPageToken. */ - public nextPageToken: string; - - /** SearchDocumentsResponse totalSize. */ - public totalSize: number; - - /** SearchDocumentsResponse metadata. */ - public metadata?: (google.cloud.contentwarehouse.v1.IResponseMetadata|null); - - /** SearchDocumentsResponse histogramQueryResults. */ - public histogramQueryResults: google.cloud.contentwarehouse.v1.IHistogramQueryResult[]; - - /** SearchDocumentsResponse questionAnswer. */ - public questionAnswer: string; - - /** - * Creates a new SearchDocumentsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns SearchDocumentsResponse instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.ISearchDocumentsResponse): google.cloud.contentwarehouse.v1.SearchDocumentsResponse; - - /** - * Encodes the specified SearchDocumentsResponse message. Does not implicitly {@link google.cloud.contentwarehouse.v1.SearchDocumentsResponse.verify|verify} messages. - * @param message SearchDocumentsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.ISearchDocumentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SearchDocumentsResponse message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.SearchDocumentsResponse.verify|verify} messages. - * @param message SearchDocumentsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.ISearchDocumentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SearchDocumentsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SearchDocumentsResponse - * @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.cloud.contentwarehouse.v1.SearchDocumentsResponse; - - /** - * Decodes a SearchDocumentsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SearchDocumentsResponse - * @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.cloud.contentwarehouse.v1.SearchDocumentsResponse; - - /** - * Verifies a SearchDocumentsResponse 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 SearchDocumentsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SearchDocumentsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.SearchDocumentsResponse; - - /** - * Creates a plain object from a SearchDocumentsResponse message. Also converts values to other types if specified. - * @param message SearchDocumentsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.SearchDocumentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SearchDocumentsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SearchDocumentsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SearchDocumentsResponse { - - /** Properties of a MatchingDocument. */ - interface IMatchingDocument { - - /** MatchingDocument document */ - document?: (google.cloud.contentwarehouse.v1.IDocument|null); - - /** MatchingDocument searchTextSnippet */ - searchTextSnippet?: (string|null); - - /** MatchingDocument qaResult */ - qaResult?: (google.cloud.contentwarehouse.v1.IQAResult|null); - - /** MatchingDocument matchedTokenPageIndices */ - matchedTokenPageIndices?: ((number|Long|string)[]|null); - } - - /** Represents a MatchingDocument. */ - class MatchingDocument implements IMatchingDocument { - - /** - * Constructs a new MatchingDocument. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.SearchDocumentsResponse.IMatchingDocument); - - /** MatchingDocument document. */ - public document?: (google.cloud.contentwarehouse.v1.IDocument|null); - - /** MatchingDocument searchTextSnippet. */ - public searchTextSnippet: string; - - /** MatchingDocument qaResult. */ - public qaResult?: (google.cloud.contentwarehouse.v1.IQAResult|null); - - /** MatchingDocument matchedTokenPageIndices. */ - public matchedTokenPageIndices: (number|Long|string)[]; - - /** - * Creates a new MatchingDocument instance using the specified properties. - * @param [properties] Properties to set - * @returns MatchingDocument instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.SearchDocumentsResponse.IMatchingDocument): google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument; - - /** - * Encodes the specified MatchingDocument message. Does not implicitly {@link google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument.verify|verify} messages. - * @param message MatchingDocument message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.SearchDocumentsResponse.IMatchingDocument, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MatchingDocument message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument.verify|verify} messages. - * @param message MatchingDocument message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.SearchDocumentsResponse.IMatchingDocument, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MatchingDocument message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MatchingDocument - * @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.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument; - - /** - * Decodes a MatchingDocument message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MatchingDocument - * @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.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument; - - /** - * Verifies a MatchingDocument 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 MatchingDocument message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MatchingDocument - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument; - - /** - * Creates a plain object from a MatchingDocument message. Also converts values to other types if specified. - * @param message MatchingDocument - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MatchingDocument to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MatchingDocument - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a FetchAclResponse. */ - interface IFetchAclResponse { - - /** FetchAclResponse policy */ - policy?: (google.iam.v1.IPolicy|null); - - /** FetchAclResponse metadata */ - metadata?: (google.cloud.contentwarehouse.v1.IResponseMetadata|null); - } - - /** Represents a FetchAclResponse. */ - class FetchAclResponse implements IFetchAclResponse { - - /** - * Constructs a new FetchAclResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IFetchAclResponse); - - /** FetchAclResponse policy. */ - public policy?: (google.iam.v1.IPolicy|null); - - /** FetchAclResponse metadata. */ - public metadata?: (google.cloud.contentwarehouse.v1.IResponseMetadata|null); - - /** - * Creates a new FetchAclResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns FetchAclResponse instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IFetchAclResponse): google.cloud.contentwarehouse.v1.FetchAclResponse; - - /** - * Encodes the specified FetchAclResponse message. Does not implicitly {@link google.cloud.contentwarehouse.v1.FetchAclResponse.verify|verify} messages. - * @param message FetchAclResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IFetchAclResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FetchAclResponse message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.FetchAclResponse.verify|verify} messages. - * @param message FetchAclResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IFetchAclResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FetchAclResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FetchAclResponse - * @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.cloud.contentwarehouse.v1.FetchAclResponse; - - /** - * Decodes a FetchAclResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FetchAclResponse - * @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.cloud.contentwarehouse.v1.FetchAclResponse; - - /** - * Verifies a FetchAclResponse 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 FetchAclResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FetchAclResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.FetchAclResponse; - - /** - * Creates a plain object from a FetchAclResponse message. Also converts values to other types if specified. - * @param message FetchAclResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.FetchAclResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FetchAclResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FetchAclResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SetAclResponse. */ - interface ISetAclResponse { - - /** SetAclResponse policy */ - policy?: (google.iam.v1.IPolicy|null); - - /** SetAclResponse metadata */ - metadata?: (google.cloud.contentwarehouse.v1.IResponseMetadata|null); - } - - /** Represents a SetAclResponse. */ - class SetAclResponse implements ISetAclResponse { - - /** - * Constructs a new SetAclResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.ISetAclResponse); - - /** SetAclResponse policy. */ - public policy?: (google.iam.v1.IPolicy|null); - - /** SetAclResponse metadata. */ - public metadata?: (google.cloud.contentwarehouse.v1.IResponseMetadata|null); - - /** - * Creates a new SetAclResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns SetAclResponse instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.ISetAclResponse): google.cloud.contentwarehouse.v1.SetAclResponse; - - /** - * Encodes the specified SetAclResponse message. Does not implicitly {@link google.cloud.contentwarehouse.v1.SetAclResponse.verify|verify} messages. - * @param message SetAclResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.ISetAclResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SetAclResponse message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.SetAclResponse.verify|verify} messages. - * @param message SetAclResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.ISetAclResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SetAclResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SetAclResponse - * @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.cloud.contentwarehouse.v1.SetAclResponse; - - /** - * Decodes a SetAclResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SetAclResponse - * @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.cloud.contentwarehouse.v1.SetAclResponse; - - /** - * Verifies a SetAclResponse 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 SetAclResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SetAclResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.SetAclResponse; - - /** - * Creates a plain object from a SetAclResponse message. Also converts values to other types if specified. - * @param message SetAclResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.SetAclResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SetAclResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SetAclResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CloudAIDocumentOption. */ - interface ICloudAIDocumentOption { - - /** CloudAIDocumentOption enableEntitiesConversions */ - enableEntitiesConversions?: (boolean|null); - - /** CloudAIDocumentOption customizedEntitiesPropertiesConversions */ - customizedEntitiesPropertiesConversions?: ({ [k: string]: string }|null); - } - - /** Represents a CloudAIDocumentOption. */ - class CloudAIDocumentOption implements ICloudAIDocumentOption { - - /** - * Constructs a new CloudAIDocumentOption. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.ICloudAIDocumentOption); - - /** CloudAIDocumentOption enableEntitiesConversions. */ - public enableEntitiesConversions: boolean; - - /** CloudAIDocumentOption customizedEntitiesPropertiesConversions. */ - public customizedEntitiesPropertiesConversions: { [k: string]: string }; - - /** - * Creates a new CloudAIDocumentOption instance using the specified properties. - * @param [properties] Properties to set - * @returns CloudAIDocumentOption instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.ICloudAIDocumentOption): google.cloud.contentwarehouse.v1.CloudAIDocumentOption; - - /** - * Encodes the specified CloudAIDocumentOption message. Does not implicitly {@link google.cloud.contentwarehouse.v1.CloudAIDocumentOption.verify|verify} messages. - * @param message CloudAIDocumentOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.ICloudAIDocumentOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CloudAIDocumentOption message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.CloudAIDocumentOption.verify|verify} messages. - * @param message CloudAIDocumentOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.ICloudAIDocumentOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CloudAIDocumentOption message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CloudAIDocumentOption - * @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.cloud.contentwarehouse.v1.CloudAIDocumentOption; - - /** - * Decodes a CloudAIDocumentOption message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CloudAIDocumentOption - * @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.cloud.contentwarehouse.v1.CloudAIDocumentOption; - - /** - * Verifies a CloudAIDocumentOption 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 CloudAIDocumentOption message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CloudAIDocumentOption - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.CloudAIDocumentOption; - - /** - * Creates a plain object from a CloudAIDocumentOption message. Also converts values to other types if specified. - * @param message CloudAIDocumentOption - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.CloudAIDocumentOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CloudAIDocumentOption to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CloudAIDocumentOption - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateDocumentRequest. */ - interface ICreateDocumentRequest { - - /** CreateDocumentRequest parent */ - parent?: (string|null); - - /** CreateDocumentRequest document */ - document?: (google.cloud.contentwarehouse.v1.IDocument|null); - - /** CreateDocumentRequest requestMetadata */ - requestMetadata?: (google.cloud.contentwarehouse.v1.IRequestMetadata|null); - - /** CreateDocumentRequest policy */ - policy?: (google.iam.v1.IPolicy|null); - - /** CreateDocumentRequest cloudAiDocumentOption */ - cloudAiDocumentOption?: (google.cloud.contentwarehouse.v1.ICloudAIDocumentOption|null); - - /** CreateDocumentRequest createMask */ - createMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents a CreateDocumentRequest. */ - class CreateDocumentRequest implements ICreateDocumentRequest { - - /** - * Constructs a new CreateDocumentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.ICreateDocumentRequest); - - /** CreateDocumentRequest parent. */ - public parent: string; - - /** CreateDocumentRequest document. */ - public document?: (google.cloud.contentwarehouse.v1.IDocument|null); - - /** CreateDocumentRequest requestMetadata. */ - public requestMetadata?: (google.cloud.contentwarehouse.v1.IRequestMetadata|null); - - /** CreateDocumentRequest policy. */ - public policy?: (google.iam.v1.IPolicy|null); - - /** CreateDocumentRequest cloudAiDocumentOption. */ - public cloudAiDocumentOption?: (google.cloud.contentwarehouse.v1.ICloudAIDocumentOption|null); - - /** CreateDocumentRequest createMask. */ - public createMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new CreateDocumentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateDocumentRequest instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.ICreateDocumentRequest): google.cloud.contentwarehouse.v1.CreateDocumentRequest; - - /** - * Encodes the specified CreateDocumentRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateDocumentRequest.verify|verify} messages. - * @param message CreateDocumentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.ICreateDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateDocumentRequest.verify|verify} messages. - * @param message CreateDocumentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.ICreateDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateDocumentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateDocumentRequest - * @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.cloud.contentwarehouse.v1.CreateDocumentRequest; - - /** - * Decodes a CreateDocumentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateDocumentRequest - * @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.cloud.contentwarehouse.v1.CreateDocumentRequest; - - /** - * Verifies a CreateDocumentRequest 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 CreateDocumentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateDocumentRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.CreateDocumentRequest; - - /** - * Creates a plain object from a CreateDocumentRequest message. Also converts values to other types if specified. - * @param message CreateDocumentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.CreateDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateDocumentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateDocumentRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetDocumentRequest. */ - interface IGetDocumentRequest { - - /** GetDocumentRequest name */ - name?: (string|null); - - /** GetDocumentRequest requestMetadata */ - requestMetadata?: (google.cloud.contentwarehouse.v1.IRequestMetadata|null); - } - - /** Represents a GetDocumentRequest. */ - class GetDocumentRequest implements IGetDocumentRequest { - - /** - * Constructs a new GetDocumentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IGetDocumentRequest); - - /** GetDocumentRequest name. */ - public name: string; - - /** GetDocumentRequest requestMetadata. */ - public requestMetadata?: (google.cloud.contentwarehouse.v1.IRequestMetadata|null); - - /** - * Creates a new GetDocumentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetDocumentRequest instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IGetDocumentRequest): google.cloud.contentwarehouse.v1.GetDocumentRequest; - - /** - * Encodes the specified GetDocumentRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.GetDocumentRequest.verify|verify} messages. - * @param message GetDocumentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IGetDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.GetDocumentRequest.verify|verify} messages. - * @param message GetDocumentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IGetDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetDocumentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetDocumentRequest - * @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.cloud.contentwarehouse.v1.GetDocumentRequest; - - /** - * Decodes a GetDocumentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetDocumentRequest - * @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.cloud.contentwarehouse.v1.GetDocumentRequest; - - /** - * Verifies a GetDocumentRequest 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 GetDocumentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetDocumentRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.GetDocumentRequest; - - /** - * Creates a plain object from a GetDocumentRequest message. Also converts values to other types if specified. - * @param message GetDocumentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.GetDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetDocumentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetDocumentRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateDocumentRequest. */ - interface IUpdateDocumentRequest { - - /** UpdateDocumentRequest name */ - name?: (string|null); - - /** UpdateDocumentRequest document */ - document?: (google.cloud.contentwarehouse.v1.IDocument|null); - - /** UpdateDocumentRequest requestMetadata */ - requestMetadata?: (google.cloud.contentwarehouse.v1.IRequestMetadata|null); - - /** UpdateDocumentRequest cloudAiDocumentOption */ - cloudAiDocumentOption?: (google.cloud.contentwarehouse.v1.ICloudAIDocumentOption|null); - - /** UpdateDocumentRequest updateOptions */ - updateOptions?: (google.cloud.contentwarehouse.v1.IUpdateOptions|null); - } - - /** Represents an UpdateDocumentRequest. */ - class UpdateDocumentRequest implements IUpdateDocumentRequest { - - /** - * Constructs a new UpdateDocumentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IUpdateDocumentRequest); - - /** UpdateDocumentRequest name. */ - public name: string; - - /** UpdateDocumentRequest document. */ - public document?: (google.cloud.contentwarehouse.v1.IDocument|null); - - /** UpdateDocumentRequest requestMetadata. */ - public requestMetadata?: (google.cloud.contentwarehouse.v1.IRequestMetadata|null); - - /** UpdateDocumentRequest cloudAiDocumentOption. */ - public cloudAiDocumentOption?: (google.cloud.contentwarehouse.v1.ICloudAIDocumentOption|null); - - /** UpdateDocumentRequest updateOptions. */ - public updateOptions?: (google.cloud.contentwarehouse.v1.IUpdateOptions|null); - - /** - * Creates a new UpdateDocumentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateDocumentRequest instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IUpdateDocumentRequest): google.cloud.contentwarehouse.v1.UpdateDocumentRequest; - - /** - * Encodes the specified UpdateDocumentRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateDocumentRequest.verify|verify} messages. - * @param message UpdateDocumentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IUpdateDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateDocumentRequest.verify|verify} messages. - * @param message UpdateDocumentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IUpdateDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateDocumentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateDocumentRequest - * @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.cloud.contentwarehouse.v1.UpdateDocumentRequest; - - /** - * Decodes an UpdateDocumentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateDocumentRequest - * @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.cloud.contentwarehouse.v1.UpdateDocumentRequest; - - /** - * Verifies an UpdateDocumentRequest 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 UpdateDocumentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateDocumentRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.UpdateDocumentRequest; - - /** - * Creates a plain object from an UpdateDocumentRequest message. Also converts values to other types if specified. - * @param message UpdateDocumentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.UpdateDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateDocumentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateDocumentRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteDocumentRequest. */ - interface IDeleteDocumentRequest { - - /** DeleteDocumentRequest name */ - name?: (string|null); - - /** DeleteDocumentRequest requestMetadata */ - requestMetadata?: (google.cloud.contentwarehouse.v1.IRequestMetadata|null); - } - - /** Represents a DeleteDocumentRequest. */ - class DeleteDocumentRequest implements IDeleteDocumentRequest { - - /** - * Constructs a new DeleteDocumentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IDeleteDocumentRequest); - - /** DeleteDocumentRequest name. */ - public name: string; - - /** DeleteDocumentRequest requestMetadata. */ - public requestMetadata?: (google.cloud.contentwarehouse.v1.IRequestMetadata|null); - - /** - * Creates a new DeleteDocumentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteDocumentRequest instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IDeleteDocumentRequest): google.cloud.contentwarehouse.v1.DeleteDocumentRequest; - - /** - * Encodes the specified DeleteDocumentRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DeleteDocumentRequest.verify|verify} messages. - * @param message DeleteDocumentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IDeleteDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DeleteDocumentRequest.verify|verify} messages. - * @param message DeleteDocumentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IDeleteDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteDocumentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteDocumentRequest - * @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.cloud.contentwarehouse.v1.DeleteDocumentRequest; - - /** - * Decodes a DeleteDocumentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteDocumentRequest - * @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.cloud.contentwarehouse.v1.DeleteDocumentRequest; - - /** - * Verifies a DeleteDocumentRequest 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 DeleteDocumentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteDocumentRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.DeleteDocumentRequest; - - /** - * Creates a plain object from a DeleteDocumentRequest message. Also converts values to other types if specified. - * @param message DeleteDocumentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.DeleteDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteDocumentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteDocumentRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SearchDocumentsRequest. */ - interface ISearchDocumentsRequest { - - /** SearchDocumentsRequest parent */ - parent?: (string|null); - - /** SearchDocumentsRequest requestMetadata */ - requestMetadata?: (google.cloud.contentwarehouse.v1.IRequestMetadata|null); - - /** SearchDocumentsRequest documentQuery */ - documentQuery?: (google.cloud.contentwarehouse.v1.IDocumentQuery|null); - - /** SearchDocumentsRequest offset */ - offset?: (number|null); - - /** SearchDocumentsRequest pageSize */ - pageSize?: (number|null); - - /** SearchDocumentsRequest pageToken */ - pageToken?: (string|null); - - /** SearchDocumentsRequest orderBy */ - orderBy?: (string|null); - - /** SearchDocumentsRequest histogramQueries */ - histogramQueries?: (google.cloud.contentwarehouse.v1.IHistogramQuery[]|null); - - /** SearchDocumentsRequest requireTotalSize */ - requireTotalSize?: (boolean|null); - - /** SearchDocumentsRequest totalResultSize */ - totalResultSize?: (google.cloud.contentwarehouse.v1.SearchDocumentsRequest.TotalResultSize|keyof typeof google.cloud.contentwarehouse.v1.SearchDocumentsRequest.TotalResultSize|null); - - /** SearchDocumentsRequest qaSizeLimit */ - qaSizeLimit?: (number|null); - } - - /** Represents a SearchDocumentsRequest. */ - class SearchDocumentsRequest implements ISearchDocumentsRequest { - - /** - * Constructs a new SearchDocumentsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.ISearchDocumentsRequest); - - /** SearchDocumentsRequest parent. */ - public parent: string; - - /** SearchDocumentsRequest requestMetadata. */ - public requestMetadata?: (google.cloud.contentwarehouse.v1.IRequestMetadata|null); - - /** SearchDocumentsRequest documentQuery. */ - public documentQuery?: (google.cloud.contentwarehouse.v1.IDocumentQuery|null); - - /** SearchDocumentsRequest offset. */ - public offset: number; - - /** SearchDocumentsRequest pageSize. */ - public pageSize: number; - - /** SearchDocumentsRequest pageToken. */ - public pageToken: string; - - /** SearchDocumentsRequest orderBy. */ - public orderBy: string; - - /** SearchDocumentsRequest histogramQueries. */ - public histogramQueries: google.cloud.contentwarehouse.v1.IHistogramQuery[]; - - /** SearchDocumentsRequest requireTotalSize. */ - public requireTotalSize: boolean; - - /** SearchDocumentsRequest totalResultSize. */ - public totalResultSize: (google.cloud.contentwarehouse.v1.SearchDocumentsRequest.TotalResultSize|keyof typeof google.cloud.contentwarehouse.v1.SearchDocumentsRequest.TotalResultSize); - - /** SearchDocumentsRequest qaSizeLimit. */ - public qaSizeLimit: number; - - /** - * Creates a new SearchDocumentsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns SearchDocumentsRequest instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.ISearchDocumentsRequest): google.cloud.contentwarehouse.v1.SearchDocumentsRequest; - - /** - * Encodes the specified SearchDocumentsRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.SearchDocumentsRequest.verify|verify} messages. - * @param message SearchDocumentsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.ISearchDocumentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SearchDocumentsRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.SearchDocumentsRequest.verify|verify} messages. - * @param message SearchDocumentsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.ISearchDocumentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SearchDocumentsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SearchDocumentsRequest - * @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.cloud.contentwarehouse.v1.SearchDocumentsRequest; - - /** - * Decodes a SearchDocumentsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SearchDocumentsRequest - * @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.cloud.contentwarehouse.v1.SearchDocumentsRequest; - - /** - * Verifies a SearchDocumentsRequest 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 SearchDocumentsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SearchDocumentsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.SearchDocumentsRequest; - - /** - * Creates a plain object from a SearchDocumentsRequest message. Also converts values to other types if specified. - * @param message SearchDocumentsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.SearchDocumentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SearchDocumentsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SearchDocumentsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SearchDocumentsRequest { - - /** TotalResultSize enum. */ - enum TotalResultSize { - TOTAL_RESULT_SIZE_UNSPECIFIED = 0, - ESTIMATED_SIZE = 1, - ACTUAL_SIZE = 2 - } - } - - /** Properties of a LockDocumentRequest. */ - interface ILockDocumentRequest { - - /** LockDocumentRequest name */ - name?: (string|null); - - /** LockDocumentRequest collectionId */ - collectionId?: (string|null); - - /** LockDocumentRequest lockingUser */ - lockingUser?: (google.cloud.contentwarehouse.v1.IUserInfo|null); - } - - /** Represents a LockDocumentRequest. */ - class LockDocumentRequest implements ILockDocumentRequest { - - /** - * Constructs a new LockDocumentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.ILockDocumentRequest); - - /** LockDocumentRequest name. */ - public name: string; - - /** LockDocumentRequest collectionId. */ - public collectionId: string; - - /** LockDocumentRequest lockingUser. */ - public lockingUser?: (google.cloud.contentwarehouse.v1.IUserInfo|null); - - /** - * Creates a new LockDocumentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns LockDocumentRequest instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.ILockDocumentRequest): google.cloud.contentwarehouse.v1.LockDocumentRequest; - - /** - * Encodes the specified LockDocumentRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.LockDocumentRequest.verify|verify} messages. - * @param message LockDocumentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.ILockDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LockDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.LockDocumentRequest.verify|verify} messages. - * @param message LockDocumentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.ILockDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LockDocumentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LockDocumentRequest - * @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.cloud.contentwarehouse.v1.LockDocumentRequest; - - /** - * Decodes a LockDocumentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LockDocumentRequest - * @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.cloud.contentwarehouse.v1.LockDocumentRequest; - - /** - * Verifies a LockDocumentRequest 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 LockDocumentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LockDocumentRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.LockDocumentRequest; - - /** - * Creates a plain object from a LockDocumentRequest message. Also converts values to other types if specified. - * @param message LockDocumentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.LockDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LockDocumentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LockDocumentRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FetchAclRequest. */ - interface IFetchAclRequest { - - /** FetchAclRequest resource */ - resource?: (string|null); - - /** FetchAclRequest requestMetadata */ - requestMetadata?: (google.cloud.contentwarehouse.v1.IRequestMetadata|null); - - /** FetchAclRequest projectOwner */ - projectOwner?: (boolean|null); - } - - /** Represents a FetchAclRequest. */ - class FetchAclRequest implements IFetchAclRequest { - - /** - * Constructs a new FetchAclRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IFetchAclRequest); - - /** FetchAclRequest resource. */ - public resource: string; - - /** FetchAclRequest requestMetadata. */ - public requestMetadata?: (google.cloud.contentwarehouse.v1.IRequestMetadata|null); - - /** FetchAclRequest projectOwner. */ - public projectOwner: boolean; - - /** - * Creates a new FetchAclRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns FetchAclRequest instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IFetchAclRequest): google.cloud.contentwarehouse.v1.FetchAclRequest; - - /** - * Encodes the specified FetchAclRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.FetchAclRequest.verify|verify} messages. - * @param message FetchAclRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IFetchAclRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FetchAclRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.FetchAclRequest.verify|verify} messages. - * @param message FetchAclRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IFetchAclRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FetchAclRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FetchAclRequest - * @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.cloud.contentwarehouse.v1.FetchAclRequest; - - /** - * Decodes a FetchAclRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FetchAclRequest - * @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.cloud.contentwarehouse.v1.FetchAclRequest; - - /** - * Verifies a FetchAclRequest 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 FetchAclRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FetchAclRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.FetchAclRequest; - - /** - * Creates a plain object from a FetchAclRequest message. Also converts values to other types if specified. - * @param message FetchAclRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.FetchAclRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FetchAclRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FetchAclRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SetAclRequest. */ - interface ISetAclRequest { - - /** SetAclRequest resource */ - resource?: (string|null); - - /** SetAclRequest policy */ - policy?: (google.iam.v1.IPolicy|null); - - /** SetAclRequest requestMetadata */ - requestMetadata?: (google.cloud.contentwarehouse.v1.IRequestMetadata|null); - - /** SetAclRequest projectOwner */ - projectOwner?: (boolean|null); - } - - /** Represents a SetAclRequest. */ - class SetAclRequest implements ISetAclRequest { - - /** - * Constructs a new SetAclRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.ISetAclRequest); - - /** SetAclRequest resource. */ - public resource: string; - - /** SetAclRequest policy. */ - public policy?: (google.iam.v1.IPolicy|null); - - /** SetAclRequest requestMetadata. */ - public requestMetadata?: (google.cloud.contentwarehouse.v1.IRequestMetadata|null); - - /** SetAclRequest projectOwner. */ - public projectOwner: boolean; - - /** - * Creates a new SetAclRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns SetAclRequest instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.ISetAclRequest): google.cloud.contentwarehouse.v1.SetAclRequest; - - /** - * Encodes the specified SetAclRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.SetAclRequest.verify|verify} messages. - * @param message SetAclRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.ISetAclRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SetAclRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.SetAclRequest.verify|verify} messages. - * @param message SetAclRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.ISetAclRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SetAclRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SetAclRequest - * @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.cloud.contentwarehouse.v1.SetAclRequest; - - /** - * Decodes a SetAclRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SetAclRequest - * @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.cloud.contentwarehouse.v1.SetAclRequest; - - /** - * Verifies a SetAclRequest 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 SetAclRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SetAclRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.SetAclRequest; - - /** - * Creates a plain object from a SetAclRequest message. Also converts values to other types if specified. - * @param message SetAclRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.SetAclRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SetAclRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SetAclRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DocumentQuery. */ - interface IDocumentQuery { - - /** DocumentQuery query */ - query?: (string|null); - - /** DocumentQuery isNlQuery */ - isNlQuery?: (boolean|null); - - /** DocumentQuery customPropertyFilter */ - customPropertyFilter?: (string|null); - - /** DocumentQuery timeFilters */ - timeFilters?: (google.cloud.contentwarehouse.v1.ITimeFilter[]|null); - - /** DocumentQuery documentSchemaNames */ - documentSchemaNames?: (string[]|null); - - /** DocumentQuery propertyFilter */ - propertyFilter?: (google.cloud.contentwarehouse.v1.IPropertyFilter[]|null); - - /** DocumentQuery fileTypeFilter */ - fileTypeFilter?: (google.cloud.contentwarehouse.v1.IFileTypeFilter|null); - - /** DocumentQuery folderNameFilter */ - folderNameFilter?: (string|null); - - /** DocumentQuery documentNameFilter */ - documentNameFilter?: (string[]|null); - - /** DocumentQuery queryContext */ - queryContext?: (string[]|null); - - /** DocumentQuery documentCreatorFilter */ - documentCreatorFilter?: (string[]|null); - - /** DocumentQuery customWeightsMetadata */ - customWeightsMetadata?: (google.cloud.contentwarehouse.v1.ICustomWeightsMetadata|null); - } - - /** Represents a DocumentQuery. */ - class DocumentQuery implements IDocumentQuery { - - /** - * Constructs a new DocumentQuery. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IDocumentQuery); - - /** DocumentQuery query. */ - public query: string; - - /** DocumentQuery isNlQuery. */ - public isNlQuery: boolean; - - /** DocumentQuery customPropertyFilter. */ - public customPropertyFilter: string; - - /** DocumentQuery timeFilters. */ - public timeFilters: google.cloud.contentwarehouse.v1.ITimeFilter[]; - - /** DocumentQuery documentSchemaNames. */ - public documentSchemaNames: string[]; - - /** DocumentQuery propertyFilter. */ - public propertyFilter: google.cloud.contentwarehouse.v1.IPropertyFilter[]; - - /** DocumentQuery fileTypeFilter. */ - public fileTypeFilter?: (google.cloud.contentwarehouse.v1.IFileTypeFilter|null); - - /** DocumentQuery folderNameFilter. */ - public folderNameFilter: string; - - /** DocumentQuery documentNameFilter. */ - public documentNameFilter: string[]; - - /** DocumentQuery queryContext. */ - public queryContext: string[]; - - /** DocumentQuery documentCreatorFilter. */ - public documentCreatorFilter: string[]; - - /** DocumentQuery customWeightsMetadata. */ - public customWeightsMetadata?: (google.cloud.contentwarehouse.v1.ICustomWeightsMetadata|null); - - /** - * Creates a new DocumentQuery instance using the specified properties. - * @param [properties] Properties to set - * @returns DocumentQuery instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IDocumentQuery): google.cloud.contentwarehouse.v1.DocumentQuery; - - /** - * Encodes the specified DocumentQuery message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DocumentQuery.verify|verify} messages. - * @param message DocumentQuery message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IDocumentQuery, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DocumentQuery message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DocumentQuery.verify|verify} messages. - * @param message DocumentQuery message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IDocumentQuery, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DocumentQuery message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DocumentQuery - * @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.cloud.contentwarehouse.v1.DocumentQuery; - - /** - * Decodes a DocumentQuery message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DocumentQuery - * @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.cloud.contentwarehouse.v1.DocumentQuery; - - /** - * Verifies a DocumentQuery 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 DocumentQuery message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DocumentQuery - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.DocumentQuery; - - /** - * Creates a plain object from a DocumentQuery message. Also converts values to other types if specified. - * @param message DocumentQuery - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.DocumentQuery, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DocumentQuery to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DocumentQuery - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TimeFilter. */ - interface ITimeFilter { - - /** TimeFilter timeRange */ - timeRange?: (google.type.IInterval|null); - - /** TimeFilter timeField */ - timeField?: (google.cloud.contentwarehouse.v1.TimeFilter.TimeField|keyof typeof google.cloud.contentwarehouse.v1.TimeFilter.TimeField|null); - } - - /** Represents a TimeFilter. */ - class TimeFilter implements ITimeFilter { - - /** - * Constructs a new TimeFilter. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.ITimeFilter); - - /** TimeFilter timeRange. */ - public timeRange?: (google.type.IInterval|null); - - /** TimeFilter timeField. */ - public timeField: (google.cloud.contentwarehouse.v1.TimeFilter.TimeField|keyof typeof google.cloud.contentwarehouse.v1.TimeFilter.TimeField); - - /** - * Creates a new TimeFilter instance using the specified properties. - * @param [properties] Properties to set - * @returns TimeFilter instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.ITimeFilter): google.cloud.contentwarehouse.v1.TimeFilter; - - /** - * Encodes the specified TimeFilter message. Does not implicitly {@link google.cloud.contentwarehouse.v1.TimeFilter.verify|verify} messages. - * @param message TimeFilter message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.ITimeFilter, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TimeFilter message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.TimeFilter.verify|verify} messages. - * @param message TimeFilter message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.ITimeFilter, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TimeFilter message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TimeFilter - * @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.cloud.contentwarehouse.v1.TimeFilter; - - /** - * Decodes a TimeFilter message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TimeFilter - * @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.cloud.contentwarehouse.v1.TimeFilter; - - /** - * Verifies a TimeFilter 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 TimeFilter message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TimeFilter - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.TimeFilter; - - /** - * Creates a plain object from a TimeFilter message. Also converts values to other types if specified. - * @param message TimeFilter - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.TimeFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TimeFilter to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TimeFilter - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace TimeFilter { - - /** TimeField enum. */ - enum TimeField { - TIME_FIELD_UNSPECIFIED = 0, - CREATE_TIME = 1, - UPDATE_TIME = 2, - DISPOSITION_TIME = 3 - } - } - - /** Properties of a PropertyFilter. */ - interface IPropertyFilter { - - /** PropertyFilter documentSchemaName */ - documentSchemaName?: (string|null); - - /** PropertyFilter condition */ - condition?: (string|null); - } - - /** Represents a PropertyFilter. */ - class PropertyFilter implements IPropertyFilter { - - /** - * Constructs a new PropertyFilter. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IPropertyFilter); - - /** PropertyFilter documentSchemaName. */ - public documentSchemaName: string; - - /** PropertyFilter condition. */ - public condition: string; - - /** - * Creates a new PropertyFilter instance using the specified properties. - * @param [properties] Properties to set - * @returns PropertyFilter instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IPropertyFilter): google.cloud.contentwarehouse.v1.PropertyFilter; - - /** - * Encodes the specified PropertyFilter message. Does not implicitly {@link google.cloud.contentwarehouse.v1.PropertyFilter.verify|verify} messages. - * @param message PropertyFilter message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IPropertyFilter, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PropertyFilter message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.PropertyFilter.verify|verify} messages. - * @param message PropertyFilter message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IPropertyFilter, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PropertyFilter message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PropertyFilter - * @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.cloud.contentwarehouse.v1.PropertyFilter; - - /** - * Decodes a PropertyFilter message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PropertyFilter - * @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.cloud.contentwarehouse.v1.PropertyFilter; - - /** - * Verifies a PropertyFilter 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 PropertyFilter message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PropertyFilter - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.PropertyFilter; - - /** - * Creates a plain object from a PropertyFilter message. Also converts values to other types if specified. - * @param message PropertyFilter - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.PropertyFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PropertyFilter to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PropertyFilter - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FileTypeFilter. */ - interface IFileTypeFilter { - - /** FileTypeFilter fileType */ - fileType?: (google.cloud.contentwarehouse.v1.FileTypeFilter.FileType|keyof typeof google.cloud.contentwarehouse.v1.FileTypeFilter.FileType|null); - } - - /** Represents a FileTypeFilter. */ - class FileTypeFilter implements IFileTypeFilter { - - /** - * Constructs a new FileTypeFilter. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IFileTypeFilter); - - /** FileTypeFilter fileType. */ - public fileType: (google.cloud.contentwarehouse.v1.FileTypeFilter.FileType|keyof typeof google.cloud.contentwarehouse.v1.FileTypeFilter.FileType); - - /** - * Creates a new FileTypeFilter instance using the specified properties. - * @param [properties] Properties to set - * @returns FileTypeFilter instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IFileTypeFilter): google.cloud.contentwarehouse.v1.FileTypeFilter; - - /** - * Encodes the specified FileTypeFilter message. Does not implicitly {@link google.cloud.contentwarehouse.v1.FileTypeFilter.verify|verify} messages. - * @param message FileTypeFilter message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IFileTypeFilter, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileTypeFilter message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.FileTypeFilter.verify|verify} messages. - * @param message FileTypeFilter message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IFileTypeFilter, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileTypeFilter message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileTypeFilter - * @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.cloud.contentwarehouse.v1.FileTypeFilter; - - /** - * Decodes a FileTypeFilter message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileTypeFilter - * @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.cloud.contentwarehouse.v1.FileTypeFilter; - - /** - * Verifies a FileTypeFilter 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 FileTypeFilter message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileTypeFilter - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.FileTypeFilter; - - /** - * Creates a plain object from a FileTypeFilter message. Also converts values to other types if specified. - * @param message FileTypeFilter - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.FileTypeFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileTypeFilter to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileTypeFilter - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FileTypeFilter { - - /** FileType enum. */ - enum FileType { - FILE_TYPE_UNSPECIFIED = 0, - ALL = 1, - FOLDER = 2, - DOCUMENT = 3, - ROOT_FOLDER = 4 - } - } - - /** Properties of a CustomWeightsMetadata. */ - interface ICustomWeightsMetadata { - - /** CustomWeightsMetadata weightedSchemaProperties */ - weightedSchemaProperties?: (google.cloud.contentwarehouse.v1.IWeightedSchemaProperty[]|null); - } - - /** Represents a CustomWeightsMetadata. */ - class CustomWeightsMetadata implements ICustomWeightsMetadata { - - /** - * Constructs a new CustomWeightsMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.ICustomWeightsMetadata); - - /** CustomWeightsMetadata weightedSchemaProperties. */ - public weightedSchemaProperties: google.cloud.contentwarehouse.v1.IWeightedSchemaProperty[]; - - /** - * Creates a new CustomWeightsMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns CustomWeightsMetadata instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.ICustomWeightsMetadata): google.cloud.contentwarehouse.v1.CustomWeightsMetadata; - - /** - * Encodes the specified CustomWeightsMetadata message. Does not implicitly {@link google.cloud.contentwarehouse.v1.CustomWeightsMetadata.verify|verify} messages. - * @param message CustomWeightsMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.ICustomWeightsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CustomWeightsMetadata message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.CustomWeightsMetadata.verify|verify} messages. - * @param message CustomWeightsMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.ICustomWeightsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CustomWeightsMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CustomWeightsMetadata - * @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.cloud.contentwarehouse.v1.CustomWeightsMetadata; - - /** - * Decodes a CustomWeightsMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CustomWeightsMetadata - * @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.cloud.contentwarehouse.v1.CustomWeightsMetadata; - - /** - * Verifies a CustomWeightsMetadata 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 CustomWeightsMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CustomWeightsMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.CustomWeightsMetadata; - - /** - * Creates a plain object from a CustomWeightsMetadata message. Also converts values to other types if specified. - * @param message CustomWeightsMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.CustomWeightsMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CustomWeightsMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CustomWeightsMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a WeightedSchemaProperty. */ - interface IWeightedSchemaProperty { - - /** WeightedSchemaProperty documentSchemaName */ - documentSchemaName?: (string|null); - - /** WeightedSchemaProperty propertyNames */ - propertyNames?: (string[]|null); - } - - /** Represents a WeightedSchemaProperty. */ - class WeightedSchemaProperty implements IWeightedSchemaProperty { - - /** - * Constructs a new WeightedSchemaProperty. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IWeightedSchemaProperty); - - /** WeightedSchemaProperty documentSchemaName. */ - public documentSchemaName: string; - - /** WeightedSchemaProperty propertyNames. */ - public propertyNames: string[]; - - /** - * Creates a new WeightedSchemaProperty instance using the specified properties. - * @param [properties] Properties to set - * @returns WeightedSchemaProperty instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IWeightedSchemaProperty): google.cloud.contentwarehouse.v1.WeightedSchemaProperty; - - /** - * Encodes the specified WeightedSchemaProperty message. Does not implicitly {@link google.cloud.contentwarehouse.v1.WeightedSchemaProperty.verify|verify} messages. - * @param message WeightedSchemaProperty message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IWeightedSchemaProperty, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified WeightedSchemaProperty message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.WeightedSchemaProperty.verify|verify} messages. - * @param message WeightedSchemaProperty message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IWeightedSchemaProperty, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a WeightedSchemaProperty message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns WeightedSchemaProperty - * @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.cloud.contentwarehouse.v1.WeightedSchemaProperty; - - /** - * Decodes a WeightedSchemaProperty message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WeightedSchemaProperty - * @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.cloud.contentwarehouse.v1.WeightedSchemaProperty; - - /** - * Verifies a WeightedSchemaProperty 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 WeightedSchemaProperty message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WeightedSchemaProperty - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.WeightedSchemaProperty; - - /** - * Creates a plain object from a WeightedSchemaProperty message. Also converts values to other types if specified. - * @param message WeightedSchemaProperty - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.WeightedSchemaProperty, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WeightedSchemaProperty to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for WeightedSchemaProperty - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a HistogramQuery. */ - interface IHistogramQuery { - - /** HistogramQuery histogramQuery */ - histogramQuery?: (string|null); - - /** HistogramQuery requirePreciseResultSize */ - requirePreciseResultSize?: (boolean|null); - - /** HistogramQuery filters */ - filters?: (google.cloud.contentwarehouse.v1.IHistogramQueryPropertyNameFilter|null); - } - - /** Represents a HistogramQuery. */ - class HistogramQuery implements IHistogramQuery { - - /** - * Constructs a new HistogramQuery. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IHistogramQuery); - - /** HistogramQuery histogramQuery. */ - public histogramQuery: string; - - /** HistogramQuery requirePreciseResultSize. */ - public requirePreciseResultSize: boolean; - - /** HistogramQuery filters. */ - public filters?: (google.cloud.contentwarehouse.v1.IHistogramQueryPropertyNameFilter|null); - - /** - * Creates a new HistogramQuery instance using the specified properties. - * @param [properties] Properties to set - * @returns HistogramQuery instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IHistogramQuery): google.cloud.contentwarehouse.v1.HistogramQuery; - - /** - * Encodes the specified HistogramQuery message. Does not implicitly {@link google.cloud.contentwarehouse.v1.HistogramQuery.verify|verify} messages. - * @param message HistogramQuery message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IHistogramQuery, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified HistogramQuery message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.HistogramQuery.verify|verify} messages. - * @param message HistogramQuery message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IHistogramQuery, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a HistogramQuery message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns HistogramQuery - * @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.cloud.contentwarehouse.v1.HistogramQuery; - - /** - * Decodes a HistogramQuery message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns HistogramQuery - * @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.cloud.contentwarehouse.v1.HistogramQuery; - - /** - * Verifies a HistogramQuery 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 HistogramQuery message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns HistogramQuery - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.HistogramQuery; - - /** - * Creates a plain object from a HistogramQuery message. Also converts values to other types if specified. - * @param message HistogramQuery - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.HistogramQuery, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this HistogramQuery to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for HistogramQuery - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a HistogramQueryPropertyNameFilter. */ - interface IHistogramQueryPropertyNameFilter { - - /** HistogramQueryPropertyNameFilter documentSchemas */ - documentSchemas?: (string[]|null); - - /** HistogramQueryPropertyNameFilter propertyNames */ - propertyNames?: (string[]|null); - - /** HistogramQueryPropertyNameFilter yAxis */ - yAxis?: (google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.HistogramYAxis|keyof typeof google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.HistogramYAxis|null); - } - - /** Represents a HistogramQueryPropertyNameFilter. */ - class HistogramQueryPropertyNameFilter implements IHistogramQueryPropertyNameFilter { - - /** - * Constructs a new HistogramQueryPropertyNameFilter. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IHistogramQueryPropertyNameFilter); - - /** HistogramQueryPropertyNameFilter documentSchemas. */ - public documentSchemas: string[]; - - /** HistogramQueryPropertyNameFilter propertyNames. */ - public propertyNames: string[]; - - /** HistogramQueryPropertyNameFilter yAxis. */ - public yAxis: (google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.HistogramYAxis|keyof typeof google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.HistogramYAxis); - - /** - * Creates a new HistogramQueryPropertyNameFilter instance using the specified properties. - * @param [properties] Properties to set - * @returns HistogramQueryPropertyNameFilter instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IHistogramQueryPropertyNameFilter): google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter; - - /** - * Encodes the specified HistogramQueryPropertyNameFilter message. Does not implicitly {@link google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.verify|verify} messages. - * @param message HistogramQueryPropertyNameFilter message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IHistogramQueryPropertyNameFilter, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified HistogramQueryPropertyNameFilter message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.verify|verify} messages. - * @param message HistogramQueryPropertyNameFilter message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IHistogramQueryPropertyNameFilter, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a HistogramQueryPropertyNameFilter message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns HistogramQueryPropertyNameFilter - * @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.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter; - - /** - * Decodes a HistogramQueryPropertyNameFilter message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns HistogramQueryPropertyNameFilter - * @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.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter; - - /** - * Verifies a HistogramQueryPropertyNameFilter 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 HistogramQueryPropertyNameFilter message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns HistogramQueryPropertyNameFilter - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter; - - /** - * Creates a plain object from a HistogramQueryPropertyNameFilter message. Also converts values to other types if specified. - * @param message HistogramQueryPropertyNameFilter - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this HistogramQueryPropertyNameFilter to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for HistogramQueryPropertyNameFilter - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace HistogramQueryPropertyNameFilter { - - /** HistogramYAxis enum. */ - enum HistogramYAxis { - HISTOGRAM_YAXIS_DOCUMENT = 0, - HISTOGRAM_YAXIS_PROPERTY = 1 - } - } - - /** Properties of a HistogramQueryResult. */ - interface IHistogramQueryResult { - - /** HistogramQueryResult histogramQuery */ - histogramQuery?: (string|null); - - /** HistogramQueryResult histogram */ - histogram?: ({ [k: string]: (number|Long|string) }|null); - } - - /** Represents a HistogramQueryResult. */ - class HistogramQueryResult implements IHistogramQueryResult { - - /** - * Constructs a new HistogramQueryResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IHistogramQueryResult); - - /** HistogramQueryResult histogramQuery. */ - public histogramQuery: string; - - /** HistogramQueryResult histogram. */ - public histogram: { [k: string]: (number|Long|string) }; - - /** - * Creates a new HistogramQueryResult instance using the specified properties. - * @param [properties] Properties to set - * @returns HistogramQueryResult instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IHistogramQueryResult): google.cloud.contentwarehouse.v1.HistogramQueryResult; - - /** - * Encodes the specified HistogramQueryResult message. Does not implicitly {@link google.cloud.contentwarehouse.v1.HistogramQueryResult.verify|verify} messages. - * @param message HistogramQueryResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IHistogramQueryResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified HistogramQueryResult message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.HistogramQueryResult.verify|verify} messages. - * @param message HistogramQueryResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IHistogramQueryResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a HistogramQueryResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns HistogramQueryResult - * @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.cloud.contentwarehouse.v1.HistogramQueryResult; - - /** - * Decodes a HistogramQueryResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns HistogramQueryResult - * @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.cloud.contentwarehouse.v1.HistogramQueryResult; - - /** - * Verifies a HistogramQueryResult 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 HistogramQueryResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns HistogramQueryResult - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.HistogramQueryResult; - - /** - * Creates a plain object from a HistogramQueryResult message. Also converts values to other types if specified. - * @param message HistogramQueryResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.HistogramQueryResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this HistogramQueryResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for HistogramQueryResult - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RuleSet. */ - interface IRuleSet { - - /** RuleSet name */ - name?: (string|null); - - /** RuleSet description */ - description?: (string|null); - - /** RuleSet source */ - source?: (string|null); - - /** RuleSet rules */ - rules?: (google.cloud.contentwarehouse.v1.IRule[]|null); - } - - /** Represents a RuleSet. */ - class RuleSet implements IRuleSet { - - /** - * Constructs a new RuleSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IRuleSet); - - /** RuleSet name. */ - public name: string; - - /** RuleSet description. */ - public description: string; - - /** RuleSet source. */ - public source: string; - - /** RuleSet rules. */ - public rules: google.cloud.contentwarehouse.v1.IRule[]; - - /** - * Creates a new RuleSet instance using the specified properties. - * @param [properties] Properties to set - * @returns RuleSet instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IRuleSet): google.cloud.contentwarehouse.v1.RuleSet; - - /** - * Encodes the specified RuleSet message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RuleSet.verify|verify} messages. - * @param message RuleSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IRuleSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RuleSet message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RuleSet.verify|verify} messages. - * @param message RuleSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IRuleSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RuleSet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RuleSet - * @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.cloud.contentwarehouse.v1.RuleSet; - - /** - * Decodes a RuleSet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RuleSet - * @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.cloud.contentwarehouse.v1.RuleSet; - - /** - * Verifies a RuleSet 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 RuleSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RuleSet - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.RuleSet; - - /** - * Creates a plain object from a RuleSet message. Also converts values to other types if specified. - * @param message RuleSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.RuleSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RuleSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RuleSet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Rule. */ - interface IRule { - - /** Rule description */ - description?: (string|null); - - /** Rule ruleId */ - ruleId?: (string|null); - - /** Rule triggerType */ - triggerType?: (google.cloud.contentwarehouse.v1.Rule.TriggerType|keyof typeof google.cloud.contentwarehouse.v1.Rule.TriggerType|null); - - /** Rule condition */ - condition?: (string|null); - - /** Rule actions */ - actions?: (google.cloud.contentwarehouse.v1.IAction[]|null); - } - - /** Represents a Rule. */ - class Rule implements IRule { - - /** - * Constructs a new Rule. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IRule); - - /** Rule description. */ - public description: string; - - /** Rule ruleId. */ - public ruleId: string; - - /** Rule triggerType. */ - public triggerType: (google.cloud.contentwarehouse.v1.Rule.TriggerType|keyof typeof google.cloud.contentwarehouse.v1.Rule.TriggerType); - - /** Rule condition. */ - public condition: string; - - /** Rule actions. */ - public actions: google.cloud.contentwarehouse.v1.IAction[]; - - /** - * Creates a new Rule instance using the specified properties. - * @param [properties] Properties to set - * @returns Rule instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IRule): google.cloud.contentwarehouse.v1.Rule; - - /** - * Encodes the specified Rule message. Does not implicitly {@link google.cloud.contentwarehouse.v1.Rule.verify|verify} messages. - * @param message Rule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Rule message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.Rule.verify|verify} messages. - * @param message Rule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Rule message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Rule - * @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.cloud.contentwarehouse.v1.Rule; - - /** - * Decodes a Rule message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Rule - * @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.cloud.contentwarehouse.v1.Rule; - - /** - * Verifies a Rule 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 Rule message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Rule - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.Rule; - - /** - * Creates a plain object from a Rule message. Also converts values to other types if specified. - * @param message Rule - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.Rule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Rule to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Rule - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Rule { - - /** TriggerType enum. */ - enum TriggerType { - UNKNOWN = 0, - ON_CREATE = 1, - ON_UPDATE = 4, - ON_CREATE_LINK = 7, - ON_DELETE_LINK = 8 - } - } - - /** Properties of an Action. */ - interface IAction { - - /** Action actionId */ - actionId?: (string|null); - - /** Action accessControl */ - accessControl?: (google.cloud.contentwarehouse.v1.IAccessControlAction|null); - - /** Action dataValidation */ - dataValidation?: (google.cloud.contentwarehouse.v1.IDataValidationAction|null); - - /** Action dataUpdate */ - dataUpdate?: (google.cloud.contentwarehouse.v1.IDataUpdateAction|null); - - /** Action addToFolder */ - addToFolder?: (google.cloud.contentwarehouse.v1.IAddToFolderAction|null); - - /** Action publishToPubSub */ - publishToPubSub?: (google.cloud.contentwarehouse.v1.IPublishAction|null); - - /** Action removeFromFolderAction */ - removeFromFolderAction?: (google.cloud.contentwarehouse.v1.IRemoveFromFolderAction|null); - - /** Action deleteDocumentAction */ - deleteDocumentAction?: (google.cloud.contentwarehouse.v1.IDeleteDocumentAction|null); - } - - /** Represents an Action. */ - class Action implements IAction { - - /** - * Constructs a new Action. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IAction); - - /** Action actionId. */ - public actionId: string; - - /** Action accessControl. */ - public accessControl?: (google.cloud.contentwarehouse.v1.IAccessControlAction|null); - - /** Action dataValidation. */ - public dataValidation?: (google.cloud.contentwarehouse.v1.IDataValidationAction|null); - - /** Action dataUpdate. */ - public dataUpdate?: (google.cloud.contentwarehouse.v1.IDataUpdateAction|null); - - /** Action addToFolder. */ - public addToFolder?: (google.cloud.contentwarehouse.v1.IAddToFolderAction|null); - - /** Action publishToPubSub. */ - public publishToPubSub?: (google.cloud.contentwarehouse.v1.IPublishAction|null); - - /** Action removeFromFolderAction. */ - public removeFromFolderAction?: (google.cloud.contentwarehouse.v1.IRemoveFromFolderAction|null); - - /** Action deleteDocumentAction. */ - public deleteDocumentAction?: (google.cloud.contentwarehouse.v1.IDeleteDocumentAction|null); - - /** Action action. */ - public action?: ("accessControl"|"dataValidation"|"dataUpdate"|"addToFolder"|"publishToPubSub"|"removeFromFolderAction"|"deleteDocumentAction"); - - /** - * Creates a new Action instance using the specified properties. - * @param [properties] Properties to set - * @returns Action instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IAction): google.cloud.contentwarehouse.v1.Action; - - /** - * Encodes the specified Action message. Does not implicitly {@link google.cloud.contentwarehouse.v1.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.cloud.contentwarehouse.v1.IAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Action message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.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.cloud.contentwarehouse.v1.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.cloud.contentwarehouse.v1.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.cloud.contentwarehouse.v1.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.cloud.contentwarehouse.v1.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.cloud.contentwarehouse.v1.Action, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Action to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Action - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AccessControlAction. */ - interface IAccessControlAction { - - /** AccessControlAction operationType */ - operationType?: (google.cloud.contentwarehouse.v1.AccessControlAction.OperationType|keyof typeof google.cloud.contentwarehouse.v1.AccessControlAction.OperationType|null); - - /** AccessControlAction policy */ - policy?: (google.iam.v1.IPolicy|null); - } - - /** Represents an AccessControlAction. */ - class AccessControlAction implements IAccessControlAction { - - /** - * Constructs a new AccessControlAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IAccessControlAction); - - /** AccessControlAction operationType. */ - public operationType: (google.cloud.contentwarehouse.v1.AccessControlAction.OperationType|keyof typeof google.cloud.contentwarehouse.v1.AccessControlAction.OperationType); - - /** AccessControlAction policy. */ - public policy?: (google.iam.v1.IPolicy|null); - - /** - * Creates a new AccessControlAction instance using the specified properties. - * @param [properties] Properties to set - * @returns AccessControlAction instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IAccessControlAction): google.cloud.contentwarehouse.v1.AccessControlAction; - - /** - * Encodes the specified AccessControlAction message. Does not implicitly {@link google.cloud.contentwarehouse.v1.AccessControlAction.verify|verify} messages. - * @param message AccessControlAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IAccessControlAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AccessControlAction message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.AccessControlAction.verify|verify} messages. - * @param message AccessControlAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IAccessControlAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AccessControlAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AccessControlAction - * @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.cloud.contentwarehouse.v1.AccessControlAction; - - /** - * Decodes an AccessControlAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AccessControlAction - * @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.cloud.contentwarehouse.v1.AccessControlAction; - - /** - * Verifies an AccessControlAction 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 AccessControlAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AccessControlAction - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.AccessControlAction; - - /** - * Creates a plain object from an AccessControlAction message. Also converts values to other types if specified. - * @param message AccessControlAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.AccessControlAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AccessControlAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AccessControlAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace AccessControlAction { - - /** OperationType enum. */ - enum OperationType { - UNKNOWN = 0, - ADD_POLICY_BINDING = 1, - REMOVE_POLICY_BINDING = 2, - REPLACE_POLICY_BINDING = 3 - } - } - - /** Properties of a DataValidationAction. */ - interface IDataValidationAction { - - /** DataValidationAction conditions */ - conditions?: ({ [k: string]: string }|null); - } - - /** Represents a DataValidationAction. */ - class DataValidationAction implements IDataValidationAction { - - /** - * Constructs a new DataValidationAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IDataValidationAction); - - /** DataValidationAction conditions. */ - public conditions: { [k: string]: string }; - - /** - * Creates a new DataValidationAction instance using the specified properties. - * @param [properties] Properties to set - * @returns DataValidationAction instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IDataValidationAction): google.cloud.contentwarehouse.v1.DataValidationAction; - - /** - * Encodes the specified DataValidationAction message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DataValidationAction.verify|verify} messages. - * @param message DataValidationAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IDataValidationAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DataValidationAction message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DataValidationAction.verify|verify} messages. - * @param message DataValidationAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IDataValidationAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DataValidationAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DataValidationAction - * @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.cloud.contentwarehouse.v1.DataValidationAction; - - /** - * Decodes a DataValidationAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DataValidationAction - * @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.cloud.contentwarehouse.v1.DataValidationAction; - - /** - * Verifies a DataValidationAction 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 DataValidationAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DataValidationAction - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.DataValidationAction; - - /** - * Creates a plain object from a DataValidationAction message. Also converts values to other types if specified. - * @param message DataValidationAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.DataValidationAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DataValidationAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DataValidationAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DataUpdateAction. */ - interface IDataUpdateAction { - - /** DataUpdateAction entries */ - entries?: ({ [k: string]: string }|null); - } - - /** Represents a DataUpdateAction. */ - class DataUpdateAction implements IDataUpdateAction { - - /** - * Constructs a new DataUpdateAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IDataUpdateAction); - - /** DataUpdateAction entries. */ - public entries: { [k: string]: string }; - - /** - * Creates a new DataUpdateAction instance using the specified properties. - * @param [properties] Properties to set - * @returns DataUpdateAction instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IDataUpdateAction): google.cloud.contentwarehouse.v1.DataUpdateAction; - - /** - * Encodes the specified DataUpdateAction message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DataUpdateAction.verify|verify} messages. - * @param message DataUpdateAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IDataUpdateAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DataUpdateAction message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DataUpdateAction.verify|verify} messages. - * @param message DataUpdateAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IDataUpdateAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DataUpdateAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DataUpdateAction - * @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.cloud.contentwarehouse.v1.DataUpdateAction; - - /** - * Decodes a DataUpdateAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DataUpdateAction - * @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.cloud.contentwarehouse.v1.DataUpdateAction; - - /** - * Verifies a DataUpdateAction 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 DataUpdateAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DataUpdateAction - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.DataUpdateAction; - - /** - * Creates a plain object from a DataUpdateAction message. Also converts values to other types if specified. - * @param message DataUpdateAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.DataUpdateAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DataUpdateAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DataUpdateAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AddToFolderAction. */ - interface IAddToFolderAction { - - /** AddToFolderAction folders */ - folders?: (string[]|null); - } - - /** Represents an AddToFolderAction. */ - class AddToFolderAction implements IAddToFolderAction { - - /** - * Constructs a new AddToFolderAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IAddToFolderAction); - - /** AddToFolderAction folders. */ - public folders: string[]; - - /** - * Creates a new AddToFolderAction instance using the specified properties. - * @param [properties] Properties to set - * @returns AddToFolderAction instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IAddToFolderAction): google.cloud.contentwarehouse.v1.AddToFolderAction; - - /** - * Encodes the specified AddToFolderAction message. Does not implicitly {@link google.cloud.contentwarehouse.v1.AddToFolderAction.verify|verify} messages. - * @param message AddToFolderAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IAddToFolderAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AddToFolderAction message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.AddToFolderAction.verify|verify} messages. - * @param message AddToFolderAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IAddToFolderAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AddToFolderAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AddToFolderAction - * @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.cloud.contentwarehouse.v1.AddToFolderAction; - - /** - * Decodes an AddToFolderAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AddToFolderAction - * @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.cloud.contentwarehouse.v1.AddToFolderAction; - - /** - * Verifies an AddToFolderAction 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 AddToFolderAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AddToFolderAction - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.AddToFolderAction; - - /** - * Creates a plain object from an AddToFolderAction message. Also converts values to other types if specified. - * @param message AddToFolderAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.AddToFolderAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AddToFolderAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AddToFolderAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RemoveFromFolderAction. */ - interface IRemoveFromFolderAction { - - /** RemoveFromFolderAction condition */ - condition?: (string|null); - - /** RemoveFromFolderAction folder */ - folder?: (string|null); - } - - /** Represents a RemoveFromFolderAction. */ - class RemoveFromFolderAction implements IRemoveFromFolderAction { - - /** - * Constructs a new RemoveFromFolderAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IRemoveFromFolderAction); - - /** RemoveFromFolderAction condition. */ - public condition: string; - - /** RemoveFromFolderAction folder. */ - public folder: string; - - /** - * Creates a new RemoveFromFolderAction instance using the specified properties. - * @param [properties] Properties to set - * @returns RemoveFromFolderAction instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IRemoveFromFolderAction): google.cloud.contentwarehouse.v1.RemoveFromFolderAction; - - /** - * Encodes the specified RemoveFromFolderAction message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RemoveFromFolderAction.verify|verify} messages. - * @param message RemoveFromFolderAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IRemoveFromFolderAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RemoveFromFolderAction message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RemoveFromFolderAction.verify|verify} messages. - * @param message RemoveFromFolderAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IRemoveFromFolderAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RemoveFromFolderAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RemoveFromFolderAction - * @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.cloud.contentwarehouse.v1.RemoveFromFolderAction; - - /** - * Decodes a RemoveFromFolderAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RemoveFromFolderAction - * @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.cloud.contentwarehouse.v1.RemoveFromFolderAction; - - /** - * Verifies a RemoveFromFolderAction 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 RemoveFromFolderAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RemoveFromFolderAction - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.RemoveFromFolderAction; - - /** - * Creates a plain object from a RemoveFromFolderAction message. Also converts values to other types if specified. - * @param message RemoveFromFolderAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.RemoveFromFolderAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RemoveFromFolderAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RemoveFromFolderAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PublishAction. */ - interface IPublishAction { - - /** PublishAction topicId */ - topicId?: (string|null); - - /** PublishAction messages */ - messages?: (string[]|null); - } - - /** Represents a PublishAction. */ - class PublishAction implements IPublishAction { - - /** - * Constructs a new PublishAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IPublishAction); - - /** PublishAction topicId. */ - public topicId: string; - - /** PublishAction messages. */ - public messages: string[]; - - /** - * Creates a new PublishAction instance using the specified properties. - * @param [properties] Properties to set - * @returns PublishAction instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IPublishAction): google.cloud.contentwarehouse.v1.PublishAction; - - /** - * Encodes the specified PublishAction message. Does not implicitly {@link google.cloud.contentwarehouse.v1.PublishAction.verify|verify} messages. - * @param message PublishAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IPublishAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PublishAction message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.PublishAction.verify|verify} messages. - * @param message PublishAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IPublishAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PublishAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PublishAction - * @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.cloud.contentwarehouse.v1.PublishAction; - - /** - * Decodes a PublishAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PublishAction - * @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.cloud.contentwarehouse.v1.PublishAction; - - /** - * Verifies a PublishAction 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 PublishAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PublishAction - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.PublishAction; - - /** - * Creates a plain object from a PublishAction message. Also converts values to other types if specified. - * @param message PublishAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.PublishAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PublishAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PublishAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteDocumentAction. */ - interface IDeleteDocumentAction { - - /** DeleteDocumentAction enableHardDelete */ - enableHardDelete?: (boolean|null); - } - - /** Represents a DeleteDocumentAction. */ - class DeleteDocumentAction implements IDeleteDocumentAction { - - /** - * Constructs a new DeleteDocumentAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IDeleteDocumentAction); - - /** DeleteDocumentAction enableHardDelete. */ - public enableHardDelete: boolean; - - /** - * Creates a new DeleteDocumentAction instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteDocumentAction instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IDeleteDocumentAction): google.cloud.contentwarehouse.v1.DeleteDocumentAction; - - /** - * Encodes the specified DeleteDocumentAction message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DeleteDocumentAction.verify|verify} messages. - * @param message DeleteDocumentAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IDeleteDocumentAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteDocumentAction message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DeleteDocumentAction.verify|verify} messages. - * @param message DeleteDocumentAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IDeleteDocumentAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteDocumentAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteDocumentAction - * @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.cloud.contentwarehouse.v1.DeleteDocumentAction; - - /** - * Decodes a DeleteDocumentAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteDocumentAction - * @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.cloud.contentwarehouse.v1.DeleteDocumentAction; - - /** - * Verifies a DeleteDocumentAction 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 DeleteDocumentAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteDocumentAction - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.DeleteDocumentAction; - - /** - * Creates a plain object from a DeleteDocumentAction message. Also converts values to other types if specified. - * @param message DeleteDocumentAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.DeleteDocumentAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteDocumentAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteDocumentAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RuleEngineOutput. */ - interface IRuleEngineOutput { - - /** RuleEngineOutput documentName */ - documentName?: (string|null); - - /** RuleEngineOutput ruleEvaluatorOutput */ - ruleEvaluatorOutput?: (google.cloud.contentwarehouse.v1.IRuleEvaluatorOutput|null); - - /** RuleEngineOutput actionExecutorOutput */ - actionExecutorOutput?: (google.cloud.contentwarehouse.v1.IActionExecutorOutput|null); - } - - /** Represents a RuleEngineOutput. */ - class RuleEngineOutput implements IRuleEngineOutput { - - /** - * Constructs a new RuleEngineOutput. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IRuleEngineOutput); - - /** RuleEngineOutput documentName. */ - public documentName: string; - - /** RuleEngineOutput ruleEvaluatorOutput. */ - public ruleEvaluatorOutput?: (google.cloud.contentwarehouse.v1.IRuleEvaluatorOutput|null); - - /** RuleEngineOutput actionExecutorOutput. */ - public actionExecutorOutput?: (google.cloud.contentwarehouse.v1.IActionExecutorOutput|null); - - /** - * Creates a new RuleEngineOutput instance using the specified properties. - * @param [properties] Properties to set - * @returns RuleEngineOutput instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IRuleEngineOutput): google.cloud.contentwarehouse.v1.RuleEngineOutput; - - /** - * Encodes the specified RuleEngineOutput message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RuleEngineOutput.verify|verify} messages. - * @param message RuleEngineOutput message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IRuleEngineOutput, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RuleEngineOutput message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RuleEngineOutput.verify|verify} messages. - * @param message RuleEngineOutput message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IRuleEngineOutput, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RuleEngineOutput message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RuleEngineOutput - * @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.cloud.contentwarehouse.v1.RuleEngineOutput; - - /** - * Decodes a RuleEngineOutput message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RuleEngineOutput - * @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.cloud.contentwarehouse.v1.RuleEngineOutput; - - /** - * Verifies a RuleEngineOutput 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 RuleEngineOutput message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RuleEngineOutput - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.RuleEngineOutput; - - /** - * Creates a plain object from a RuleEngineOutput message. Also converts values to other types if specified. - * @param message RuleEngineOutput - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.RuleEngineOutput, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RuleEngineOutput to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RuleEngineOutput - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RuleEvaluatorOutput. */ - interface IRuleEvaluatorOutput { - - /** RuleEvaluatorOutput triggeredRules */ - triggeredRules?: (google.cloud.contentwarehouse.v1.IRule[]|null); - - /** RuleEvaluatorOutput matchedRules */ - matchedRules?: (google.cloud.contentwarehouse.v1.IRule[]|null); - - /** RuleEvaluatorOutput invalidRules */ - invalidRules?: (google.cloud.contentwarehouse.v1.IInvalidRule[]|null); - } - - /** Represents a RuleEvaluatorOutput. */ - class RuleEvaluatorOutput implements IRuleEvaluatorOutput { - - /** - * Constructs a new RuleEvaluatorOutput. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IRuleEvaluatorOutput); - - /** RuleEvaluatorOutput triggeredRules. */ - public triggeredRules: google.cloud.contentwarehouse.v1.IRule[]; - - /** RuleEvaluatorOutput matchedRules. */ - public matchedRules: google.cloud.contentwarehouse.v1.IRule[]; - - /** RuleEvaluatorOutput invalidRules. */ - public invalidRules: google.cloud.contentwarehouse.v1.IInvalidRule[]; - - /** - * Creates a new RuleEvaluatorOutput instance using the specified properties. - * @param [properties] Properties to set - * @returns RuleEvaluatorOutput instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IRuleEvaluatorOutput): google.cloud.contentwarehouse.v1.RuleEvaluatorOutput; - - /** - * Encodes the specified RuleEvaluatorOutput message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RuleEvaluatorOutput.verify|verify} messages. - * @param message RuleEvaluatorOutput message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IRuleEvaluatorOutput, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RuleEvaluatorOutput message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RuleEvaluatorOutput.verify|verify} messages. - * @param message RuleEvaluatorOutput message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IRuleEvaluatorOutput, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RuleEvaluatorOutput message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RuleEvaluatorOutput - * @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.cloud.contentwarehouse.v1.RuleEvaluatorOutput; - - /** - * Decodes a RuleEvaluatorOutput message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RuleEvaluatorOutput - * @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.cloud.contentwarehouse.v1.RuleEvaluatorOutput; - - /** - * Verifies a RuleEvaluatorOutput 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 RuleEvaluatorOutput message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RuleEvaluatorOutput - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.RuleEvaluatorOutput; - - /** - * Creates a plain object from a RuleEvaluatorOutput message. Also converts values to other types if specified. - * @param message RuleEvaluatorOutput - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.RuleEvaluatorOutput, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RuleEvaluatorOutput to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RuleEvaluatorOutput - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an InvalidRule. */ - interface IInvalidRule { - - /** InvalidRule rule */ - rule?: (google.cloud.contentwarehouse.v1.IRule|null); - - /** InvalidRule error */ - error?: (string|null); - } - - /** Represents an InvalidRule. */ - class InvalidRule implements IInvalidRule { - - /** - * Constructs a new InvalidRule. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IInvalidRule); - - /** InvalidRule rule. */ - public rule?: (google.cloud.contentwarehouse.v1.IRule|null); - - /** InvalidRule error. */ - public error: string; - - /** - * Creates a new InvalidRule instance using the specified properties. - * @param [properties] Properties to set - * @returns InvalidRule instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IInvalidRule): google.cloud.contentwarehouse.v1.InvalidRule; - - /** - * Encodes the specified InvalidRule message. Does not implicitly {@link google.cloud.contentwarehouse.v1.InvalidRule.verify|verify} messages. - * @param message InvalidRule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IInvalidRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InvalidRule message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.InvalidRule.verify|verify} messages. - * @param message InvalidRule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IInvalidRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InvalidRule message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InvalidRule - * @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.cloud.contentwarehouse.v1.InvalidRule; - - /** - * Decodes an InvalidRule message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InvalidRule - * @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.cloud.contentwarehouse.v1.InvalidRule; - - /** - * Verifies an InvalidRule 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 InvalidRule message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InvalidRule - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.InvalidRule; - - /** - * Creates a plain object from an InvalidRule message. Also converts values to other types if specified. - * @param message InvalidRule - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.InvalidRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InvalidRule to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InvalidRule - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ActionExecutorOutput. */ - interface IActionExecutorOutput { - - /** ActionExecutorOutput ruleActionsPairs */ - ruleActionsPairs?: (google.cloud.contentwarehouse.v1.IRuleActionsPair[]|null); - } - - /** Represents an ActionExecutorOutput. */ - class ActionExecutorOutput implements IActionExecutorOutput { - - /** - * Constructs a new ActionExecutorOutput. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IActionExecutorOutput); - - /** ActionExecutorOutput ruleActionsPairs. */ - public ruleActionsPairs: google.cloud.contentwarehouse.v1.IRuleActionsPair[]; - - /** - * Creates a new ActionExecutorOutput instance using the specified properties. - * @param [properties] Properties to set - * @returns ActionExecutorOutput instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IActionExecutorOutput): google.cloud.contentwarehouse.v1.ActionExecutorOutput; - - /** - * Encodes the specified ActionExecutorOutput message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ActionExecutorOutput.verify|verify} messages. - * @param message ActionExecutorOutput message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IActionExecutorOutput, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ActionExecutorOutput message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ActionExecutorOutput.verify|verify} messages. - * @param message ActionExecutorOutput message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IActionExecutorOutput, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ActionExecutorOutput message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ActionExecutorOutput - * @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.cloud.contentwarehouse.v1.ActionExecutorOutput; - - /** - * Decodes an ActionExecutorOutput message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ActionExecutorOutput - * @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.cloud.contentwarehouse.v1.ActionExecutorOutput; - - /** - * Verifies an ActionExecutorOutput 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 ActionExecutorOutput message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ActionExecutorOutput - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.ActionExecutorOutput; - - /** - * Creates a plain object from an ActionExecutorOutput message. Also converts values to other types if specified. - * @param message ActionExecutorOutput - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.ActionExecutorOutput, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ActionExecutorOutput to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ActionExecutorOutput - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RuleActionsPair. */ - interface IRuleActionsPair { - - /** RuleActionsPair rule */ - rule?: (google.cloud.contentwarehouse.v1.IRule|null); - - /** RuleActionsPair actionOutputs */ - actionOutputs?: (google.cloud.contentwarehouse.v1.IActionOutput[]|null); - } - - /** Represents a RuleActionsPair. */ - class RuleActionsPair implements IRuleActionsPair { - - /** - * Constructs a new RuleActionsPair. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IRuleActionsPair); - - /** RuleActionsPair rule. */ - public rule?: (google.cloud.contentwarehouse.v1.IRule|null); - - /** RuleActionsPair actionOutputs. */ - public actionOutputs: google.cloud.contentwarehouse.v1.IActionOutput[]; - - /** - * Creates a new RuleActionsPair instance using the specified properties. - * @param [properties] Properties to set - * @returns RuleActionsPair instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IRuleActionsPair): google.cloud.contentwarehouse.v1.RuleActionsPair; - - /** - * Encodes the specified RuleActionsPair message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RuleActionsPair.verify|verify} messages. - * @param message RuleActionsPair message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IRuleActionsPair, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RuleActionsPair message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RuleActionsPair.verify|verify} messages. - * @param message RuleActionsPair message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IRuleActionsPair, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RuleActionsPair message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RuleActionsPair - * @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.cloud.contentwarehouse.v1.RuleActionsPair; - - /** - * Decodes a RuleActionsPair message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RuleActionsPair - * @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.cloud.contentwarehouse.v1.RuleActionsPair; - - /** - * Verifies a RuleActionsPair 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 RuleActionsPair message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RuleActionsPair - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.RuleActionsPair; - - /** - * Creates a plain object from a RuleActionsPair message. Also converts values to other types if specified. - * @param message RuleActionsPair - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.RuleActionsPair, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RuleActionsPair to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RuleActionsPair - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ActionOutput. */ - interface IActionOutput { - - /** ActionOutput actionId */ - actionId?: (string|null); - - /** ActionOutput actionState */ - actionState?: (google.cloud.contentwarehouse.v1.ActionOutput.State|keyof typeof google.cloud.contentwarehouse.v1.ActionOutput.State|null); - - /** ActionOutput outputMessage */ - outputMessage?: (string|null); - } - - /** Represents an ActionOutput. */ - class ActionOutput implements IActionOutput { - - /** - * Constructs a new ActionOutput. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IActionOutput); - - /** ActionOutput actionId. */ - public actionId: string; - - /** ActionOutput actionState. */ - public actionState: (google.cloud.contentwarehouse.v1.ActionOutput.State|keyof typeof google.cloud.contentwarehouse.v1.ActionOutput.State); - - /** ActionOutput outputMessage. */ - public outputMessage: string; - - /** - * Creates a new ActionOutput instance using the specified properties. - * @param [properties] Properties to set - * @returns ActionOutput instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IActionOutput): google.cloud.contentwarehouse.v1.ActionOutput; - - /** - * Encodes the specified ActionOutput message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ActionOutput.verify|verify} messages. - * @param message ActionOutput message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IActionOutput, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ActionOutput message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ActionOutput.verify|verify} messages. - * @param message ActionOutput message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IActionOutput, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ActionOutput message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ActionOutput - * @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.cloud.contentwarehouse.v1.ActionOutput; - - /** - * Decodes an ActionOutput message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ActionOutput - * @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.cloud.contentwarehouse.v1.ActionOutput; - - /** - * Verifies an ActionOutput 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 ActionOutput message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ActionOutput - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.ActionOutput; - - /** - * Creates a plain object from an ActionOutput message. Also converts values to other types if specified. - * @param message ActionOutput - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.ActionOutput, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ActionOutput to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ActionOutput - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ActionOutput { - - /** State enum. */ - enum State { - UNKNOWN = 0, - ACTION_SUCCEEDED = 1, - ACTION_FAILED = 2, - ACTION_TIMED_OUT = 3, - ACTION_PENDING = 4 - } - } - - /** Represents a PipelineService */ - class PipelineService extends $protobuf.rpc.Service { - - /** - * Constructs a new PipelineService 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 PipelineService 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): PipelineService; - - /** - * Calls RunPipeline. - * @param request RunPipelineRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public runPipeline(request: google.cloud.contentwarehouse.v1.IRunPipelineRequest, callback: google.cloud.contentwarehouse.v1.PipelineService.RunPipelineCallback): void; - - /** - * Calls RunPipeline. - * @param request RunPipelineRequest message or plain object - * @returns Promise - */ - public runPipeline(request: google.cloud.contentwarehouse.v1.IRunPipelineRequest): Promise; - } - - namespace PipelineService { - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.PipelineService|runPipeline}. - * @param error Error, if any - * @param [response] Operation - */ - type RunPipelineCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - } - - /** Properties of a RunPipelineRequest. */ - interface IRunPipelineRequest { - - /** RunPipelineRequest name */ - name?: (string|null); - - /** RunPipelineRequest gcsIngestPipeline */ - gcsIngestPipeline?: (google.cloud.contentwarehouse.v1.IGcsIngestPipeline|null); - - /** RunPipelineRequest gcsIngestWithDocAiProcessorsPipeline */ - gcsIngestWithDocAiProcessorsPipeline?: (google.cloud.contentwarehouse.v1.IGcsIngestWithDocAiProcessorsPipeline|null); - - /** RunPipelineRequest exportCdwPipeline */ - exportCdwPipeline?: (google.cloud.contentwarehouse.v1.IExportToCdwPipeline|null); - - /** RunPipelineRequest processWithDocAiPipeline */ - processWithDocAiPipeline?: (google.cloud.contentwarehouse.v1.IProcessWithDocAiPipeline|null); - - /** RunPipelineRequest requestMetadata */ - requestMetadata?: (google.cloud.contentwarehouse.v1.IRequestMetadata|null); - } - - /** Represents a RunPipelineRequest. */ - class RunPipelineRequest implements IRunPipelineRequest { - - /** - * Constructs a new RunPipelineRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IRunPipelineRequest); - - /** RunPipelineRequest name. */ - public name: string; - - /** RunPipelineRequest gcsIngestPipeline. */ - public gcsIngestPipeline?: (google.cloud.contentwarehouse.v1.IGcsIngestPipeline|null); - - /** RunPipelineRequest gcsIngestWithDocAiProcessorsPipeline. */ - public gcsIngestWithDocAiProcessorsPipeline?: (google.cloud.contentwarehouse.v1.IGcsIngestWithDocAiProcessorsPipeline|null); - - /** RunPipelineRequest exportCdwPipeline. */ - public exportCdwPipeline?: (google.cloud.contentwarehouse.v1.IExportToCdwPipeline|null); - - /** RunPipelineRequest processWithDocAiPipeline. */ - public processWithDocAiPipeline?: (google.cloud.contentwarehouse.v1.IProcessWithDocAiPipeline|null); - - /** RunPipelineRequest requestMetadata. */ - public requestMetadata?: (google.cloud.contentwarehouse.v1.IRequestMetadata|null); - - /** RunPipelineRequest pipeline. */ - public pipeline?: ("gcsIngestPipeline"|"gcsIngestWithDocAiProcessorsPipeline"|"exportCdwPipeline"|"processWithDocAiPipeline"); - - /** - * Creates a new RunPipelineRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns RunPipelineRequest instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IRunPipelineRequest): google.cloud.contentwarehouse.v1.RunPipelineRequest; - - /** - * Encodes the specified RunPipelineRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineRequest.verify|verify} messages. - * @param message RunPipelineRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IRunPipelineRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RunPipelineRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineRequest.verify|verify} messages. - * @param message RunPipelineRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IRunPipelineRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RunPipelineRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RunPipelineRequest - * @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.cloud.contentwarehouse.v1.RunPipelineRequest; - - /** - * Decodes a RunPipelineRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RunPipelineRequest - * @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.cloud.contentwarehouse.v1.RunPipelineRequest; - - /** - * Verifies a RunPipelineRequest 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 RunPipelineRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RunPipelineRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.RunPipelineRequest; - - /** - * Creates a plain object from a RunPipelineRequest message. Also converts values to other types if specified. - * @param message RunPipelineRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.RunPipelineRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RunPipelineRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RunPipelineRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RunPipelineResponse. */ - interface IRunPipelineResponse { - } - - /** Represents a RunPipelineResponse. */ - class RunPipelineResponse implements IRunPipelineResponse { - - /** - * Constructs a new RunPipelineResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IRunPipelineResponse); - - /** - * Creates a new RunPipelineResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns RunPipelineResponse instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IRunPipelineResponse): google.cloud.contentwarehouse.v1.RunPipelineResponse; - - /** - * Encodes the specified RunPipelineResponse message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineResponse.verify|verify} messages. - * @param message RunPipelineResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IRunPipelineResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RunPipelineResponse message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineResponse.verify|verify} messages. - * @param message RunPipelineResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IRunPipelineResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RunPipelineResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RunPipelineResponse - * @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.cloud.contentwarehouse.v1.RunPipelineResponse; - - /** - * Decodes a RunPipelineResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RunPipelineResponse - * @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.cloud.contentwarehouse.v1.RunPipelineResponse; - - /** - * Verifies a RunPipelineResponse 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 RunPipelineResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RunPipelineResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.RunPipelineResponse; - - /** - * Creates a plain object from a RunPipelineResponse message. Also converts values to other types if specified. - * @param message RunPipelineResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.RunPipelineResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RunPipelineResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RunPipelineResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RunPipelineMetadata. */ - interface IRunPipelineMetadata { - - /** RunPipelineMetadata totalFileCount */ - totalFileCount?: (number|null); - - /** RunPipelineMetadata failedFileCount */ - failedFileCount?: (number|null); - - /** RunPipelineMetadata userInfo */ - userInfo?: (google.cloud.contentwarehouse.v1.IUserInfo|null); - - /** RunPipelineMetadata gcsIngestPipelineMetadata */ - gcsIngestPipelineMetadata?: (google.cloud.contentwarehouse.v1.RunPipelineMetadata.IGcsIngestPipelineMetadata|null); - - /** RunPipelineMetadata exportToCdwPipelineMetadata */ - exportToCdwPipelineMetadata?: (google.cloud.contentwarehouse.v1.RunPipelineMetadata.IExportToCdwPipelineMetadata|null); - - /** RunPipelineMetadata processWithDocAiPipelineMetadata */ - processWithDocAiPipelineMetadata?: (google.cloud.contentwarehouse.v1.RunPipelineMetadata.IProcessWithDocAiPipelineMetadata|null); - - /** RunPipelineMetadata individualDocumentStatuses */ - individualDocumentStatuses?: (google.cloud.contentwarehouse.v1.RunPipelineMetadata.IIndividualDocumentStatus[]|null); - } - - /** Represents a RunPipelineMetadata. */ - class RunPipelineMetadata implements IRunPipelineMetadata { - - /** - * Constructs a new RunPipelineMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IRunPipelineMetadata); - - /** RunPipelineMetadata totalFileCount. */ - public totalFileCount: number; - - /** RunPipelineMetadata failedFileCount. */ - public failedFileCount: number; - - /** RunPipelineMetadata userInfo. */ - public userInfo?: (google.cloud.contentwarehouse.v1.IUserInfo|null); - - /** RunPipelineMetadata gcsIngestPipelineMetadata. */ - public gcsIngestPipelineMetadata?: (google.cloud.contentwarehouse.v1.RunPipelineMetadata.IGcsIngestPipelineMetadata|null); - - /** RunPipelineMetadata exportToCdwPipelineMetadata. */ - public exportToCdwPipelineMetadata?: (google.cloud.contentwarehouse.v1.RunPipelineMetadata.IExportToCdwPipelineMetadata|null); - - /** RunPipelineMetadata processWithDocAiPipelineMetadata. */ - public processWithDocAiPipelineMetadata?: (google.cloud.contentwarehouse.v1.RunPipelineMetadata.IProcessWithDocAiPipelineMetadata|null); - - /** RunPipelineMetadata individualDocumentStatuses. */ - public individualDocumentStatuses: google.cloud.contentwarehouse.v1.RunPipelineMetadata.IIndividualDocumentStatus[]; - - /** RunPipelineMetadata pipelineMetadata. */ - public pipelineMetadata?: ("gcsIngestPipelineMetadata"|"exportToCdwPipelineMetadata"|"processWithDocAiPipelineMetadata"); - - /** - * Creates a new RunPipelineMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns RunPipelineMetadata instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IRunPipelineMetadata): google.cloud.contentwarehouse.v1.RunPipelineMetadata; - - /** - * Encodes the specified RunPipelineMetadata message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineMetadata.verify|verify} messages. - * @param message RunPipelineMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IRunPipelineMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RunPipelineMetadata message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineMetadata.verify|verify} messages. - * @param message RunPipelineMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IRunPipelineMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RunPipelineMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RunPipelineMetadata - * @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.cloud.contentwarehouse.v1.RunPipelineMetadata; - - /** - * Decodes a RunPipelineMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RunPipelineMetadata - * @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.cloud.contentwarehouse.v1.RunPipelineMetadata; - - /** - * Verifies a RunPipelineMetadata 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 RunPipelineMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RunPipelineMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.RunPipelineMetadata; - - /** - * Creates a plain object from a RunPipelineMetadata message. Also converts values to other types if specified. - * @param message RunPipelineMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.RunPipelineMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RunPipelineMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RunPipelineMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace RunPipelineMetadata { - - /** Properties of a GcsIngestPipelineMetadata. */ - interface IGcsIngestPipelineMetadata { - - /** GcsIngestPipelineMetadata inputPath */ - inputPath?: (string|null); - } - - /** Represents a GcsIngestPipelineMetadata. */ - class GcsIngestPipelineMetadata implements IGcsIngestPipelineMetadata { - - /** - * Constructs a new GcsIngestPipelineMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.RunPipelineMetadata.IGcsIngestPipelineMetadata); - - /** GcsIngestPipelineMetadata inputPath. */ - public inputPath: string; - - /** - * Creates a new GcsIngestPipelineMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns GcsIngestPipelineMetadata instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.RunPipelineMetadata.IGcsIngestPipelineMetadata): google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata; - - /** - * Encodes the specified GcsIngestPipelineMetadata message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata.verify|verify} messages. - * @param message GcsIngestPipelineMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.RunPipelineMetadata.IGcsIngestPipelineMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GcsIngestPipelineMetadata message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata.verify|verify} messages. - * @param message GcsIngestPipelineMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.RunPipelineMetadata.IGcsIngestPipelineMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GcsIngestPipelineMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GcsIngestPipelineMetadata - * @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.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata; - - /** - * Decodes a GcsIngestPipelineMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GcsIngestPipelineMetadata - * @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.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata; - - /** - * Verifies a GcsIngestPipelineMetadata 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 GcsIngestPipelineMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GcsIngestPipelineMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata; - - /** - * Creates a plain object from a GcsIngestPipelineMetadata message. Also converts values to other types if specified. - * @param message GcsIngestPipelineMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GcsIngestPipelineMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GcsIngestPipelineMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ExportToCdwPipelineMetadata. */ - interface IExportToCdwPipelineMetadata { - - /** ExportToCdwPipelineMetadata documents */ - documents?: (string[]|null); - - /** ExportToCdwPipelineMetadata docAiDataset */ - docAiDataset?: (string|null); - - /** ExportToCdwPipelineMetadata outputPath */ - outputPath?: (string|null); - } - - /** Represents an ExportToCdwPipelineMetadata. */ - class ExportToCdwPipelineMetadata implements IExportToCdwPipelineMetadata { - - /** - * Constructs a new ExportToCdwPipelineMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.RunPipelineMetadata.IExportToCdwPipelineMetadata); - - /** ExportToCdwPipelineMetadata documents. */ - public documents: string[]; - - /** ExportToCdwPipelineMetadata docAiDataset. */ - public docAiDataset: string; - - /** ExportToCdwPipelineMetadata outputPath. */ - public outputPath: string; - - /** - * Creates a new ExportToCdwPipelineMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns ExportToCdwPipelineMetadata instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.RunPipelineMetadata.IExportToCdwPipelineMetadata): google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata; - - /** - * Encodes the specified ExportToCdwPipelineMetadata message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata.verify|verify} messages. - * @param message ExportToCdwPipelineMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.RunPipelineMetadata.IExportToCdwPipelineMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExportToCdwPipelineMetadata message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata.verify|verify} messages. - * @param message ExportToCdwPipelineMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.RunPipelineMetadata.IExportToCdwPipelineMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExportToCdwPipelineMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExportToCdwPipelineMetadata - * @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.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata; - - /** - * Decodes an ExportToCdwPipelineMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExportToCdwPipelineMetadata - * @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.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata; - - /** - * Verifies an ExportToCdwPipelineMetadata 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 ExportToCdwPipelineMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExportToCdwPipelineMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata; - - /** - * Creates a plain object from an ExportToCdwPipelineMetadata message. Also converts values to other types if specified. - * @param message ExportToCdwPipelineMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExportToCdwPipelineMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExportToCdwPipelineMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ProcessWithDocAiPipelineMetadata. */ - interface IProcessWithDocAiPipelineMetadata { - - /** ProcessWithDocAiPipelineMetadata documents */ - documents?: (string[]|null); - - /** ProcessWithDocAiPipelineMetadata processorInfo */ - processorInfo?: (google.cloud.contentwarehouse.v1.IProcessorInfo|null); - } - - /** Represents a ProcessWithDocAiPipelineMetadata. */ - class ProcessWithDocAiPipelineMetadata implements IProcessWithDocAiPipelineMetadata { - - /** - * Constructs a new ProcessWithDocAiPipelineMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.RunPipelineMetadata.IProcessWithDocAiPipelineMetadata); - - /** ProcessWithDocAiPipelineMetadata documents. */ - public documents: string[]; - - /** ProcessWithDocAiPipelineMetadata processorInfo. */ - public processorInfo?: (google.cloud.contentwarehouse.v1.IProcessorInfo|null); - - /** - * Creates a new ProcessWithDocAiPipelineMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns ProcessWithDocAiPipelineMetadata instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.RunPipelineMetadata.IProcessWithDocAiPipelineMetadata): google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata; - - /** - * Encodes the specified ProcessWithDocAiPipelineMetadata message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata.verify|verify} messages. - * @param message ProcessWithDocAiPipelineMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.RunPipelineMetadata.IProcessWithDocAiPipelineMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ProcessWithDocAiPipelineMetadata message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata.verify|verify} messages. - * @param message ProcessWithDocAiPipelineMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.RunPipelineMetadata.IProcessWithDocAiPipelineMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ProcessWithDocAiPipelineMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ProcessWithDocAiPipelineMetadata - * @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.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata; - - /** - * Decodes a ProcessWithDocAiPipelineMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ProcessWithDocAiPipelineMetadata - * @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.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata; - - /** - * Verifies a ProcessWithDocAiPipelineMetadata 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 ProcessWithDocAiPipelineMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ProcessWithDocAiPipelineMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata; - - /** - * Creates a plain object from a ProcessWithDocAiPipelineMetadata message. Also converts values to other types if specified. - * @param message ProcessWithDocAiPipelineMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ProcessWithDocAiPipelineMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ProcessWithDocAiPipelineMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an IndividualDocumentStatus. */ - interface IIndividualDocumentStatus { - - /** IndividualDocumentStatus documentId */ - documentId?: (string|null); - - /** IndividualDocumentStatus status */ - status?: (google.rpc.IStatus|null); - } - - /** Represents an IndividualDocumentStatus. */ - class IndividualDocumentStatus implements IIndividualDocumentStatus { - - /** - * Constructs a new IndividualDocumentStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.RunPipelineMetadata.IIndividualDocumentStatus); - - /** IndividualDocumentStatus documentId. */ - public documentId: string; - - /** IndividualDocumentStatus status. */ - public status?: (google.rpc.IStatus|null); - - /** - * Creates a new IndividualDocumentStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns IndividualDocumentStatus instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.RunPipelineMetadata.IIndividualDocumentStatus): google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus; - - /** - * Encodes the specified IndividualDocumentStatus message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus.verify|verify} messages. - * @param message IndividualDocumentStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.RunPipelineMetadata.IIndividualDocumentStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified IndividualDocumentStatus message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus.verify|verify} messages. - * @param message IndividualDocumentStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.RunPipelineMetadata.IIndividualDocumentStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an IndividualDocumentStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IndividualDocumentStatus - * @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.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus; - - /** - * Decodes an IndividualDocumentStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IndividualDocumentStatus - * @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.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus; - - /** - * Verifies an IndividualDocumentStatus 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 IndividualDocumentStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IndividualDocumentStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus; - - /** - * Creates a plain object from an IndividualDocumentStatus message. Also converts values to other types if specified. - * @param message IndividualDocumentStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IndividualDocumentStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for IndividualDocumentStatus - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a ProcessorInfo. */ - interface IProcessorInfo { - - /** ProcessorInfo processorName */ - processorName?: (string|null); - - /** ProcessorInfo documentType */ - documentType?: (string|null); - - /** ProcessorInfo schemaName */ - schemaName?: (string|null); - } - - /** Represents a ProcessorInfo. */ - class ProcessorInfo implements IProcessorInfo { - - /** - * Constructs a new ProcessorInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IProcessorInfo); - - /** ProcessorInfo processorName. */ - public processorName: string; - - /** ProcessorInfo documentType. */ - public documentType: string; - - /** ProcessorInfo schemaName. */ - public schemaName: string; - - /** - * Creates a new ProcessorInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns ProcessorInfo instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IProcessorInfo): google.cloud.contentwarehouse.v1.ProcessorInfo; - - /** - * Encodes the specified ProcessorInfo message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ProcessorInfo.verify|verify} messages. - * @param message ProcessorInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IProcessorInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ProcessorInfo message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ProcessorInfo.verify|verify} messages. - * @param message ProcessorInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IProcessorInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ProcessorInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ProcessorInfo - * @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.cloud.contentwarehouse.v1.ProcessorInfo; - - /** - * Decodes a ProcessorInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ProcessorInfo - * @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.cloud.contentwarehouse.v1.ProcessorInfo; - - /** - * Verifies a ProcessorInfo 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 ProcessorInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ProcessorInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.ProcessorInfo; - - /** - * Creates a plain object from a ProcessorInfo message. Also converts values to other types if specified. - * @param message ProcessorInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.ProcessorInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ProcessorInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ProcessorInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an IngestPipelineConfig. */ - interface IIngestPipelineConfig { - - /** IngestPipelineConfig documentAclPolicy */ - documentAclPolicy?: (google.iam.v1.IPolicy|null); - - /** IngestPipelineConfig enableDocumentTextExtraction */ - enableDocumentTextExtraction?: (boolean|null); - - /** IngestPipelineConfig folder */ - folder?: (string|null); - - /** IngestPipelineConfig cloudFunction */ - cloudFunction?: (string|null); - } - - /** Represents an IngestPipelineConfig. */ - class IngestPipelineConfig implements IIngestPipelineConfig { - - /** - * Constructs a new IngestPipelineConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IIngestPipelineConfig); - - /** IngestPipelineConfig documentAclPolicy. */ - public documentAclPolicy?: (google.iam.v1.IPolicy|null); - - /** IngestPipelineConfig enableDocumentTextExtraction. */ - public enableDocumentTextExtraction: boolean; - - /** IngestPipelineConfig folder. */ - public folder: string; - - /** IngestPipelineConfig cloudFunction. */ - public cloudFunction: string; - - /** - * Creates a new IngestPipelineConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns IngestPipelineConfig instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IIngestPipelineConfig): google.cloud.contentwarehouse.v1.IngestPipelineConfig; - - /** - * Encodes the specified IngestPipelineConfig message. Does not implicitly {@link google.cloud.contentwarehouse.v1.IngestPipelineConfig.verify|verify} messages. - * @param message IngestPipelineConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IIngestPipelineConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified IngestPipelineConfig message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.IngestPipelineConfig.verify|verify} messages. - * @param message IngestPipelineConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IIngestPipelineConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an IngestPipelineConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IngestPipelineConfig - * @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.cloud.contentwarehouse.v1.IngestPipelineConfig; - - /** - * Decodes an IngestPipelineConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IngestPipelineConfig - * @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.cloud.contentwarehouse.v1.IngestPipelineConfig; - - /** - * Verifies an IngestPipelineConfig 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 IngestPipelineConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IngestPipelineConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.IngestPipelineConfig; - - /** - * Creates a plain object from an IngestPipelineConfig message. Also converts values to other types if specified. - * @param message IngestPipelineConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.IngestPipelineConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IngestPipelineConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for IngestPipelineConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GcsIngestPipeline. */ - interface IGcsIngestPipeline { - - /** GcsIngestPipeline inputPath */ - inputPath?: (string|null); - - /** GcsIngestPipeline schemaName */ - schemaName?: (string|null); - - /** GcsIngestPipeline processorType */ - processorType?: (string|null); - - /** GcsIngestPipeline skipIngestedDocuments */ - skipIngestedDocuments?: (boolean|null); - - /** GcsIngestPipeline pipelineConfig */ - pipelineConfig?: (google.cloud.contentwarehouse.v1.IIngestPipelineConfig|null); - } - - /** Represents a GcsIngestPipeline. */ - class GcsIngestPipeline implements IGcsIngestPipeline { - - /** - * Constructs a new GcsIngestPipeline. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IGcsIngestPipeline); - - /** GcsIngestPipeline inputPath. */ - public inputPath: string; - - /** GcsIngestPipeline schemaName. */ - public schemaName: string; - - /** GcsIngestPipeline processorType. */ - public processorType: string; - - /** GcsIngestPipeline skipIngestedDocuments. */ - public skipIngestedDocuments: boolean; - - /** GcsIngestPipeline pipelineConfig. */ - public pipelineConfig?: (google.cloud.contentwarehouse.v1.IIngestPipelineConfig|null); - - /** - * Creates a new GcsIngestPipeline instance using the specified properties. - * @param [properties] Properties to set - * @returns GcsIngestPipeline instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IGcsIngestPipeline): google.cloud.contentwarehouse.v1.GcsIngestPipeline; - - /** - * Encodes the specified GcsIngestPipeline message. Does not implicitly {@link google.cloud.contentwarehouse.v1.GcsIngestPipeline.verify|verify} messages. - * @param message GcsIngestPipeline message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IGcsIngestPipeline, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GcsIngestPipeline message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.GcsIngestPipeline.verify|verify} messages. - * @param message GcsIngestPipeline message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IGcsIngestPipeline, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GcsIngestPipeline message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GcsIngestPipeline - * @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.cloud.contentwarehouse.v1.GcsIngestPipeline; - - /** - * Decodes a GcsIngestPipeline message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GcsIngestPipeline - * @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.cloud.contentwarehouse.v1.GcsIngestPipeline; - - /** - * Verifies a GcsIngestPipeline 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 GcsIngestPipeline message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GcsIngestPipeline - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.GcsIngestPipeline; - - /** - * Creates a plain object from a GcsIngestPipeline message. Also converts values to other types if specified. - * @param message GcsIngestPipeline - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.GcsIngestPipeline, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GcsIngestPipeline to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GcsIngestPipeline - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GcsIngestWithDocAiProcessorsPipeline. */ - interface IGcsIngestWithDocAiProcessorsPipeline { - - /** GcsIngestWithDocAiProcessorsPipeline inputPath */ - inputPath?: (string|null); - - /** GcsIngestWithDocAiProcessorsPipeline splitClassifyProcessorInfo */ - splitClassifyProcessorInfo?: (google.cloud.contentwarehouse.v1.IProcessorInfo|null); - - /** GcsIngestWithDocAiProcessorsPipeline extractProcessorInfos */ - extractProcessorInfos?: (google.cloud.contentwarehouse.v1.IProcessorInfo[]|null); - - /** GcsIngestWithDocAiProcessorsPipeline processorResultsFolderPath */ - processorResultsFolderPath?: (string|null); - - /** GcsIngestWithDocAiProcessorsPipeline skipIngestedDocuments */ - skipIngestedDocuments?: (boolean|null); - - /** GcsIngestWithDocAiProcessorsPipeline pipelineConfig */ - pipelineConfig?: (google.cloud.contentwarehouse.v1.IIngestPipelineConfig|null); - } - - /** Represents a GcsIngestWithDocAiProcessorsPipeline. */ - class GcsIngestWithDocAiProcessorsPipeline implements IGcsIngestWithDocAiProcessorsPipeline { - - /** - * Constructs a new GcsIngestWithDocAiProcessorsPipeline. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IGcsIngestWithDocAiProcessorsPipeline); - - /** GcsIngestWithDocAiProcessorsPipeline inputPath. */ - public inputPath: string; - - /** GcsIngestWithDocAiProcessorsPipeline splitClassifyProcessorInfo. */ - public splitClassifyProcessorInfo?: (google.cloud.contentwarehouse.v1.IProcessorInfo|null); - - /** GcsIngestWithDocAiProcessorsPipeline extractProcessorInfos. */ - public extractProcessorInfos: google.cloud.contentwarehouse.v1.IProcessorInfo[]; - - /** GcsIngestWithDocAiProcessorsPipeline processorResultsFolderPath. */ - public processorResultsFolderPath: string; - - /** GcsIngestWithDocAiProcessorsPipeline skipIngestedDocuments. */ - public skipIngestedDocuments: boolean; - - /** GcsIngestWithDocAiProcessorsPipeline pipelineConfig. */ - public pipelineConfig?: (google.cloud.contentwarehouse.v1.IIngestPipelineConfig|null); - - /** - * Creates a new GcsIngestWithDocAiProcessorsPipeline instance using the specified properties. - * @param [properties] Properties to set - * @returns GcsIngestWithDocAiProcessorsPipeline instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IGcsIngestWithDocAiProcessorsPipeline): google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline; - - /** - * Encodes the specified GcsIngestWithDocAiProcessorsPipeline message. Does not implicitly {@link google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline.verify|verify} messages. - * @param message GcsIngestWithDocAiProcessorsPipeline message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IGcsIngestWithDocAiProcessorsPipeline, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GcsIngestWithDocAiProcessorsPipeline message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline.verify|verify} messages. - * @param message GcsIngestWithDocAiProcessorsPipeline message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IGcsIngestWithDocAiProcessorsPipeline, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GcsIngestWithDocAiProcessorsPipeline message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GcsIngestWithDocAiProcessorsPipeline - * @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.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline; - - /** - * Decodes a GcsIngestWithDocAiProcessorsPipeline message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GcsIngestWithDocAiProcessorsPipeline - * @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.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline; - - /** - * Verifies a GcsIngestWithDocAiProcessorsPipeline 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 GcsIngestWithDocAiProcessorsPipeline message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GcsIngestWithDocAiProcessorsPipeline - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline; - - /** - * Creates a plain object from a GcsIngestWithDocAiProcessorsPipeline message. Also converts values to other types if specified. - * @param message GcsIngestWithDocAiProcessorsPipeline - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GcsIngestWithDocAiProcessorsPipeline to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GcsIngestWithDocAiProcessorsPipeline - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ExportToCdwPipeline. */ - interface IExportToCdwPipeline { - - /** ExportToCdwPipeline documents */ - documents?: (string[]|null); - - /** ExportToCdwPipeline exportFolderPath */ - exportFolderPath?: (string|null); - - /** ExportToCdwPipeline docAiDataset */ - docAiDataset?: (string|null); - - /** ExportToCdwPipeline trainingSplitRatio */ - trainingSplitRatio?: (number|null); - } - - /** Represents an ExportToCdwPipeline. */ - class ExportToCdwPipeline implements IExportToCdwPipeline { - - /** - * Constructs a new ExportToCdwPipeline. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IExportToCdwPipeline); - - /** ExportToCdwPipeline documents. */ - public documents: string[]; - - /** ExportToCdwPipeline exportFolderPath. */ - public exportFolderPath: string; - - /** ExportToCdwPipeline docAiDataset. */ - public docAiDataset: string; - - /** ExportToCdwPipeline trainingSplitRatio. */ - public trainingSplitRatio: number; - - /** - * Creates a new ExportToCdwPipeline instance using the specified properties. - * @param [properties] Properties to set - * @returns ExportToCdwPipeline instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IExportToCdwPipeline): google.cloud.contentwarehouse.v1.ExportToCdwPipeline; - - /** - * Encodes the specified ExportToCdwPipeline message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ExportToCdwPipeline.verify|verify} messages. - * @param message ExportToCdwPipeline message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IExportToCdwPipeline, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExportToCdwPipeline message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ExportToCdwPipeline.verify|verify} messages. - * @param message ExportToCdwPipeline message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IExportToCdwPipeline, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExportToCdwPipeline message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExportToCdwPipeline - * @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.cloud.contentwarehouse.v1.ExportToCdwPipeline; - - /** - * Decodes an ExportToCdwPipeline message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExportToCdwPipeline - * @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.cloud.contentwarehouse.v1.ExportToCdwPipeline; - - /** - * Verifies an ExportToCdwPipeline 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 ExportToCdwPipeline message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExportToCdwPipeline - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.ExportToCdwPipeline; - - /** - * Creates a plain object from an ExportToCdwPipeline message. Also converts values to other types if specified. - * @param message ExportToCdwPipeline - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.ExportToCdwPipeline, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExportToCdwPipeline to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExportToCdwPipeline - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ProcessWithDocAiPipeline. */ - interface IProcessWithDocAiPipeline { - - /** ProcessWithDocAiPipeline documents */ - documents?: (string[]|null); - - /** ProcessWithDocAiPipeline exportFolderPath */ - exportFolderPath?: (string|null); - - /** ProcessWithDocAiPipeline processorInfo */ - processorInfo?: (google.cloud.contentwarehouse.v1.IProcessorInfo|null); - - /** ProcessWithDocAiPipeline processorResultsFolderPath */ - processorResultsFolderPath?: (string|null); - } - - /** Represents a ProcessWithDocAiPipeline. */ - class ProcessWithDocAiPipeline implements IProcessWithDocAiPipeline { - - /** - * Constructs a new ProcessWithDocAiPipeline. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IProcessWithDocAiPipeline); - - /** ProcessWithDocAiPipeline documents. */ - public documents: string[]; - - /** ProcessWithDocAiPipeline exportFolderPath. */ - public exportFolderPath: string; - - /** ProcessWithDocAiPipeline processorInfo. */ - public processorInfo?: (google.cloud.contentwarehouse.v1.IProcessorInfo|null); - - /** ProcessWithDocAiPipeline processorResultsFolderPath. */ - public processorResultsFolderPath: string; - - /** - * Creates a new ProcessWithDocAiPipeline instance using the specified properties. - * @param [properties] Properties to set - * @returns ProcessWithDocAiPipeline instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IProcessWithDocAiPipeline): google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline; - - /** - * Encodes the specified ProcessWithDocAiPipeline message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline.verify|verify} messages. - * @param message ProcessWithDocAiPipeline message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IProcessWithDocAiPipeline, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ProcessWithDocAiPipeline message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline.verify|verify} messages. - * @param message ProcessWithDocAiPipeline message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IProcessWithDocAiPipeline, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ProcessWithDocAiPipeline message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ProcessWithDocAiPipeline - * @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.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline; - - /** - * Decodes a ProcessWithDocAiPipeline message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ProcessWithDocAiPipeline - * @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.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline; - - /** - * Verifies a ProcessWithDocAiPipeline 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 ProcessWithDocAiPipeline message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ProcessWithDocAiPipeline - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline; - - /** - * Creates a plain object from a ProcessWithDocAiPipeline message. Also converts values to other types if specified. - * @param message ProcessWithDocAiPipeline - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ProcessWithDocAiPipeline to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ProcessWithDocAiPipeline - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents a RuleSetService */ - class RuleSetService extends $protobuf.rpc.Service { - - /** - * Constructs a new RuleSetService 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 RuleSetService 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): RuleSetService; - - /** - * Calls CreateRuleSet. - * @param request CreateRuleSetRequest message or plain object - * @param callback Node-style callback called with the error, if any, and RuleSet - */ - public createRuleSet(request: google.cloud.contentwarehouse.v1.ICreateRuleSetRequest, callback: google.cloud.contentwarehouse.v1.RuleSetService.CreateRuleSetCallback): void; - - /** - * Calls CreateRuleSet. - * @param request CreateRuleSetRequest message or plain object - * @returns Promise - */ - public createRuleSet(request: google.cloud.contentwarehouse.v1.ICreateRuleSetRequest): Promise; - - /** - * Calls GetRuleSet. - * @param request GetRuleSetRequest message or plain object - * @param callback Node-style callback called with the error, if any, and RuleSet - */ - public getRuleSet(request: google.cloud.contentwarehouse.v1.IGetRuleSetRequest, callback: google.cloud.contentwarehouse.v1.RuleSetService.GetRuleSetCallback): void; - - /** - * Calls GetRuleSet. - * @param request GetRuleSetRequest message or plain object - * @returns Promise - */ - public getRuleSet(request: google.cloud.contentwarehouse.v1.IGetRuleSetRequest): Promise; - - /** - * Calls UpdateRuleSet. - * @param request UpdateRuleSetRequest message or plain object - * @param callback Node-style callback called with the error, if any, and RuleSet - */ - public updateRuleSet(request: google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest, callback: google.cloud.contentwarehouse.v1.RuleSetService.UpdateRuleSetCallback): void; - - /** - * Calls UpdateRuleSet. - * @param request UpdateRuleSetRequest message or plain object - * @returns Promise - */ - public updateRuleSet(request: google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest): Promise; - - /** - * Calls DeleteRuleSet. - * @param request DeleteRuleSetRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteRuleSet(request: google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest, callback: google.cloud.contentwarehouse.v1.RuleSetService.DeleteRuleSetCallback): void; - - /** - * Calls DeleteRuleSet. - * @param request DeleteRuleSetRequest message or plain object - * @returns Promise - */ - public deleteRuleSet(request: google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest): Promise; - - /** - * Calls ListRuleSets. - * @param request ListRuleSetsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListRuleSetsResponse - */ - public listRuleSets(request: google.cloud.contentwarehouse.v1.IListRuleSetsRequest, callback: google.cloud.contentwarehouse.v1.RuleSetService.ListRuleSetsCallback): void; - - /** - * Calls ListRuleSets. - * @param request ListRuleSetsRequest message or plain object - * @returns Promise - */ - public listRuleSets(request: google.cloud.contentwarehouse.v1.IListRuleSetsRequest): Promise; - } - - namespace RuleSetService { - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.RuleSetService|createRuleSet}. - * @param error Error, if any - * @param [response] RuleSet - */ - type CreateRuleSetCallback = (error: (Error|null), response?: google.cloud.contentwarehouse.v1.RuleSet) => void; - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.RuleSetService|getRuleSet}. - * @param error Error, if any - * @param [response] RuleSet - */ - type GetRuleSetCallback = (error: (Error|null), response?: google.cloud.contentwarehouse.v1.RuleSet) => void; - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.RuleSetService|updateRuleSet}. - * @param error Error, if any - * @param [response] RuleSet - */ - type UpdateRuleSetCallback = (error: (Error|null), response?: google.cloud.contentwarehouse.v1.RuleSet) => void; - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.RuleSetService|deleteRuleSet}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteRuleSetCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.RuleSetService|listRuleSets}. - * @param error Error, if any - * @param [response] ListRuleSetsResponse - */ - type ListRuleSetsCallback = (error: (Error|null), response?: google.cloud.contentwarehouse.v1.ListRuleSetsResponse) => void; - } - - /** Properties of a CreateRuleSetRequest. */ - interface ICreateRuleSetRequest { - - /** CreateRuleSetRequest parent */ - parent?: (string|null); - - /** CreateRuleSetRequest ruleSet */ - ruleSet?: (google.cloud.contentwarehouse.v1.IRuleSet|null); - } - - /** Represents a CreateRuleSetRequest. */ - class CreateRuleSetRequest implements ICreateRuleSetRequest { - - /** - * Constructs a new CreateRuleSetRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.ICreateRuleSetRequest); - - /** CreateRuleSetRequest parent. */ - public parent: string; - - /** CreateRuleSetRequest ruleSet. */ - public ruleSet?: (google.cloud.contentwarehouse.v1.IRuleSet|null); - - /** - * Creates a new CreateRuleSetRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateRuleSetRequest instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.ICreateRuleSetRequest): google.cloud.contentwarehouse.v1.CreateRuleSetRequest; - - /** - * Encodes the specified CreateRuleSetRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateRuleSetRequest.verify|verify} messages. - * @param message CreateRuleSetRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.ICreateRuleSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateRuleSetRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateRuleSetRequest.verify|verify} messages. - * @param message CreateRuleSetRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.ICreateRuleSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateRuleSetRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateRuleSetRequest - * @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.cloud.contentwarehouse.v1.CreateRuleSetRequest; - - /** - * Decodes a CreateRuleSetRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateRuleSetRequest - * @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.cloud.contentwarehouse.v1.CreateRuleSetRequest; - - /** - * Verifies a CreateRuleSetRequest 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 CreateRuleSetRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateRuleSetRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.CreateRuleSetRequest; - - /** - * Creates a plain object from a CreateRuleSetRequest message. Also converts values to other types if specified. - * @param message CreateRuleSetRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.CreateRuleSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateRuleSetRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateRuleSetRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetRuleSetRequest. */ - interface IGetRuleSetRequest { - - /** GetRuleSetRequest name */ - name?: (string|null); - } - - /** Represents a GetRuleSetRequest. */ - class GetRuleSetRequest implements IGetRuleSetRequest { - - /** - * Constructs a new GetRuleSetRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IGetRuleSetRequest); - - /** GetRuleSetRequest name. */ - public name: string; - - /** - * Creates a new GetRuleSetRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetRuleSetRequest instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IGetRuleSetRequest): google.cloud.contentwarehouse.v1.GetRuleSetRequest; - - /** - * Encodes the specified GetRuleSetRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.GetRuleSetRequest.verify|verify} messages. - * @param message GetRuleSetRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IGetRuleSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetRuleSetRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.GetRuleSetRequest.verify|verify} messages. - * @param message GetRuleSetRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IGetRuleSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetRuleSetRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetRuleSetRequest - * @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.cloud.contentwarehouse.v1.GetRuleSetRequest; - - /** - * Decodes a GetRuleSetRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetRuleSetRequest - * @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.cloud.contentwarehouse.v1.GetRuleSetRequest; - - /** - * Verifies a GetRuleSetRequest 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 GetRuleSetRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetRuleSetRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.GetRuleSetRequest; - - /** - * Creates a plain object from a GetRuleSetRequest message. Also converts values to other types if specified. - * @param message GetRuleSetRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.GetRuleSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetRuleSetRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetRuleSetRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateRuleSetRequest. */ - interface IUpdateRuleSetRequest { - - /** UpdateRuleSetRequest name */ - name?: (string|null); - - /** UpdateRuleSetRequest ruleSet */ - ruleSet?: (google.cloud.contentwarehouse.v1.IRuleSet|null); - } - - /** Represents an UpdateRuleSetRequest. */ - class UpdateRuleSetRequest implements IUpdateRuleSetRequest { - - /** - * Constructs a new UpdateRuleSetRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest); - - /** UpdateRuleSetRequest name. */ - public name: string; - - /** UpdateRuleSetRequest ruleSet. */ - public ruleSet?: (google.cloud.contentwarehouse.v1.IRuleSet|null); - - /** - * Creates a new UpdateRuleSetRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateRuleSetRequest instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest): google.cloud.contentwarehouse.v1.UpdateRuleSetRequest; - - /** - * Encodes the specified UpdateRuleSetRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateRuleSetRequest.verify|verify} messages. - * @param message UpdateRuleSetRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateRuleSetRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateRuleSetRequest.verify|verify} messages. - * @param message UpdateRuleSetRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateRuleSetRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateRuleSetRequest - * @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.cloud.contentwarehouse.v1.UpdateRuleSetRequest; - - /** - * Decodes an UpdateRuleSetRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateRuleSetRequest - * @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.cloud.contentwarehouse.v1.UpdateRuleSetRequest; - - /** - * Verifies an UpdateRuleSetRequest 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 UpdateRuleSetRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateRuleSetRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.UpdateRuleSetRequest; - - /** - * Creates a plain object from an UpdateRuleSetRequest message. Also converts values to other types if specified. - * @param message UpdateRuleSetRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.UpdateRuleSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateRuleSetRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateRuleSetRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteRuleSetRequest. */ - interface IDeleteRuleSetRequest { - - /** DeleteRuleSetRequest name */ - name?: (string|null); - } - - /** Represents a DeleteRuleSetRequest. */ - class DeleteRuleSetRequest implements IDeleteRuleSetRequest { - - /** - * Constructs a new DeleteRuleSetRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest); - - /** DeleteRuleSetRequest name. */ - public name: string; - - /** - * Creates a new DeleteRuleSetRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteRuleSetRequest instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest): google.cloud.contentwarehouse.v1.DeleteRuleSetRequest; - - /** - * Encodes the specified DeleteRuleSetRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DeleteRuleSetRequest.verify|verify} messages. - * @param message DeleteRuleSetRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteRuleSetRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DeleteRuleSetRequest.verify|verify} messages. - * @param message DeleteRuleSetRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteRuleSetRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteRuleSetRequest - * @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.cloud.contentwarehouse.v1.DeleteRuleSetRequest; - - /** - * Decodes a DeleteRuleSetRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteRuleSetRequest - * @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.cloud.contentwarehouse.v1.DeleteRuleSetRequest; - - /** - * Verifies a DeleteRuleSetRequest 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 DeleteRuleSetRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteRuleSetRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.DeleteRuleSetRequest; - - /** - * Creates a plain object from a DeleteRuleSetRequest message. Also converts values to other types if specified. - * @param message DeleteRuleSetRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.DeleteRuleSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteRuleSetRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteRuleSetRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListRuleSetsRequest. */ - interface IListRuleSetsRequest { - - /** ListRuleSetsRequest parent */ - parent?: (string|null); - - /** ListRuleSetsRequest pageSize */ - pageSize?: (number|null); - - /** ListRuleSetsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListRuleSetsRequest. */ - class ListRuleSetsRequest implements IListRuleSetsRequest { - - /** - * Constructs a new ListRuleSetsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IListRuleSetsRequest); - - /** ListRuleSetsRequest parent. */ - public parent: string; - - /** ListRuleSetsRequest pageSize. */ - public pageSize: number; - - /** ListRuleSetsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListRuleSetsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListRuleSetsRequest instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IListRuleSetsRequest): google.cloud.contentwarehouse.v1.ListRuleSetsRequest; - - /** - * Encodes the specified ListRuleSetsRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListRuleSetsRequest.verify|verify} messages. - * @param message ListRuleSetsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IListRuleSetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListRuleSetsRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListRuleSetsRequest.verify|verify} messages. - * @param message ListRuleSetsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IListRuleSetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListRuleSetsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListRuleSetsRequest - * @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.cloud.contentwarehouse.v1.ListRuleSetsRequest; - - /** - * Decodes a ListRuleSetsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListRuleSetsRequest - * @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.cloud.contentwarehouse.v1.ListRuleSetsRequest; - - /** - * Verifies a ListRuleSetsRequest 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 ListRuleSetsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListRuleSetsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.ListRuleSetsRequest; - - /** - * Creates a plain object from a ListRuleSetsRequest message. Also converts values to other types if specified. - * @param message ListRuleSetsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.ListRuleSetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListRuleSetsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListRuleSetsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListRuleSetsResponse. */ - interface IListRuleSetsResponse { - - /** ListRuleSetsResponse ruleSets */ - ruleSets?: (google.cloud.contentwarehouse.v1.IRuleSet[]|null); - - /** ListRuleSetsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListRuleSetsResponse. */ - class ListRuleSetsResponse implements IListRuleSetsResponse { - - /** - * Constructs a new ListRuleSetsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IListRuleSetsResponse); - - /** ListRuleSetsResponse ruleSets. */ - public ruleSets: google.cloud.contentwarehouse.v1.IRuleSet[]; - - /** ListRuleSetsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListRuleSetsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListRuleSetsResponse instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IListRuleSetsResponse): google.cloud.contentwarehouse.v1.ListRuleSetsResponse; - - /** - * Encodes the specified ListRuleSetsResponse message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListRuleSetsResponse.verify|verify} messages. - * @param message ListRuleSetsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IListRuleSetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListRuleSetsResponse message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListRuleSetsResponse.verify|verify} messages. - * @param message ListRuleSetsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IListRuleSetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListRuleSetsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListRuleSetsResponse - * @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.cloud.contentwarehouse.v1.ListRuleSetsResponse; - - /** - * Decodes a ListRuleSetsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListRuleSetsResponse - * @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.cloud.contentwarehouse.v1.ListRuleSetsResponse; - - /** - * Verifies a ListRuleSetsResponse 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 ListRuleSetsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListRuleSetsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.ListRuleSetsResponse; - - /** - * Creates a plain object from a ListRuleSetsResponse message. Also converts values to other types if specified. - * @param message ListRuleSetsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.ListRuleSetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListRuleSetsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListRuleSetsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SynonymSet. */ - interface ISynonymSet { - - /** SynonymSet name */ - name?: (string|null); - - /** SynonymSet context */ - context?: (string|null); - - /** SynonymSet synonyms */ - synonyms?: (google.cloud.contentwarehouse.v1.SynonymSet.ISynonym[]|null); - } - - /** Represents a SynonymSet. */ - class SynonymSet implements ISynonymSet { - - /** - * Constructs a new SynonymSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.ISynonymSet); - - /** SynonymSet name. */ - public name: string; - - /** SynonymSet context. */ - public context: string; - - /** SynonymSet synonyms. */ - public synonyms: google.cloud.contentwarehouse.v1.SynonymSet.ISynonym[]; - - /** - * Creates a new SynonymSet instance using the specified properties. - * @param [properties] Properties to set - * @returns SynonymSet instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.ISynonymSet): google.cloud.contentwarehouse.v1.SynonymSet; - - /** - * Encodes the specified SynonymSet message. Does not implicitly {@link google.cloud.contentwarehouse.v1.SynonymSet.verify|verify} messages. - * @param message SynonymSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.ISynonymSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SynonymSet message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.SynonymSet.verify|verify} messages. - * @param message SynonymSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.ISynonymSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SynonymSet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SynonymSet - * @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.cloud.contentwarehouse.v1.SynonymSet; - - /** - * Decodes a SynonymSet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SynonymSet - * @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.cloud.contentwarehouse.v1.SynonymSet; - - /** - * Verifies a SynonymSet 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 SynonymSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SynonymSet - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.SynonymSet; - - /** - * Creates a plain object from a SynonymSet message. Also converts values to other types if specified. - * @param message SynonymSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.SynonymSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SynonymSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SynonymSet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SynonymSet { - - /** Properties of a Synonym. */ - interface ISynonym { - - /** Synonym words */ - words?: (string[]|null); - } - - /** Represents a Synonym. */ - class Synonym implements ISynonym { - - /** - * Constructs a new Synonym. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.SynonymSet.ISynonym); - - /** Synonym words. */ - public words: string[]; - - /** - * Creates a new Synonym instance using the specified properties. - * @param [properties] Properties to set - * @returns Synonym instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.SynonymSet.ISynonym): google.cloud.contentwarehouse.v1.SynonymSet.Synonym; - - /** - * Encodes the specified Synonym message. Does not implicitly {@link google.cloud.contentwarehouse.v1.SynonymSet.Synonym.verify|verify} messages. - * @param message Synonym message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.SynonymSet.ISynonym, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Synonym message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.SynonymSet.Synonym.verify|verify} messages. - * @param message Synonym message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.SynonymSet.ISynonym, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Synonym message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Synonym - * @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.cloud.contentwarehouse.v1.SynonymSet.Synonym; - - /** - * Decodes a Synonym message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Synonym - * @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.cloud.contentwarehouse.v1.SynonymSet.Synonym; - - /** - * Verifies a Synonym 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 Synonym message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Synonym - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.SynonymSet.Synonym; - - /** - * Creates a plain object from a Synonym message. Also converts values to other types if specified. - * @param message Synonym - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.SynonymSet.Synonym, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Synonym to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Synonym - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Represents a SynonymSetService */ - class SynonymSetService extends $protobuf.rpc.Service { - - /** - * Constructs a new SynonymSetService 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 SynonymSetService 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): SynonymSetService; - - /** - * Calls CreateSynonymSet. - * @param request CreateSynonymSetRequest message or plain object - * @param callback Node-style callback called with the error, if any, and SynonymSet - */ - public createSynonymSet(request: google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest, callback: google.cloud.contentwarehouse.v1.SynonymSetService.CreateSynonymSetCallback): void; - - /** - * Calls CreateSynonymSet. - * @param request CreateSynonymSetRequest message or plain object - * @returns Promise - */ - public createSynonymSet(request: google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest): Promise; - - /** - * Calls GetSynonymSet. - * @param request GetSynonymSetRequest message or plain object - * @param callback Node-style callback called with the error, if any, and SynonymSet - */ - public getSynonymSet(request: google.cloud.contentwarehouse.v1.IGetSynonymSetRequest, callback: google.cloud.contentwarehouse.v1.SynonymSetService.GetSynonymSetCallback): void; - - /** - * Calls GetSynonymSet. - * @param request GetSynonymSetRequest message or plain object - * @returns Promise - */ - public getSynonymSet(request: google.cloud.contentwarehouse.v1.IGetSynonymSetRequest): Promise; - - /** - * Calls UpdateSynonymSet. - * @param request UpdateSynonymSetRequest message or plain object - * @param callback Node-style callback called with the error, if any, and SynonymSet - */ - public updateSynonymSet(request: google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest, callback: google.cloud.contentwarehouse.v1.SynonymSetService.UpdateSynonymSetCallback): void; - - /** - * Calls UpdateSynonymSet. - * @param request UpdateSynonymSetRequest message or plain object - * @returns Promise - */ - public updateSynonymSet(request: google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest): Promise; - - /** - * Calls DeleteSynonymSet. - * @param request DeleteSynonymSetRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteSynonymSet(request: google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest, callback: google.cloud.contentwarehouse.v1.SynonymSetService.DeleteSynonymSetCallback): void; - - /** - * Calls DeleteSynonymSet. - * @param request DeleteSynonymSetRequest message or plain object - * @returns Promise - */ - public deleteSynonymSet(request: google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest): Promise; - - /** - * Calls ListSynonymSets. - * @param request ListSynonymSetsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListSynonymSetsResponse - */ - public listSynonymSets(request: google.cloud.contentwarehouse.v1.IListSynonymSetsRequest, callback: google.cloud.contentwarehouse.v1.SynonymSetService.ListSynonymSetsCallback): void; - - /** - * Calls ListSynonymSets. - * @param request ListSynonymSetsRequest message or plain object - * @returns Promise - */ - public listSynonymSets(request: google.cloud.contentwarehouse.v1.IListSynonymSetsRequest): Promise; - } - - namespace SynonymSetService { - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.SynonymSetService|createSynonymSet}. - * @param error Error, if any - * @param [response] SynonymSet - */ - type CreateSynonymSetCallback = (error: (Error|null), response?: google.cloud.contentwarehouse.v1.SynonymSet) => void; - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.SynonymSetService|getSynonymSet}. - * @param error Error, if any - * @param [response] SynonymSet - */ - type GetSynonymSetCallback = (error: (Error|null), response?: google.cloud.contentwarehouse.v1.SynonymSet) => void; - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.SynonymSetService|updateSynonymSet}. - * @param error Error, if any - * @param [response] SynonymSet - */ - type UpdateSynonymSetCallback = (error: (Error|null), response?: google.cloud.contentwarehouse.v1.SynonymSet) => void; - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.SynonymSetService|deleteSynonymSet}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteSynonymSetCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.SynonymSetService|listSynonymSets}. - * @param error Error, if any - * @param [response] ListSynonymSetsResponse - */ - type ListSynonymSetsCallback = (error: (Error|null), response?: google.cloud.contentwarehouse.v1.ListSynonymSetsResponse) => void; - } - - /** Properties of a CreateSynonymSetRequest. */ - interface ICreateSynonymSetRequest { - - /** CreateSynonymSetRequest parent */ - parent?: (string|null); - - /** CreateSynonymSetRequest synonymSet */ - synonymSet?: (google.cloud.contentwarehouse.v1.ISynonymSet|null); - } - - /** Represents a CreateSynonymSetRequest. */ - class CreateSynonymSetRequest implements ICreateSynonymSetRequest { - - /** - * Constructs a new CreateSynonymSetRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest); - - /** CreateSynonymSetRequest parent. */ - public parent: string; - - /** CreateSynonymSetRequest synonymSet. */ - public synonymSet?: (google.cloud.contentwarehouse.v1.ISynonymSet|null); - - /** - * Creates a new CreateSynonymSetRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateSynonymSetRequest instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest): google.cloud.contentwarehouse.v1.CreateSynonymSetRequest; - - /** - * Encodes the specified CreateSynonymSetRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateSynonymSetRequest.verify|verify} messages. - * @param message CreateSynonymSetRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateSynonymSetRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateSynonymSetRequest.verify|verify} messages. - * @param message CreateSynonymSetRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateSynonymSetRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateSynonymSetRequest - * @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.cloud.contentwarehouse.v1.CreateSynonymSetRequest; - - /** - * Decodes a CreateSynonymSetRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateSynonymSetRequest - * @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.cloud.contentwarehouse.v1.CreateSynonymSetRequest; - - /** - * Verifies a CreateSynonymSetRequest 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 CreateSynonymSetRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateSynonymSetRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.CreateSynonymSetRequest; - - /** - * Creates a plain object from a CreateSynonymSetRequest message. Also converts values to other types if specified. - * @param message CreateSynonymSetRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.CreateSynonymSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateSynonymSetRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateSynonymSetRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetSynonymSetRequest. */ - interface IGetSynonymSetRequest { - - /** GetSynonymSetRequest name */ - name?: (string|null); - } - - /** Represents a GetSynonymSetRequest. */ - class GetSynonymSetRequest implements IGetSynonymSetRequest { - - /** - * Constructs a new GetSynonymSetRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IGetSynonymSetRequest); - - /** GetSynonymSetRequest name. */ - public name: string; - - /** - * Creates a new GetSynonymSetRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetSynonymSetRequest instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IGetSynonymSetRequest): google.cloud.contentwarehouse.v1.GetSynonymSetRequest; - - /** - * Encodes the specified GetSynonymSetRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.GetSynonymSetRequest.verify|verify} messages. - * @param message GetSynonymSetRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IGetSynonymSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetSynonymSetRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.GetSynonymSetRequest.verify|verify} messages. - * @param message GetSynonymSetRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IGetSynonymSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetSynonymSetRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetSynonymSetRequest - * @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.cloud.contentwarehouse.v1.GetSynonymSetRequest; - - /** - * Decodes a GetSynonymSetRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetSynonymSetRequest - * @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.cloud.contentwarehouse.v1.GetSynonymSetRequest; - - /** - * Verifies a GetSynonymSetRequest 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 GetSynonymSetRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetSynonymSetRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.GetSynonymSetRequest; - - /** - * Creates a plain object from a GetSynonymSetRequest message. Also converts values to other types if specified. - * @param message GetSynonymSetRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.GetSynonymSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetSynonymSetRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetSynonymSetRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListSynonymSetsRequest. */ - interface IListSynonymSetsRequest { - - /** ListSynonymSetsRequest parent */ - parent?: (string|null); - - /** ListSynonymSetsRequest pageSize */ - pageSize?: (number|null); - - /** ListSynonymSetsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListSynonymSetsRequest. */ - class ListSynonymSetsRequest implements IListSynonymSetsRequest { - - /** - * Constructs a new ListSynonymSetsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IListSynonymSetsRequest); - - /** ListSynonymSetsRequest parent. */ - public parent: string; - - /** ListSynonymSetsRequest pageSize. */ - public pageSize: number; - - /** ListSynonymSetsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListSynonymSetsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListSynonymSetsRequest instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IListSynonymSetsRequest): google.cloud.contentwarehouse.v1.ListSynonymSetsRequest; - - /** - * Encodes the specified ListSynonymSetsRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListSynonymSetsRequest.verify|verify} messages. - * @param message ListSynonymSetsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IListSynonymSetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListSynonymSetsRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListSynonymSetsRequest.verify|verify} messages. - * @param message ListSynonymSetsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IListSynonymSetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListSynonymSetsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListSynonymSetsRequest - * @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.cloud.contentwarehouse.v1.ListSynonymSetsRequest; - - /** - * Decodes a ListSynonymSetsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListSynonymSetsRequest - * @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.cloud.contentwarehouse.v1.ListSynonymSetsRequest; - - /** - * Verifies a ListSynonymSetsRequest 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 ListSynonymSetsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListSynonymSetsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.ListSynonymSetsRequest; - - /** - * Creates a plain object from a ListSynonymSetsRequest message. Also converts values to other types if specified. - * @param message ListSynonymSetsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.ListSynonymSetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListSynonymSetsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListSynonymSetsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListSynonymSetsResponse. */ - interface IListSynonymSetsResponse { - - /** ListSynonymSetsResponse synonymSets */ - synonymSets?: (google.cloud.contentwarehouse.v1.ISynonymSet[]|null); - - /** ListSynonymSetsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListSynonymSetsResponse. */ - class ListSynonymSetsResponse implements IListSynonymSetsResponse { - - /** - * Constructs a new ListSynonymSetsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IListSynonymSetsResponse); - - /** ListSynonymSetsResponse synonymSets. */ - public synonymSets: google.cloud.contentwarehouse.v1.ISynonymSet[]; - - /** ListSynonymSetsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListSynonymSetsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListSynonymSetsResponse instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IListSynonymSetsResponse): google.cloud.contentwarehouse.v1.ListSynonymSetsResponse; - - /** - * Encodes the specified ListSynonymSetsResponse message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListSynonymSetsResponse.verify|verify} messages. - * @param message ListSynonymSetsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IListSynonymSetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListSynonymSetsResponse message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListSynonymSetsResponse.verify|verify} messages. - * @param message ListSynonymSetsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IListSynonymSetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListSynonymSetsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListSynonymSetsResponse - * @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.cloud.contentwarehouse.v1.ListSynonymSetsResponse; - - /** - * Decodes a ListSynonymSetsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListSynonymSetsResponse - * @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.cloud.contentwarehouse.v1.ListSynonymSetsResponse; - - /** - * Verifies a ListSynonymSetsResponse 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 ListSynonymSetsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListSynonymSetsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.ListSynonymSetsResponse; - - /** - * Creates a plain object from a ListSynonymSetsResponse message. Also converts values to other types if specified. - * @param message ListSynonymSetsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.ListSynonymSetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListSynonymSetsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListSynonymSetsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateSynonymSetRequest. */ - interface IUpdateSynonymSetRequest { - - /** UpdateSynonymSetRequest name */ - name?: (string|null); - - /** UpdateSynonymSetRequest synonymSet */ - synonymSet?: (google.cloud.contentwarehouse.v1.ISynonymSet|null); - } - - /** Represents an UpdateSynonymSetRequest. */ - class UpdateSynonymSetRequest implements IUpdateSynonymSetRequest { - - /** - * Constructs a new UpdateSynonymSetRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest); - - /** UpdateSynonymSetRequest name. */ - public name: string; - - /** UpdateSynonymSetRequest synonymSet. */ - public synonymSet?: (google.cloud.contentwarehouse.v1.ISynonymSet|null); - - /** - * Creates a new UpdateSynonymSetRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateSynonymSetRequest instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest): google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest; - - /** - * Encodes the specified UpdateSynonymSetRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest.verify|verify} messages. - * @param message UpdateSynonymSetRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateSynonymSetRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest.verify|verify} messages. - * @param message UpdateSynonymSetRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateSynonymSetRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateSynonymSetRequest - * @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.cloud.contentwarehouse.v1.UpdateSynonymSetRequest; - - /** - * Decodes an UpdateSynonymSetRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateSynonymSetRequest - * @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.cloud.contentwarehouse.v1.UpdateSynonymSetRequest; - - /** - * Verifies an UpdateSynonymSetRequest 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 UpdateSynonymSetRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateSynonymSetRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest; - - /** - * Creates a plain object from an UpdateSynonymSetRequest message. Also converts values to other types if specified. - * @param message UpdateSynonymSetRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateSynonymSetRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateSynonymSetRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteSynonymSetRequest. */ - interface IDeleteSynonymSetRequest { - - /** DeleteSynonymSetRequest name */ - name?: (string|null); - } - - /** Represents a DeleteSynonymSetRequest. */ - class DeleteSynonymSetRequest implements IDeleteSynonymSetRequest { - - /** - * Constructs a new DeleteSynonymSetRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest); - - /** DeleteSynonymSetRequest name. */ - public name: string; - - /** - * Creates a new DeleteSynonymSetRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteSynonymSetRequest instance - */ - public static create(properties?: google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest): google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest; - - /** - * Encodes the specified DeleteSynonymSetRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest.verify|verify} messages. - * @param message DeleteSynonymSetRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteSynonymSetRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest.verify|verify} messages. - * @param message DeleteSynonymSetRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteSynonymSetRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteSynonymSetRequest - * @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.cloud.contentwarehouse.v1.DeleteSynonymSetRequest; - - /** - * Decodes a DeleteSynonymSetRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteSynonymSetRequest - * @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.cloud.contentwarehouse.v1.DeleteSynonymSetRequest; - - /** - * Verifies a DeleteSynonymSetRequest 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 DeleteSynonymSetRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteSynonymSetRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest; - - /** - * Creates a plain object from a DeleteSynonymSetRequest message. Also converts values to other types if specified. - * @param message DeleteSynonymSetRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteSynonymSetRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteSynonymSetRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - } - - /** Namespace documentai. */ - namespace documentai { - - /** Namespace v1. */ - namespace v1 { - - /** Properties of a Document. */ - interface IDocument { - - /** Document uri */ - uri?: (string|null); - - /** Document content */ - content?: (Uint8Array|Buffer|string|null); - - /** Document docid */ - docid?: (string|null); - - /** Document mimeType */ - mimeType?: (string|null); - - /** Document text */ - text?: (string|null); - - /** Document textStyles */ - textStyles?: (google.cloud.documentai.v1.Document.IStyle[]|null); - - /** Document pages */ - pages?: (google.cloud.documentai.v1.Document.IPage[]|null); - - /** Document entities */ - entities?: (google.cloud.documentai.v1.Document.IEntity[]|null); - - /** Document entityRelations */ - entityRelations?: (google.cloud.documentai.v1.Document.IEntityRelation[]|null); - - /** Document textChanges */ - textChanges?: (google.cloud.documentai.v1.Document.ITextChange[]|null); - - /** Document shardInfo */ - shardInfo?: (google.cloud.documentai.v1.Document.IShardInfo|null); - - /** Document error */ - error?: (google.rpc.IStatus|null); - - /** Document revisions */ - revisions?: (google.cloud.documentai.v1.Document.IRevision[]|null); - - /** Document documentLayout */ - documentLayout?: (google.cloud.documentai.v1.Document.IDocumentLayout|null); - - /** Document chunkedDocument */ - chunkedDocument?: (google.cloud.documentai.v1.Document.IChunkedDocument|null); - - /** Document entityValidationOutput */ - entityValidationOutput?: (google.cloud.documentai.v1.Document.IEntityValidationOutput|null); - - /** Document entitiesRevisions */ - entitiesRevisions?: (google.cloud.documentai.v1.Document.IEntitiesRevision[]|null); - - /** Document entitiesRevisionId */ - entitiesRevisionId?: (string|null); - } - - /** Represents a Document. */ - class Document implements IDocument { - - /** - * Constructs a new Document. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IDocument); - - /** Document uri. */ - public uri?: (string|null); - - /** Document content. */ - public content?: (Uint8Array|Buffer|string|null); - - /** Document docid. */ - public docid: string; - - /** Document mimeType. */ - public mimeType: string; - - /** Document text. */ - public text: string; - - /** Document textStyles. */ - public textStyles: google.cloud.documentai.v1.Document.IStyle[]; - - /** Document pages. */ - public pages: google.cloud.documentai.v1.Document.IPage[]; - - /** Document entities. */ - public entities: google.cloud.documentai.v1.Document.IEntity[]; - - /** Document entityRelations. */ - public entityRelations: google.cloud.documentai.v1.Document.IEntityRelation[]; - - /** Document textChanges. */ - public textChanges: google.cloud.documentai.v1.Document.ITextChange[]; - - /** Document shardInfo. */ - public shardInfo?: (google.cloud.documentai.v1.Document.IShardInfo|null); - - /** Document error. */ - public error?: (google.rpc.IStatus|null); - - /** Document revisions. */ - public revisions: google.cloud.documentai.v1.Document.IRevision[]; - - /** Document documentLayout. */ - public documentLayout?: (google.cloud.documentai.v1.Document.IDocumentLayout|null); - - /** Document chunkedDocument. */ - public chunkedDocument?: (google.cloud.documentai.v1.Document.IChunkedDocument|null); - - /** Document entityValidationOutput. */ - public entityValidationOutput?: (google.cloud.documentai.v1.Document.IEntityValidationOutput|null); - - /** Document entitiesRevisions. */ - public entitiesRevisions: google.cloud.documentai.v1.Document.IEntitiesRevision[]; - - /** Document entitiesRevisionId. */ - public entitiesRevisionId: string; - - /** Document source. */ - public source?: ("uri"|"content"); - - /** - * Creates a new Document instance using the specified properties. - * @param [properties] Properties to set - * @returns Document instance - */ - public static create(properties?: google.cloud.documentai.v1.IDocument): google.cloud.documentai.v1.Document; - - /** - * Encodes the specified Document message. Does not implicitly {@link google.cloud.documentai.v1.Document.verify|verify} messages. - * @param message Document message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IDocument, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Document message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.verify|verify} messages. - * @param message Document message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IDocument, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Document message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Document - * @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.cloud.documentai.v1.Document; - - /** - * Decodes a Document message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Document - * @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.cloud.documentai.v1.Document; - - /** - * Verifies a Document 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 Document message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Document - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document; - - /** - * Creates a plain object from a Document message. Also converts values to other types if specified. - * @param message Document - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Document to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Document - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Document { - - /** Properties of a ShardInfo. */ - interface IShardInfo { - - /** ShardInfo shardIndex */ - shardIndex?: (number|Long|string|null); - - /** ShardInfo shardCount */ - shardCount?: (number|Long|string|null); - - /** ShardInfo textOffset */ - textOffset?: (number|Long|string|null); - } - - /** Represents a ShardInfo. */ - class ShardInfo implements IShardInfo { - - /** - * Constructs a new ShardInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.IShardInfo); - - /** ShardInfo shardIndex. */ - public shardIndex: (number|Long|string); - - /** ShardInfo shardCount. */ - public shardCount: (number|Long|string); - - /** ShardInfo textOffset. */ - public textOffset: (number|Long|string); - - /** - * Creates a new ShardInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns ShardInfo instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.IShardInfo): google.cloud.documentai.v1.Document.ShardInfo; - - /** - * Encodes the specified ShardInfo message. Does not implicitly {@link google.cloud.documentai.v1.Document.ShardInfo.verify|verify} messages. - * @param message ShardInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Document.IShardInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ShardInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.ShardInfo.verify|verify} messages. - * @param message ShardInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Document.IShardInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ShardInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ShardInfo - * @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.cloud.documentai.v1.Document.ShardInfo; - - /** - * Decodes a ShardInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ShardInfo - * @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.cloud.documentai.v1.Document.ShardInfo; - - /** - * Verifies a ShardInfo 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 ShardInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ShardInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.ShardInfo; - - /** - * Creates a plain object from a ShardInfo message. Also converts values to other types if specified. - * @param message ShardInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document.ShardInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ShardInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ShardInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Style. */ - interface IStyle { - - /** Style textAnchor */ - textAnchor?: (google.cloud.documentai.v1.Document.ITextAnchor|null); - - /** Style color */ - color?: (google.type.IColor|null); - - /** Style backgroundColor */ - backgroundColor?: (google.type.IColor|null); - - /** Style fontWeight */ - fontWeight?: (string|null); - - /** Style textStyle */ - textStyle?: (string|null); - - /** Style textDecoration */ - textDecoration?: (string|null); - - /** Style fontSize */ - fontSize?: (google.cloud.documentai.v1.Document.Style.IFontSize|null); - - /** Style fontFamily */ - fontFamily?: (string|null); - } - - /** Represents a Style. */ - class Style implements IStyle { - - /** - * Constructs a new Style. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.IStyle); - - /** Style textAnchor. */ - public textAnchor?: (google.cloud.documentai.v1.Document.ITextAnchor|null); - - /** Style color. */ - public color?: (google.type.IColor|null); - - /** Style backgroundColor. */ - public backgroundColor?: (google.type.IColor|null); - - /** Style fontWeight. */ - public fontWeight: string; - - /** Style textStyle. */ - public textStyle: string; - - /** Style textDecoration. */ - public textDecoration: string; - - /** Style fontSize. */ - public fontSize?: (google.cloud.documentai.v1.Document.Style.IFontSize|null); - - /** Style fontFamily. */ - public fontFamily: string; - - /** - * Creates a new Style instance using the specified properties. - * @param [properties] Properties to set - * @returns Style instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.IStyle): google.cloud.documentai.v1.Document.Style; - - /** - * Encodes the specified Style message. Does not implicitly {@link google.cloud.documentai.v1.Document.Style.verify|verify} messages. - * @param message Style message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Document.IStyle, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Style message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Style.verify|verify} messages. - * @param message Style message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Document.IStyle, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Style message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Style - * @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.cloud.documentai.v1.Document.Style; - - /** - * Decodes a Style message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Style - * @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.cloud.documentai.v1.Document.Style; - - /** - * Verifies a Style 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 Style message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Style - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Style; - - /** - * Creates a plain object from a Style message. Also converts values to other types if specified. - * @param message Style - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document.Style, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Style to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Style - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Style { - - /** Properties of a FontSize. */ - interface IFontSize { - - /** FontSize size */ - size?: (number|null); - - /** FontSize unit */ - unit?: (string|null); - } - - /** Represents a FontSize. */ - class FontSize implements IFontSize { - - /** - * Constructs a new FontSize. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.Style.IFontSize); - - /** FontSize size. */ - public size: number; - - /** FontSize unit. */ - public unit: string; - - /** - * Creates a new FontSize instance using the specified properties. - * @param [properties] Properties to set - * @returns FontSize instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.Style.IFontSize): google.cloud.documentai.v1.Document.Style.FontSize; - - /** - * Encodes the specified FontSize message. Does not implicitly {@link google.cloud.documentai.v1.Document.Style.FontSize.verify|verify} messages. - * @param message FontSize message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Document.Style.IFontSize, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FontSize message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Style.FontSize.verify|verify} messages. - * @param message FontSize message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Document.Style.IFontSize, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FontSize message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FontSize - * @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.cloud.documentai.v1.Document.Style.FontSize; - - /** - * Decodes a FontSize message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FontSize - * @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.cloud.documentai.v1.Document.Style.FontSize; - - /** - * Verifies a FontSize 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 FontSize message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FontSize - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Style.FontSize; - - /** - * Creates a plain object from a FontSize message. Also converts values to other types if specified. - * @param message FontSize - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document.Style.FontSize, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FontSize to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FontSize - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a Page. */ - interface IPage { - - /** Page pageNumber */ - pageNumber?: (number|null); - - /** Page image */ - image?: (google.cloud.documentai.v1.Document.Page.IImage|null); - - /** Page transforms */ - transforms?: (google.cloud.documentai.v1.Document.Page.IMatrix[]|null); - - /** Page dimension */ - dimension?: (google.cloud.documentai.v1.Document.Page.IDimension|null); - - /** Page layout */ - layout?: (google.cloud.documentai.v1.Document.Page.ILayout|null); - - /** Page detectedLanguages */ - detectedLanguages?: (google.cloud.documentai.v1.Document.Page.IDetectedLanguage[]|null); - - /** Page blocks */ - blocks?: (google.cloud.documentai.v1.Document.Page.IBlock[]|null); - - /** Page paragraphs */ - paragraphs?: (google.cloud.documentai.v1.Document.Page.IParagraph[]|null); - - /** Page lines */ - lines?: (google.cloud.documentai.v1.Document.Page.ILine[]|null); - - /** Page tokens */ - tokens?: (google.cloud.documentai.v1.Document.Page.IToken[]|null); - - /** Page visualElements */ - visualElements?: (google.cloud.documentai.v1.Document.Page.IVisualElement[]|null); - - /** Page tables */ - tables?: (google.cloud.documentai.v1.Document.Page.ITable[]|null); - - /** Page formFields */ - formFields?: (google.cloud.documentai.v1.Document.Page.IFormField[]|null); - - /** Page symbols */ - symbols?: (google.cloud.documentai.v1.Document.Page.ISymbol[]|null); - - /** Page detectedBarcodes */ - detectedBarcodes?: (google.cloud.documentai.v1.Document.Page.IDetectedBarcode[]|null); - - /** Page imageQualityScores */ - imageQualityScores?: (google.cloud.documentai.v1.Document.Page.IImageQualityScores|null); - - /** Page provenance */ - provenance?: (google.cloud.documentai.v1.Document.IProvenance|null); - } - - /** Represents a Page. */ - class Page implements IPage { - - /** - * Constructs a new Page. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.IPage); - - /** Page pageNumber. */ - public pageNumber: number; - - /** Page image. */ - public image?: (google.cloud.documentai.v1.Document.Page.IImage|null); - - /** Page transforms. */ - public transforms: google.cloud.documentai.v1.Document.Page.IMatrix[]; - - /** Page dimension. */ - public dimension?: (google.cloud.documentai.v1.Document.Page.IDimension|null); - - /** Page layout. */ - public layout?: (google.cloud.documentai.v1.Document.Page.ILayout|null); - - /** Page detectedLanguages. */ - public detectedLanguages: google.cloud.documentai.v1.Document.Page.IDetectedLanguage[]; - - /** Page blocks. */ - public blocks: google.cloud.documentai.v1.Document.Page.IBlock[]; - - /** Page paragraphs. */ - public paragraphs: google.cloud.documentai.v1.Document.Page.IParagraph[]; - - /** Page lines. */ - public lines: google.cloud.documentai.v1.Document.Page.ILine[]; - - /** Page tokens. */ - public tokens: google.cloud.documentai.v1.Document.Page.IToken[]; - - /** Page visualElements. */ - public visualElements: google.cloud.documentai.v1.Document.Page.IVisualElement[]; - - /** Page tables. */ - public tables: google.cloud.documentai.v1.Document.Page.ITable[]; - - /** Page formFields. */ - public formFields: google.cloud.documentai.v1.Document.Page.IFormField[]; - - /** Page symbols. */ - public symbols: google.cloud.documentai.v1.Document.Page.ISymbol[]; - - /** Page detectedBarcodes. */ - public detectedBarcodes: google.cloud.documentai.v1.Document.Page.IDetectedBarcode[]; - - /** Page imageQualityScores. */ - public imageQualityScores?: (google.cloud.documentai.v1.Document.Page.IImageQualityScores|null); - - /** Page provenance. */ - public provenance?: (google.cloud.documentai.v1.Document.IProvenance|null); - - /** - * Creates a new Page instance using the specified properties. - * @param [properties] Properties to set - * @returns Page instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.IPage): google.cloud.documentai.v1.Document.Page; - - /** - * Encodes the specified Page message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.verify|verify} messages. - * @param message Page message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Document.IPage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Page message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.verify|verify} messages. - * @param message Page message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Document.IPage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Page message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Page - * @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.cloud.documentai.v1.Document.Page; - - /** - * Decodes a Page message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Page - * @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.cloud.documentai.v1.Document.Page; - - /** - * Verifies a Page 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 Page message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Page - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Page; - - /** - * Creates a plain object from a Page message. Also converts values to other types if specified. - * @param message Page - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document.Page, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Page to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Page - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Page { - - /** Properties of a Dimension. */ - interface IDimension { - - /** Dimension width */ - width?: (number|null); - - /** Dimension height */ - height?: (number|null); - - /** Dimension unit */ - unit?: (string|null); - } - - /** Represents a Dimension. */ - class Dimension implements IDimension { - - /** - * Constructs a new Dimension. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.Page.IDimension); - - /** Dimension width. */ - public width: number; - - /** Dimension height. */ - public height: number; - - /** Dimension unit. */ - public unit: string; - - /** - * Creates a new Dimension instance using the specified properties. - * @param [properties] Properties to set - * @returns Dimension instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.Page.IDimension): google.cloud.documentai.v1.Document.Page.Dimension; - - /** - * Encodes the specified Dimension message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Dimension.verify|verify} messages. - * @param message Dimension message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Document.Page.IDimension, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Dimension message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Dimension.verify|verify} messages. - * @param message Dimension message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Document.Page.IDimension, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Dimension message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Dimension - * @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.cloud.documentai.v1.Document.Page.Dimension; - - /** - * Decodes a Dimension message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Dimension - * @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.cloud.documentai.v1.Document.Page.Dimension; - - /** - * Verifies a Dimension 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 Dimension message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Dimension - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Page.Dimension; - - /** - * Creates a plain object from a Dimension message. Also converts values to other types if specified. - * @param message Dimension - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document.Page.Dimension, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Dimension to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Dimension - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Image. */ - interface IImage { - - /** Image content */ - content?: (Uint8Array|Buffer|string|null); - - /** Image mimeType */ - mimeType?: (string|null); - - /** Image width */ - width?: (number|null); - - /** Image height */ - height?: (number|null); - } - - /** Represents an Image. */ - class Image implements IImage { - - /** - * Constructs a new Image. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.Page.IImage); - - /** Image content. */ - public content: (Uint8Array|Buffer|string); - - /** Image mimeType. */ - public mimeType: string; - - /** Image width. */ - public width: number; - - /** Image height. */ - public height: number; - - /** - * Creates a new Image instance using the specified properties. - * @param [properties] Properties to set - * @returns Image instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.Page.IImage): google.cloud.documentai.v1.Document.Page.Image; - - /** - * Encodes the specified Image message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Image.verify|verify} messages. - * @param message Image message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Document.Page.IImage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Image.verify|verify} messages. - * @param message Image message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Document.Page.IImage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Image message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Image - * @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.cloud.documentai.v1.Document.Page.Image; - - /** - * Decodes an Image message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Image - * @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.cloud.documentai.v1.Document.Page.Image; - - /** - * Verifies an Image 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 Image message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Image - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Page.Image; - - /** - * Creates a plain object from an Image message. Also converts values to other types if specified. - * @param message Image - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document.Page.Image, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Image to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Image - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Matrix. */ - interface IMatrix { - - /** Matrix rows */ - rows?: (number|null); - - /** Matrix cols */ - cols?: (number|null); - - /** Matrix type */ - type?: (number|null); - - /** Matrix data */ - data?: (Uint8Array|Buffer|string|null); - } - - /** Represents a Matrix. */ - class Matrix implements IMatrix { - - /** - * Constructs a new Matrix. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.Page.IMatrix); - - /** Matrix rows. */ - public rows: number; - - /** Matrix cols. */ - public cols: number; - - /** Matrix type. */ - public type: number; - - /** Matrix data. */ - public data: (Uint8Array|Buffer|string); - - /** - * Creates a new Matrix instance using the specified properties. - * @param [properties] Properties to set - * @returns Matrix instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.Page.IMatrix): google.cloud.documentai.v1.Document.Page.Matrix; - - /** - * Encodes the specified Matrix message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Matrix.verify|verify} messages. - * @param message Matrix message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Document.Page.IMatrix, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Matrix message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Matrix.verify|verify} messages. - * @param message Matrix message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Document.Page.IMatrix, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Matrix message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Matrix - * @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.cloud.documentai.v1.Document.Page.Matrix; - - /** - * Decodes a Matrix message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Matrix - * @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.cloud.documentai.v1.Document.Page.Matrix; - - /** - * Verifies a Matrix 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 Matrix message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Matrix - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Page.Matrix; - - /** - * Creates a plain object from a Matrix message. Also converts values to other types if specified. - * @param message Matrix - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document.Page.Matrix, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Matrix to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Matrix - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Layout. */ - interface ILayout { - - /** Layout textAnchor */ - textAnchor?: (google.cloud.documentai.v1.Document.ITextAnchor|null); - - /** Layout confidence */ - confidence?: (number|null); - - /** Layout boundingPoly */ - boundingPoly?: (google.cloud.documentai.v1.IBoundingPoly|null); - - /** Layout orientation */ - orientation?: (google.cloud.documentai.v1.Document.Page.Layout.Orientation|keyof typeof google.cloud.documentai.v1.Document.Page.Layout.Orientation|null); - } - - /** Represents a Layout. */ - class Layout implements ILayout { - - /** - * Constructs a new Layout. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.Page.ILayout); - - /** Layout textAnchor. */ - public textAnchor?: (google.cloud.documentai.v1.Document.ITextAnchor|null); - - /** Layout confidence. */ - public confidence: number; - - /** Layout boundingPoly. */ - public boundingPoly?: (google.cloud.documentai.v1.IBoundingPoly|null); - - /** Layout orientation. */ - public orientation: (google.cloud.documentai.v1.Document.Page.Layout.Orientation|keyof typeof google.cloud.documentai.v1.Document.Page.Layout.Orientation); - - /** - * Creates a new Layout instance using the specified properties. - * @param [properties] Properties to set - * @returns Layout instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.Page.ILayout): google.cloud.documentai.v1.Document.Page.Layout; - - /** - * Encodes the specified Layout message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Layout.verify|verify} messages. - * @param message Layout message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Document.Page.ILayout, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Layout message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Layout.verify|verify} messages. - * @param message Layout message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Document.Page.ILayout, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Layout message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Layout - * @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.cloud.documentai.v1.Document.Page.Layout; - - /** - * Decodes a Layout message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Layout - * @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.cloud.documentai.v1.Document.Page.Layout; - - /** - * Verifies a Layout 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 Layout message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Layout - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Page.Layout; - - /** - * Creates a plain object from a Layout message. Also converts values to other types if specified. - * @param message Layout - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document.Page.Layout, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Layout to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Layout - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Layout { - - /** Orientation enum. */ - enum Orientation { - ORIENTATION_UNSPECIFIED = 0, - PAGE_UP = 1, - PAGE_RIGHT = 2, - PAGE_DOWN = 3, - PAGE_LEFT = 4 - } - } - - /** Properties of a Block. */ - interface IBlock { - - /** Block layout */ - layout?: (google.cloud.documentai.v1.Document.Page.ILayout|null); - - /** Block detectedLanguages */ - detectedLanguages?: (google.cloud.documentai.v1.Document.Page.IDetectedLanguage[]|null); - - /** Block provenance */ - provenance?: (google.cloud.documentai.v1.Document.IProvenance|null); - } - - /** Represents a Block. */ - class Block implements IBlock { - - /** - * Constructs a new Block. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.Page.IBlock); - - /** Block layout. */ - public layout?: (google.cloud.documentai.v1.Document.Page.ILayout|null); - - /** Block detectedLanguages. */ - public detectedLanguages: google.cloud.documentai.v1.Document.Page.IDetectedLanguage[]; - - /** Block provenance. */ - public provenance?: (google.cloud.documentai.v1.Document.IProvenance|null); - - /** - * Creates a new Block instance using the specified properties. - * @param [properties] Properties to set - * @returns Block instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.Page.IBlock): google.cloud.documentai.v1.Document.Page.Block; - - /** - * Encodes the specified Block message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Block.verify|verify} messages. - * @param message Block message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Document.Page.IBlock, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Block message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Block.verify|verify} messages. - * @param message Block message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Document.Page.IBlock, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Block message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Block - * @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.cloud.documentai.v1.Document.Page.Block; - - /** - * Decodes a Block message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Block - * @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.cloud.documentai.v1.Document.Page.Block; - - /** - * Verifies a Block 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 Block message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Block - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Page.Block; - - /** - * Creates a plain object from a Block message. Also converts values to other types if specified. - * @param message Block - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document.Page.Block, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Block to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Block - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Paragraph. */ - interface IParagraph { - - /** Paragraph layout */ - layout?: (google.cloud.documentai.v1.Document.Page.ILayout|null); - - /** Paragraph detectedLanguages */ - detectedLanguages?: (google.cloud.documentai.v1.Document.Page.IDetectedLanguage[]|null); - - /** Paragraph provenance */ - provenance?: (google.cloud.documentai.v1.Document.IProvenance|null); - } - - /** Represents a Paragraph. */ - class Paragraph implements IParagraph { - - /** - * Constructs a new Paragraph. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.Page.IParagraph); - - /** Paragraph layout. */ - public layout?: (google.cloud.documentai.v1.Document.Page.ILayout|null); - - /** Paragraph detectedLanguages. */ - public detectedLanguages: google.cloud.documentai.v1.Document.Page.IDetectedLanguage[]; - - /** Paragraph provenance. */ - public provenance?: (google.cloud.documentai.v1.Document.IProvenance|null); - - /** - * Creates a new Paragraph instance using the specified properties. - * @param [properties] Properties to set - * @returns Paragraph instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.Page.IParagraph): google.cloud.documentai.v1.Document.Page.Paragraph; - - /** - * Encodes the specified Paragraph message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Paragraph.verify|verify} messages. - * @param message Paragraph message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Document.Page.IParagraph, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Paragraph message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Paragraph.verify|verify} messages. - * @param message Paragraph message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Document.Page.IParagraph, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Paragraph message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Paragraph - * @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.cloud.documentai.v1.Document.Page.Paragraph; - - /** - * Decodes a Paragraph message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Paragraph - * @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.cloud.documentai.v1.Document.Page.Paragraph; - - /** - * Verifies a Paragraph 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 Paragraph message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Paragraph - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Page.Paragraph; - - /** - * Creates a plain object from a Paragraph message. Also converts values to other types if specified. - * @param message Paragraph - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document.Page.Paragraph, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Paragraph to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Paragraph - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Line. */ - interface ILine { - - /** Line layout */ - layout?: (google.cloud.documentai.v1.Document.Page.ILayout|null); - - /** Line detectedLanguages */ - detectedLanguages?: (google.cloud.documentai.v1.Document.Page.IDetectedLanguage[]|null); - - /** Line provenance */ - provenance?: (google.cloud.documentai.v1.Document.IProvenance|null); - } - - /** Represents a Line. */ - class Line implements ILine { - - /** - * Constructs a new Line. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.Page.ILine); - - /** Line layout. */ - public layout?: (google.cloud.documentai.v1.Document.Page.ILayout|null); - - /** Line detectedLanguages. */ - public detectedLanguages: google.cloud.documentai.v1.Document.Page.IDetectedLanguage[]; - - /** Line provenance. */ - public provenance?: (google.cloud.documentai.v1.Document.IProvenance|null); - - /** - * Creates a new Line instance using the specified properties. - * @param [properties] Properties to set - * @returns Line instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.Page.ILine): google.cloud.documentai.v1.Document.Page.Line; - - /** - * Encodes the specified Line message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Line.verify|verify} messages. - * @param message Line message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Document.Page.ILine, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Line message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Line.verify|verify} messages. - * @param message Line message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Document.Page.ILine, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Line message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Line - * @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.cloud.documentai.v1.Document.Page.Line; - - /** - * Decodes a Line message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Line - * @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.cloud.documentai.v1.Document.Page.Line; - - /** - * Verifies a Line 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 Line message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Line - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Page.Line; - - /** - * Creates a plain object from a Line message. Also converts values to other types if specified. - * @param message Line - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document.Page.Line, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Line to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Line - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Token. */ - interface IToken { - - /** Token layout */ - layout?: (google.cloud.documentai.v1.Document.Page.ILayout|null); - - /** Token detectedBreak */ - detectedBreak?: (google.cloud.documentai.v1.Document.Page.Token.IDetectedBreak|null); - - /** Token detectedLanguages */ - detectedLanguages?: (google.cloud.documentai.v1.Document.Page.IDetectedLanguage[]|null); - - /** Token provenance */ - provenance?: (google.cloud.documentai.v1.Document.IProvenance|null); - - /** Token styleInfo */ - styleInfo?: (google.cloud.documentai.v1.Document.Page.Token.IStyleInfo|null); - } - - /** Represents a Token. */ - class Token implements IToken { - - /** - * Constructs a new Token. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.Page.IToken); - - /** Token layout. */ - public layout?: (google.cloud.documentai.v1.Document.Page.ILayout|null); - - /** Token detectedBreak. */ - public detectedBreak?: (google.cloud.documentai.v1.Document.Page.Token.IDetectedBreak|null); - - /** Token detectedLanguages. */ - public detectedLanguages: google.cloud.documentai.v1.Document.Page.IDetectedLanguage[]; - - /** Token provenance. */ - public provenance?: (google.cloud.documentai.v1.Document.IProvenance|null); - - /** Token styleInfo. */ - public styleInfo?: (google.cloud.documentai.v1.Document.Page.Token.IStyleInfo|null); - - /** - * Creates a new Token instance using the specified properties. - * @param [properties] Properties to set - * @returns Token instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.Page.IToken): google.cloud.documentai.v1.Document.Page.Token; - - /** - * Encodes the specified Token message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Token.verify|verify} messages. - * @param message Token message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Document.Page.IToken, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Token message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Token.verify|verify} messages. - * @param message Token message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Document.Page.IToken, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Token message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Token - * @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.cloud.documentai.v1.Document.Page.Token; - - /** - * Decodes a Token message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Token - * @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.cloud.documentai.v1.Document.Page.Token; - - /** - * Verifies a Token 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 Token message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Token - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Page.Token; - - /** - * Creates a plain object from a Token message. Also converts values to other types if specified. - * @param message Token - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document.Page.Token, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Token to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Token - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Token { - - /** Properties of a DetectedBreak. */ - interface IDetectedBreak { - - /** DetectedBreak type */ - type?: (google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.Type|keyof typeof google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.Type|null); - } - - /** Represents a DetectedBreak. */ - class DetectedBreak implements IDetectedBreak { - - /** - * Constructs a new DetectedBreak. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.Page.Token.IDetectedBreak); - - /** DetectedBreak type. */ - public type: (google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.Type|keyof typeof google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.Type); - - /** - * Creates a new DetectedBreak instance using the specified properties. - * @param [properties] Properties to set - * @returns DetectedBreak instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.Page.Token.IDetectedBreak): google.cloud.documentai.v1.Document.Page.Token.DetectedBreak; - - /** - * Encodes the specified DetectedBreak message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.verify|verify} messages. - * @param message DetectedBreak message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Document.Page.Token.IDetectedBreak, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DetectedBreak message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.verify|verify} messages. - * @param message DetectedBreak message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Document.Page.Token.IDetectedBreak, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DetectedBreak message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DetectedBreak - * @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.cloud.documentai.v1.Document.Page.Token.DetectedBreak; - - /** - * Decodes a DetectedBreak message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DetectedBreak - * @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.cloud.documentai.v1.Document.Page.Token.DetectedBreak; - - /** - * Verifies a DetectedBreak 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 DetectedBreak message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DetectedBreak - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Page.Token.DetectedBreak; - - /** - * Creates a plain object from a DetectedBreak message. Also converts values to other types if specified. - * @param message DetectedBreak - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document.Page.Token.DetectedBreak, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DetectedBreak to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DetectedBreak - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace DetectedBreak { - - /** Type enum. */ - enum Type { - TYPE_UNSPECIFIED = 0, - SPACE = 1, - WIDE_SPACE = 2, - HYPHEN = 3 - } - } - - /** Properties of a StyleInfo. */ - interface IStyleInfo { - - /** StyleInfo fontSize */ - fontSize?: (number|null); - - /** StyleInfo pixelFontSize */ - pixelFontSize?: (number|null); - - /** StyleInfo letterSpacing */ - letterSpacing?: (number|null); - - /** StyleInfo fontType */ - fontType?: (string|null); - - /** StyleInfo bold */ - bold?: (boolean|null); - - /** StyleInfo italic */ - italic?: (boolean|null); - - /** StyleInfo underlined */ - underlined?: (boolean|null); - - /** StyleInfo strikeout */ - strikeout?: (boolean|null); - - /** StyleInfo subscript */ - subscript?: (boolean|null); - - /** StyleInfo superscript */ - superscript?: (boolean|null); - - /** StyleInfo smallcaps */ - smallcaps?: (boolean|null); - - /** StyleInfo fontWeight */ - fontWeight?: (number|null); - - /** StyleInfo handwritten */ - handwritten?: (boolean|null); - - /** StyleInfo textColor */ - textColor?: (google.type.IColor|null); - - /** StyleInfo backgroundColor */ - backgroundColor?: (google.type.IColor|null); - } - - /** Represents a StyleInfo. */ - class StyleInfo implements IStyleInfo { - - /** - * Constructs a new StyleInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.Page.Token.IStyleInfo); - - /** StyleInfo fontSize. */ - public fontSize: number; - - /** StyleInfo pixelFontSize. */ - public pixelFontSize: number; - - /** StyleInfo letterSpacing. */ - public letterSpacing: number; - - /** StyleInfo fontType. */ - public fontType: string; - - /** StyleInfo bold. */ - public bold: boolean; - - /** StyleInfo italic. */ - public italic: boolean; - - /** StyleInfo underlined. */ - public underlined: boolean; - - /** StyleInfo strikeout. */ - public strikeout: boolean; - - /** StyleInfo subscript. */ - public subscript: boolean; - - /** StyleInfo superscript. */ - public superscript: boolean; - - /** StyleInfo smallcaps. */ - public smallcaps: boolean; - - /** StyleInfo fontWeight. */ - public fontWeight: number; - - /** StyleInfo handwritten. */ - public handwritten: boolean; - - /** StyleInfo textColor. */ - public textColor?: (google.type.IColor|null); - - /** StyleInfo backgroundColor. */ - public backgroundColor?: (google.type.IColor|null); - - /** - * Creates a new StyleInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns StyleInfo instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.Page.Token.IStyleInfo): google.cloud.documentai.v1.Document.Page.Token.StyleInfo; - - /** - * Encodes the specified StyleInfo message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Token.StyleInfo.verify|verify} messages. - * @param message StyleInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Document.Page.Token.IStyleInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StyleInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Token.StyleInfo.verify|verify} messages. - * @param message StyleInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Document.Page.Token.IStyleInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StyleInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StyleInfo - * @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.cloud.documentai.v1.Document.Page.Token.StyleInfo; - - /** - * Decodes a StyleInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StyleInfo - * @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.cloud.documentai.v1.Document.Page.Token.StyleInfo; - - /** - * Verifies a StyleInfo 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 StyleInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StyleInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Page.Token.StyleInfo; - - /** - * Creates a plain object from a StyleInfo message. Also converts values to other types if specified. - * @param message StyleInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document.Page.Token.StyleInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StyleInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StyleInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a Symbol. */ - interface ISymbol { - - /** Symbol layout */ - layout?: (google.cloud.documentai.v1.Document.Page.ILayout|null); - - /** Symbol detectedLanguages */ - detectedLanguages?: (google.cloud.documentai.v1.Document.Page.IDetectedLanguage[]|null); - } - - /** Represents a Symbol. */ - class Symbol implements ISymbol { - - /** - * Constructs a new Symbol. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.Page.ISymbol); - - /** Symbol layout. */ - public layout?: (google.cloud.documentai.v1.Document.Page.ILayout|null); - - /** Symbol detectedLanguages. */ - public detectedLanguages: google.cloud.documentai.v1.Document.Page.IDetectedLanguage[]; - - /** - * Creates a new Symbol instance using the specified properties. - * @param [properties] Properties to set - * @returns Symbol instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.Page.ISymbol): google.cloud.documentai.v1.Document.Page.Symbol; - - /** - * Encodes the specified Symbol message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Symbol.verify|verify} messages. - * @param message Symbol message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Document.Page.ISymbol, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Symbol message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Symbol.verify|verify} messages. - * @param message Symbol message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Document.Page.ISymbol, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Symbol message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Symbol - * @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.cloud.documentai.v1.Document.Page.Symbol; - - /** - * Decodes a Symbol message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Symbol - * @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.cloud.documentai.v1.Document.Page.Symbol; - - /** - * Verifies a Symbol 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 Symbol message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Symbol - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Page.Symbol; - - /** - * Creates a plain object from a Symbol message. Also converts values to other types if specified. - * @param message Symbol - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document.Page.Symbol, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Symbol to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Symbol - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a VisualElement. */ - interface IVisualElement { - - /** VisualElement layout */ - layout?: (google.cloud.documentai.v1.Document.Page.ILayout|null); - - /** VisualElement type */ - type?: (string|null); - - /** VisualElement detectedLanguages */ - detectedLanguages?: (google.cloud.documentai.v1.Document.Page.IDetectedLanguage[]|null); - } - - /** Represents a VisualElement. */ - class VisualElement implements IVisualElement { - - /** - * Constructs a new VisualElement. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.Page.IVisualElement); - - /** VisualElement layout. */ - public layout?: (google.cloud.documentai.v1.Document.Page.ILayout|null); - - /** VisualElement type. */ - public type: string; - - /** VisualElement detectedLanguages. */ - public detectedLanguages: google.cloud.documentai.v1.Document.Page.IDetectedLanguage[]; - - /** - * Creates a new VisualElement instance using the specified properties. - * @param [properties] Properties to set - * @returns VisualElement instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.Page.IVisualElement): google.cloud.documentai.v1.Document.Page.VisualElement; - - /** - * Encodes the specified VisualElement message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.VisualElement.verify|verify} messages. - * @param message VisualElement message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Document.Page.IVisualElement, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified VisualElement message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.VisualElement.verify|verify} messages. - * @param message VisualElement message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Document.Page.IVisualElement, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a VisualElement message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns VisualElement - * @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.cloud.documentai.v1.Document.Page.VisualElement; - - /** - * Decodes a VisualElement message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns VisualElement - * @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.cloud.documentai.v1.Document.Page.VisualElement; - - /** - * Verifies a VisualElement 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 VisualElement message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns VisualElement - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Page.VisualElement; - - /** - * Creates a plain object from a VisualElement message. Also converts values to other types if specified. - * @param message VisualElement - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document.Page.VisualElement, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this VisualElement to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for VisualElement - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Table. */ - interface ITable { - - /** Table layout */ - layout?: (google.cloud.documentai.v1.Document.Page.ILayout|null); - - /** Table headerRows */ - headerRows?: (google.cloud.documentai.v1.Document.Page.Table.ITableRow[]|null); - - /** Table bodyRows */ - bodyRows?: (google.cloud.documentai.v1.Document.Page.Table.ITableRow[]|null); - - /** Table detectedLanguages */ - detectedLanguages?: (google.cloud.documentai.v1.Document.Page.IDetectedLanguage[]|null); - - /** Table provenance */ - provenance?: (google.cloud.documentai.v1.Document.IProvenance|null); - } - - /** Represents a Table. */ - class Table implements ITable { - - /** - * Constructs a new Table. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.Page.ITable); - - /** Table layout. */ - public layout?: (google.cloud.documentai.v1.Document.Page.ILayout|null); - - /** Table headerRows. */ - public headerRows: google.cloud.documentai.v1.Document.Page.Table.ITableRow[]; - - /** Table bodyRows. */ - public bodyRows: google.cloud.documentai.v1.Document.Page.Table.ITableRow[]; - - /** Table detectedLanguages. */ - public detectedLanguages: google.cloud.documentai.v1.Document.Page.IDetectedLanguage[]; - - /** Table provenance. */ - public provenance?: (google.cloud.documentai.v1.Document.IProvenance|null); - - /** - * Creates a new Table instance using the specified properties. - * @param [properties] Properties to set - * @returns Table instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.Page.ITable): google.cloud.documentai.v1.Document.Page.Table; - - /** - * Encodes the specified Table message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.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.cloud.documentai.v1.Document.Page.ITable, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Table message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.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.cloud.documentai.v1.Document.Page.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.cloud.documentai.v1.Document.Page.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.cloud.documentai.v1.Document.Page.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.cloud.documentai.v1.Document.Page.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.cloud.documentai.v1.Document.Page.Table, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Table to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Table - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Table { - - /** Properties of a TableRow. */ - interface ITableRow { - - /** TableRow cells */ - cells?: (google.cloud.documentai.v1.Document.Page.Table.ITableCell[]|null); - } - - /** Represents a TableRow. */ - class TableRow implements ITableRow { - - /** - * Constructs a new TableRow. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.Page.Table.ITableRow); - - /** TableRow cells. */ - public cells: google.cloud.documentai.v1.Document.Page.Table.ITableCell[]; - - /** - * Creates a new TableRow instance using the specified properties. - * @param [properties] Properties to set - * @returns TableRow instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.Page.Table.ITableRow): google.cloud.documentai.v1.Document.Page.Table.TableRow; - - /** - * Encodes the specified TableRow message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Table.TableRow.verify|verify} messages. - * @param message TableRow message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Document.Page.Table.ITableRow, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TableRow message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Table.TableRow.verify|verify} messages. - * @param message TableRow message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Document.Page.Table.ITableRow, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TableRow message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TableRow - * @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.cloud.documentai.v1.Document.Page.Table.TableRow; - - /** - * Decodes a TableRow message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TableRow - * @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.cloud.documentai.v1.Document.Page.Table.TableRow; - - /** - * Verifies a TableRow 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 TableRow message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TableRow - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Page.Table.TableRow; - - /** - * Creates a plain object from a TableRow message. Also converts values to other types if specified. - * @param message TableRow - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document.Page.Table.TableRow, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TableRow to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TableRow - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TableCell. */ - interface ITableCell { - - /** TableCell layout */ - layout?: (google.cloud.documentai.v1.Document.Page.ILayout|null); - - /** TableCell rowSpan */ - rowSpan?: (number|null); - - /** TableCell colSpan */ - colSpan?: (number|null); - - /** TableCell detectedLanguages */ - detectedLanguages?: (google.cloud.documentai.v1.Document.Page.IDetectedLanguage[]|null); - } - - /** Represents a TableCell. */ - class TableCell implements ITableCell { - - /** - * Constructs a new TableCell. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.Page.Table.ITableCell); - - /** TableCell layout. */ - public layout?: (google.cloud.documentai.v1.Document.Page.ILayout|null); - - /** TableCell rowSpan. */ - public rowSpan: number; - - /** TableCell colSpan. */ - public colSpan: number; - - /** TableCell detectedLanguages. */ - public detectedLanguages: google.cloud.documentai.v1.Document.Page.IDetectedLanguage[]; - - /** - * Creates a new TableCell instance using the specified properties. - * @param [properties] Properties to set - * @returns TableCell instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.Page.Table.ITableCell): google.cloud.documentai.v1.Document.Page.Table.TableCell; - - /** - * Encodes the specified TableCell message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Table.TableCell.verify|verify} messages. - * @param message TableCell message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Document.Page.Table.ITableCell, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TableCell message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Table.TableCell.verify|verify} messages. - * @param message TableCell message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Document.Page.Table.ITableCell, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TableCell message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TableCell - * @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.cloud.documentai.v1.Document.Page.Table.TableCell; - - /** - * Decodes a TableCell message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TableCell - * @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.cloud.documentai.v1.Document.Page.Table.TableCell; - - /** - * Verifies a TableCell 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 TableCell message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TableCell - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Page.Table.TableCell; - - /** - * Creates a plain object from a TableCell message. Also converts values to other types if specified. - * @param message TableCell - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document.Page.Table.TableCell, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TableCell to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TableCell - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a FormField. */ - interface IFormField { - - /** FormField fieldName */ - fieldName?: (google.cloud.documentai.v1.Document.Page.ILayout|null); - - /** FormField fieldValue */ - fieldValue?: (google.cloud.documentai.v1.Document.Page.ILayout|null); - - /** FormField nameDetectedLanguages */ - nameDetectedLanguages?: (google.cloud.documentai.v1.Document.Page.IDetectedLanguage[]|null); - - /** FormField valueDetectedLanguages */ - valueDetectedLanguages?: (google.cloud.documentai.v1.Document.Page.IDetectedLanguage[]|null); - - /** FormField valueType */ - valueType?: (string|null); - - /** FormField correctedKeyText */ - correctedKeyText?: (string|null); - - /** FormField correctedValueText */ - correctedValueText?: (string|null); - - /** FormField provenance */ - provenance?: (google.cloud.documentai.v1.Document.IProvenance|null); - } - - /** Represents a FormField. */ - class FormField implements IFormField { - - /** - * Constructs a new FormField. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.Page.IFormField); - - /** FormField fieldName. */ - public fieldName?: (google.cloud.documentai.v1.Document.Page.ILayout|null); - - /** FormField fieldValue. */ - public fieldValue?: (google.cloud.documentai.v1.Document.Page.ILayout|null); - - /** FormField nameDetectedLanguages. */ - public nameDetectedLanguages: google.cloud.documentai.v1.Document.Page.IDetectedLanguage[]; - - /** FormField valueDetectedLanguages. */ - public valueDetectedLanguages: google.cloud.documentai.v1.Document.Page.IDetectedLanguage[]; - - /** FormField valueType. */ - public valueType: string; - - /** FormField correctedKeyText. */ - public correctedKeyText: string; - - /** FormField correctedValueText. */ - public correctedValueText: string; - - /** FormField provenance. */ - public provenance?: (google.cloud.documentai.v1.Document.IProvenance|null); - - /** - * Creates a new FormField instance using the specified properties. - * @param [properties] Properties to set - * @returns FormField instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.Page.IFormField): google.cloud.documentai.v1.Document.Page.FormField; - - /** - * Encodes the specified FormField message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.FormField.verify|verify} messages. - * @param message FormField message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Document.Page.IFormField, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FormField message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.FormField.verify|verify} messages. - * @param message FormField message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Document.Page.IFormField, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FormField message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FormField - * @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.cloud.documentai.v1.Document.Page.FormField; - - /** - * Decodes a FormField message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FormField - * @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.cloud.documentai.v1.Document.Page.FormField; - - /** - * Verifies a FormField 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 FormField message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FormField - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Page.FormField; - - /** - * Creates a plain object from a FormField message. Also converts values to other types if specified. - * @param message FormField - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document.Page.FormField, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FormField to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FormField - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DetectedBarcode. */ - interface IDetectedBarcode { - - /** DetectedBarcode layout */ - layout?: (google.cloud.documentai.v1.Document.Page.ILayout|null); - - /** DetectedBarcode barcode */ - barcode?: (google.cloud.documentai.v1.IBarcode|null); - } - - /** Represents a DetectedBarcode. */ - class DetectedBarcode implements IDetectedBarcode { - - /** - * Constructs a new DetectedBarcode. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.Page.IDetectedBarcode); - - /** DetectedBarcode layout. */ - public layout?: (google.cloud.documentai.v1.Document.Page.ILayout|null); - - /** DetectedBarcode barcode. */ - public barcode?: (google.cloud.documentai.v1.IBarcode|null); - - /** - * Creates a new DetectedBarcode instance using the specified properties. - * @param [properties] Properties to set - * @returns DetectedBarcode instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.Page.IDetectedBarcode): google.cloud.documentai.v1.Document.Page.DetectedBarcode; - - /** - * Encodes the specified DetectedBarcode message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.DetectedBarcode.verify|verify} messages. - * @param message DetectedBarcode message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Document.Page.IDetectedBarcode, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DetectedBarcode message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.DetectedBarcode.verify|verify} messages. - * @param message DetectedBarcode message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Document.Page.IDetectedBarcode, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DetectedBarcode message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DetectedBarcode - * @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.cloud.documentai.v1.Document.Page.DetectedBarcode; - - /** - * Decodes a DetectedBarcode message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DetectedBarcode - * @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.cloud.documentai.v1.Document.Page.DetectedBarcode; - - /** - * Verifies a DetectedBarcode 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 DetectedBarcode message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DetectedBarcode - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Page.DetectedBarcode; - - /** - * Creates a plain object from a DetectedBarcode message. Also converts values to other types if specified. - * @param message DetectedBarcode - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document.Page.DetectedBarcode, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DetectedBarcode to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DetectedBarcode - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DetectedLanguage. */ - interface IDetectedLanguage { - - /** DetectedLanguage languageCode */ - languageCode?: (string|null); - - /** DetectedLanguage confidence */ - confidence?: (number|null); - } - - /** Represents a DetectedLanguage. */ - class DetectedLanguage implements IDetectedLanguage { - - /** - * Constructs a new DetectedLanguage. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.Page.IDetectedLanguage); - - /** DetectedLanguage languageCode. */ - public languageCode: string; - - /** DetectedLanguage confidence. */ - public confidence: number; - - /** - * Creates a new DetectedLanguage instance using the specified properties. - * @param [properties] Properties to set - * @returns DetectedLanguage instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.Page.IDetectedLanguage): google.cloud.documentai.v1.Document.Page.DetectedLanguage; - - /** - * Encodes the specified DetectedLanguage message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.DetectedLanguage.verify|verify} messages. - * @param message DetectedLanguage message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Document.Page.IDetectedLanguage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DetectedLanguage message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.DetectedLanguage.verify|verify} messages. - * @param message DetectedLanguage message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Document.Page.IDetectedLanguage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DetectedLanguage message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DetectedLanguage - * @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.cloud.documentai.v1.Document.Page.DetectedLanguage; - - /** - * Decodes a DetectedLanguage message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DetectedLanguage - * @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.cloud.documentai.v1.Document.Page.DetectedLanguage; - - /** - * Verifies a DetectedLanguage 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 DetectedLanguage message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DetectedLanguage - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Page.DetectedLanguage; - - /** - * Creates a plain object from a DetectedLanguage message. Also converts values to other types if specified. - * @param message DetectedLanguage - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document.Page.DetectedLanguage, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DetectedLanguage to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DetectedLanguage - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ImageQualityScores. */ - interface IImageQualityScores { - - /** ImageQualityScores qualityScore */ - qualityScore?: (number|null); - - /** ImageQualityScores detectedDefects */ - detectedDefects?: (google.cloud.documentai.v1.Document.Page.ImageQualityScores.IDetectedDefect[]|null); - } - - /** Represents an ImageQualityScores. */ - class ImageQualityScores implements IImageQualityScores { - - /** - * Constructs a new ImageQualityScores. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.Page.IImageQualityScores); - - /** ImageQualityScores qualityScore. */ - public qualityScore: number; - - /** ImageQualityScores detectedDefects. */ - public detectedDefects: google.cloud.documentai.v1.Document.Page.ImageQualityScores.IDetectedDefect[]; - - /** - * Creates a new ImageQualityScores instance using the specified properties. - * @param [properties] Properties to set - * @returns ImageQualityScores instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.Page.IImageQualityScores): google.cloud.documentai.v1.Document.Page.ImageQualityScores; - - /** - * Encodes the specified ImageQualityScores message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.ImageQualityScores.verify|verify} messages. - * @param message ImageQualityScores message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Document.Page.IImageQualityScores, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ImageQualityScores message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.ImageQualityScores.verify|verify} messages. - * @param message ImageQualityScores message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Document.Page.IImageQualityScores, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ImageQualityScores message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ImageQualityScores - * @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.cloud.documentai.v1.Document.Page.ImageQualityScores; - - /** - * Decodes an ImageQualityScores message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ImageQualityScores - * @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.cloud.documentai.v1.Document.Page.ImageQualityScores; - - /** - * Verifies an ImageQualityScores 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 ImageQualityScores message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ImageQualityScores - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Page.ImageQualityScores; - - /** - * Creates a plain object from an ImageQualityScores message. Also converts values to other types if specified. - * @param message ImageQualityScores - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document.Page.ImageQualityScores, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ImageQualityScores to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ImageQualityScores - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ImageQualityScores { - - /** Properties of a DetectedDefect. */ - interface IDetectedDefect { - - /** DetectedDefect type */ - type?: (string|null); - - /** DetectedDefect confidence */ - confidence?: (number|null); - } - - /** Represents a DetectedDefect. */ - class DetectedDefect implements IDetectedDefect { - - /** - * Constructs a new DetectedDefect. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.Page.ImageQualityScores.IDetectedDefect); - - /** DetectedDefect type. */ - public type: string; - - /** DetectedDefect confidence. */ - public confidence: number; - - /** - * Creates a new DetectedDefect instance using the specified properties. - * @param [properties] Properties to set - * @returns DetectedDefect instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.Page.ImageQualityScores.IDetectedDefect): google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect; - - /** - * Encodes the specified DetectedDefect message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect.verify|verify} messages. - * @param message DetectedDefect message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Document.Page.ImageQualityScores.IDetectedDefect, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DetectedDefect message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect.verify|verify} messages. - * @param message DetectedDefect message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Document.Page.ImageQualityScores.IDetectedDefect, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DetectedDefect message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DetectedDefect - * @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.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect; - - /** - * Decodes a DetectedDefect message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DetectedDefect - * @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.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect; - - /** - * Verifies a DetectedDefect 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 DetectedDefect message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DetectedDefect - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect; - - /** - * Creates a plain object from a DetectedDefect message. Also converts values to other types if specified. - * @param message DetectedDefect - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DetectedDefect to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DetectedDefect - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - } - - /** Properties of an Entity. */ - interface IEntity { - - /** Entity textAnchor */ - textAnchor?: (google.cloud.documentai.v1.Document.ITextAnchor|null); - - /** Entity type */ - type?: (string|null); - - /** Entity mentionText */ - mentionText?: (string|null); - - /** Entity mentionId */ - mentionId?: (string|null); - - /** Entity confidence */ - confidence?: (number|null); - - /** Entity pageAnchor */ - pageAnchor?: (google.cloud.documentai.v1.Document.IPageAnchor|null); - - /** Entity id */ - id?: (string|null); - - /** Entity normalizedValue */ - normalizedValue?: (google.cloud.documentai.v1.Document.Entity.INormalizedValue|null); - - /** Entity properties */ - properties?: (google.cloud.documentai.v1.Document.IEntity[]|null); - - /** Entity provenance */ - provenance?: (google.cloud.documentai.v1.Document.IProvenance|null); - - /** Entity redacted */ - redacted?: (boolean|null); - - /** Entity method */ - method?: (google.cloud.documentai.v1.Document.Entity.Method|keyof typeof google.cloud.documentai.v1.Document.Entity.Method|null); - } - - /** Represents an Entity. */ - class Entity implements IEntity { - - /** - * Constructs a new Entity. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.IEntity); - - /** Entity textAnchor. */ - public textAnchor?: (google.cloud.documentai.v1.Document.ITextAnchor|null); - - /** Entity type. */ - public type: string; - - /** Entity mentionText. */ - public mentionText: string; - - /** Entity mentionId. */ - public mentionId: string; - - /** Entity confidence. */ - public confidence: number; - - /** Entity pageAnchor. */ - public pageAnchor?: (google.cloud.documentai.v1.Document.IPageAnchor|null); - - /** Entity id. */ - public id: string; - - /** Entity normalizedValue. */ - public normalizedValue?: (google.cloud.documentai.v1.Document.Entity.INormalizedValue|null); - - /** Entity properties. */ - public properties: google.cloud.documentai.v1.Document.IEntity[]; - - /** Entity provenance. */ - public provenance?: (google.cloud.documentai.v1.Document.IProvenance|null); - - /** Entity redacted. */ - public redacted: boolean; - - /** Entity method. */ - public method: (google.cloud.documentai.v1.Document.Entity.Method|keyof typeof google.cloud.documentai.v1.Document.Entity.Method); - - /** - * Creates a new Entity instance using the specified properties. - * @param [properties] Properties to set - * @returns Entity instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.IEntity): google.cloud.documentai.v1.Document.Entity; - - /** - * Encodes the specified Entity message. Does not implicitly {@link google.cloud.documentai.v1.Document.Entity.verify|verify} messages. - * @param message Entity message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Document.IEntity, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Entity message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Entity.verify|verify} messages. - * @param message Entity message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Document.IEntity, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Entity message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Entity - * @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.cloud.documentai.v1.Document.Entity; - - /** - * Decodes an Entity message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Entity - * @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.cloud.documentai.v1.Document.Entity; - - /** - * Verifies an Entity 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 Entity message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Entity - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Entity; - - /** - * Creates a plain object from an Entity message. Also converts values to other types if specified. - * @param message Entity - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document.Entity, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Entity to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Entity - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Entity { - - /** Properties of a NormalizedValue. */ - interface INormalizedValue { - - /** NormalizedValue moneyValue */ - moneyValue?: (google.type.IMoney|null); - - /** NormalizedValue dateValue */ - dateValue?: (google.type.IDate|null); - - /** NormalizedValue datetimeValue */ - datetimeValue?: (google.type.IDateTime|null); - - /** NormalizedValue addressValue */ - addressValue?: (google.type.IPostalAddress|null); - - /** NormalizedValue booleanValue */ - booleanValue?: (boolean|null); - - /** NormalizedValue integerValue */ - integerValue?: (number|null); - - /** NormalizedValue floatValue */ - floatValue?: (number|null); - - /** NormalizedValue signatureValue */ - signatureValue?: (boolean|null); - - /** NormalizedValue text */ - text?: (string|null); - } - - /** Represents a NormalizedValue. */ - class NormalizedValue implements INormalizedValue { - - /** - * Constructs a new NormalizedValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.Entity.INormalizedValue); - - /** NormalizedValue moneyValue. */ - public moneyValue?: (google.type.IMoney|null); - - /** NormalizedValue dateValue. */ - public dateValue?: (google.type.IDate|null); - - /** NormalizedValue datetimeValue. */ - public datetimeValue?: (google.type.IDateTime|null); - - /** NormalizedValue addressValue. */ - public addressValue?: (google.type.IPostalAddress|null); - - /** NormalizedValue booleanValue. */ - public booleanValue?: (boolean|null); - - /** NormalizedValue integerValue. */ - public integerValue?: (number|null); - - /** NormalizedValue floatValue. */ - public floatValue?: (number|null); - - /** NormalizedValue signatureValue. */ - public signatureValue?: (boolean|null); - - /** NormalizedValue text. */ - public text: string; - - /** NormalizedValue structuredValue. */ - public structuredValue?: ("moneyValue"|"dateValue"|"datetimeValue"|"addressValue"|"booleanValue"|"integerValue"|"floatValue"|"signatureValue"); - - /** - * Creates a new NormalizedValue instance using the specified properties. - * @param [properties] Properties to set - * @returns NormalizedValue instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.Entity.INormalizedValue): google.cloud.documentai.v1.Document.Entity.NormalizedValue; - - /** - * Encodes the specified NormalizedValue message. Does not implicitly {@link google.cloud.documentai.v1.Document.Entity.NormalizedValue.verify|verify} messages. - * @param message NormalizedValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Document.Entity.INormalizedValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NormalizedValue message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Entity.NormalizedValue.verify|verify} messages. - * @param message NormalizedValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Document.Entity.INormalizedValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NormalizedValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NormalizedValue - * @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.cloud.documentai.v1.Document.Entity.NormalizedValue; - - /** - * Decodes a NormalizedValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NormalizedValue - * @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.cloud.documentai.v1.Document.Entity.NormalizedValue; - - /** - * Verifies a NormalizedValue 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 NormalizedValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NormalizedValue - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Entity.NormalizedValue; - - /** - * Creates a plain object from a NormalizedValue message. Also converts values to other types if specified. - * @param message NormalizedValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document.Entity.NormalizedValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NormalizedValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NormalizedValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Method enum. */ - enum Method { - METHOD_UNSPECIFIED = 0, - EXTRACT = 1, - DERIVE = 2 - } - } - - /** Properties of an EntityRelation. */ - interface IEntityRelation { - - /** EntityRelation subjectId */ - subjectId?: (string|null); - - /** EntityRelation objectId */ - objectId?: (string|null); - - /** EntityRelation relation */ - relation?: (string|null); - } - - /** Represents an EntityRelation. */ - class EntityRelation implements IEntityRelation { - - /** - * Constructs a new EntityRelation. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.IEntityRelation); - - /** EntityRelation subjectId. */ - public subjectId: string; - - /** EntityRelation objectId. */ - public objectId: string; - - /** EntityRelation relation. */ - public relation: string; - - /** - * Creates a new EntityRelation instance using the specified properties. - * @param [properties] Properties to set - * @returns EntityRelation instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.IEntityRelation): google.cloud.documentai.v1.Document.EntityRelation; - - /** - * Encodes the specified EntityRelation message. Does not implicitly {@link google.cloud.documentai.v1.Document.EntityRelation.verify|verify} messages. - * @param message EntityRelation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Document.IEntityRelation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EntityRelation message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.EntityRelation.verify|verify} messages. - * @param message EntityRelation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Document.IEntityRelation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EntityRelation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EntityRelation - * @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.cloud.documentai.v1.Document.EntityRelation; - - /** - * Decodes an EntityRelation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EntityRelation - * @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.cloud.documentai.v1.Document.EntityRelation; - - /** - * Verifies an EntityRelation 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 EntityRelation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EntityRelation - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.EntityRelation; - - /** - * Creates a plain object from an EntityRelation message. Also converts values to other types if specified. - * @param message EntityRelation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document.EntityRelation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EntityRelation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EntityRelation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TextAnchor. */ - interface ITextAnchor { - - /** TextAnchor textSegments */ - textSegments?: (google.cloud.documentai.v1.Document.TextAnchor.ITextSegment[]|null); - - /** TextAnchor content */ - content?: (string|null); - } - - /** Represents a TextAnchor. */ - class TextAnchor implements ITextAnchor { - - /** - * Constructs a new TextAnchor. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.ITextAnchor); - - /** TextAnchor textSegments. */ - public textSegments: google.cloud.documentai.v1.Document.TextAnchor.ITextSegment[]; - - /** TextAnchor content. */ - public content: string; - - /** - * Creates a new TextAnchor instance using the specified properties. - * @param [properties] Properties to set - * @returns TextAnchor instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.ITextAnchor): google.cloud.documentai.v1.Document.TextAnchor; - - /** - * Encodes the specified TextAnchor message. Does not implicitly {@link google.cloud.documentai.v1.Document.TextAnchor.verify|verify} messages. - * @param message TextAnchor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Document.ITextAnchor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TextAnchor message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.TextAnchor.verify|verify} messages. - * @param message TextAnchor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Document.ITextAnchor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TextAnchor message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TextAnchor - * @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.cloud.documentai.v1.Document.TextAnchor; - - /** - * Decodes a TextAnchor message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TextAnchor - * @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.cloud.documentai.v1.Document.TextAnchor; - - /** - * Verifies a TextAnchor 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 TextAnchor message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TextAnchor - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.TextAnchor; - - /** - * Creates a plain object from a TextAnchor message. Also converts values to other types if specified. - * @param message TextAnchor - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document.TextAnchor, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TextAnchor to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TextAnchor - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace TextAnchor { - - /** Properties of a TextSegment. */ - interface ITextSegment { - - /** TextSegment startIndex */ - startIndex?: (number|Long|string|null); - - /** TextSegment endIndex */ - endIndex?: (number|Long|string|null); - } - - /** Represents a TextSegment. */ - class TextSegment implements ITextSegment { - - /** - * Constructs a new TextSegment. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.TextAnchor.ITextSegment); - - /** TextSegment startIndex. */ - public startIndex: (number|Long|string); - - /** TextSegment endIndex. */ - public endIndex: (number|Long|string); - - /** - * Creates a new TextSegment instance using the specified properties. - * @param [properties] Properties to set - * @returns TextSegment instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.TextAnchor.ITextSegment): google.cloud.documentai.v1.Document.TextAnchor.TextSegment; - - /** - * Encodes the specified TextSegment message. Does not implicitly {@link google.cloud.documentai.v1.Document.TextAnchor.TextSegment.verify|verify} messages. - * @param message TextSegment message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Document.TextAnchor.ITextSegment, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TextSegment message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.TextAnchor.TextSegment.verify|verify} messages. - * @param message TextSegment message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Document.TextAnchor.ITextSegment, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TextSegment message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TextSegment - * @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.cloud.documentai.v1.Document.TextAnchor.TextSegment; - - /** - * Decodes a TextSegment message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TextSegment - * @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.cloud.documentai.v1.Document.TextAnchor.TextSegment; - - /** - * Verifies a TextSegment 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 TextSegment message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TextSegment - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.TextAnchor.TextSegment; - - /** - * Creates a plain object from a TextSegment message. Also converts values to other types if specified. - * @param message TextSegment - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document.TextAnchor.TextSegment, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TextSegment to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TextSegment - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a PageAnchor. */ - interface IPageAnchor { - - /** PageAnchor pageRefs */ - pageRefs?: (google.cloud.documentai.v1.Document.PageAnchor.IPageRef[]|null); - } - - /** Represents a PageAnchor. */ - class PageAnchor implements IPageAnchor { - - /** - * Constructs a new PageAnchor. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.IPageAnchor); - - /** PageAnchor pageRefs. */ - public pageRefs: google.cloud.documentai.v1.Document.PageAnchor.IPageRef[]; - - /** - * Creates a new PageAnchor instance using the specified properties. - * @param [properties] Properties to set - * @returns PageAnchor instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.IPageAnchor): google.cloud.documentai.v1.Document.PageAnchor; - - /** - * Encodes the specified PageAnchor message. Does not implicitly {@link google.cloud.documentai.v1.Document.PageAnchor.verify|verify} messages. - * @param message PageAnchor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Document.IPageAnchor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PageAnchor message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.PageAnchor.verify|verify} messages. - * @param message PageAnchor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Document.IPageAnchor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PageAnchor message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PageAnchor - * @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.cloud.documentai.v1.Document.PageAnchor; - - /** - * Decodes a PageAnchor message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PageAnchor - * @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.cloud.documentai.v1.Document.PageAnchor; - - /** - * Verifies a PageAnchor 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 PageAnchor message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PageAnchor - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.PageAnchor; - - /** - * Creates a plain object from a PageAnchor message. Also converts values to other types if specified. - * @param message PageAnchor - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document.PageAnchor, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PageAnchor to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PageAnchor - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace PageAnchor { - - /** Properties of a PageRef. */ - interface IPageRef { - - /** PageRef page */ - page?: (number|Long|string|null); - - /** PageRef layoutType */ - layoutType?: (google.cloud.documentai.v1.Document.PageAnchor.PageRef.LayoutType|keyof typeof google.cloud.documentai.v1.Document.PageAnchor.PageRef.LayoutType|null); - - /** PageRef layoutId */ - layoutId?: (string|null); - - /** PageRef boundingPoly */ - boundingPoly?: (google.cloud.documentai.v1.IBoundingPoly|null); - - /** PageRef confidence */ - confidence?: (number|null); - } - - /** Represents a PageRef. */ - class PageRef implements IPageRef { - - /** - * Constructs a new PageRef. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.PageAnchor.IPageRef); - - /** PageRef page. */ - public page: (number|Long|string); - - /** PageRef layoutType. */ - public layoutType: (google.cloud.documentai.v1.Document.PageAnchor.PageRef.LayoutType|keyof typeof google.cloud.documentai.v1.Document.PageAnchor.PageRef.LayoutType); - - /** PageRef layoutId. */ - public layoutId: string; - - /** PageRef boundingPoly. */ - public boundingPoly?: (google.cloud.documentai.v1.IBoundingPoly|null); - - /** PageRef confidence. */ - public confidence: number; - - /** - * Creates a new PageRef instance using the specified properties. - * @param [properties] Properties to set - * @returns PageRef instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.PageAnchor.IPageRef): google.cloud.documentai.v1.Document.PageAnchor.PageRef; - - /** - * Encodes the specified PageRef message. Does not implicitly {@link google.cloud.documentai.v1.Document.PageAnchor.PageRef.verify|verify} messages. - * @param message PageRef message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Document.PageAnchor.IPageRef, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PageRef message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.PageAnchor.PageRef.verify|verify} messages. - * @param message PageRef message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Document.PageAnchor.IPageRef, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PageRef message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PageRef - * @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.cloud.documentai.v1.Document.PageAnchor.PageRef; - - /** - * Decodes a PageRef message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PageRef - * @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.cloud.documentai.v1.Document.PageAnchor.PageRef; - - /** - * Verifies a PageRef 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 PageRef message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PageRef - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.PageAnchor.PageRef; - - /** - * Creates a plain object from a PageRef message. Also converts values to other types if specified. - * @param message PageRef - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document.PageAnchor.PageRef, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PageRef to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PageRef - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace PageRef { - - /** LayoutType enum. */ - enum LayoutType { - LAYOUT_TYPE_UNSPECIFIED = 0, - BLOCK = 1, - PARAGRAPH = 2, - LINE = 3, - TOKEN = 4, - VISUAL_ELEMENT = 5, - TABLE = 6, - FORM_FIELD = 7 - } - } - } - - /** Properties of a Provenance. */ - interface IProvenance { - - /** Provenance revision */ - revision?: (number|null); - - /** Provenance id */ - id?: (number|null); - - /** Provenance parents */ - parents?: (google.cloud.documentai.v1.Document.Provenance.IParent[]|null); - - /** Provenance type */ - type?: (google.cloud.documentai.v1.Document.Provenance.OperationType|keyof typeof google.cloud.documentai.v1.Document.Provenance.OperationType|null); - } - - /** Represents a Provenance. */ - class Provenance implements IProvenance { - - /** - * Constructs a new Provenance. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.IProvenance); - - /** Provenance revision. */ - public revision: number; - - /** Provenance id. */ - public id: number; - - /** Provenance parents. */ - public parents: google.cloud.documentai.v1.Document.Provenance.IParent[]; - - /** Provenance type. */ - public type: (google.cloud.documentai.v1.Document.Provenance.OperationType|keyof typeof google.cloud.documentai.v1.Document.Provenance.OperationType); - - /** - * Creates a new Provenance instance using the specified properties. - * @param [properties] Properties to set - * @returns Provenance instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.IProvenance): google.cloud.documentai.v1.Document.Provenance; - - /** - * Encodes the specified Provenance message. Does not implicitly {@link google.cloud.documentai.v1.Document.Provenance.verify|verify} messages. - * @param message Provenance message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Document.IProvenance, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Provenance message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Provenance.verify|verify} messages. - * @param message Provenance message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Document.IProvenance, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Provenance message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Provenance - * @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.cloud.documentai.v1.Document.Provenance; - - /** - * Decodes a Provenance message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Provenance - * @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.cloud.documentai.v1.Document.Provenance; - - /** - * Verifies a Provenance 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 Provenance message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Provenance - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Provenance; - - /** - * Creates a plain object from a Provenance message. Also converts values to other types if specified. - * @param message Provenance - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document.Provenance, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Provenance to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Provenance - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Provenance { - - /** Properties of a Parent. */ - interface IParent { - - /** Parent revision */ - revision?: (number|null); - - /** Parent index */ - index?: (number|null); - - /** Parent id */ - id?: (number|null); - } - - /** Represents a Parent. */ - class Parent implements IParent { - - /** - * Constructs a new Parent. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.Provenance.IParent); - - /** Parent revision. */ - public revision: number; - - /** Parent index. */ - public index: number; - - /** Parent id. */ - public id: number; - - /** - * Creates a new Parent instance using the specified properties. - * @param [properties] Properties to set - * @returns Parent instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.Provenance.IParent): google.cloud.documentai.v1.Document.Provenance.Parent; - - /** - * Encodes the specified Parent message. Does not implicitly {@link google.cloud.documentai.v1.Document.Provenance.Parent.verify|verify} messages. - * @param message Parent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Document.Provenance.IParent, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Parent message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Provenance.Parent.verify|verify} messages. - * @param message Parent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Document.Provenance.IParent, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Parent message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Parent - * @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.cloud.documentai.v1.Document.Provenance.Parent; - - /** - * Decodes a Parent message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Parent - * @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.cloud.documentai.v1.Document.Provenance.Parent; - - /** - * Verifies a Parent 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 Parent message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Parent - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Provenance.Parent; - - /** - * Creates a plain object from a Parent message. Also converts values to other types if specified. - * @param message Parent - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document.Provenance.Parent, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Parent to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Parent - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** OperationType enum. */ - enum OperationType { - OPERATION_TYPE_UNSPECIFIED = 0, - ADD = 1, - REMOVE = 2, - UPDATE = 7, - REPLACE = 3, - EVAL_REQUESTED = 4, - EVAL_APPROVED = 5, - EVAL_SKIPPED = 6 - } - } - - /** Properties of a Revision. */ - interface IRevision { - - /** Revision agent */ - agent?: (string|null); - - /** Revision processor */ - processor?: (string|null); - - /** Revision id */ - id?: (string|null); - - /** Revision parent */ - parent?: (number[]|null); - - /** Revision parentIds */ - parentIds?: (string[]|null); - - /** Revision createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Revision humanReview */ - humanReview?: (google.cloud.documentai.v1.Document.Revision.IHumanReview|null); - } - - /** Represents a Revision. */ - class Revision implements IRevision { - - /** - * Constructs a new Revision. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.IRevision); - - /** Revision agent. */ - public agent?: (string|null); - - /** Revision processor. */ - public processor?: (string|null); - - /** Revision id. */ - public id: string; - - /** Revision parent. */ - public parent: number[]; - - /** Revision parentIds. */ - public parentIds: string[]; - - /** Revision createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Revision humanReview. */ - public humanReview?: (google.cloud.documentai.v1.Document.Revision.IHumanReview|null); - - /** Revision source. */ - public source?: ("agent"|"processor"); - - /** - * Creates a new Revision instance using the specified properties. - * @param [properties] Properties to set - * @returns Revision instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.IRevision): google.cloud.documentai.v1.Document.Revision; - - /** - * Encodes the specified Revision message. Does not implicitly {@link google.cloud.documentai.v1.Document.Revision.verify|verify} messages. - * @param message Revision message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Document.IRevision, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Revision message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Revision.verify|verify} messages. - * @param message Revision message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Document.IRevision, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Revision message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Revision - * @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.cloud.documentai.v1.Document.Revision; - - /** - * Decodes a Revision message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Revision - * @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.cloud.documentai.v1.Document.Revision; - - /** - * Verifies a Revision 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 Revision message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Revision - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Revision; - - /** - * Creates a plain object from a Revision message. Also converts values to other types if specified. - * @param message Revision - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document.Revision, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Revision to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Revision - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Revision { - - /** Properties of a HumanReview. */ - interface IHumanReview { - - /** HumanReview state */ - state?: (string|null); - - /** HumanReview stateMessage */ - stateMessage?: (string|null); - } - - /** Represents a HumanReview. */ - class HumanReview implements IHumanReview { - - /** - * Constructs a new HumanReview. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.Revision.IHumanReview); - - /** HumanReview state. */ - public state: string; - - /** HumanReview stateMessage. */ - public stateMessage: string; - - /** - * Creates a new HumanReview instance using the specified properties. - * @param [properties] Properties to set - * @returns HumanReview instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.Revision.IHumanReview): google.cloud.documentai.v1.Document.Revision.HumanReview; - - /** - * Encodes the specified HumanReview message. Does not implicitly {@link google.cloud.documentai.v1.Document.Revision.HumanReview.verify|verify} messages. - * @param message HumanReview message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Document.Revision.IHumanReview, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified HumanReview message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Revision.HumanReview.verify|verify} messages. - * @param message HumanReview message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Document.Revision.IHumanReview, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a HumanReview message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns HumanReview - * @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.cloud.documentai.v1.Document.Revision.HumanReview; - - /** - * Decodes a HumanReview message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns HumanReview - * @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.cloud.documentai.v1.Document.Revision.HumanReview; - - /** - * Verifies a HumanReview 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 HumanReview message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns HumanReview - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Revision.HumanReview; - - /** - * Creates a plain object from a HumanReview message. Also converts values to other types if specified. - * @param message HumanReview - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document.Revision.HumanReview, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this HumanReview to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for HumanReview - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a TextChange. */ - interface ITextChange { - - /** TextChange textAnchor */ - textAnchor?: (google.cloud.documentai.v1.Document.ITextAnchor|null); - - /** TextChange changedText */ - changedText?: (string|null); - - /** TextChange provenance */ - provenance?: (google.cloud.documentai.v1.Document.IProvenance[]|null); - } - - /** Represents a TextChange. */ - class TextChange implements ITextChange { - - /** - * Constructs a new TextChange. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.ITextChange); - - /** TextChange textAnchor. */ - public textAnchor?: (google.cloud.documentai.v1.Document.ITextAnchor|null); - - /** TextChange changedText. */ - public changedText: string; - - /** TextChange provenance. */ - public provenance: google.cloud.documentai.v1.Document.IProvenance[]; - - /** - * Creates a new TextChange instance using the specified properties. - * @param [properties] Properties to set - * @returns TextChange instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.ITextChange): google.cloud.documentai.v1.Document.TextChange; - - /** - * Encodes the specified TextChange message. Does not implicitly {@link google.cloud.documentai.v1.Document.TextChange.verify|verify} messages. - * @param message TextChange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Document.ITextChange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TextChange message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.TextChange.verify|verify} messages. - * @param message TextChange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Document.ITextChange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TextChange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TextChange - * @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.cloud.documentai.v1.Document.TextChange; - - /** - * Decodes a TextChange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TextChange - * @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.cloud.documentai.v1.Document.TextChange; - - /** - * Verifies a TextChange 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 TextChange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TextChange - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.TextChange; - - /** - * Creates a plain object from a TextChange message. Also converts values to other types if specified. - * @param message TextChange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document.TextChange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TextChange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TextChange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DocumentLayout. */ - interface IDocumentLayout { - - /** DocumentLayout blocks */ - blocks?: (google.cloud.documentai.v1.Document.DocumentLayout.IDocumentLayoutBlock[]|null); - } - - /** Represents a DocumentLayout. */ - class DocumentLayout implements IDocumentLayout { - - /** - * Constructs a new DocumentLayout. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.IDocumentLayout); - - /** DocumentLayout blocks. */ - public blocks: google.cloud.documentai.v1.Document.DocumentLayout.IDocumentLayoutBlock[]; - - /** - * Creates a new DocumentLayout instance using the specified properties. - * @param [properties] Properties to set - * @returns DocumentLayout instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.IDocumentLayout): google.cloud.documentai.v1.Document.DocumentLayout; - - /** - * Encodes the specified DocumentLayout message. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.verify|verify} messages. - * @param message DocumentLayout message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Document.IDocumentLayout, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DocumentLayout message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.verify|verify} messages. - * @param message DocumentLayout message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Document.IDocumentLayout, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DocumentLayout message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DocumentLayout - * @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.cloud.documentai.v1.Document.DocumentLayout; - - /** - * Decodes a DocumentLayout message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DocumentLayout - * @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.cloud.documentai.v1.Document.DocumentLayout; - - /** - * Verifies a DocumentLayout 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 DocumentLayout message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DocumentLayout - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.DocumentLayout; - - /** - * Creates a plain object from a DocumentLayout message. Also converts values to other types if specified. - * @param message DocumentLayout - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document.DocumentLayout, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DocumentLayout to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DocumentLayout - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace DocumentLayout { - - /** Properties of a DocumentLayoutBlock. */ - interface IDocumentLayoutBlock { - - /** DocumentLayoutBlock textBlock */ - textBlock?: (google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTextBlock|null); - - /** DocumentLayoutBlock tableBlock */ - tableBlock?: (google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableBlock|null); - - /** DocumentLayoutBlock listBlock */ - listBlock?: (google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListBlock|null); - - /** DocumentLayoutBlock blockId */ - blockId?: (string|null); - - /** DocumentLayoutBlock pageSpan */ - pageSpan?: (google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutPageSpan|null); - - /** DocumentLayoutBlock boundingBox */ - boundingBox?: (google.cloud.documentai.v1.IBoundingPoly|null); - } - - /** Represents a DocumentLayoutBlock. */ - class DocumentLayoutBlock implements IDocumentLayoutBlock { - - /** - * Constructs a new DocumentLayoutBlock. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.DocumentLayout.IDocumentLayoutBlock); - - /** DocumentLayoutBlock textBlock. */ - public textBlock?: (google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTextBlock|null); - - /** DocumentLayoutBlock tableBlock. */ - public tableBlock?: (google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableBlock|null); - - /** DocumentLayoutBlock listBlock. */ - public listBlock?: (google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListBlock|null); - - /** DocumentLayoutBlock blockId. */ - public blockId: string; - - /** DocumentLayoutBlock pageSpan. */ - public pageSpan?: (google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutPageSpan|null); - - /** DocumentLayoutBlock boundingBox. */ - public boundingBox?: (google.cloud.documentai.v1.IBoundingPoly|null); - - /** DocumentLayoutBlock block. */ - public block?: ("textBlock"|"tableBlock"|"listBlock"); - - /** - * Creates a new DocumentLayoutBlock instance using the specified properties. - * @param [properties] Properties to set - * @returns DocumentLayoutBlock instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.DocumentLayout.IDocumentLayoutBlock): google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock; - - /** - * Encodes the specified DocumentLayoutBlock message. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.verify|verify} messages. - * @param message DocumentLayoutBlock message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Document.DocumentLayout.IDocumentLayoutBlock, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DocumentLayoutBlock message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.verify|verify} messages. - * @param message DocumentLayoutBlock message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Document.DocumentLayout.IDocumentLayoutBlock, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DocumentLayoutBlock message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DocumentLayoutBlock - * @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.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock; - - /** - * Decodes a DocumentLayoutBlock message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DocumentLayoutBlock - * @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.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock; - - /** - * Verifies a DocumentLayoutBlock 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 DocumentLayoutBlock message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DocumentLayoutBlock - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock; - - /** - * Creates a plain object from a DocumentLayoutBlock message. Also converts values to other types if specified. - * @param message DocumentLayoutBlock - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DocumentLayoutBlock to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DocumentLayoutBlock - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace DocumentLayoutBlock { - - /** Properties of a LayoutPageSpan. */ - interface ILayoutPageSpan { - - /** LayoutPageSpan pageStart */ - pageStart?: (number|null); - - /** LayoutPageSpan pageEnd */ - pageEnd?: (number|null); - } - - /** Represents a LayoutPageSpan. */ - class LayoutPageSpan implements ILayoutPageSpan { - - /** - * Constructs a new LayoutPageSpan. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutPageSpan); - - /** LayoutPageSpan pageStart. */ - public pageStart: number; - - /** LayoutPageSpan pageEnd. */ - public pageEnd: number; - - /** - * Creates a new LayoutPageSpan instance using the specified properties. - * @param [properties] Properties to set - * @returns LayoutPageSpan instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutPageSpan): google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan; - - /** - * Encodes the specified LayoutPageSpan message. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan.verify|verify} messages. - * @param message LayoutPageSpan message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutPageSpan, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LayoutPageSpan message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan.verify|verify} messages. - * @param message LayoutPageSpan message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutPageSpan, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LayoutPageSpan message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LayoutPageSpan - * @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.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan; - - /** - * Decodes a LayoutPageSpan message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LayoutPageSpan - * @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.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan; - - /** - * Verifies a LayoutPageSpan 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 LayoutPageSpan message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LayoutPageSpan - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan; - - /** - * Creates a plain object from a LayoutPageSpan message. Also converts values to other types if specified. - * @param message LayoutPageSpan - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LayoutPageSpan to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LayoutPageSpan - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a LayoutTextBlock. */ - interface ILayoutTextBlock { - - /** LayoutTextBlock text */ - text?: (string|null); - - /** LayoutTextBlock type */ - type?: (string|null); - - /** LayoutTextBlock blocks */ - blocks?: (google.cloud.documentai.v1.Document.DocumentLayout.IDocumentLayoutBlock[]|null); - } - - /** Represents a LayoutTextBlock. */ - class LayoutTextBlock implements ILayoutTextBlock { - - /** - * Constructs a new LayoutTextBlock. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTextBlock); - - /** LayoutTextBlock text. */ - public text: string; - - /** LayoutTextBlock type. */ - public type: string; - - /** LayoutTextBlock blocks. */ - public blocks: google.cloud.documentai.v1.Document.DocumentLayout.IDocumentLayoutBlock[]; - - /** - * Creates a new LayoutTextBlock instance using the specified properties. - * @param [properties] Properties to set - * @returns LayoutTextBlock instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTextBlock): google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock; - - /** - * Encodes the specified LayoutTextBlock message. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock.verify|verify} messages. - * @param message LayoutTextBlock message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTextBlock, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LayoutTextBlock message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock.verify|verify} messages. - * @param message LayoutTextBlock message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTextBlock, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LayoutTextBlock message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LayoutTextBlock - * @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.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock; - - /** - * Decodes a LayoutTextBlock message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LayoutTextBlock - * @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.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock; - - /** - * Verifies a LayoutTextBlock 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 LayoutTextBlock message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LayoutTextBlock - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock; - - /** - * Creates a plain object from a LayoutTextBlock message. Also converts values to other types if specified. - * @param message LayoutTextBlock - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LayoutTextBlock to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LayoutTextBlock - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a LayoutTableBlock. */ - interface ILayoutTableBlock { - - /** LayoutTableBlock headerRows */ - headerRows?: (google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableRow[]|null); - - /** LayoutTableBlock bodyRows */ - bodyRows?: (google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableRow[]|null); - - /** LayoutTableBlock caption */ - caption?: (string|null); - } - - /** Represents a LayoutTableBlock. */ - class LayoutTableBlock implements ILayoutTableBlock { - - /** - * Constructs a new LayoutTableBlock. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableBlock); - - /** LayoutTableBlock headerRows. */ - public headerRows: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableRow[]; - - /** LayoutTableBlock bodyRows. */ - public bodyRows: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableRow[]; - - /** LayoutTableBlock caption. */ - public caption: string; - - /** - * Creates a new LayoutTableBlock instance using the specified properties. - * @param [properties] Properties to set - * @returns LayoutTableBlock instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableBlock): google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock; - - /** - * Encodes the specified LayoutTableBlock message. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock.verify|verify} messages. - * @param message LayoutTableBlock message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableBlock, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LayoutTableBlock message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock.verify|verify} messages. - * @param message LayoutTableBlock message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableBlock, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LayoutTableBlock message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LayoutTableBlock - * @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.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock; - - /** - * Decodes a LayoutTableBlock message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LayoutTableBlock - * @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.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock; - - /** - * Verifies a LayoutTableBlock 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 LayoutTableBlock message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LayoutTableBlock - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock; - - /** - * Creates a plain object from a LayoutTableBlock message. Also converts values to other types if specified. - * @param message LayoutTableBlock - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LayoutTableBlock to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LayoutTableBlock - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a LayoutTableRow. */ - interface ILayoutTableRow { - - /** LayoutTableRow cells */ - cells?: (google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableCell[]|null); - } - - /** Represents a LayoutTableRow. */ - class LayoutTableRow implements ILayoutTableRow { - - /** - * Constructs a new LayoutTableRow. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableRow); - - /** LayoutTableRow cells. */ - public cells: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableCell[]; - - /** - * Creates a new LayoutTableRow instance using the specified properties. - * @param [properties] Properties to set - * @returns LayoutTableRow instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableRow): google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow; - - /** - * Encodes the specified LayoutTableRow message. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow.verify|verify} messages. - * @param message LayoutTableRow message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableRow, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LayoutTableRow message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow.verify|verify} messages. - * @param message LayoutTableRow message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableRow, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LayoutTableRow message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LayoutTableRow - * @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.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow; - - /** - * Decodes a LayoutTableRow message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LayoutTableRow - * @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.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow; - - /** - * Verifies a LayoutTableRow 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 LayoutTableRow message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LayoutTableRow - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow; - - /** - * Creates a plain object from a LayoutTableRow message. Also converts values to other types if specified. - * @param message LayoutTableRow - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LayoutTableRow to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LayoutTableRow - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a LayoutTableCell. */ - interface ILayoutTableCell { - - /** LayoutTableCell blocks */ - blocks?: (google.cloud.documentai.v1.Document.DocumentLayout.IDocumentLayoutBlock[]|null); - - /** LayoutTableCell rowSpan */ - rowSpan?: (number|null); - - /** LayoutTableCell colSpan */ - colSpan?: (number|null); - } - - /** Represents a LayoutTableCell. */ - class LayoutTableCell implements ILayoutTableCell { - - /** - * Constructs a new LayoutTableCell. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableCell); - - /** LayoutTableCell blocks. */ - public blocks: google.cloud.documentai.v1.Document.DocumentLayout.IDocumentLayoutBlock[]; - - /** LayoutTableCell rowSpan. */ - public rowSpan: number; - - /** LayoutTableCell colSpan. */ - public colSpan: number; - - /** - * Creates a new LayoutTableCell instance using the specified properties. - * @param [properties] Properties to set - * @returns LayoutTableCell instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableCell): google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell; - - /** - * Encodes the specified LayoutTableCell message. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell.verify|verify} messages. - * @param message LayoutTableCell message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableCell, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LayoutTableCell message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell.verify|verify} messages. - * @param message LayoutTableCell message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableCell, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LayoutTableCell message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LayoutTableCell - * @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.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell; - - /** - * Decodes a LayoutTableCell message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LayoutTableCell - * @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.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell; - - /** - * Verifies a LayoutTableCell 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 LayoutTableCell message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LayoutTableCell - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell; - - /** - * Creates a plain object from a LayoutTableCell message. Also converts values to other types if specified. - * @param message LayoutTableCell - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LayoutTableCell to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LayoutTableCell - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a LayoutListBlock. */ - interface ILayoutListBlock { - - /** LayoutListBlock listEntries */ - listEntries?: (google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListEntry[]|null); - - /** LayoutListBlock type */ - type?: (string|null); - } - - /** Represents a LayoutListBlock. */ - class LayoutListBlock implements ILayoutListBlock { - - /** - * Constructs a new LayoutListBlock. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListBlock); - - /** LayoutListBlock listEntries. */ - public listEntries: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListEntry[]; - - /** LayoutListBlock type. */ - public type: string; - - /** - * Creates a new LayoutListBlock instance using the specified properties. - * @param [properties] Properties to set - * @returns LayoutListBlock instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListBlock): google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock; - - /** - * Encodes the specified LayoutListBlock message. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock.verify|verify} messages. - * @param message LayoutListBlock message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListBlock, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LayoutListBlock message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock.verify|verify} messages. - * @param message LayoutListBlock message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListBlock, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LayoutListBlock message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LayoutListBlock - * @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.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock; - - /** - * Decodes a LayoutListBlock message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LayoutListBlock - * @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.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock; - - /** - * Verifies a LayoutListBlock 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 LayoutListBlock message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LayoutListBlock - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock; - - /** - * Creates a plain object from a LayoutListBlock message. Also converts values to other types if specified. - * @param message LayoutListBlock - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LayoutListBlock to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LayoutListBlock - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a LayoutListEntry. */ - interface ILayoutListEntry { - - /** LayoutListEntry blocks */ - blocks?: (google.cloud.documentai.v1.Document.DocumentLayout.IDocumentLayoutBlock[]|null); - } - - /** Represents a LayoutListEntry. */ - class LayoutListEntry implements ILayoutListEntry { - - /** - * Constructs a new LayoutListEntry. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListEntry); - - /** LayoutListEntry blocks. */ - public blocks: google.cloud.documentai.v1.Document.DocumentLayout.IDocumentLayoutBlock[]; - - /** - * Creates a new LayoutListEntry instance using the specified properties. - * @param [properties] Properties to set - * @returns LayoutListEntry instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListEntry): google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry; - - /** - * Encodes the specified LayoutListEntry message. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry.verify|verify} messages. - * @param message LayoutListEntry message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListEntry, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LayoutListEntry message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry.verify|verify} messages. - * @param message LayoutListEntry message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListEntry, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LayoutListEntry message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LayoutListEntry - * @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.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry; - - /** - * Decodes a LayoutListEntry message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LayoutListEntry - * @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.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry; - - /** - * Verifies a LayoutListEntry 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 LayoutListEntry message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LayoutListEntry - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry; - - /** - * Creates a plain object from a LayoutListEntry message. Also converts values to other types if specified. - * @param message LayoutListEntry - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LayoutListEntry to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LayoutListEntry - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - } - - /** Properties of a ChunkedDocument. */ - interface IChunkedDocument { - - /** ChunkedDocument chunks */ - chunks?: (google.cloud.documentai.v1.Document.ChunkedDocument.IChunk[]|null); - } - - /** Represents a ChunkedDocument. */ - class ChunkedDocument implements IChunkedDocument { - - /** - * Constructs a new ChunkedDocument. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.IChunkedDocument); - - /** ChunkedDocument chunks. */ - public chunks: google.cloud.documentai.v1.Document.ChunkedDocument.IChunk[]; - - /** - * Creates a new ChunkedDocument instance using the specified properties. - * @param [properties] Properties to set - * @returns ChunkedDocument instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.IChunkedDocument): google.cloud.documentai.v1.Document.ChunkedDocument; - - /** - * Encodes the specified ChunkedDocument message. Does not implicitly {@link google.cloud.documentai.v1.Document.ChunkedDocument.verify|verify} messages. - * @param message ChunkedDocument message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Document.IChunkedDocument, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ChunkedDocument message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.ChunkedDocument.verify|verify} messages. - * @param message ChunkedDocument message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Document.IChunkedDocument, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ChunkedDocument message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ChunkedDocument - * @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.cloud.documentai.v1.Document.ChunkedDocument; - - /** - * Decodes a ChunkedDocument message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ChunkedDocument - * @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.cloud.documentai.v1.Document.ChunkedDocument; - - /** - * Verifies a ChunkedDocument 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 ChunkedDocument message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ChunkedDocument - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.ChunkedDocument; - - /** - * Creates a plain object from a ChunkedDocument message. Also converts values to other types if specified. - * @param message ChunkedDocument - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document.ChunkedDocument, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ChunkedDocument to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ChunkedDocument - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ChunkedDocument { - - /** Properties of a Chunk. */ - interface IChunk { - - /** Chunk chunkId */ - chunkId?: (string|null); - - /** Chunk sourceBlockIds */ - sourceBlockIds?: (string[]|null); - - /** Chunk content */ - content?: (string|null); - - /** Chunk pageSpan */ - pageSpan?: (google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageSpan|null); - - /** Chunk pageHeaders */ - pageHeaders?: (google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageHeader[]|null); - - /** Chunk pageFooters */ - pageFooters?: (google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageFooter[]|null); - } - - /** Represents a Chunk. */ - class Chunk implements IChunk { - - /** - * Constructs a new Chunk. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.ChunkedDocument.IChunk); - - /** Chunk chunkId. */ - public chunkId: string; - - /** Chunk sourceBlockIds. */ - public sourceBlockIds: string[]; - - /** Chunk content. */ - public content: string; - - /** Chunk pageSpan. */ - public pageSpan?: (google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageSpan|null); - - /** Chunk pageHeaders. */ - public pageHeaders: google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageHeader[]; - - /** Chunk pageFooters. */ - public pageFooters: google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageFooter[]; - - /** - * Creates a new Chunk instance using the specified properties. - * @param [properties] Properties to set - * @returns Chunk instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.ChunkedDocument.IChunk): google.cloud.documentai.v1.Document.ChunkedDocument.Chunk; - - /** - * Encodes the specified Chunk message. Does not implicitly {@link google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.verify|verify} messages. - * @param message Chunk message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Document.ChunkedDocument.IChunk, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Chunk message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.verify|verify} messages. - * @param message Chunk message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Document.ChunkedDocument.IChunk, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Chunk message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Chunk - * @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.cloud.documentai.v1.Document.ChunkedDocument.Chunk; - - /** - * Decodes a Chunk message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Chunk - * @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.cloud.documentai.v1.Document.ChunkedDocument.Chunk; - - /** - * Verifies a Chunk 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 Chunk message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Chunk - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.ChunkedDocument.Chunk; - - /** - * Creates a plain object from a Chunk message. Also converts values to other types if specified. - * @param message Chunk - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document.ChunkedDocument.Chunk, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Chunk to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Chunk - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Chunk { - - /** Properties of a ChunkPageSpan. */ - interface IChunkPageSpan { - - /** ChunkPageSpan pageStart */ - pageStart?: (number|null); - - /** ChunkPageSpan pageEnd */ - pageEnd?: (number|null); - } - - /** Represents a ChunkPageSpan. */ - class ChunkPageSpan implements IChunkPageSpan { - - /** - * Constructs a new ChunkPageSpan. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageSpan); - - /** ChunkPageSpan pageStart. */ - public pageStart: number; - - /** ChunkPageSpan pageEnd. */ - public pageEnd: number; - - /** - * Creates a new ChunkPageSpan instance using the specified properties. - * @param [properties] Properties to set - * @returns ChunkPageSpan instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageSpan): google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan; - - /** - * Encodes the specified ChunkPageSpan message. Does not implicitly {@link google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan.verify|verify} messages. - * @param message ChunkPageSpan message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageSpan, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ChunkPageSpan message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan.verify|verify} messages. - * @param message ChunkPageSpan message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageSpan, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ChunkPageSpan message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ChunkPageSpan - * @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.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan; - - /** - * Decodes a ChunkPageSpan message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ChunkPageSpan - * @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.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan; - - /** - * Verifies a ChunkPageSpan 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 ChunkPageSpan message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ChunkPageSpan - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan; - - /** - * Creates a plain object from a ChunkPageSpan message. Also converts values to other types if specified. - * @param message ChunkPageSpan - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ChunkPageSpan to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ChunkPageSpan - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ChunkPageHeader. */ - interface IChunkPageHeader { - - /** ChunkPageHeader text */ - text?: (string|null); - - /** ChunkPageHeader pageSpan */ - pageSpan?: (google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageSpan|null); - } - - /** Represents a ChunkPageHeader. */ - class ChunkPageHeader implements IChunkPageHeader { - - /** - * Constructs a new ChunkPageHeader. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageHeader); - - /** ChunkPageHeader text. */ - public text: string; - - /** ChunkPageHeader pageSpan. */ - public pageSpan?: (google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageSpan|null); - - /** - * Creates a new ChunkPageHeader instance using the specified properties. - * @param [properties] Properties to set - * @returns ChunkPageHeader instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageHeader): google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader; - - /** - * Encodes the specified ChunkPageHeader message. Does not implicitly {@link google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader.verify|verify} messages. - * @param message ChunkPageHeader message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageHeader, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ChunkPageHeader message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader.verify|verify} messages. - * @param message ChunkPageHeader message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageHeader, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ChunkPageHeader message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ChunkPageHeader - * @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.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader; - - /** - * Decodes a ChunkPageHeader message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ChunkPageHeader - * @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.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader; - - /** - * Verifies a ChunkPageHeader 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 ChunkPageHeader message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ChunkPageHeader - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader; - - /** - * Creates a plain object from a ChunkPageHeader message. Also converts values to other types if specified. - * @param message ChunkPageHeader - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ChunkPageHeader to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ChunkPageHeader - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ChunkPageFooter. */ - interface IChunkPageFooter { - - /** ChunkPageFooter text */ - text?: (string|null); - - /** ChunkPageFooter pageSpan */ - pageSpan?: (google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageSpan|null); - } - - /** Represents a ChunkPageFooter. */ - class ChunkPageFooter implements IChunkPageFooter { - - /** - * Constructs a new ChunkPageFooter. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageFooter); - - /** ChunkPageFooter text. */ - public text: string; - - /** ChunkPageFooter pageSpan. */ - public pageSpan?: (google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageSpan|null); - - /** - * Creates a new ChunkPageFooter instance using the specified properties. - * @param [properties] Properties to set - * @returns ChunkPageFooter instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageFooter): google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter; - - /** - * Encodes the specified ChunkPageFooter message. Does not implicitly {@link google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter.verify|verify} messages. - * @param message ChunkPageFooter message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageFooter, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ChunkPageFooter message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter.verify|verify} messages. - * @param message ChunkPageFooter message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageFooter, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ChunkPageFooter message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ChunkPageFooter - * @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.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter; - - /** - * Decodes a ChunkPageFooter message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ChunkPageFooter - * @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.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter; - - /** - * Verifies a ChunkPageFooter 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 ChunkPageFooter message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ChunkPageFooter - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter; - - /** - * Creates a plain object from a ChunkPageFooter message. Also converts values to other types if specified. - * @param message ChunkPageFooter - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ChunkPageFooter to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ChunkPageFooter - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - } - - /** Properties of an EntityValidationOutput. */ - interface IEntityValidationOutput { - - /** EntityValidationOutput validationResults */ - validationResults?: (google.cloud.documentai.v1.Document.EntityValidationOutput.IValidationResult[]|null); - - /** EntityValidationOutput passAllRules */ - passAllRules?: (boolean|null); - } - - /** Represents an EntityValidationOutput. */ - class EntityValidationOutput implements IEntityValidationOutput { - - /** - * Constructs a new EntityValidationOutput. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.IEntityValidationOutput); - - /** EntityValidationOutput validationResults. */ - public validationResults: google.cloud.documentai.v1.Document.EntityValidationOutput.IValidationResult[]; - - /** EntityValidationOutput passAllRules. */ - public passAllRules: boolean; - - /** - * Creates a new EntityValidationOutput instance using the specified properties. - * @param [properties] Properties to set - * @returns EntityValidationOutput instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.IEntityValidationOutput): google.cloud.documentai.v1.Document.EntityValidationOutput; - - /** - * Encodes the specified EntityValidationOutput message. Does not implicitly {@link google.cloud.documentai.v1.Document.EntityValidationOutput.verify|verify} messages. - * @param message EntityValidationOutput message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Document.IEntityValidationOutput, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EntityValidationOutput message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.EntityValidationOutput.verify|verify} messages. - * @param message EntityValidationOutput message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Document.IEntityValidationOutput, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EntityValidationOutput message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EntityValidationOutput - * @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.cloud.documentai.v1.Document.EntityValidationOutput; - - /** - * Decodes an EntityValidationOutput message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EntityValidationOutput - * @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.cloud.documentai.v1.Document.EntityValidationOutput; - - /** - * Verifies an EntityValidationOutput 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 EntityValidationOutput message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EntityValidationOutput - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.EntityValidationOutput; - - /** - * Creates a plain object from an EntityValidationOutput message. Also converts values to other types if specified. - * @param message EntityValidationOutput - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document.EntityValidationOutput, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EntityValidationOutput to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EntityValidationOutput - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace EntityValidationOutput { - - /** Properties of a ValidationResult. */ - interface IValidationResult { - - /** ValidationResult ruleName */ - ruleName?: (string|null); - - /** ValidationResult ruleDescription */ - ruleDescription?: (string|null); - - /** ValidationResult validationResultType */ - validationResultType?: (google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult.ValidationResultType|keyof typeof google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult.ValidationResultType|null); - - /** ValidationResult validationDetails */ - validationDetails?: (string|null); - } - - /** Represents a ValidationResult. */ - class ValidationResult implements IValidationResult { - - /** - * Constructs a new ValidationResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.EntityValidationOutput.IValidationResult); - - /** ValidationResult ruleName. */ - public ruleName: string; - - /** ValidationResult ruleDescription. */ - public ruleDescription: string; - - /** ValidationResult validationResultType. */ - public validationResultType: (google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult.ValidationResultType|keyof typeof google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult.ValidationResultType); - - /** ValidationResult validationDetails. */ - public validationDetails: string; - - /** - * Creates a new ValidationResult instance using the specified properties. - * @param [properties] Properties to set - * @returns ValidationResult instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.EntityValidationOutput.IValidationResult): google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult; - - /** - * Encodes the specified ValidationResult message. Does not implicitly {@link google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult.verify|verify} messages. - * @param message ValidationResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Document.EntityValidationOutput.IValidationResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ValidationResult message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult.verify|verify} messages. - * @param message ValidationResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Document.EntityValidationOutput.IValidationResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ValidationResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ValidationResult - * @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.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult; - - /** - * Decodes a ValidationResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ValidationResult - * @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.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult; - - /** - * Verifies a ValidationResult 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 ValidationResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ValidationResult - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult; - - /** - * Creates a plain object from a ValidationResult message. Also converts values to other types if specified. - * @param message ValidationResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ValidationResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ValidationResult - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ValidationResult { - - /** ValidationResultType enum. */ - enum ValidationResultType { - VALIDATION_RESULT_TYPE_UNSPECIFIED = 0, - VALIDATION_RESULT_TYPE_VALID = 1, - VALIDATION_RESULT_TYPE_INVALID = 2, - VALIDATION_RESULT_TYPE_SKIPPED = 3, - VALIDATION_RESULT_TYPE_NOT_APPLICABLE = 4 - } - } - } - - /** Properties of an EntitiesRevision. */ - interface IEntitiesRevision { - - /** EntitiesRevision revisionId */ - revisionId?: (string|null); - - /** EntitiesRevision entities */ - entities?: (google.cloud.documentai.v1.Document.IEntity[]|null); - - /** EntitiesRevision entityValidationOutput */ - entityValidationOutput?: (google.cloud.documentai.v1.Document.IEntityValidationOutput|null); - } - - /** Represents an EntitiesRevision. */ - class EntitiesRevision implements IEntitiesRevision { - - /** - * Constructs a new EntitiesRevision. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Document.IEntitiesRevision); - - /** EntitiesRevision revisionId. */ - public revisionId: string; - - /** EntitiesRevision entities. */ - public entities: google.cloud.documentai.v1.Document.IEntity[]; - - /** EntitiesRevision entityValidationOutput. */ - public entityValidationOutput?: (google.cloud.documentai.v1.Document.IEntityValidationOutput|null); - - /** - * Creates a new EntitiesRevision instance using the specified properties. - * @param [properties] Properties to set - * @returns EntitiesRevision instance - */ - public static create(properties?: google.cloud.documentai.v1.Document.IEntitiesRevision): google.cloud.documentai.v1.Document.EntitiesRevision; - - /** - * Encodes the specified EntitiesRevision message. Does not implicitly {@link google.cloud.documentai.v1.Document.EntitiesRevision.verify|verify} messages. - * @param message EntitiesRevision message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Document.IEntitiesRevision, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EntitiesRevision message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.EntitiesRevision.verify|verify} messages. - * @param message EntitiesRevision message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Document.IEntitiesRevision, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EntitiesRevision message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EntitiesRevision - * @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.cloud.documentai.v1.Document.EntitiesRevision; - - /** - * Decodes an EntitiesRevision message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EntitiesRevision - * @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.cloud.documentai.v1.Document.EntitiesRevision; - - /** - * Verifies an EntitiesRevision 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 EntitiesRevision message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EntitiesRevision - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.EntitiesRevision; - - /** - * Creates a plain object from an EntitiesRevision message. Also converts values to other types if specified. - * @param message EntitiesRevision - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Document.EntitiesRevision, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EntitiesRevision to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EntitiesRevision - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a Barcode. */ - interface IBarcode { - - /** Barcode format */ - format?: (string|null); - - /** Barcode valueFormat */ - valueFormat?: (string|null); - - /** Barcode rawValue */ - rawValue?: (string|null); - } - - /** Represents a Barcode. */ - class Barcode implements IBarcode { - - /** - * Constructs a new Barcode. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IBarcode); - - /** Barcode format. */ - public format: string; - - /** Barcode valueFormat. */ - public valueFormat: string; - - /** Barcode rawValue. */ - public rawValue: string; - - /** - * Creates a new Barcode instance using the specified properties. - * @param [properties] Properties to set - * @returns Barcode instance - */ - public static create(properties?: google.cloud.documentai.v1.IBarcode): google.cloud.documentai.v1.Barcode; - - /** - * Encodes the specified Barcode message. Does not implicitly {@link google.cloud.documentai.v1.Barcode.verify|verify} messages. - * @param message Barcode message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IBarcode, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Barcode message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Barcode.verify|verify} messages. - * @param message Barcode message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IBarcode, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Barcode message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Barcode - * @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.cloud.documentai.v1.Barcode; - - /** - * Decodes a Barcode message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Barcode - * @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.cloud.documentai.v1.Barcode; - - /** - * Verifies a Barcode 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 Barcode message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Barcode - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Barcode; - - /** - * Creates a plain object from a Barcode message. Also converts values to other types if specified. - * @param message Barcode - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Barcode, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Barcode to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Barcode - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Vertex. */ - interface IVertex { - - /** Vertex x */ - x?: (number|null); - - /** Vertex y */ - y?: (number|null); - } - - /** Represents a Vertex. */ - class Vertex implements IVertex { - - /** - * Constructs a new Vertex. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IVertex); - - /** Vertex x. */ - public x: number; - - /** Vertex y. */ - public y: number; - - /** - * Creates a new Vertex instance using the specified properties. - * @param [properties] Properties to set - * @returns Vertex instance - */ - public static create(properties?: google.cloud.documentai.v1.IVertex): google.cloud.documentai.v1.Vertex; - - /** - * Encodes the specified Vertex message. Does not implicitly {@link google.cloud.documentai.v1.Vertex.verify|verify} messages. - * @param message Vertex message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IVertex, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Vertex message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Vertex.verify|verify} messages. - * @param message Vertex message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IVertex, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Vertex message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Vertex - * @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.cloud.documentai.v1.Vertex; - - /** - * Decodes a Vertex message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Vertex - * @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.cloud.documentai.v1.Vertex; - - /** - * Verifies a Vertex 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 Vertex message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Vertex - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Vertex; - - /** - * Creates a plain object from a Vertex message. Also converts values to other types if specified. - * @param message Vertex - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Vertex, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Vertex to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Vertex - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a NormalizedVertex. */ - interface INormalizedVertex { - - /** NormalizedVertex x */ - x?: (number|null); - - /** NormalizedVertex y */ - y?: (number|null); - } - - /** Represents a NormalizedVertex. */ - class NormalizedVertex implements INormalizedVertex { - - /** - * Constructs a new NormalizedVertex. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.INormalizedVertex); - - /** NormalizedVertex x. */ - public x: number; - - /** NormalizedVertex y. */ - public y: number; - - /** - * Creates a new NormalizedVertex instance using the specified properties. - * @param [properties] Properties to set - * @returns NormalizedVertex instance - */ - public static create(properties?: google.cloud.documentai.v1.INormalizedVertex): google.cloud.documentai.v1.NormalizedVertex; - - /** - * Encodes the specified NormalizedVertex message. Does not implicitly {@link google.cloud.documentai.v1.NormalizedVertex.verify|verify} messages. - * @param message NormalizedVertex message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.INormalizedVertex, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NormalizedVertex message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.NormalizedVertex.verify|verify} messages. - * @param message NormalizedVertex message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.INormalizedVertex, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NormalizedVertex message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NormalizedVertex - * @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.cloud.documentai.v1.NormalizedVertex; - - /** - * Decodes a NormalizedVertex message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NormalizedVertex - * @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.cloud.documentai.v1.NormalizedVertex; - - /** - * Verifies a NormalizedVertex 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 NormalizedVertex message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NormalizedVertex - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.NormalizedVertex; - - /** - * Creates a plain object from a NormalizedVertex message. Also converts values to other types if specified. - * @param message NormalizedVertex - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.NormalizedVertex, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NormalizedVertex to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NormalizedVertex - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BoundingPoly. */ - interface IBoundingPoly { - - /** BoundingPoly vertices */ - vertices?: (google.cloud.documentai.v1.IVertex[]|null); - - /** BoundingPoly normalizedVertices */ - normalizedVertices?: (google.cloud.documentai.v1.INormalizedVertex[]|null); - } - - /** Represents a BoundingPoly. */ - class BoundingPoly implements IBoundingPoly { - - /** - * Constructs a new BoundingPoly. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IBoundingPoly); - - /** BoundingPoly vertices. */ - public vertices: google.cloud.documentai.v1.IVertex[]; - - /** BoundingPoly normalizedVertices. */ - public normalizedVertices: google.cloud.documentai.v1.INormalizedVertex[]; - - /** - * Creates a new BoundingPoly instance using the specified properties. - * @param [properties] Properties to set - * @returns BoundingPoly instance - */ - public static create(properties?: google.cloud.documentai.v1.IBoundingPoly): google.cloud.documentai.v1.BoundingPoly; - - /** - * Encodes the specified BoundingPoly message. Does not implicitly {@link google.cloud.documentai.v1.BoundingPoly.verify|verify} messages. - * @param message BoundingPoly message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IBoundingPoly, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BoundingPoly message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.BoundingPoly.verify|verify} messages. - * @param message BoundingPoly message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IBoundingPoly, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BoundingPoly message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BoundingPoly - * @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.cloud.documentai.v1.BoundingPoly; - - /** - * Decodes a BoundingPoly message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BoundingPoly - * @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.cloud.documentai.v1.BoundingPoly; - - /** - * Verifies a BoundingPoly 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 BoundingPoly message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BoundingPoly - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.BoundingPoly; - - /** - * Creates a plain object from a BoundingPoly message. Also converts values to other types if specified. - * @param message BoundingPoly - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.BoundingPoly, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BoundingPoly to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BoundingPoly - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - } - } - - /** Namespace api. */ - namespace api { - - /** FieldBehavior enum. */ - enum FieldBehavior { - FIELD_BEHAVIOR_UNSPECIFIED = 0, - OPTIONAL = 1, - REQUIRED = 2, - OUTPUT_ONLY = 3, - INPUT_ONLY = 4, - IMMUTABLE = 5, - UNORDERED_LIST = 6, - NON_EMPTY_DEFAULT = 7, - IDENTIFIER = 8 - } - - /** 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 }; - - /** - * Gets the default type url for ResourceDescriptor - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - 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 }; - - /** - * Gets the default type url for ResourceReference - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** 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 }; - - /** - * Gets the default type url for Http - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** 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|null); - - /** HttpRule put. */ - public put?: (string|null); - - /** HttpRule post. */ - public post?: (string|null); - - /** HttpRule delete. */ - public delete?: (string|null); - - /** HttpRule patch. */ - public patch?: (string|null); - - /** HttpRule custom. */ - public custom?: (google.api.ICustomHttpPattern|null); - - /** HttpRule body. */ - public body: string; - - /** HttpRule responseBody. */ - public responseBody: string; - - /** HttpRule additionalBindings. */ - public additionalBindings: google.api.IHttpRule[]; - - /** HttpRule pattern. */ - public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); - - /** - * Creates a new HttpRule instance using the specified properties. - * @param [properties] Properties to set - * @returns HttpRule instance - */ - public static create(properties?: google.api.IHttpRule): google.api.HttpRule; - - /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @param message HttpRule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @param message HttpRule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a HttpRule message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns 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 }; - - /** - * Gets the default type url for HttpRule - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** 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 }; - - /** - * Gets the default type url for CustomHttpPattern - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CommonLanguageSettings. */ - interface ICommonLanguageSettings { - - /** CommonLanguageSettings referenceDocsUri */ - referenceDocsUri?: (string|null); - - /** CommonLanguageSettings destinations */ - destinations?: (google.api.ClientLibraryDestination[]|null); - } - - /** Represents a CommonLanguageSettings. */ - class CommonLanguageSettings implements ICommonLanguageSettings { - - /** - * Constructs a new CommonLanguageSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICommonLanguageSettings); - - /** CommonLanguageSettings referenceDocsUri. */ - public referenceDocsUri: string; - - /** CommonLanguageSettings destinations. */ - public destinations: google.api.ClientLibraryDestination[]; - - /** - * Creates a new CommonLanguageSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns CommonLanguageSettings instance - */ - public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; - - /** - * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @param message CommonLanguageSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @param message CommonLanguageSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CommonLanguageSettings - * @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.CommonLanguageSettings; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CommonLanguageSettings - * @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.CommonLanguageSettings; - - /** - * Verifies a CommonLanguageSettings 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 CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CommonLanguageSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; - - /** - * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. - * @param message CommonLanguageSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CommonLanguageSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CommonLanguageSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ClientLibrarySettings. */ - interface IClientLibrarySettings { - - /** ClientLibrarySettings version */ - version?: (string|null); - - /** ClientLibrarySettings launchStage */ - launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); - - /** ClientLibrarySettings restNumericEnums */ - restNumericEnums?: (boolean|null); - - /** ClientLibrarySettings javaSettings */ - javaSettings?: (google.api.IJavaSettings|null); - - /** ClientLibrarySettings cppSettings */ - cppSettings?: (google.api.ICppSettings|null); - - /** ClientLibrarySettings phpSettings */ - phpSettings?: (google.api.IPhpSettings|null); - - /** ClientLibrarySettings pythonSettings */ - pythonSettings?: (google.api.IPythonSettings|null); - - /** ClientLibrarySettings nodeSettings */ - nodeSettings?: (google.api.INodeSettings|null); - - /** ClientLibrarySettings dotnetSettings */ - dotnetSettings?: (google.api.IDotnetSettings|null); - - /** ClientLibrarySettings rubySettings */ - rubySettings?: (google.api.IRubySettings|null); - - /** ClientLibrarySettings goSettings */ - goSettings?: (google.api.IGoSettings|null); - } - - /** Represents a ClientLibrarySettings. */ - class ClientLibrarySettings implements IClientLibrarySettings { - - /** - * Constructs a new ClientLibrarySettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IClientLibrarySettings); - - /** ClientLibrarySettings version. */ - public version: string; - - /** ClientLibrarySettings launchStage. */ - public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); - - /** ClientLibrarySettings restNumericEnums. */ - public restNumericEnums: boolean; - - /** ClientLibrarySettings javaSettings. */ - public javaSettings?: (google.api.IJavaSettings|null); - - /** ClientLibrarySettings cppSettings. */ - public cppSettings?: (google.api.ICppSettings|null); - - /** ClientLibrarySettings phpSettings. */ - public phpSettings?: (google.api.IPhpSettings|null); - - /** ClientLibrarySettings pythonSettings. */ - public pythonSettings?: (google.api.IPythonSettings|null); - - /** ClientLibrarySettings nodeSettings. */ - public nodeSettings?: (google.api.INodeSettings|null); - - /** ClientLibrarySettings dotnetSettings. */ - public dotnetSettings?: (google.api.IDotnetSettings|null); - - /** ClientLibrarySettings rubySettings. */ - public rubySettings?: (google.api.IRubySettings|null); - - /** ClientLibrarySettings goSettings. */ - public goSettings?: (google.api.IGoSettings|null); - - /** - * Creates a new ClientLibrarySettings instance using the specified properties. - * @param [properties] Properties to set - * @returns ClientLibrarySettings instance - */ - public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; - - /** - * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @param message ClientLibrarySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @param message ClientLibrarySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ClientLibrarySettings - * @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.ClientLibrarySettings; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ClientLibrarySettings - * @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.ClientLibrarySettings; - - /** - * Verifies a ClientLibrarySettings 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 ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ClientLibrarySettings - */ - public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; - - /** - * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. - * @param message ClientLibrarySettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ClientLibrarySettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ClientLibrarySettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Publishing. */ - interface IPublishing { - - /** Publishing methodSettings */ - methodSettings?: (google.api.IMethodSettings[]|null); - - /** Publishing newIssueUri */ - newIssueUri?: (string|null); - - /** Publishing documentationUri */ - documentationUri?: (string|null); - - /** Publishing apiShortName */ - apiShortName?: (string|null); - - /** Publishing githubLabel */ - githubLabel?: (string|null); - - /** Publishing codeownerGithubTeams */ - codeownerGithubTeams?: (string[]|null); - - /** Publishing docTagPrefix */ - docTagPrefix?: (string|null); - - /** Publishing organization */ - organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); - - /** Publishing librarySettings */ - librarySettings?: (google.api.IClientLibrarySettings[]|null); - - /** Publishing protoReferenceDocumentationUri */ - protoReferenceDocumentationUri?: (string|null); - - /** Publishing restReferenceDocumentationUri */ - restReferenceDocumentationUri?: (string|null); - } - - /** Represents a Publishing. */ - class Publishing implements IPublishing { - - /** - * Constructs a new Publishing. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IPublishing); - - /** Publishing methodSettings. */ - public methodSettings: google.api.IMethodSettings[]; - - /** Publishing newIssueUri. */ - public newIssueUri: string; - - /** Publishing documentationUri. */ - public documentationUri: string; - - /** Publishing apiShortName. */ - public apiShortName: string; - - /** Publishing githubLabel. */ - public githubLabel: string; - - /** Publishing codeownerGithubTeams. */ - public codeownerGithubTeams: string[]; - - /** Publishing docTagPrefix. */ - public docTagPrefix: string; - - /** Publishing organization. */ - public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); - - /** Publishing librarySettings. */ - public librarySettings: google.api.IClientLibrarySettings[]; - - /** Publishing protoReferenceDocumentationUri. */ - public protoReferenceDocumentationUri: string; - - /** Publishing restReferenceDocumentationUri. */ - public restReferenceDocumentationUri: string; - - /** - * Creates a new Publishing instance using the specified properties. - * @param [properties] Properties to set - * @returns Publishing instance - */ - public static create(properties?: google.api.IPublishing): google.api.Publishing; - - /** - * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @param message Publishing message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @param message Publishing message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Publishing message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Publishing - * @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.Publishing; - - /** - * Decodes a Publishing message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Publishing - * @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.Publishing; - - /** - * Verifies a Publishing 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 Publishing message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Publishing - */ - public static fromObject(object: { [k: string]: any }): google.api.Publishing; - - /** - * Creates a plain object from a Publishing message. Also converts values to other types if specified. - * @param message Publishing - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Publishing to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Publishing - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a JavaSettings. */ - interface IJavaSettings { - - /** JavaSettings libraryPackage */ - libraryPackage?: (string|null); - - /** JavaSettings serviceClassNames */ - serviceClassNames?: ({ [k: string]: string }|null); - - /** JavaSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a JavaSettings. */ - class JavaSettings implements IJavaSettings { - - /** - * Constructs a new JavaSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IJavaSettings); - - /** JavaSettings libraryPackage. */ - public libraryPackage: string; - - /** JavaSettings serviceClassNames. */ - public serviceClassNames: { [k: string]: string }; - - /** JavaSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new JavaSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns JavaSettings instance - */ - public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; - - /** - * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @param message JavaSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @param message JavaSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a JavaSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns JavaSettings - * @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.JavaSettings; - - /** - * Decodes a JavaSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns JavaSettings - * @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.JavaSettings; - - /** - * Verifies a JavaSettings 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 JavaSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns JavaSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; - - /** - * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. - * @param message JavaSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this JavaSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for JavaSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CppSettings. */ - interface ICppSettings { - - /** CppSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a CppSettings. */ - class CppSettings implements ICppSettings { - - /** - * Constructs a new CppSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICppSettings); - - /** CppSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new CppSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns CppSettings instance - */ - public static create(properties?: google.api.ICppSettings): google.api.CppSettings; - - /** - * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @param message CppSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @param message CppSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CppSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CppSettings - * @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.CppSettings; - - /** - * Decodes a CppSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CppSettings - * @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.CppSettings; - - /** - * Verifies a CppSettings 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 CppSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CppSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.CppSettings; - - /** - * Creates a plain object from a CppSettings message. Also converts values to other types if specified. - * @param message CppSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CppSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CppSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PhpSettings. */ - interface IPhpSettings { - - /** PhpSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a PhpSettings. */ - class PhpSettings implements IPhpSettings { - - /** - * Constructs a new PhpSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IPhpSettings); - - /** PhpSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new PhpSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns PhpSettings instance - */ - public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; - - /** - * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @param message PhpSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @param message PhpSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PhpSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PhpSettings - * @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.PhpSettings; - - /** - * Decodes a PhpSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PhpSettings - * @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.PhpSettings; - - /** - * Verifies a PhpSettings 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 PhpSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PhpSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; - - /** - * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. - * @param message PhpSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PhpSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PhpSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PythonSettings. */ - interface IPythonSettings { - - /** PythonSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a PythonSettings. */ - class PythonSettings implements IPythonSettings { - - /** - * Constructs a new PythonSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IPythonSettings); - - /** PythonSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new PythonSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns PythonSettings instance - */ - public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; - - /** - * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @param message PythonSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @param message PythonSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PythonSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PythonSettings - * @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.PythonSettings; - - /** - * Decodes a PythonSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PythonSettings - * @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.PythonSettings; - - /** - * Verifies a PythonSettings 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 PythonSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PythonSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; - - /** - * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. - * @param message PythonSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PythonSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PythonSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a NodeSettings. */ - interface INodeSettings { - - /** NodeSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a NodeSettings. */ - class NodeSettings implements INodeSettings { - - /** - * Constructs a new NodeSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.INodeSettings); - - /** NodeSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new NodeSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns NodeSettings instance - */ - public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; - - /** - * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @param message NodeSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @param message NodeSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NodeSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NodeSettings - * @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.NodeSettings; - - /** - * Decodes a NodeSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NodeSettings - * @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.NodeSettings; - - /** - * Verifies a NodeSettings 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 NodeSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NodeSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; - - /** - * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. - * @param message NodeSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NodeSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NodeSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DotnetSettings. */ - interface IDotnetSettings { - - /** DotnetSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - - /** DotnetSettings renamedServices */ - renamedServices?: ({ [k: string]: string }|null); - - /** DotnetSettings renamedResources */ - renamedResources?: ({ [k: string]: string }|null); - - /** DotnetSettings ignoredResources */ - ignoredResources?: (string[]|null); - - /** DotnetSettings forcedNamespaceAliases */ - forcedNamespaceAliases?: (string[]|null); - - /** DotnetSettings handwrittenSignatures */ - handwrittenSignatures?: (string[]|null); - } - - /** Represents a DotnetSettings. */ - class DotnetSettings implements IDotnetSettings { - - /** - * Constructs a new DotnetSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IDotnetSettings); - - /** DotnetSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** DotnetSettings renamedServices. */ - public renamedServices: { [k: string]: string }; - - /** DotnetSettings renamedResources. */ - public renamedResources: { [k: string]: string }; - - /** DotnetSettings ignoredResources. */ - public ignoredResources: string[]; - - /** DotnetSettings forcedNamespaceAliases. */ - public forcedNamespaceAliases: string[]; - - /** DotnetSettings handwrittenSignatures. */ - public handwrittenSignatures: string[]; - - /** - * Creates a new DotnetSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns DotnetSettings instance - */ - public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; - - /** - * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @param message DotnetSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @param message DotnetSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DotnetSettings - * @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.DotnetSettings; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DotnetSettings - * @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.DotnetSettings; - - /** - * Verifies a DotnetSettings 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 DotnetSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DotnetSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; - - /** - * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. - * @param message DotnetSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DotnetSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DotnetSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RubySettings. */ - interface IRubySettings { - - /** RubySettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a RubySettings. */ - class RubySettings implements IRubySettings { - - /** - * Constructs a new RubySettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IRubySettings); - - /** RubySettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new RubySettings instance using the specified properties. - * @param [properties] Properties to set - * @returns RubySettings instance - */ - public static create(properties?: google.api.IRubySettings): google.api.RubySettings; - - /** - * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @param message RubySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @param message RubySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RubySettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RubySettings - * @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.RubySettings; - - /** - * Decodes a RubySettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RubySettings - * @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.RubySettings; - - /** - * Verifies a RubySettings 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 RubySettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RubySettings - */ - public static fromObject(object: { [k: string]: any }): google.api.RubySettings; - - /** - * Creates a plain object from a RubySettings message. Also converts values to other types if specified. - * @param message RubySettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RubySettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RubySettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GoSettings. */ - interface IGoSettings { - - /** GoSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a GoSettings. */ - class GoSettings implements IGoSettings { - - /** - * Constructs a new GoSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IGoSettings); - - /** GoSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new GoSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns GoSettings instance - */ - public static create(properties?: google.api.IGoSettings): google.api.GoSettings; - - /** - * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @param message GoSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @param message GoSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GoSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GoSettings - * @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.GoSettings; - - /** - * Decodes a GoSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GoSettings - * @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.GoSettings; - - /** - * Verifies a GoSettings 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 GoSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GoSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.GoSettings; - - /** - * Creates a plain object from a GoSettings message. Also converts values to other types if specified. - * @param message GoSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GoSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GoSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodSettings. */ - interface IMethodSettings { - - /** MethodSettings selector */ - selector?: (string|null); - - /** MethodSettings longRunning */ - longRunning?: (google.api.MethodSettings.ILongRunning|null); - - /** MethodSettings autoPopulatedFields */ - autoPopulatedFields?: (string[]|null); - } - - /** Represents a MethodSettings. */ - class MethodSettings implements IMethodSettings { - - /** - * Constructs a new MethodSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IMethodSettings); - - /** MethodSettings selector. */ - public selector: string; - - /** MethodSettings longRunning. */ - public longRunning?: (google.api.MethodSettings.ILongRunning|null); - - /** MethodSettings autoPopulatedFields. */ - public autoPopulatedFields: string[]; - - /** - * Creates a new MethodSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodSettings instance - */ - public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; - - /** - * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @param message MethodSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @param message MethodSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodSettings - * @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.MethodSettings; - - /** - * Decodes a MethodSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodSettings - * @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.MethodSettings; - - /** - * Verifies a MethodSettings 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 MethodSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; - - /** - * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. - * @param message MethodSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace MethodSettings { - - /** Properties of a LongRunning. */ - interface ILongRunning { - - /** LongRunning initialPollDelay */ - initialPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning pollDelayMultiplier */ - pollDelayMultiplier?: (number|null); - - /** LongRunning maxPollDelay */ - maxPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning totalPollTimeout */ - totalPollTimeout?: (google.protobuf.IDuration|null); - } - - /** Represents a LongRunning. */ - class LongRunning implements ILongRunning { - - /** - * Constructs a new LongRunning. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.MethodSettings.ILongRunning); - - /** LongRunning initialPollDelay. */ - public initialPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning pollDelayMultiplier. */ - public pollDelayMultiplier: number; - - /** LongRunning maxPollDelay. */ - public maxPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning totalPollTimeout. */ - public totalPollTimeout?: (google.protobuf.IDuration|null); - - /** - * Creates a new LongRunning instance using the specified properties. - * @param [properties] Properties to set - * @returns LongRunning instance - */ - public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; - - /** - * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @param message LongRunning message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @param message LongRunning message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LongRunning message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LongRunning - * @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.MethodSettings.LongRunning; - - /** - * Decodes a LongRunning message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LongRunning - * @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.MethodSettings.LongRunning; - - /** - * Verifies a LongRunning 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 LongRunning message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LongRunning - */ - public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; - - /** - * Creates a plain object from a LongRunning message. Also converts values to other types if specified. - * @param message LongRunning - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LongRunning to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LongRunning - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** ClientLibraryOrganization enum. */ - enum ClientLibraryOrganization { - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, - CLOUD = 1, - ADS = 2, - PHOTOS = 3, - STREET_VIEW = 4, - SHOPPING = 5, - GEO = 6, - GENERATIVE_AI = 7 - } - - /** ClientLibraryDestination enum. */ - enum ClientLibraryDestination { - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, - GITHUB = 10, - PACKAGE_MANAGER = 20 - } - - /** LaunchStage enum. */ - enum LaunchStage { - LAUNCH_STAGE_UNSPECIFIED = 0, - UNIMPLEMENTED = 6, - PRELAUNCH = 7, - EARLY_ACCESS = 1, - ALPHA = 2, - BETA = 3, - GA = 4, - DEPRECATED = 5 - } - } - - /** 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 }; - - /** - * Gets the default type url for FileDescriptorSet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Edition enum. */ - enum Edition { - EDITION_UNKNOWN = 0, - EDITION_PROTO2 = 998, - EDITION_PROTO3 = 999, - EDITION_2023 = 1000, - EDITION_2024 = 1001, - EDITION_1_TEST_ONLY = 1, - EDITION_2_TEST_ONLY = 2, - EDITION_99997_TEST_ONLY = 99997, - EDITION_99998_TEST_ONLY = 99998, - EDITION_99999_TEST_ONLY = 99999, - EDITION_MAX = 2147483647 - } - - /** 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); - - /** FileDescriptorProto edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|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; - - /** FileDescriptorProto edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** - * 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 }; - - /** - * Gets the default type url for FileDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** 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 }; - - /** - * Gets the default type url for DescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - 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 }; - - /** - * Gets the default type url for ExtensionRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** 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 }; - - /** - * Gets the default type url for ReservedRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an ExtensionRangeOptions. */ - interface IExtensionRangeOptions { - - /** ExtensionRangeOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** ExtensionRangeOptions declaration */ - declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); - - /** ExtensionRangeOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** ExtensionRangeOptions verification */ - verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|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[]; - - /** ExtensionRangeOptions declaration. */ - public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; - - /** ExtensionRangeOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** ExtensionRangeOptions verification. */ - public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); - - /** - * 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 }; - - /** - * Gets the default type url for ExtensionRangeOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ExtensionRangeOptions { - - /** Properties of a Declaration. */ - interface IDeclaration { - - /** Declaration number */ - number?: (number|null); - - /** Declaration fullName */ - fullName?: (string|null); - - /** Declaration type */ - type?: (string|null); - - /** Declaration reserved */ - reserved?: (boolean|null); - - /** Declaration repeated */ - repeated?: (boolean|null); - } - - /** Represents a Declaration. */ - class Declaration implements IDeclaration { - - /** - * Constructs a new Declaration. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); - - /** Declaration number. */ - public number: number; - - /** Declaration fullName. */ - public fullName: string; - - /** Declaration type. */ - public type: string; - - /** Declaration reserved. */ - public reserved: boolean; - - /** Declaration repeated. */ - public repeated: boolean; - - /** - * Creates a new Declaration instance using the specified properties. - * @param [properties] Properties to set - * @returns Declaration instance - */ - public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @param message Declaration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @param message Declaration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Declaration message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Declaration - * @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.Declaration; - - /** - * Decodes a Declaration message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Declaration - * @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.Declaration; - - /** - * Verifies a Declaration 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 Declaration message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Declaration - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Creates a plain object from a Declaration message. Also converts values to other types if specified. - * @param message Declaration - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Declaration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Declaration - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** VerificationState enum. */ - enum VerificationState { - DECLARATION = 0, - UNVERIFIED = 1 - } - } - - /** 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 }; - - /** - * Gets the default type url for FieldDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - 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_REPEATED = 3, - LABEL_REQUIRED = 2 - } - } - - /** 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 }; - - /** - * Gets the default type url for OneofDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** 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 }; - - /** - * Gets the default type url for EnumDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - 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 }; - - /** - * Gets the default type url for EnumReservedRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** 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 }; - - /** - * Gets the default type url for EnumValueDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** 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 }; - - /** - * Gets the default type url for ServiceDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** 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 }; - - /** - * Gets the default type url for MethodDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** 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 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 features */ - features?: (google.protobuf.IFeatureSet|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 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 features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** 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 }; - - /** - * Gets the default type url for FileOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - 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 deprecatedLegacyJsonFieldConflicts */ - deprecatedLegacyJsonFieldConflicts?: (boolean|null); - - /** MessageOptions features */ - features?: (google.protobuf.IFeatureSet|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 deprecatedLegacyJsonFieldConflicts. */ - public deprecatedLegacyJsonFieldConflicts: boolean; - - /** MessageOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** 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 }; - - /** - * Gets the default type url for MessageOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** 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 unverifiedLazy */ - unverifiedLazy?: (boolean|null); - - /** FieldOptions deprecated */ - deprecated?: (boolean|null); - - /** FieldOptions weak */ - weak?: (boolean|null); - - /** FieldOptions debugRedact */ - debugRedact?: (boolean|null); - - /** FieldOptions retention */ - retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); - - /** FieldOptions targets */ - targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); - - /** FieldOptions editionDefaults */ - editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); - - /** FieldOptions features */ - features?: (google.protobuf.IFeatureSet|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 unverifiedLazy. */ - public unverifiedLazy: boolean; - - /** FieldOptions deprecated. */ - public deprecated: boolean; - - /** FieldOptions weak. */ - public weak: boolean; - - /** FieldOptions debugRedact. */ - public debugRedact: boolean; - - /** FieldOptions retention. */ - public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); - - /** FieldOptions targets. */ - public targets: google.protobuf.FieldOptions.OptionTargetType[]; - - /** FieldOptions editionDefaults. */ - public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; - - /** FieldOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** 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 }; - - /** - * Gets the default type url for FieldOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - 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 - } - - /** OptionRetention enum. */ - enum OptionRetention { - RETENTION_UNKNOWN = 0, - RETENTION_RUNTIME = 1, - RETENTION_SOURCE = 2 - } - - /** OptionTargetType enum. */ - enum OptionTargetType { - TARGET_TYPE_UNKNOWN = 0, - TARGET_TYPE_FILE = 1, - TARGET_TYPE_EXTENSION_RANGE = 2, - TARGET_TYPE_MESSAGE = 3, - TARGET_TYPE_FIELD = 4, - TARGET_TYPE_ONEOF = 5, - TARGET_TYPE_ENUM = 6, - TARGET_TYPE_ENUM_ENTRY = 7, - TARGET_TYPE_SERVICE = 8, - TARGET_TYPE_METHOD = 9 - } - - /** Properties of an EditionDefault. */ - interface IEditionDefault { - - /** EditionDefault edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** EditionDefault value */ - value?: (string|null); - } - - /** Represents an EditionDefault. */ - class EditionDefault implements IEditionDefault { - - /** - * Constructs a new EditionDefault. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); - - /** EditionDefault edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** EditionDefault value. */ - public value: string; - - /** - * Creates a new EditionDefault instance using the specified properties. - * @param [properties] Properties to set - * @returns EditionDefault instance - */ - public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; - - /** - * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @param message EditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @param message EditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EditionDefault message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EditionDefault - * @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.EditionDefault; - - /** - * Decodes an EditionDefault message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EditionDefault - * @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.EditionDefault; - - /** - * Verifies an EditionDefault 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 EditionDefault message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EditionDefault - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; - - /** - * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. - * @param message EditionDefault - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EditionDefault to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EditionDefault - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an OneofOptions. */ - interface IOneofOptions { - - /** OneofOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** 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 features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** 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 }; - - /** - * Gets the default type url for OneofOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumOptions. */ - interface IEnumOptions { - - /** EnumOptions allowAlias */ - allowAlias?: (boolean|null); - - /** EnumOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumOptions deprecatedLegacyJsonFieldConflicts */ - deprecatedLegacyJsonFieldConflicts?: (boolean|null); - - /** EnumOptions features */ - features?: (google.protobuf.IFeatureSet|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 deprecatedLegacyJsonFieldConflicts. */ - public deprecatedLegacyJsonFieldConflicts: boolean; - - /** EnumOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** 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 }; - - /** - * Gets the default type url for EnumOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumValueOptions. */ - interface IEnumValueOptions { - - /** EnumValueOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumValueOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** EnumValueOptions debugRedact */ - debugRedact?: (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 features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** EnumValueOptions debugRedact. */ - public debugRedact: 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 }; - - /** - * Gets the default type url for EnumValueOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ServiceOptions. */ - interface IServiceOptions { - - /** ServiceOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** 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); - - /** ServiceOptions .google.api.apiVersion */ - ".google.api.apiVersion"?: (string|null); - } - - /** Represents a ServiceOptions. */ - class ServiceOptions implements IServiceOptions { - - /** - * Constructs a new ServiceOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceOptions); - - /** ServiceOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** 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 }; - - /** - * Gets the default type url for ServiceOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** 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 features */ - features?: (google.protobuf.IFeatureSet|null); - - /** MethodOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** MethodOptions .google.api.http */ - ".google.api.http"?: (google.api.IHttpRule|null); - - /** MethodOptions .google.api.methodSignature */ - ".google.api.methodSignature"?: (string[]|null); - - /** MethodOptions .google.longrunning.operationInfo */ - ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|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 features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** 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 }; - - /** - * Gets the default type url for MethodOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - 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|Buffer|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|Buffer|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 }; - - /** - * Gets the default type url for UninterpretedOption - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - 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 }; - - /** - * Gets the default type url for NamePart - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a FeatureSet. */ - interface IFeatureSet { - - /** FeatureSet fieldPresence */ - fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); - - /** FeatureSet enumType */ - enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); - - /** FeatureSet repeatedFieldEncoding */ - repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); - - /** FeatureSet utf8Validation */ - utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); - - /** FeatureSet messageEncoding */ - messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); - - /** FeatureSet jsonFormat */ - jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); - } - - /** Represents a FeatureSet. */ - class FeatureSet implements IFeatureSet { - - /** - * Constructs a new FeatureSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFeatureSet); - - /** FeatureSet fieldPresence. */ - public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); - - /** FeatureSet enumType. */ - public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); - - /** FeatureSet repeatedFieldEncoding. */ - public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); - - /** FeatureSet utf8Validation. */ - public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); - - /** FeatureSet messageEncoding. */ - public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); - - /** FeatureSet jsonFormat. */ - public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); - - /** - * Creates a new FeatureSet instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSet instance - */ - public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; - - /** - * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @param message FeatureSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @param message FeatureSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSet - * @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.FeatureSet; - - /** - * Decodes a FeatureSet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSet - * @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.FeatureSet; - - /** - * Verifies a FeatureSet 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 FeatureSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSet - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; - - /** - * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. - * @param message FeatureSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FeatureSet { - - /** FieldPresence enum. */ - enum FieldPresence { - FIELD_PRESENCE_UNKNOWN = 0, - EXPLICIT = 1, - IMPLICIT = 2, - LEGACY_REQUIRED = 3 - } - - /** EnumType enum. */ - enum EnumType { - ENUM_TYPE_UNKNOWN = 0, - OPEN = 1, - CLOSED = 2 - } - - /** RepeatedFieldEncoding enum. */ - enum RepeatedFieldEncoding { - REPEATED_FIELD_ENCODING_UNKNOWN = 0, - PACKED = 1, - EXPANDED = 2 - } - - /** Utf8Validation enum. */ - enum Utf8Validation { - UTF8_VALIDATION_UNKNOWN = 0, - VERIFY = 2, - NONE = 3 - } - - /** MessageEncoding enum. */ - enum MessageEncoding { - MESSAGE_ENCODING_UNKNOWN = 0, - LENGTH_PREFIXED = 1, - DELIMITED = 2 - } - - /** JsonFormat enum. */ - enum JsonFormat { - JSON_FORMAT_UNKNOWN = 0, - ALLOW = 1, - LEGACY_BEST_EFFORT = 2 - } - } - - /** Properties of a FeatureSetDefaults. */ - interface IFeatureSetDefaults { - - /** FeatureSetDefaults defaults */ - defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); - - /** FeatureSetDefaults minimumEdition */ - minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** FeatureSetDefaults maximumEdition */ - maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - } - - /** Represents a FeatureSetDefaults. */ - class FeatureSetDefaults implements IFeatureSetDefaults { - - /** - * Constructs a new FeatureSetDefaults. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFeatureSetDefaults); - - /** FeatureSetDefaults defaults. */ - public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; - - /** FeatureSetDefaults minimumEdition. */ - public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** FeatureSetDefaults maximumEdition. */ - public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** - * Creates a new FeatureSetDefaults instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSetDefaults instance - */ - public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; - - /** - * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @param message FeatureSetDefaults message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @param message FeatureSetDefaults message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSetDefaults - * @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.FeatureSetDefaults; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSetDefaults - * @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.FeatureSetDefaults; - - /** - * Verifies a FeatureSetDefaults 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 FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSetDefaults - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; - - /** - * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. - * @param message FeatureSetDefaults - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSetDefaults to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSetDefaults - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FeatureSetDefaults { - - /** Properties of a FeatureSetEditionDefault. */ - interface IFeatureSetEditionDefault { - - /** FeatureSetEditionDefault edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** FeatureSetEditionDefault features */ - features?: (google.protobuf.IFeatureSet|null); - } - - /** Represents a FeatureSetEditionDefault. */ - class FeatureSetEditionDefault implements IFeatureSetEditionDefault { - - /** - * Constructs a new FeatureSetEditionDefault. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); - - /** FeatureSetEditionDefault edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** FeatureSetEditionDefault features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** - * Creates a new FeatureSetEditionDefault instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSetEditionDefault instance - */ - public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @param message FeatureSetEditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @param message FeatureSetEditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSetEditionDefault - * @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.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSetEditionDefault - * @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.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Verifies a FeatureSetEditionDefault 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 FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSetEditionDefault - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. - * @param message FeatureSetEditionDefault - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSetEditionDefault to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSetEditionDefault - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** 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 }; - - /** - * Gets the default type url for SourceCodeInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - 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 }; - - /** - * Gets the default type url for Location - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** 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 }; - - /** - * Gets the default type url for GeneratedCodeInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - 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); - - /** Annotation semantic */ - semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|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; - - /** Annotation semantic. */ - public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); - - /** - * 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 }; - - /** - * Gets the default type url for Annotation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Annotation { - - /** Semantic enum. */ - enum Semantic { - NONE = 0, - SET = 1, - ALIAS = 2 - } - } - } - - /** 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 }; - - /** - * Gets the default type url for FieldMask - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** 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 }; - - /** - * Gets the default type url for Timestamp - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Any. */ - interface IAny { - - /** Any type_url */ - type_url?: (string|null); - - /** Any value */ - value?: (Uint8Array|Buffer|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|Buffer|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 }; - - /** - * Gets the default type url for Any - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DoubleValue. */ - interface IDoubleValue { - - /** DoubleValue value */ - value?: (number|null); - } - - /** Represents a DoubleValue. */ - class DoubleValue implements IDoubleValue { - - /** - * Constructs a new DoubleValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDoubleValue); - - /** DoubleValue value. */ - public value: number; - - /** - * Creates a new DoubleValue instance using the specified properties. - * @param [properties] Properties to set - * @returns DoubleValue instance - */ - public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; - - /** - * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. - * @param message DoubleValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. - * @param message DoubleValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DoubleValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DoubleValue - * @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.DoubleValue; - - /** - * Decodes a DoubleValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DoubleValue - * @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.DoubleValue; - - /** - * Verifies a DoubleValue 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 DoubleValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DoubleValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DoubleValue; - - /** - * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. - * @param message DoubleValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DoubleValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DoubleValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DoubleValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FloatValue. */ - interface IFloatValue { - - /** FloatValue value */ - value?: (number|null); - } - - /** Represents a FloatValue. */ - class FloatValue implements IFloatValue { - - /** - * Constructs a new FloatValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFloatValue); - - /** FloatValue value. */ - public value: number; - - /** - * Creates a new FloatValue instance using the specified properties. - * @param [properties] Properties to set - * @returns FloatValue instance - */ - public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; - - /** - * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. - * @param message FloatValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. - * @param message FloatValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FloatValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FloatValue - * @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.FloatValue; - - /** - * Decodes a FloatValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FloatValue - * @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.FloatValue; - - /** - * Verifies a FloatValue 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 FloatValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FloatValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FloatValue; - - /** - * Creates a plain object from a FloatValue message. Also converts values to other types if specified. - * @param message FloatValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FloatValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FloatValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FloatValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Int64Value. */ - interface IInt64Value { - - /** Int64Value value */ - value?: (number|Long|string|null); - } - - /** Represents an Int64Value. */ - class Int64Value implements IInt64Value { - - /** - * Constructs a new Int64Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IInt64Value); - - /** Int64Value value. */ - public value: (number|Long|string); - - /** - * Creates a new Int64Value instance using the specified properties. - * @param [properties] Properties to set - * @returns Int64Value instance - */ - public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; - - /** - * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. - * @param message Int64Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. - * @param message Int64Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Int64Value message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Int64Value - * @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.Int64Value; - - /** - * Decodes an Int64Value message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Int64Value - * @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.Int64Value; - - /** - * Verifies an Int64Value 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 Int64Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Int64Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Int64Value; - - /** - * Creates a plain object from an Int64Value message. Also converts values to other types if specified. - * @param message Int64Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Int64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Int64Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Int64Value - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a UInt64Value. */ - interface IUInt64Value { - - /** UInt64Value value */ - value?: (number|Long|string|null); - } - - /** Represents a UInt64Value. */ - class UInt64Value implements IUInt64Value { - - /** - * Constructs a new UInt64Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUInt64Value); - - /** UInt64Value value. */ - public value: (number|Long|string); - - /** - * Creates a new UInt64Value instance using the specified properties. - * @param [properties] Properties to set - * @returns UInt64Value instance - */ - public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; - - /** - * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. - * @param message UInt64Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. - * @param message UInt64Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a UInt64Value message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UInt64Value - * @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.UInt64Value; - - /** - * Decodes a UInt64Value message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UInt64Value - * @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.UInt64Value; - - /** - * Verifies a UInt64Value 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 UInt64Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UInt64Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UInt64Value; - - /** - * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. - * @param message UInt64Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UInt64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UInt64Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UInt64Value - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Int32Value. */ - interface IInt32Value { - - /** Int32Value value */ - value?: (number|null); - } - - /** Represents an Int32Value. */ - class Int32Value implements IInt32Value { - - /** - * Constructs a new Int32Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IInt32Value); - - /** Int32Value value. */ - public value: number; - - /** - * Creates a new Int32Value instance using the specified properties. - * @param [properties] Properties to set - * @returns Int32Value instance - */ - public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; - - /** - * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. - * @param message Int32Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. - * @param message Int32Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Int32Value message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Int32Value - * @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.Int32Value; - - /** - * Decodes an Int32Value message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Int32Value - * @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.Int32Value; - - /** - * Verifies an Int32Value 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 Int32Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Int32Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Int32Value; - - /** - * Creates a plain object from an Int32Value message. Also converts values to other types if specified. - * @param message Int32Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Int32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Int32Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Int32Value - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a UInt32Value. */ - interface IUInt32Value { - - /** UInt32Value value */ - value?: (number|null); - } - - /** Represents a UInt32Value. */ - class UInt32Value implements IUInt32Value { - - /** - * Constructs a new UInt32Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUInt32Value); - - /** UInt32Value value. */ - public value: number; - - /** - * Creates a new UInt32Value instance using the specified properties. - * @param [properties] Properties to set - * @returns UInt32Value instance - */ - public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; - - /** - * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. - * @param message UInt32Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. - * @param message UInt32Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a UInt32Value message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UInt32Value - * @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.UInt32Value; - - /** - * Decodes a UInt32Value message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UInt32Value - * @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.UInt32Value; - - /** - * Verifies a UInt32Value 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 UInt32Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UInt32Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UInt32Value; - - /** - * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. - * @param message UInt32Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UInt32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UInt32Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UInt32Value - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BoolValue. */ - interface IBoolValue { - - /** BoolValue value */ - value?: (boolean|null); - } - - /** Represents a BoolValue. */ - class BoolValue implements IBoolValue { - - /** - * Constructs a new BoolValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IBoolValue); - - /** BoolValue value. */ - public value: boolean; - - /** - * Creates a new BoolValue instance using the specified properties. - * @param [properties] Properties to set - * @returns BoolValue instance - */ - public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; - - /** - * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. - * @param message BoolValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. - * @param message BoolValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BoolValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BoolValue - * @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.BoolValue; - - /** - * Decodes a BoolValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BoolValue - * @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.BoolValue; - - /** - * Verifies a BoolValue 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 BoolValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BoolValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.BoolValue; - - /** - * Creates a plain object from a BoolValue message. Also converts values to other types if specified. - * @param message BoolValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.BoolValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BoolValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BoolValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a StringValue. */ - interface IStringValue { - - /** StringValue value */ - value?: (string|null); - } - - /** Represents a StringValue. */ - class StringValue implements IStringValue { - - /** - * Constructs a new StringValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IStringValue); - - /** StringValue value. */ - public value: string; - - /** - * Creates a new StringValue instance using the specified properties. - * @param [properties] Properties to set - * @returns StringValue instance - */ - public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; - - /** - * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. - * @param message StringValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. - * @param message StringValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StringValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StringValue - * @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.StringValue; - - /** - * Decodes a StringValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StringValue - * @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.StringValue; - - /** - * Verifies a StringValue 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 StringValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StringValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.StringValue; - - /** - * Creates a plain object from a StringValue message. Also converts values to other types if specified. - * @param message StringValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.StringValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StringValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StringValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BytesValue. */ - interface IBytesValue { - - /** BytesValue value */ - value?: (Uint8Array|Buffer|string|null); - } - - /** Represents a BytesValue. */ - class BytesValue implements IBytesValue { - - /** - * Constructs a new BytesValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IBytesValue); - - /** BytesValue value. */ - public value: (Uint8Array|Buffer|string); - - /** - * Creates a new BytesValue instance using the specified properties. - * @param [properties] Properties to set - * @returns BytesValue instance - */ - public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; - - /** - * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. - * @param message BytesValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. - * @param message BytesValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BytesValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BytesValue - * @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.BytesValue; - - /** - * Decodes a BytesValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BytesValue - * @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.BytesValue; - - /** - * Verifies a BytesValue 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 BytesValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BytesValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.BytesValue; - - /** - * Creates a plain object from a BytesValue message. Also converts values to other types if specified. - * @param message BytesValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.BytesValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BytesValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BytesValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** 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 }; - - /** - * Gets the default type url for Duration - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** 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 }; - - /** - * Gets the default type url for Empty - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** 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 }; - - /** - * Gets the default type url for Status - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace type. */ - namespace type { - - /** Properties of a Color. */ - interface IColor { - - /** Color red */ - red?: (number|null); - - /** Color green */ - green?: (number|null); - - /** Color blue */ - blue?: (number|null); - - /** Color alpha */ - alpha?: (google.protobuf.IFloatValue|null); - } - - /** Represents a Color. */ - class Color implements IColor { - - /** - * Constructs a new Color. - * @param [properties] Properties to set - */ - constructor(properties?: google.type.IColor); - - /** Color red. */ - public red: number; - - /** Color green. */ - public green: number; - - /** Color blue. */ - public blue: number; - - /** Color alpha. */ - public alpha?: (google.protobuf.IFloatValue|null); - - /** - * Creates a new Color instance using the specified properties. - * @param [properties] Properties to set - * @returns Color instance - */ - public static create(properties?: google.type.IColor): google.type.Color; - - /** - * Encodes the specified Color message. Does not implicitly {@link google.type.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.type.IColor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Color message, length delimited. Does not implicitly {@link google.type.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.type.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.type.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.type.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.type.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.type.Color, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Color to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Color - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** 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 }; - - /** - * Gets the default type url for Date - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DateTime. */ - interface IDateTime { - - /** DateTime year */ - year?: (number|null); - - /** DateTime month */ - month?: (number|null); - - /** DateTime day */ - day?: (number|null); - - /** DateTime hours */ - hours?: (number|null); - - /** DateTime minutes */ - minutes?: (number|null); - - /** DateTime seconds */ - seconds?: (number|null); - - /** DateTime nanos */ - nanos?: (number|null); - - /** DateTime utcOffset */ - utcOffset?: (google.protobuf.IDuration|null); - - /** DateTime timeZone */ - timeZone?: (google.type.ITimeZone|null); - } - - /** Represents a DateTime. */ - class DateTime implements IDateTime { - - /** - * Constructs a new DateTime. - * @param [properties] Properties to set - */ - constructor(properties?: google.type.IDateTime); - - /** DateTime year. */ - public year: number; - - /** DateTime month. */ - public month: number; - - /** DateTime day. */ - public day: number; - - /** DateTime hours. */ - public hours: number; - - /** DateTime minutes. */ - public minutes: number; - - /** DateTime seconds. */ - public seconds: number; - - /** DateTime nanos. */ - public nanos: number; - - /** DateTime utcOffset. */ - public utcOffset?: (google.protobuf.IDuration|null); - - /** DateTime timeZone. */ - public timeZone?: (google.type.ITimeZone|null); - - /** DateTime timeOffset. */ - public timeOffset?: ("utcOffset"|"timeZone"); - - /** - * Creates a new DateTime instance using the specified properties. - * @param [properties] Properties to set - * @returns DateTime instance - */ - public static create(properties?: google.type.IDateTime): google.type.DateTime; - - /** - * Encodes the specified DateTime message. Does not implicitly {@link google.type.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.type.IDateTime, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DateTime message, length delimited. Does not implicitly {@link google.type.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.type.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.type.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.type.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.type.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.type.DateTime, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DateTime to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DateTime - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TimeZone. */ - interface ITimeZone { - - /** TimeZone id */ - id?: (string|null); - - /** TimeZone version */ - version?: (string|null); - } - - /** Represents a TimeZone. */ - class TimeZone implements ITimeZone { - - /** - * Constructs a new TimeZone. - * @param [properties] Properties to set - */ - constructor(properties?: google.type.ITimeZone); - - /** TimeZone id. */ - public id: string; - - /** TimeZone version. */ - public version: string; - - /** - * Creates a new TimeZone instance using the specified properties. - * @param [properties] Properties to set - * @returns TimeZone instance - */ - public static create(properties?: google.type.ITimeZone): google.type.TimeZone; - - /** - * Encodes the specified TimeZone message. Does not implicitly {@link google.type.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.type.ITimeZone, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TimeZone message, length delimited. Does not implicitly {@link google.type.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.type.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.type.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.type.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.type.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.type.TimeZone, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TimeZone to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TimeZone - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Money. */ - interface IMoney { - - /** Money currencyCode */ - currencyCode?: (string|null); - - /** Money units */ - units?: (number|Long|string|null); - - /** Money nanos */ - nanos?: (number|null); - } - - /** Represents a Money. */ - class Money implements IMoney { - - /** - * Constructs a new Money. - * @param [properties] Properties to set - */ - constructor(properties?: google.type.IMoney); - - /** Money currencyCode. */ - public currencyCode: string; - - /** Money units. */ - public units: (number|Long|string); - - /** Money nanos. */ - public nanos: number; - - /** - * Creates a new Money instance using the specified properties. - * @param [properties] Properties to set - * @returns Money instance - */ - public static create(properties?: google.type.IMoney): google.type.Money; - - /** - * Encodes the specified Money message. Does not implicitly {@link google.type.Money.verify|verify} messages. - * @param message Money message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.type.IMoney, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Money message, length delimited. Does not implicitly {@link google.type.Money.verify|verify} messages. - * @param message Money message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.type.IMoney, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Money message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Money - * @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.Money; - - /** - * Decodes a Money message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Money - * @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.Money; - - /** - * Verifies a Money 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 Money message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Money - */ - public static fromObject(object: { [k: string]: any }): google.type.Money; - - /** - * Creates a plain object from a Money message. Also converts values to other types if specified. - * @param message Money - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.type.Money, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Money to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Money - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PostalAddress. */ - interface IPostalAddress { - - /** PostalAddress revision */ - revision?: (number|null); - - /** PostalAddress regionCode */ - regionCode?: (string|null); - - /** PostalAddress languageCode */ - languageCode?: (string|null); - - /** PostalAddress postalCode */ - postalCode?: (string|null); - - /** PostalAddress sortingCode */ - sortingCode?: (string|null); - - /** PostalAddress administrativeArea */ - administrativeArea?: (string|null); - - /** PostalAddress locality */ - locality?: (string|null); - - /** PostalAddress sublocality */ - sublocality?: (string|null); - - /** PostalAddress addressLines */ - addressLines?: (string[]|null); - - /** PostalAddress recipients */ - recipients?: (string[]|null); - - /** PostalAddress organization */ - organization?: (string|null); - } - - /** Represents a PostalAddress. */ - class PostalAddress implements IPostalAddress { - - /** - * Constructs a new PostalAddress. - * @param [properties] Properties to set - */ - constructor(properties?: google.type.IPostalAddress); - - /** PostalAddress revision. */ - public revision: number; - - /** PostalAddress regionCode. */ - public regionCode: string; - - /** PostalAddress languageCode. */ - public languageCode: string; - - /** PostalAddress postalCode. */ - public postalCode: string; - - /** PostalAddress sortingCode. */ - public sortingCode: string; - - /** PostalAddress administrativeArea. */ - public administrativeArea: string; - - /** PostalAddress locality. */ - public locality: string; - - /** PostalAddress sublocality. */ - public sublocality: string; - - /** PostalAddress addressLines. */ - public addressLines: string[]; - - /** PostalAddress recipients. */ - public recipients: string[]; - - /** PostalAddress organization. */ - public organization: string; - - /** - * Creates a new PostalAddress instance using the specified properties. - * @param [properties] Properties to set - * @returns PostalAddress instance - */ - public static create(properties?: google.type.IPostalAddress): google.type.PostalAddress; - - /** - * Encodes the specified PostalAddress message. Does not implicitly {@link google.type.PostalAddress.verify|verify} messages. - * @param message PostalAddress message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.type.IPostalAddress, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PostalAddress message, length delimited. Does not implicitly {@link google.type.PostalAddress.verify|verify} messages. - * @param message PostalAddress message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.type.IPostalAddress, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PostalAddress message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PostalAddress - * @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.PostalAddress; - - /** - * Decodes a PostalAddress message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PostalAddress - * @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.PostalAddress; - - /** - * Verifies a PostalAddress 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 PostalAddress message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PostalAddress - */ - public static fromObject(object: { [k: string]: any }): google.type.PostalAddress; - - /** - * Creates a plain object from a PostalAddress message. Also converts values to other types if specified. - * @param message PostalAddress - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.type.PostalAddress, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PostalAddress to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PostalAddress - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Interval. */ - interface IInterval { - - /** Interval startTime */ - startTime?: (google.protobuf.ITimestamp|null); - - /** Interval endTime */ - endTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents an Interval. */ - class Interval implements IInterval { - - /** - * Constructs a new Interval. - * @param [properties] Properties to set - */ - constructor(properties?: google.type.IInterval); - - /** Interval startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); - - /** Interval endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new Interval instance using the specified properties. - * @param [properties] Properties to set - * @returns Interval instance - */ - public static create(properties?: google.type.IInterval): google.type.Interval; - - /** - * Encodes the specified Interval message. Does not implicitly {@link google.type.Interval.verify|verify} messages. - * @param message Interval message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.type.IInterval, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Interval message, length delimited. Does not implicitly {@link google.type.Interval.verify|verify} messages. - * @param message Interval message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.type.IInterval, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Interval message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Interval - * @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.Interval; - - /** - * Decodes an Interval message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Interval - * @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.Interval; - - /** - * Verifies an Interval 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 Interval message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Interval - */ - public static fromObject(object: { [k: string]: any }): google.type.Interval; - - /** - * Creates a plain object from an Interval message. Also converts values to other types if specified. - * @param message Interval - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.type.Interval, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Interval to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Interval - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Expr. */ - interface IExpr { - - /** Expr expression */ - expression?: (string|null); - - /** Expr title */ - title?: (string|null); - - /** Expr description */ - description?: (string|null); - - /** Expr location */ - location?: (string|null); - } - - /** Represents an Expr. */ - class Expr implements IExpr { - - /** - * Constructs a new Expr. - * @param [properties] Properties to set - */ - constructor(properties?: google.type.IExpr); - - /** Expr expression. */ - public expression: string; - - /** Expr title. */ - public title: string; - - /** Expr description. */ - public description: string; - - /** Expr location. */ - public location: string; - - /** - * Creates a new Expr instance using the specified properties. - * @param [properties] Properties to set - * @returns Expr instance - */ - public static create(properties?: google.type.IExpr): google.type.Expr; - - /** - * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. - * @param message Expr message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. - * @param message Expr message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Expr message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Expr - * @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.Expr; - - /** - * Decodes an Expr message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Expr - * @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.Expr; - - /** - * Verifies an Expr 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 Expr message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Expr - */ - public static fromObject(object: { [k: string]: any }): google.type.Expr; - - /** - * Creates a plain object from an Expr message. Also converts values to other types if specified. - * @param message Expr - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.type.Expr, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Expr to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Expr - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace iam. */ - namespace iam { - - /** Namespace v1. */ - namespace v1 { - - /** Properties of a Policy. */ - interface IPolicy { - - /** Policy version */ - version?: (number|null); - - /** Policy bindings */ - bindings?: (google.iam.v1.IBinding[]|null); - - /** Policy auditConfigs */ - auditConfigs?: (google.iam.v1.IAuditConfig[]|null); - - /** Policy etag */ - etag?: (Uint8Array|Buffer|string|null); - } - - /** Represents a Policy. */ - class Policy implements IPolicy { - - /** - * Constructs a new Policy. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IPolicy); - - /** Policy version. */ - public version: number; - - /** Policy bindings. */ - public bindings: google.iam.v1.IBinding[]; - - /** Policy auditConfigs. */ - public auditConfigs: google.iam.v1.IAuditConfig[]; - - /** Policy etag. */ - public etag: (Uint8Array|Buffer|string); - - /** - * Creates a new Policy instance using the specified properties. - * @param [properties] Properties to set - * @returns Policy instance - */ - public static create(properties?: google.iam.v1.IPolicy): google.iam.v1.Policy; - - /** - * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. - * @param message Policy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. - * @param message Policy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Policy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Policy - * @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.iam.v1.Policy; - - /** - * Decodes a Policy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Policy - * @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.iam.v1.Policy; - - /** - * Verifies a Policy 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 Policy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Policy - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.Policy; - - /** - * Creates a plain object from a Policy message. Also converts values to other types if specified. - * @param message Policy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.Policy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Policy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Policy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Binding. */ - interface IBinding { - - /** Binding role */ - role?: (string|null); - - /** Binding members */ - members?: (string[]|null); - - /** Binding condition */ - condition?: (google.type.IExpr|null); - } - - /** Represents a Binding. */ - class Binding implements IBinding { - - /** - * Constructs a new Binding. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IBinding); - - /** Binding role. */ - public role: string; - - /** Binding members. */ - public members: string[]; - - /** Binding condition. */ - public condition?: (google.type.IExpr|null); - - /** - * Creates a new Binding instance using the specified properties. - * @param [properties] Properties to set - * @returns Binding instance - */ - public static create(properties?: google.iam.v1.IBinding): google.iam.v1.Binding; - - /** - * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. - * @param message Binding message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. - * @param message Binding message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Binding message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Binding - * @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.iam.v1.Binding; - - /** - * Decodes a Binding message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Binding - * @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.iam.v1.Binding; - - /** - * Verifies a Binding 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 Binding message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Binding - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.Binding; - - /** - * Creates a plain object from a Binding message. Also converts values to other types if specified. - * @param message Binding - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.Binding, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Binding to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Binding - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AuditConfig. */ - interface IAuditConfig { - - /** AuditConfig service */ - service?: (string|null); - - /** AuditConfig auditLogConfigs */ - auditLogConfigs?: (google.iam.v1.IAuditLogConfig[]|null); - } - - /** Represents an AuditConfig. */ - class AuditConfig implements IAuditConfig { - - /** - * Constructs a new AuditConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IAuditConfig); - - /** AuditConfig service. */ - public service: string; - - /** AuditConfig auditLogConfigs. */ - public auditLogConfigs: google.iam.v1.IAuditLogConfig[]; - - /** - * Creates a new AuditConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns AuditConfig instance - */ - public static create(properties?: google.iam.v1.IAuditConfig): google.iam.v1.AuditConfig; - - /** - * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. - * @param message AuditConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. - * @param message AuditConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AuditConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AuditConfig - * @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.iam.v1.AuditConfig; - - /** - * Decodes an AuditConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AuditConfig - * @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.iam.v1.AuditConfig; - - /** - * Verifies an AuditConfig 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 AuditConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AuditConfig - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfig; - - /** - * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. - * @param message AuditConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.AuditConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AuditConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AuditConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AuditLogConfig. */ - interface IAuditLogConfig { - - /** AuditLogConfig logType */ - logType?: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType|null); - - /** AuditLogConfig exemptedMembers */ - exemptedMembers?: (string[]|null); - } - - /** Represents an AuditLogConfig. */ - class AuditLogConfig implements IAuditLogConfig { - - /** - * Constructs a new AuditLogConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IAuditLogConfig); - - /** AuditLogConfig logType. */ - public logType: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType); - - /** AuditLogConfig exemptedMembers. */ - public exemptedMembers: string[]; - - /** - * Creates a new AuditLogConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns AuditLogConfig instance - */ - public static create(properties?: google.iam.v1.IAuditLogConfig): google.iam.v1.AuditLogConfig; - - /** - * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. - * @param message AuditLogConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. - * @param message AuditLogConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AuditLogConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AuditLogConfig - * @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.iam.v1.AuditLogConfig; - - /** - * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AuditLogConfig - * @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.iam.v1.AuditLogConfig; - - /** - * Verifies an AuditLogConfig 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 AuditLogConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AuditLogConfig - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditLogConfig; - - /** - * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. - * @param message AuditLogConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.AuditLogConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AuditLogConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AuditLogConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace AuditLogConfig { - - /** LogType enum. */ - enum LogType { - LOG_TYPE_UNSPECIFIED = 0, - ADMIN_READ = 1, - DATA_WRITE = 2, - DATA_READ = 3 - } - } - - /** Properties of a PolicyDelta. */ - interface IPolicyDelta { - - /** PolicyDelta bindingDeltas */ - bindingDeltas?: (google.iam.v1.IBindingDelta[]|null); - - /** PolicyDelta auditConfigDeltas */ - auditConfigDeltas?: (google.iam.v1.IAuditConfigDelta[]|null); - } - - /** Represents a PolicyDelta. */ - class PolicyDelta implements IPolicyDelta { - - /** - * Constructs a new PolicyDelta. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IPolicyDelta); - - /** PolicyDelta bindingDeltas. */ - public bindingDeltas: google.iam.v1.IBindingDelta[]; - - /** PolicyDelta auditConfigDeltas. */ - public auditConfigDeltas: google.iam.v1.IAuditConfigDelta[]; - - /** - * Creates a new PolicyDelta instance using the specified properties. - * @param [properties] Properties to set - * @returns PolicyDelta instance - */ - public static create(properties?: google.iam.v1.IPolicyDelta): google.iam.v1.PolicyDelta; - - /** - * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. - * @param message PolicyDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. - * @param message PolicyDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PolicyDelta message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PolicyDelta - * @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.iam.v1.PolicyDelta; - - /** - * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PolicyDelta - * @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.iam.v1.PolicyDelta; - - /** - * Verifies a PolicyDelta 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 PolicyDelta message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PolicyDelta - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.PolicyDelta; - - /** - * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. - * @param message PolicyDelta - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.PolicyDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PolicyDelta to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PolicyDelta - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BindingDelta. */ - interface IBindingDelta { - - /** BindingDelta action */ - action?: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action|null); - - /** BindingDelta role */ - role?: (string|null); - - /** BindingDelta member */ - member?: (string|null); - - /** BindingDelta condition */ - condition?: (google.type.IExpr|null); - } - - /** Represents a BindingDelta. */ - class BindingDelta implements IBindingDelta { - - /** - * Constructs a new BindingDelta. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IBindingDelta); - - /** BindingDelta action. */ - public action: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action); - - /** BindingDelta role. */ - public role: string; - - /** BindingDelta member. */ - public member: string; - - /** BindingDelta condition. */ - public condition?: (google.type.IExpr|null); - - /** - * Creates a new BindingDelta instance using the specified properties. - * @param [properties] Properties to set - * @returns BindingDelta instance - */ - public static create(properties?: google.iam.v1.IBindingDelta): google.iam.v1.BindingDelta; - - /** - * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. - * @param message BindingDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. - * @param message BindingDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BindingDelta message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BindingDelta - * @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.iam.v1.BindingDelta; - - /** - * Decodes a BindingDelta message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BindingDelta - * @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.iam.v1.BindingDelta; - - /** - * Verifies a BindingDelta 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 BindingDelta message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BindingDelta - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.BindingDelta; - - /** - * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. - * @param message BindingDelta - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.BindingDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BindingDelta to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BindingDelta - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace BindingDelta { - - /** Action enum. */ - enum Action { - ACTION_UNSPECIFIED = 0, - ADD = 1, - REMOVE = 2 - } - } - - /** Properties of an AuditConfigDelta. */ - interface IAuditConfigDelta { - - /** AuditConfigDelta action */ - action?: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action|null); - - /** AuditConfigDelta service */ - service?: (string|null); - - /** AuditConfigDelta exemptedMember */ - exemptedMember?: (string|null); - - /** AuditConfigDelta logType */ - logType?: (string|null); - } - - /** Represents an AuditConfigDelta. */ - class AuditConfigDelta implements IAuditConfigDelta { - - /** - * Constructs a new AuditConfigDelta. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IAuditConfigDelta); - - /** AuditConfigDelta action. */ - public action: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action); - - /** AuditConfigDelta service. */ - public service: string; - - /** AuditConfigDelta exemptedMember. */ - public exemptedMember: string; - - /** AuditConfigDelta logType. */ - public logType: string; - - /** - * Creates a new AuditConfigDelta instance using the specified properties. - * @param [properties] Properties to set - * @returns AuditConfigDelta instance - */ - public static create(properties?: google.iam.v1.IAuditConfigDelta): google.iam.v1.AuditConfigDelta; - - /** - * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. - * @param message AuditConfigDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. - * @param message AuditConfigDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AuditConfigDelta message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AuditConfigDelta - * @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.iam.v1.AuditConfigDelta; - - /** - * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AuditConfigDelta - * @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.iam.v1.AuditConfigDelta; - - /** - * Verifies an AuditConfigDelta 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 AuditConfigDelta message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AuditConfigDelta - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfigDelta; - - /** - * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. - * @param message AuditConfigDelta - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.AuditConfigDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AuditConfigDelta to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AuditConfigDelta - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace AuditConfigDelta { - - /** Action enum. */ - enum Action { - ACTION_UNSPECIFIED = 0, - ADD = 1, - REMOVE = 2 - } - } - } - } - - /** Namespace longrunning. */ - namespace longrunning { - - /** Represents an Operations */ - class Operations extends $protobuf.rpc.Service { - - /** - * Constructs a new Operations 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 Operations 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): Operations; - - /** - * Calls ListOperations. - * @param request ListOperationsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListOperationsResponse - */ - public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; - - /** - * Calls ListOperations. - * @param request ListOperationsRequest message or plain object - * @returns Promise - */ - public listOperations(request: google.longrunning.IListOperationsRequest): Promise; - - /** - * Calls GetOperation. - * @param request GetOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; - - /** - * Calls GetOperation. - * @param request GetOperationRequest message or plain object - * @returns Promise - */ - public getOperation(request: google.longrunning.IGetOperationRequest): Promise; - - /** - * Calls DeleteOperation. - * @param request DeleteOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; - - /** - * Calls DeleteOperation. - * @param request DeleteOperationRequest message or plain object - * @returns Promise - */ - public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; - - /** - * Calls CancelOperation. - * @param request CancelOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; - - /** - * Calls CancelOperation. - * @param request CancelOperationRequest message or plain object - * @returns Promise - */ - public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; - - /** - * Calls WaitOperation. - * @param request WaitOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; - - /** - * Calls WaitOperation. - * @param request WaitOperationRequest message or plain object - * @returns Promise - */ - public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; - } - - namespace Operations { - - /** - * Callback as used by {@link google.longrunning.Operations|listOperations}. - * @param error Error, if any - * @param [response] ListOperationsResponse - */ - type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|getOperation}. - * @param error Error, if any - * @param [response] Operation - */ - type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|deleteOperation}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|cancelOperation}. - * @param error Error, if any - * @param [response] Empty - */ - type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|waitOperation}. - * @param error Error, if any - * @param [response] Operation - */ - type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - } - - /** Properties of an Operation. */ - interface IOperation { - - /** Operation name */ - name?: (string|null); - - /** Operation metadata */ - metadata?: (google.protobuf.IAny|null); - - /** Operation done */ - done?: (boolean|null); - - /** Operation error */ - error?: (google.rpc.IStatus|null); - - /** Operation response */ - response?: (google.protobuf.IAny|null); - } - - /** Represents an Operation. */ - class Operation implements IOperation { - - /** - * Constructs a new Operation. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IOperation); - - /** Operation name. */ - public name: string; - - /** Operation metadata. */ - public metadata?: (google.protobuf.IAny|null); - - /** Operation done. */ - public done: boolean; - - /** Operation error. */ - public error?: (google.rpc.IStatus|null); - - /** Operation response. */ - public response?: (google.protobuf.IAny|null); - - /** Operation result. */ - public result?: ("error"|"response"); - - /** - * Creates a new Operation instance using the specified properties. - * @param [properties] Properties to set - * @returns Operation instance - */ - public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; - - /** - * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @param message Operation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @param message Operation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Operation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Operation - * @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.longrunning.Operation; - - /** - * Decodes an Operation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Operation - * @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.longrunning.Operation; - - /** - * Verifies an Operation 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 Operation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Operation - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; - - /** - * Creates a plain object from an Operation message. Also converts values to other types if specified. - * @param message Operation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Operation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Operation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetOperationRequest. */ - interface IGetOperationRequest { - - /** GetOperationRequest name */ - name?: (string|null); - } - - /** Represents a GetOperationRequest. */ - class GetOperationRequest implements IGetOperationRequest { - - /** - * Constructs a new GetOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IGetOperationRequest); - - /** GetOperationRequest name. */ - public name: string; - - /** - * Creates a new GetOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetOperationRequest instance - */ - public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; - - /** - * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @param message GetOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @param message GetOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetOperationRequest - * @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.longrunning.GetOperationRequest; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetOperationRequest - * @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.longrunning.GetOperationRequest; - - /** - * Verifies a GetOperationRequest 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 GetOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; - - /** - * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. - * @param message GetOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListOperationsRequest. */ - interface IListOperationsRequest { - - /** ListOperationsRequest name */ - name?: (string|null); - - /** ListOperationsRequest filter */ - filter?: (string|null); - - /** ListOperationsRequest pageSize */ - pageSize?: (number|null); - - /** ListOperationsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListOperationsRequest. */ - class ListOperationsRequest implements IListOperationsRequest { - - /** - * Constructs a new ListOperationsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IListOperationsRequest); - - /** ListOperationsRequest name. */ - public name: string; - - /** ListOperationsRequest filter. */ - public filter: string; - - /** ListOperationsRequest pageSize. */ - public pageSize: number; - - /** ListOperationsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListOperationsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListOperationsRequest instance - */ - public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; - - /** - * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @param message ListOperationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @param message ListOperationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListOperationsRequest - * @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.longrunning.ListOperationsRequest; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListOperationsRequest - * @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.longrunning.ListOperationsRequest; - - /** - * Verifies a ListOperationsRequest 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 ListOperationsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListOperationsRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; - - /** - * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. - * @param message ListOperationsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListOperationsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListOperationsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListOperationsResponse. */ - interface IListOperationsResponse { - - /** ListOperationsResponse operations */ - operations?: (google.longrunning.IOperation[]|null); - - /** ListOperationsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListOperationsResponse. */ - class ListOperationsResponse implements IListOperationsResponse { - - /** - * Constructs a new ListOperationsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IListOperationsResponse); - - /** ListOperationsResponse operations. */ - public operations: google.longrunning.IOperation[]; - - /** ListOperationsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListOperationsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListOperationsResponse instance - */ - public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; - - /** - * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @param message ListOperationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @param message ListOperationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListOperationsResponse - * @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.longrunning.ListOperationsResponse; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListOperationsResponse - * @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.longrunning.ListOperationsResponse; - - /** - * Verifies a ListOperationsResponse 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 ListOperationsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListOperationsResponse - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; - - /** - * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. - * @param message ListOperationsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListOperationsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListOperationsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CancelOperationRequest. */ - interface ICancelOperationRequest { - - /** CancelOperationRequest name */ - name?: (string|null); - } - - /** Represents a CancelOperationRequest. */ - class CancelOperationRequest implements ICancelOperationRequest { - - /** - * Constructs a new CancelOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.ICancelOperationRequest); - - /** CancelOperationRequest name. */ - public name: string; - - /** - * Creates a new CancelOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CancelOperationRequest instance - */ - public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; - - /** - * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @param message CancelOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @param message CancelOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CancelOperationRequest - * @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.longrunning.CancelOperationRequest; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CancelOperationRequest - * @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.longrunning.CancelOperationRequest; - - /** - * Verifies a CancelOperationRequest 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 CancelOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CancelOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; - - /** - * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. - * @param message CancelOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CancelOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CancelOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteOperationRequest. */ - interface IDeleteOperationRequest { - - /** DeleteOperationRequest name */ - name?: (string|null); - } - - /** Represents a DeleteOperationRequest. */ - class DeleteOperationRequest implements IDeleteOperationRequest { - - /** - * Constructs a new DeleteOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IDeleteOperationRequest); - - /** DeleteOperationRequest name. */ - public name: string; - - /** - * Creates a new DeleteOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteOperationRequest instance - */ - public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; - - /** - * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @param message DeleteOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @param message DeleteOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteOperationRequest - * @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.longrunning.DeleteOperationRequest; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteOperationRequest - * @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.longrunning.DeleteOperationRequest; - - /** - * Verifies a DeleteOperationRequest 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 DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; - - /** - * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. - * @param message DeleteOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a WaitOperationRequest. */ - interface IWaitOperationRequest { - - /** WaitOperationRequest name */ - name?: (string|null); - - /** WaitOperationRequest timeout */ - timeout?: (google.protobuf.IDuration|null); - } - - /** Represents a WaitOperationRequest. */ - class WaitOperationRequest implements IWaitOperationRequest { - - /** - * Constructs a new WaitOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IWaitOperationRequest); - - /** WaitOperationRequest name. */ - public name: string; - - /** WaitOperationRequest timeout. */ - public timeout?: (google.protobuf.IDuration|null); - - /** - * Creates a new WaitOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns WaitOperationRequest instance - */ - public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; - - /** - * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @param message WaitOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @param message WaitOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns WaitOperationRequest - * @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.longrunning.WaitOperationRequest; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WaitOperationRequest - * @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.longrunning.WaitOperationRequest; - - /** - * Verifies a WaitOperationRequest 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 WaitOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WaitOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; - - /** - * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. - * @param message WaitOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WaitOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for WaitOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an OperationInfo. */ - interface IOperationInfo { - - /** OperationInfo responseType */ - responseType?: (string|null); - - /** OperationInfo metadataType */ - metadataType?: (string|null); - } - - /** Represents an OperationInfo. */ - class OperationInfo implements IOperationInfo { - - /** - * Constructs a new OperationInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IOperationInfo); - - /** OperationInfo responseType. */ - public responseType: string; - - /** OperationInfo metadataType. */ - public metadataType: string; - - /** - * Creates a new OperationInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns OperationInfo instance - */ - public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; - - /** - * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @param message OperationInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @param message OperationInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OperationInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OperationInfo - * @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.longrunning.OperationInfo; - - /** - * Decodes an OperationInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OperationInfo - * @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.longrunning.OperationInfo; - - /** - * Verifies an OperationInfo 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 OperationInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OperationInfo - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; - - /** - * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. - * @param message OperationInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OperationInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OperationInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } -} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/protos.js b/owl-bot-staging/google-cloud-contentwarehouse/protos/protos.js deleted file mode 100644 index e7b4bd21f14..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/protos/protos.js +++ /dev/null @@ -1,78298 +0,0 @@ -// Copyright 2026 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/build/src/protobuf").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_contentwarehouse_protos || ($protobuf.roots._google_cloud_contentwarehouse_protos = {}); - - $root.google = (function() { - - /** - * Namespace google. - * @exports google - * @namespace - */ - var google = {}; - - google.cloud = (function() { - - /** - * Namespace cloud. - * @memberof google - * @namespace - */ - var cloud = {}; - - cloud.contentwarehouse = (function() { - - /** - * Namespace contentwarehouse. - * @memberof google.cloud - * @namespace - */ - var contentwarehouse = {}; - - contentwarehouse.v1 = (function() { - - /** - * Namespace v1. - * @memberof google.cloud.contentwarehouse - * @namespace - */ - var v1 = {}; - - v1.CreateDocumentMetadata = (function() { - - /** - * Properties of a CreateDocumentMetadata. - * @memberof google.cloud.contentwarehouse.v1 - * @interface ICreateDocumentMetadata - */ - - /** - * Constructs a new CreateDocumentMetadata. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a CreateDocumentMetadata. - * @implements ICreateDocumentMetadata - * @constructor - * @param {google.cloud.contentwarehouse.v1.ICreateDocumentMetadata=} [properties] Properties to set - */ - function CreateDocumentMetadata(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 CreateDocumentMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentMetadata - * @static - * @param {google.cloud.contentwarehouse.v1.ICreateDocumentMetadata=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.CreateDocumentMetadata} CreateDocumentMetadata instance - */ - CreateDocumentMetadata.create = function create(properties) { - return new CreateDocumentMetadata(properties); - }; - - /** - * Encodes the specified CreateDocumentMetadata message. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateDocumentMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentMetadata - * @static - * @param {google.cloud.contentwarehouse.v1.ICreateDocumentMetadata} message CreateDocumentMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateDocumentMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified CreateDocumentMetadata message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateDocumentMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentMetadata - * @static - * @param {google.cloud.contentwarehouse.v1.ICreateDocumentMetadata} message CreateDocumentMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateDocumentMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateDocumentMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.CreateDocumentMetadata} CreateDocumentMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateDocumentMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.CreateDocumentMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateDocumentMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.CreateDocumentMetadata} CreateDocumentMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateDocumentMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateDocumentMetadata message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateDocumentMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a CreateDocumentMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.CreateDocumentMetadata} CreateDocumentMetadata - */ - CreateDocumentMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.CreateDocumentMetadata) - return object; - return new $root.google.cloud.contentwarehouse.v1.CreateDocumentMetadata(); - }; - - /** - * Creates a plain object from a CreateDocumentMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentMetadata - * @static - * @param {google.cloud.contentwarehouse.v1.CreateDocumentMetadata} message CreateDocumentMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateDocumentMetadata.toObject = function toObject() { - return {}; - }; - - /** - * Converts this CreateDocumentMetadata to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentMetadata - * @instance - * @returns {Object.} JSON object - */ - CreateDocumentMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateDocumentMetadata - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateDocumentMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.CreateDocumentMetadata"; - }; - - return CreateDocumentMetadata; - })(); - - v1.UpdateDocumentMetadata = (function() { - - /** - * Properties of an UpdateDocumentMetadata. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IUpdateDocumentMetadata - */ - - /** - * Constructs a new UpdateDocumentMetadata. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents an UpdateDocumentMetadata. - * @implements IUpdateDocumentMetadata - * @constructor - * @param {google.cloud.contentwarehouse.v1.IUpdateDocumentMetadata=} [properties] Properties to set - */ - function UpdateDocumentMetadata(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 UpdateDocumentMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentMetadata - * @static - * @param {google.cloud.contentwarehouse.v1.IUpdateDocumentMetadata=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.UpdateDocumentMetadata} UpdateDocumentMetadata instance - */ - UpdateDocumentMetadata.create = function create(properties) { - return new UpdateDocumentMetadata(properties); - }; - - /** - * Encodes the specified UpdateDocumentMetadata message. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateDocumentMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentMetadata - * @static - * @param {google.cloud.contentwarehouse.v1.IUpdateDocumentMetadata} message UpdateDocumentMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateDocumentMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified UpdateDocumentMetadata message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateDocumentMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentMetadata - * @static - * @param {google.cloud.contentwarehouse.v1.IUpdateDocumentMetadata} message UpdateDocumentMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateDocumentMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateDocumentMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.UpdateDocumentMetadata} UpdateDocumentMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateDocumentMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.UpdateDocumentMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateDocumentMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.UpdateDocumentMetadata} UpdateDocumentMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateDocumentMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateDocumentMetadata message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateDocumentMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates an UpdateDocumentMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.UpdateDocumentMetadata} UpdateDocumentMetadata - */ - UpdateDocumentMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.UpdateDocumentMetadata) - return object; - return new $root.google.cloud.contentwarehouse.v1.UpdateDocumentMetadata(); - }; - - /** - * Creates a plain object from an UpdateDocumentMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentMetadata - * @static - * @param {google.cloud.contentwarehouse.v1.UpdateDocumentMetadata} message UpdateDocumentMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateDocumentMetadata.toObject = function toObject() { - return {}; - }; - - /** - * Converts this UpdateDocumentMetadata to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentMetadata - * @instance - * @returns {Object.} JSON object - */ - UpdateDocumentMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateDocumentMetadata - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateDocumentMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.UpdateDocumentMetadata"; - }; - - return UpdateDocumentMetadata; - })(); - - v1.RequestMetadata = (function() { - - /** - * Properties of a RequestMetadata. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IRequestMetadata - * @property {google.cloud.contentwarehouse.v1.IUserInfo|null} [userInfo] RequestMetadata userInfo - */ - - /** - * Constructs a new RequestMetadata. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a RequestMetadata. - * @implements IRequestMetadata - * @constructor - * @param {google.cloud.contentwarehouse.v1.IRequestMetadata=} [properties] Properties to set - */ - function RequestMetadata(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]]; - } - - /** - * RequestMetadata userInfo. - * @member {google.cloud.contentwarehouse.v1.IUserInfo|null|undefined} userInfo - * @memberof google.cloud.contentwarehouse.v1.RequestMetadata - * @instance - */ - RequestMetadata.prototype.userInfo = null; - - /** - * Creates a new RequestMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.RequestMetadata - * @static - * @param {google.cloud.contentwarehouse.v1.IRequestMetadata=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.RequestMetadata} RequestMetadata instance - */ - RequestMetadata.create = function create(properties) { - return new RequestMetadata(properties); - }; - - /** - * Encodes the specified RequestMetadata message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RequestMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.RequestMetadata - * @static - * @param {google.cloud.contentwarehouse.v1.IRequestMetadata} message RequestMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RequestMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.userInfo != null && Object.hasOwnProperty.call(message, "userInfo")) - $root.google.cloud.contentwarehouse.v1.UserInfo.encode(message.userInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RequestMetadata message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RequestMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.RequestMetadata - * @static - * @param {google.cloud.contentwarehouse.v1.IRequestMetadata} message RequestMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RequestMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RequestMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.RequestMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.RequestMetadata} RequestMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RequestMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.RequestMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.userInfo = $root.google.cloud.contentwarehouse.v1.UserInfo.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RequestMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.RequestMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.RequestMetadata} RequestMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RequestMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RequestMetadata message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.RequestMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RequestMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.userInfo != null && message.hasOwnProperty("userInfo")) { - var error = $root.google.cloud.contentwarehouse.v1.UserInfo.verify(message.userInfo); - if (error) - return "userInfo." + error; - } - return null; - }; - - /** - * Creates a RequestMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.RequestMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.RequestMetadata} RequestMetadata - */ - RequestMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.RequestMetadata) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.RequestMetadata(); - if (object.userInfo != null) { - if (typeof object.userInfo !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.RequestMetadata.userInfo: object expected"); - message.userInfo = $root.google.cloud.contentwarehouse.v1.UserInfo.fromObject(object.userInfo); - } - return message; - }; - - /** - * Creates a plain object from a RequestMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.RequestMetadata - * @static - * @param {google.cloud.contentwarehouse.v1.RequestMetadata} message RequestMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RequestMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.userInfo = null; - if (message.userInfo != null && message.hasOwnProperty("userInfo")) - object.userInfo = $root.google.cloud.contentwarehouse.v1.UserInfo.toObject(message.userInfo, options); - return object; - }; - - /** - * Converts this RequestMetadata to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.RequestMetadata - * @instance - * @returns {Object.} JSON object - */ - RequestMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RequestMetadata - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.RequestMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RequestMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.RequestMetadata"; - }; - - return RequestMetadata; - })(); - - v1.ResponseMetadata = (function() { - - /** - * Properties of a ResponseMetadata. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IResponseMetadata - * @property {string|null} [requestId] ResponseMetadata requestId - */ - - /** - * Constructs a new ResponseMetadata. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a ResponseMetadata. - * @implements IResponseMetadata - * @constructor - * @param {google.cloud.contentwarehouse.v1.IResponseMetadata=} [properties] Properties to set - */ - function ResponseMetadata(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]]; - } - - /** - * ResponseMetadata requestId. - * @member {string} requestId - * @memberof google.cloud.contentwarehouse.v1.ResponseMetadata - * @instance - */ - ResponseMetadata.prototype.requestId = ""; - - /** - * Creates a new ResponseMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.ResponseMetadata - * @static - * @param {google.cloud.contentwarehouse.v1.IResponseMetadata=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.ResponseMetadata} ResponseMetadata instance - */ - ResponseMetadata.create = function create(properties) { - return new ResponseMetadata(properties); - }; - - /** - * Encodes the specified ResponseMetadata message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ResponseMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.ResponseMetadata - * @static - * @param {google.cloud.contentwarehouse.v1.IResponseMetadata} message ResponseMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResponseMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified ResponseMetadata message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ResponseMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.ResponseMetadata - * @static - * @param {google.cloud.contentwarehouse.v1.IResponseMetadata} message ResponseMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResponseMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResponseMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.ResponseMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.ResponseMetadata} ResponseMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResponseMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.ResponseMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResponseMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.ResponseMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.ResponseMetadata} ResponseMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResponseMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResponseMetadata message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.ResponseMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResponseMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates a ResponseMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.ResponseMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.ResponseMetadata} ResponseMetadata - */ - ResponseMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.ResponseMetadata) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.ResponseMetadata(); - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from a ResponseMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.ResponseMetadata - * @static - * @param {google.cloud.contentwarehouse.v1.ResponseMetadata} message ResponseMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResponseMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.requestId = ""; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this ResponseMetadata to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.ResponseMetadata - * @instance - * @returns {Object.} JSON object - */ - ResponseMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResponseMetadata - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.ResponseMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResponseMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.ResponseMetadata"; - }; - - return ResponseMetadata; - })(); - - v1.UserInfo = (function() { - - /** - * Properties of a UserInfo. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IUserInfo - * @property {string|null} [id] UserInfo id - * @property {Array.|null} [groupIds] UserInfo groupIds - */ - - /** - * Constructs a new UserInfo. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a UserInfo. - * @implements IUserInfo - * @constructor - * @param {google.cloud.contentwarehouse.v1.IUserInfo=} [properties] Properties to set - */ - function UserInfo(properties) { - this.groupIds = []; - 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]]; - } - - /** - * UserInfo id. - * @member {string} id - * @memberof google.cloud.contentwarehouse.v1.UserInfo - * @instance - */ - UserInfo.prototype.id = ""; - - /** - * UserInfo groupIds. - * @member {Array.} groupIds - * @memberof google.cloud.contentwarehouse.v1.UserInfo - * @instance - */ - UserInfo.prototype.groupIds = $util.emptyArray; - - /** - * Creates a new UserInfo instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.UserInfo - * @static - * @param {google.cloud.contentwarehouse.v1.IUserInfo=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.UserInfo} UserInfo instance - */ - UserInfo.create = function create(properties) { - return new UserInfo(properties); - }; - - /** - * Encodes the specified UserInfo message. Does not implicitly {@link google.cloud.contentwarehouse.v1.UserInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.UserInfo - * @static - * @param {google.cloud.contentwarehouse.v1.IUserInfo} message UserInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UserInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); - if (message.groupIds != null && message.groupIds.length) - for (var i = 0; i < message.groupIds.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.groupIds[i]); - return writer; - }; - - /** - * Encodes the specified UserInfo message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.UserInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.UserInfo - * @static - * @param {google.cloud.contentwarehouse.v1.IUserInfo} message UserInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UserInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a UserInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.UserInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.UserInfo} UserInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UserInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.UserInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.id = reader.string(); - break; - } - case 2: { - if (!(message.groupIds && message.groupIds.length)) - message.groupIds = []; - message.groupIds.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a UserInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.UserInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.UserInfo} UserInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UserInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a UserInfo message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.UserInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UserInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; - if (message.groupIds != null && message.hasOwnProperty("groupIds")) { - if (!Array.isArray(message.groupIds)) - return "groupIds: array expected"; - for (var i = 0; i < message.groupIds.length; ++i) - if (!$util.isString(message.groupIds[i])) - return "groupIds: string[] expected"; - } - return null; - }; - - /** - * Creates a UserInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.UserInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.UserInfo} UserInfo - */ - UserInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.UserInfo) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.UserInfo(); - if (object.id != null) - message.id = String(object.id); - if (object.groupIds) { - if (!Array.isArray(object.groupIds)) - throw TypeError(".google.cloud.contentwarehouse.v1.UserInfo.groupIds: array expected"); - message.groupIds = []; - for (var i = 0; i < object.groupIds.length; ++i) - message.groupIds[i] = String(object.groupIds[i]); - } - return message; - }; - - /** - * Creates a plain object from a UserInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.UserInfo - * @static - * @param {google.cloud.contentwarehouse.v1.UserInfo} message UserInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UserInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.groupIds = []; - if (options.defaults) - object.id = ""; - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.groupIds && message.groupIds.length) { - object.groupIds = []; - for (var j = 0; j < message.groupIds.length; ++j) - object.groupIds[j] = message.groupIds[j]; - } - return object; - }; - - /** - * Converts this UserInfo to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.UserInfo - * @instance - * @returns {Object.} JSON object - */ - UserInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UserInfo - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.UserInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UserInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.UserInfo"; - }; - - return UserInfo; - })(); - - v1.UpdateOptions = (function() { - - /** - * Properties of an UpdateOptions. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IUpdateOptions - * @property {google.cloud.contentwarehouse.v1.UpdateType|null} [updateType] UpdateOptions updateType - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateOptions updateMask - * @property {google.cloud.contentwarehouse.v1.IMergeFieldsOptions|null} [mergeFieldsOptions] UpdateOptions mergeFieldsOptions - */ - - /** - * Constructs a new UpdateOptions. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents an UpdateOptions. - * @implements IUpdateOptions - * @constructor - * @param {google.cloud.contentwarehouse.v1.IUpdateOptions=} [properties] Properties to set - */ - function UpdateOptions(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]]; - } - - /** - * UpdateOptions updateType. - * @member {google.cloud.contentwarehouse.v1.UpdateType} updateType - * @memberof google.cloud.contentwarehouse.v1.UpdateOptions - * @instance - */ - UpdateOptions.prototype.updateType = 0; - - /** - * UpdateOptions updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.contentwarehouse.v1.UpdateOptions - * @instance - */ - UpdateOptions.prototype.updateMask = null; - - /** - * UpdateOptions mergeFieldsOptions. - * @member {google.cloud.contentwarehouse.v1.IMergeFieldsOptions|null|undefined} mergeFieldsOptions - * @memberof google.cloud.contentwarehouse.v1.UpdateOptions - * @instance - */ - UpdateOptions.prototype.mergeFieldsOptions = null; - - /** - * Creates a new UpdateOptions instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.UpdateOptions - * @static - * @param {google.cloud.contentwarehouse.v1.IUpdateOptions=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.UpdateOptions} UpdateOptions instance - */ - UpdateOptions.create = function create(properties) { - return new UpdateOptions(properties); - }; - - /** - * Encodes the specified UpdateOptions message. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateOptions.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.UpdateOptions - * @static - * @param {google.cloud.contentwarehouse.v1.IUpdateOptions} message UpdateOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.updateType != null && Object.hasOwnProperty.call(message, "updateType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.updateType); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.mergeFieldsOptions != null && Object.hasOwnProperty.call(message, "mergeFieldsOptions")) - $root.google.cloud.contentwarehouse.v1.MergeFieldsOptions.encode(message.mergeFieldsOptions, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateOptions message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.UpdateOptions - * @static - * @param {google.cloud.contentwarehouse.v1.IUpdateOptions} message UpdateOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateOptions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.UpdateOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.UpdateOptions} UpdateOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.UpdateOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.updateType = reader.int32(); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 3: { - message.mergeFieldsOptions = $root.google.cloud.contentwarehouse.v1.MergeFieldsOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.UpdateOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.UpdateOptions} UpdateOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateOptions message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.UpdateOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.updateType != null && message.hasOwnProperty("updateType")) - switch (message.updateType) { - default: - return "updateType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.mergeFieldsOptions != null && message.hasOwnProperty("mergeFieldsOptions")) { - var error = $root.google.cloud.contentwarehouse.v1.MergeFieldsOptions.verify(message.mergeFieldsOptions); - if (error) - return "mergeFieldsOptions." + error; - } - return null; - }; - - /** - * Creates an UpdateOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.UpdateOptions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.UpdateOptions} UpdateOptions - */ - UpdateOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.UpdateOptions) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.UpdateOptions(); - switch (object.updateType) { - default: - if (typeof object.updateType === "number") { - message.updateType = object.updateType; - break; - } - break; - case "UPDATE_TYPE_UNSPECIFIED": - case 0: - message.updateType = 0; - break; - case "UPDATE_TYPE_REPLACE": - case 1: - message.updateType = 1; - break; - case "UPDATE_TYPE_MERGE": - case 2: - message.updateType = 2; - break; - case "UPDATE_TYPE_INSERT_PROPERTIES_BY_NAMES": - case 3: - message.updateType = 3; - break; - case "UPDATE_TYPE_REPLACE_PROPERTIES_BY_NAMES": - case 4: - message.updateType = 4; - break; - case "UPDATE_TYPE_DELETE_PROPERTIES_BY_NAMES": - case 5: - message.updateType = 5; - break; - case "UPDATE_TYPE_MERGE_AND_REPLACE_OR_INSERT_PROPERTIES_BY_NAMES": - case 6: - message.updateType = 6; - break; - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.UpdateOptions.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.mergeFieldsOptions != null) { - if (typeof object.mergeFieldsOptions !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.UpdateOptions.mergeFieldsOptions: object expected"); - message.mergeFieldsOptions = $root.google.cloud.contentwarehouse.v1.MergeFieldsOptions.fromObject(object.mergeFieldsOptions); - } - return message; - }; - - /** - * Creates a plain object from an UpdateOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.UpdateOptions - * @static - * @param {google.cloud.contentwarehouse.v1.UpdateOptions} message UpdateOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.updateType = options.enums === String ? "UPDATE_TYPE_UNSPECIFIED" : 0; - object.updateMask = null; - object.mergeFieldsOptions = null; - } - if (message.updateType != null && message.hasOwnProperty("updateType")) - object.updateType = options.enums === String ? $root.google.cloud.contentwarehouse.v1.UpdateType[message.updateType] === undefined ? message.updateType : $root.google.cloud.contentwarehouse.v1.UpdateType[message.updateType] : message.updateType; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.mergeFieldsOptions != null && message.hasOwnProperty("mergeFieldsOptions")) - object.mergeFieldsOptions = $root.google.cloud.contentwarehouse.v1.MergeFieldsOptions.toObject(message.mergeFieldsOptions, options); - return object; - }; - - /** - * Converts this UpdateOptions to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.UpdateOptions - * @instance - * @returns {Object.} JSON object - */ - UpdateOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateOptions - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.UpdateOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.UpdateOptions"; - }; - - return UpdateOptions; - })(); - - v1.MergeFieldsOptions = (function() { - - /** - * Properties of a MergeFieldsOptions. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IMergeFieldsOptions - * @property {boolean|null} [replaceMessageFields] MergeFieldsOptions replaceMessageFields - * @property {boolean|null} [replaceRepeatedFields] MergeFieldsOptions replaceRepeatedFields - */ - - /** - * Constructs a new MergeFieldsOptions. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a MergeFieldsOptions. - * @implements IMergeFieldsOptions - * @constructor - * @param {google.cloud.contentwarehouse.v1.IMergeFieldsOptions=} [properties] Properties to set - */ - function MergeFieldsOptions(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]]; - } - - /** - * MergeFieldsOptions replaceMessageFields. - * @member {boolean|null|undefined} replaceMessageFields - * @memberof google.cloud.contentwarehouse.v1.MergeFieldsOptions - * @instance - */ - MergeFieldsOptions.prototype.replaceMessageFields = null; - - /** - * MergeFieldsOptions replaceRepeatedFields. - * @member {boolean|null|undefined} replaceRepeatedFields - * @memberof google.cloud.contentwarehouse.v1.MergeFieldsOptions - * @instance - */ - MergeFieldsOptions.prototype.replaceRepeatedFields = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(MergeFieldsOptions.prototype, "_replaceMessageFields", { - get: $util.oneOfGetter($oneOfFields = ["replaceMessageFields"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(MergeFieldsOptions.prototype, "_replaceRepeatedFields", { - get: $util.oneOfGetter($oneOfFields = ["replaceRepeatedFields"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new MergeFieldsOptions instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.MergeFieldsOptions - * @static - * @param {google.cloud.contentwarehouse.v1.IMergeFieldsOptions=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.MergeFieldsOptions} MergeFieldsOptions instance - */ - MergeFieldsOptions.create = function create(properties) { - return new MergeFieldsOptions(properties); - }; - - /** - * Encodes the specified MergeFieldsOptions message. Does not implicitly {@link google.cloud.contentwarehouse.v1.MergeFieldsOptions.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.MergeFieldsOptions - * @static - * @param {google.cloud.contentwarehouse.v1.IMergeFieldsOptions} message MergeFieldsOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MergeFieldsOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.replaceMessageFields != null && Object.hasOwnProperty.call(message, "replaceMessageFields")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.replaceMessageFields); - if (message.replaceRepeatedFields != null && Object.hasOwnProperty.call(message, "replaceRepeatedFields")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.replaceRepeatedFields); - return writer; - }; - - /** - * Encodes the specified MergeFieldsOptions message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.MergeFieldsOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.MergeFieldsOptions - * @static - * @param {google.cloud.contentwarehouse.v1.IMergeFieldsOptions} message MergeFieldsOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MergeFieldsOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MergeFieldsOptions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.MergeFieldsOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.MergeFieldsOptions} MergeFieldsOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MergeFieldsOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.MergeFieldsOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.replaceMessageFields = reader.bool(); - break; - } - case 2: { - message.replaceRepeatedFields = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MergeFieldsOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.MergeFieldsOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.MergeFieldsOptions} MergeFieldsOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MergeFieldsOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MergeFieldsOptions message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.MergeFieldsOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MergeFieldsOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.replaceMessageFields != null && message.hasOwnProperty("replaceMessageFields")) { - properties._replaceMessageFields = 1; - if (typeof message.replaceMessageFields !== "boolean") - return "replaceMessageFields: boolean expected"; - } - if (message.replaceRepeatedFields != null && message.hasOwnProperty("replaceRepeatedFields")) { - properties._replaceRepeatedFields = 1; - if (typeof message.replaceRepeatedFields !== "boolean") - return "replaceRepeatedFields: boolean expected"; - } - return null; - }; - - /** - * Creates a MergeFieldsOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.MergeFieldsOptions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.MergeFieldsOptions} MergeFieldsOptions - */ - MergeFieldsOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.MergeFieldsOptions) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.MergeFieldsOptions(); - if (object.replaceMessageFields != null) - message.replaceMessageFields = Boolean(object.replaceMessageFields); - if (object.replaceRepeatedFields != null) - message.replaceRepeatedFields = Boolean(object.replaceRepeatedFields); - return message; - }; - - /** - * Creates a plain object from a MergeFieldsOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.MergeFieldsOptions - * @static - * @param {google.cloud.contentwarehouse.v1.MergeFieldsOptions} message MergeFieldsOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MergeFieldsOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.replaceMessageFields != null && message.hasOwnProperty("replaceMessageFields")) { - object.replaceMessageFields = message.replaceMessageFields; - if (options.oneofs) - object._replaceMessageFields = "replaceMessageFields"; - } - if (message.replaceRepeatedFields != null && message.hasOwnProperty("replaceRepeatedFields")) { - object.replaceRepeatedFields = message.replaceRepeatedFields; - if (options.oneofs) - object._replaceRepeatedFields = "replaceRepeatedFields"; - } - return object; - }; - - /** - * Converts this MergeFieldsOptions to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.MergeFieldsOptions - * @instance - * @returns {Object.} JSON object - */ - MergeFieldsOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MergeFieldsOptions - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.MergeFieldsOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MergeFieldsOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.MergeFieldsOptions"; - }; - - return MergeFieldsOptions; - })(); - - /** - * UpdateType enum. - * @name google.cloud.contentwarehouse.v1.UpdateType - * @enum {number} - * @property {number} UPDATE_TYPE_UNSPECIFIED=0 UPDATE_TYPE_UNSPECIFIED value - * @property {number} UPDATE_TYPE_REPLACE=1 UPDATE_TYPE_REPLACE value - * @property {number} UPDATE_TYPE_MERGE=2 UPDATE_TYPE_MERGE value - * @property {number} UPDATE_TYPE_INSERT_PROPERTIES_BY_NAMES=3 UPDATE_TYPE_INSERT_PROPERTIES_BY_NAMES value - * @property {number} UPDATE_TYPE_REPLACE_PROPERTIES_BY_NAMES=4 UPDATE_TYPE_REPLACE_PROPERTIES_BY_NAMES value - * @property {number} UPDATE_TYPE_DELETE_PROPERTIES_BY_NAMES=5 UPDATE_TYPE_DELETE_PROPERTIES_BY_NAMES value - * @property {number} UPDATE_TYPE_MERGE_AND_REPLACE_OR_INSERT_PROPERTIES_BY_NAMES=6 UPDATE_TYPE_MERGE_AND_REPLACE_OR_INSERT_PROPERTIES_BY_NAMES value - */ - v1.UpdateType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UPDATE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "UPDATE_TYPE_REPLACE"] = 1; - values[valuesById[2] = "UPDATE_TYPE_MERGE"] = 2; - values[valuesById[3] = "UPDATE_TYPE_INSERT_PROPERTIES_BY_NAMES"] = 3; - values[valuesById[4] = "UPDATE_TYPE_REPLACE_PROPERTIES_BY_NAMES"] = 4; - values[valuesById[5] = "UPDATE_TYPE_DELETE_PROPERTIES_BY_NAMES"] = 5; - values[valuesById[6] = "UPDATE_TYPE_MERGE_AND_REPLACE_OR_INSERT_PROPERTIES_BY_NAMES"] = 6; - return values; - })(); - - /** - * DatabaseType enum. - * @name google.cloud.contentwarehouse.v1.DatabaseType - * @enum {number} - * @property {number} DB_UNKNOWN=0 DB_UNKNOWN value - * @property {number} DB_INFRA_SPANNER=1 DB_INFRA_SPANNER value - * @property {number} DB_CLOUD_SQL_POSTGRES=2 DB_CLOUD_SQL_POSTGRES value - */ - v1.DatabaseType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DB_UNKNOWN"] = 0; - values[valuesById[1] = "DB_INFRA_SPANNER"] = 1; - values[valuesById[2] = "DB_CLOUD_SQL_POSTGRES"] = 2; - return values; - })(); - - /** - * AccessControlMode enum. - * @name google.cloud.contentwarehouse.v1.AccessControlMode - * @enum {number} - * @property {number} ACL_MODE_UNKNOWN=0 ACL_MODE_UNKNOWN value - * @property {number} ACL_MODE_UNIVERSAL_ACCESS=1 ACL_MODE_UNIVERSAL_ACCESS value - * @property {number} ACL_MODE_DOCUMENT_LEVEL_ACCESS_CONTROL_BYOID=2 ACL_MODE_DOCUMENT_LEVEL_ACCESS_CONTROL_BYOID value - * @property {number} ACL_MODE_DOCUMENT_LEVEL_ACCESS_CONTROL_GCI=3 ACL_MODE_DOCUMENT_LEVEL_ACCESS_CONTROL_GCI value - */ - v1.AccessControlMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ACL_MODE_UNKNOWN"] = 0; - values[valuesById[1] = "ACL_MODE_UNIVERSAL_ACCESS"] = 1; - values[valuesById[2] = "ACL_MODE_DOCUMENT_LEVEL_ACCESS_CONTROL_BYOID"] = 2; - values[valuesById[3] = "ACL_MODE_DOCUMENT_LEVEL_ACCESS_CONTROL_GCI"] = 3; - return values; - })(); - - /** - * DocumentCreatorDefaultRole enum. - * @name google.cloud.contentwarehouse.v1.DocumentCreatorDefaultRole - * @enum {number} - * @property {number} DOCUMENT_CREATOR_DEFAULT_ROLE_UNSPECIFIED=0 DOCUMENT_CREATOR_DEFAULT_ROLE_UNSPECIFIED value - * @property {number} DOCUMENT_ADMIN=1 DOCUMENT_ADMIN value - * @property {number} DOCUMENT_EDITOR=2 DOCUMENT_EDITOR value - * @property {number} DOCUMENT_VIEWER=3 DOCUMENT_VIEWER value - */ - v1.DocumentCreatorDefaultRole = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DOCUMENT_CREATOR_DEFAULT_ROLE_UNSPECIFIED"] = 0; - values[valuesById[1] = "DOCUMENT_ADMIN"] = 1; - values[valuesById[2] = "DOCUMENT_EDITOR"] = 2; - values[valuesById[3] = "DOCUMENT_VIEWER"] = 3; - return values; - })(); - - v1.Document = (function() { - - /** - * Properties of a Document. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IDocument - * @property {string|null} [name] Document name - * @property {string|null} [referenceId] Document referenceId - * @property {string|null} [displayName] Document displayName - * @property {string|null} [title] Document title - * @property {string|null} [displayUri] Document displayUri - * @property {string|null} [documentSchemaName] Document documentSchemaName - * @property {string|null} [plainText] Document plainText - * @property {google.cloud.documentai.v1.IDocument|null} [cloudAiDocument] Document cloudAiDocument - * @property {string|null} [structuredContentUri] Document structuredContentUri - * @property {string|null} [rawDocumentPath] Document rawDocumentPath - * @property {Uint8Array|null} [inlineRawDocument] Document inlineRawDocument - * @property {Array.|null} [properties] Document properties - * @property {google.protobuf.ITimestamp|null} [updateTime] Document updateTime - * @property {google.protobuf.ITimestamp|null} [createTime] Document createTime - * @property {google.cloud.contentwarehouse.v1.RawDocumentFileType|null} [rawDocumentFileType] Document rawDocumentFileType - * @property {boolean|null} [asyncEnabled] Document asyncEnabled - * @property {google.cloud.contentwarehouse.v1.ContentCategory|null} [contentCategory] Document contentCategory - * @property {boolean|null} [textExtractionDisabled] Document textExtractionDisabled - * @property {boolean|null} [textExtractionEnabled] Document textExtractionEnabled - * @property {string|null} [creator] Document creator - * @property {string|null} [updater] Document updater - * @property {google.protobuf.ITimestamp|null} [dispositionTime] Document dispositionTime - * @property {boolean|null} [legalHold] Document legalHold - */ - - /** - * Constructs a new Document. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a Document. - * @implements IDocument - * @constructor - * @param {google.cloud.contentwarehouse.v1.IDocument=} [properties] Properties to set - */ - function Document(properties) { - this.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]]; - } - - /** - * Document name. - * @member {string} name - * @memberof google.cloud.contentwarehouse.v1.Document - * @instance - */ - Document.prototype.name = ""; - - /** - * Document referenceId. - * @member {string} referenceId - * @memberof google.cloud.contentwarehouse.v1.Document - * @instance - */ - Document.prototype.referenceId = ""; - - /** - * Document displayName. - * @member {string} displayName - * @memberof google.cloud.contentwarehouse.v1.Document - * @instance - */ - Document.prototype.displayName = ""; - - /** - * Document title. - * @member {string} title - * @memberof google.cloud.contentwarehouse.v1.Document - * @instance - */ - Document.prototype.title = ""; - - /** - * Document displayUri. - * @member {string} displayUri - * @memberof google.cloud.contentwarehouse.v1.Document - * @instance - */ - Document.prototype.displayUri = ""; - - /** - * Document documentSchemaName. - * @member {string} documentSchemaName - * @memberof google.cloud.contentwarehouse.v1.Document - * @instance - */ - Document.prototype.documentSchemaName = ""; - - /** - * Document plainText. - * @member {string|null|undefined} plainText - * @memberof google.cloud.contentwarehouse.v1.Document - * @instance - */ - Document.prototype.plainText = null; - - /** - * Document cloudAiDocument. - * @member {google.cloud.documentai.v1.IDocument|null|undefined} cloudAiDocument - * @memberof google.cloud.contentwarehouse.v1.Document - * @instance - */ - Document.prototype.cloudAiDocument = null; - - /** - * Document structuredContentUri. - * @member {string} structuredContentUri - * @memberof google.cloud.contentwarehouse.v1.Document - * @instance - */ - Document.prototype.structuredContentUri = ""; - - /** - * Document rawDocumentPath. - * @member {string|null|undefined} rawDocumentPath - * @memberof google.cloud.contentwarehouse.v1.Document - * @instance - */ - Document.prototype.rawDocumentPath = null; - - /** - * Document inlineRawDocument. - * @member {Uint8Array|null|undefined} inlineRawDocument - * @memberof google.cloud.contentwarehouse.v1.Document - * @instance - */ - Document.prototype.inlineRawDocument = null; - - /** - * Document properties. - * @member {Array.} properties - * @memberof google.cloud.contentwarehouse.v1.Document - * @instance - */ - Document.prototype.properties = $util.emptyArray; - - /** - * Document updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.contentwarehouse.v1.Document - * @instance - */ - Document.prototype.updateTime = null; - - /** - * Document createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.contentwarehouse.v1.Document - * @instance - */ - Document.prototype.createTime = null; - - /** - * Document rawDocumentFileType. - * @member {google.cloud.contentwarehouse.v1.RawDocumentFileType} rawDocumentFileType - * @memberof google.cloud.contentwarehouse.v1.Document - * @instance - */ - Document.prototype.rawDocumentFileType = 0; - - /** - * Document asyncEnabled. - * @member {boolean} asyncEnabled - * @memberof google.cloud.contentwarehouse.v1.Document - * @instance - */ - Document.prototype.asyncEnabled = false; - - /** - * Document contentCategory. - * @member {google.cloud.contentwarehouse.v1.ContentCategory} contentCategory - * @memberof google.cloud.contentwarehouse.v1.Document - * @instance - */ - Document.prototype.contentCategory = 0; - - /** - * Document textExtractionDisabled. - * @member {boolean} textExtractionDisabled - * @memberof google.cloud.contentwarehouse.v1.Document - * @instance - */ - Document.prototype.textExtractionDisabled = false; - - /** - * Document textExtractionEnabled. - * @member {boolean} textExtractionEnabled - * @memberof google.cloud.contentwarehouse.v1.Document - * @instance - */ - Document.prototype.textExtractionEnabled = false; - - /** - * Document creator. - * @member {string} creator - * @memberof google.cloud.contentwarehouse.v1.Document - * @instance - */ - Document.prototype.creator = ""; - - /** - * Document updater. - * @member {string} updater - * @memberof google.cloud.contentwarehouse.v1.Document - * @instance - */ - Document.prototype.updater = ""; - - /** - * Document dispositionTime. - * @member {google.protobuf.ITimestamp|null|undefined} dispositionTime - * @memberof google.cloud.contentwarehouse.v1.Document - * @instance - */ - Document.prototype.dispositionTime = null; - - /** - * Document legalHold. - * @member {boolean} legalHold - * @memberof google.cloud.contentwarehouse.v1.Document - * @instance - */ - Document.prototype.legalHold = false; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Document structuredContent. - * @member {"plainText"|"cloudAiDocument"|undefined} structuredContent - * @memberof google.cloud.contentwarehouse.v1.Document - * @instance - */ - Object.defineProperty(Document.prototype, "structuredContent", { - get: $util.oneOfGetter($oneOfFields = ["plainText", "cloudAiDocument"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Document rawDocument. - * @member {"rawDocumentPath"|"inlineRawDocument"|undefined} rawDocument - * @memberof google.cloud.contentwarehouse.v1.Document - * @instance - */ - Object.defineProperty(Document.prototype, "rawDocument", { - get: $util.oneOfGetter($oneOfFields = ["rawDocumentPath", "inlineRawDocument"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Document instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.Document - * @static - * @param {google.cloud.contentwarehouse.v1.IDocument=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.Document} Document instance - */ - Document.create = function create(properties) { - return new Document(properties); - }; - - /** - * Encodes the specified Document message. Does not implicitly {@link google.cloud.contentwarehouse.v1.Document.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.Document - * @static - * @param {google.cloud.contentwarehouse.v1.IDocument} message Document message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Document.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.documentSchemaName != null && Object.hasOwnProperty.call(message, "documentSchemaName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.documentSchemaName); - if (message.cloudAiDocument != null && Object.hasOwnProperty.call(message, "cloudAiDocument")) - $root.google.cloud.documentai.v1.Document.encode(message.cloudAiDocument, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.rawDocumentPath != null && Object.hasOwnProperty.call(message, "rawDocumentPath")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.rawDocumentPath); - if (message.inlineRawDocument != null && Object.hasOwnProperty.call(message, "inlineRawDocument")) - writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.inlineRawDocument); - if (message.properties != null && message.properties.length) - for (var i = 0; i < message.properties.length; ++i) - $root.google.cloud.contentwarehouse.v1.Property.encode(message.properties[i], 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.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.rawDocumentFileType != null && Object.hasOwnProperty.call(message, "rawDocumentFileType")) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.rawDocumentFileType); - if (message.referenceId != null && Object.hasOwnProperty.call(message, "referenceId")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.referenceId); - if (message.asyncEnabled != null && Object.hasOwnProperty.call(message, "asyncEnabled")) - writer.uint32(/* id 12, wireType 0 =*/96).bool(message.asyncEnabled); - if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.creator); - if (message.updater != null && Object.hasOwnProperty.call(message, "updater")) - writer.uint32(/* id 14, wireType 2 =*/114).string(message.updater); - if (message.plainText != null && Object.hasOwnProperty.call(message, "plainText")) - writer.uint32(/* id 15, wireType 2 =*/122).string(message.plainText); - if (message.structuredContentUri != null && Object.hasOwnProperty.call(message, "structuredContentUri")) - writer.uint32(/* id 16, wireType 2 =*/130).string(message.structuredContentUri); - if (message.displayUri != null && Object.hasOwnProperty.call(message, "displayUri")) - writer.uint32(/* id 17, wireType 2 =*/138).string(message.displayUri); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 18, wireType 2 =*/146).string(message.title); - if (message.textExtractionDisabled != null && Object.hasOwnProperty.call(message, "textExtractionDisabled")) - writer.uint32(/* id 19, wireType 0 =*/152).bool(message.textExtractionDisabled); - if (message.contentCategory != null && Object.hasOwnProperty.call(message, "contentCategory")) - writer.uint32(/* id 20, wireType 0 =*/160).int32(message.contentCategory); - if (message.textExtractionEnabled != null && Object.hasOwnProperty.call(message, "textExtractionEnabled")) - writer.uint32(/* id 21, wireType 0 =*/168).bool(message.textExtractionEnabled); - if (message.dispositionTime != null && Object.hasOwnProperty.call(message, "dispositionTime")) - $root.google.protobuf.Timestamp.encode(message.dispositionTime, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.legalHold != null && Object.hasOwnProperty.call(message, "legalHold")) - writer.uint32(/* id 23, wireType 0 =*/184).bool(message.legalHold); - return writer; - }; - - /** - * Encodes the specified Document message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.Document.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.Document - * @static - * @param {google.cloud.contentwarehouse.v1.IDocument} message Document message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Document.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Document message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.Document - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.Document} Document - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Document.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.Document(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 11: { - message.referenceId = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - case 18: { - message.title = reader.string(); - break; - } - case 17: { - message.displayUri = reader.string(); - break; - } - case 3: { - message.documentSchemaName = reader.string(); - break; - } - case 15: { - message.plainText = reader.string(); - break; - } - case 4: { - message.cloudAiDocument = $root.google.cloud.documentai.v1.Document.decode(reader, reader.uint32()); - break; - } - case 16: { - message.structuredContentUri = reader.string(); - break; - } - case 5: { - message.rawDocumentPath = reader.string(); - break; - } - case 6: { - message.inlineRawDocument = reader.bytes(); - break; - } - case 7: { - if (!(message.properties && message.properties.length)) - message.properties = []; - message.properties.push($root.google.cloud.contentwarehouse.v1.Property.decode(reader, reader.uint32())); - break; - } - case 8: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 9: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 10: { - message.rawDocumentFileType = reader.int32(); - break; - } - case 12: { - message.asyncEnabled = reader.bool(); - break; - } - case 20: { - message.contentCategory = reader.int32(); - break; - } - case 19: { - message.textExtractionDisabled = reader.bool(); - break; - } - case 21: { - message.textExtractionEnabled = reader.bool(); - break; - } - case 13: { - message.creator = reader.string(); - break; - } - case 14: { - message.updater = reader.string(); - break; - } - case 22: { - message.dispositionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 23: { - message.legalHold = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Document message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.Document - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.Document} Document - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Document.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Document message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.Document - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Document.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.referenceId != null && message.hasOwnProperty("referenceId")) - if (!$util.isString(message.referenceId)) - return "referenceId: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.displayUri != null && message.hasOwnProperty("displayUri")) - if (!$util.isString(message.displayUri)) - return "displayUri: string expected"; - if (message.documentSchemaName != null && message.hasOwnProperty("documentSchemaName")) - if (!$util.isString(message.documentSchemaName)) - return "documentSchemaName: string expected"; - if (message.plainText != null && message.hasOwnProperty("plainText")) { - properties.structuredContent = 1; - if (!$util.isString(message.plainText)) - return "plainText: string expected"; - } - if (message.cloudAiDocument != null && message.hasOwnProperty("cloudAiDocument")) { - if (properties.structuredContent === 1) - return "structuredContent: multiple values"; - properties.structuredContent = 1; - { - var error = $root.google.cloud.documentai.v1.Document.verify(message.cloudAiDocument); - if (error) - return "cloudAiDocument." + error; - } - } - if (message.structuredContentUri != null && message.hasOwnProperty("structuredContentUri")) - if (!$util.isString(message.structuredContentUri)) - return "structuredContentUri: string expected"; - if (message.rawDocumentPath != null && message.hasOwnProperty("rawDocumentPath")) { - properties.rawDocument = 1; - if (!$util.isString(message.rawDocumentPath)) - return "rawDocumentPath: string expected"; - } - if (message.inlineRawDocument != null && message.hasOwnProperty("inlineRawDocument")) { - if (properties.rawDocument === 1) - return "rawDocument: multiple values"; - properties.rawDocument = 1; - if (!(message.inlineRawDocument && typeof message.inlineRawDocument.length === "number" || $util.isString(message.inlineRawDocument))) - return "inlineRawDocument: buffer expected"; - } - if (message.properties != null && message.hasOwnProperty("properties")) { - if (!Array.isArray(message.properties)) - return "properties: array expected"; - for (var i = 0; i < message.properties.length; ++i) { - var error = $root.google.cloud.contentwarehouse.v1.Property.verify(message.properties[i]); - if (error) - return "properties." + error; - } - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.rawDocumentFileType != null && message.hasOwnProperty("rawDocumentFileType")) - switch (message.rawDocumentFileType) { - default: - return "rawDocumentFileType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - if (message.asyncEnabled != null && message.hasOwnProperty("asyncEnabled")) - if (typeof message.asyncEnabled !== "boolean") - return "asyncEnabled: boolean expected"; - if (message.contentCategory != null && message.hasOwnProperty("contentCategory")) - switch (message.contentCategory) { - default: - return "contentCategory: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.textExtractionDisabled != null && message.hasOwnProperty("textExtractionDisabled")) - if (typeof message.textExtractionDisabled !== "boolean") - return "textExtractionDisabled: boolean expected"; - if (message.textExtractionEnabled != null && message.hasOwnProperty("textExtractionEnabled")) - if (typeof message.textExtractionEnabled !== "boolean") - return "textExtractionEnabled: boolean expected"; - if (message.creator != null && message.hasOwnProperty("creator")) - if (!$util.isString(message.creator)) - return "creator: string expected"; - if (message.updater != null && message.hasOwnProperty("updater")) - if (!$util.isString(message.updater)) - return "updater: string expected"; - if (message.dispositionTime != null && message.hasOwnProperty("dispositionTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.dispositionTime); - if (error) - return "dispositionTime." + error; - } - if (message.legalHold != null && message.hasOwnProperty("legalHold")) - if (typeof message.legalHold !== "boolean") - return "legalHold: boolean expected"; - return null; - }; - - /** - * Creates a Document message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.Document - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.Document} Document - */ - Document.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.Document) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.Document(); - if (object.name != null) - message.name = String(object.name); - if (object.referenceId != null) - message.referenceId = String(object.referenceId); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.title != null) - message.title = String(object.title); - if (object.displayUri != null) - message.displayUri = String(object.displayUri); - if (object.documentSchemaName != null) - message.documentSchemaName = String(object.documentSchemaName); - if (object.plainText != null) - message.plainText = String(object.plainText); - if (object.cloudAiDocument != null) { - if (typeof object.cloudAiDocument !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.Document.cloudAiDocument: object expected"); - message.cloudAiDocument = $root.google.cloud.documentai.v1.Document.fromObject(object.cloudAiDocument); - } - if (object.structuredContentUri != null) - message.structuredContentUri = String(object.structuredContentUri); - if (object.rawDocumentPath != null) - message.rawDocumentPath = String(object.rawDocumentPath); - if (object.inlineRawDocument != null) - if (typeof object.inlineRawDocument === "string") - $util.base64.decode(object.inlineRawDocument, message.inlineRawDocument = $util.newBuffer($util.base64.length(object.inlineRawDocument)), 0); - else if (object.inlineRawDocument.length >= 0) - message.inlineRawDocument = object.inlineRawDocument; - if (object.properties) { - if (!Array.isArray(object.properties)) - throw TypeError(".google.cloud.contentwarehouse.v1.Document.properties: array expected"); - message.properties = []; - for (var i = 0; i < object.properties.length; ++i) { - if (typeof object.properties[i] !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.Document.properties: object expected"); - message.properties[i] = $root.google.cloud.contentwarehouse.v1.Property.fromObject(object.properties[i]); - } - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.Document.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.Document.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - switch (object.rawDocumentFileType) { - default: - if (typeof object.rawDocumentFileType === "number") { - message.rawDocumentFileType = object.rawDocumentFileType; - break; - } - break; - case "RAW_DOCUMENT_FILE_TYPE_UNSPECIFIED": - case 0: - message.rawDocumentFileType = 0; - break; - case "RAW_DOCUMENT_FILE_TYPE_PDF": - case 1: - message.rawDocumentFileType = 1; - break; - case "RAW_DOCUMENT_FILE_TYPE_DOCX": - case 2: - message.rawDocumentFileType = 2; - break; - case "RAW_DOCUMENT_FILE_TYPE_XLSX": - case 3: - message.rawDocumentFileType = 3; - break; - case "RAW_DOCUMENT_FILE_TYPE_PPTX": - case 4: - message.rawDocumentFileType = 4; - break; - case "RAW_DOCUMENT_FILE_TYPE_TEXT": - case 5: - message.rawDocumentFileType = 5; - break; - case "RAW_DOCUMENT_FILE_TYPE_TIFF": - case 6: - message.rawDocumentFileType = 6; - break; - } - if (object.asyncEnabled != null) - message.asyncEnabled = Boolean(object.asyncEnabled); - switch (object.contentCategory) { - default: - if (typeof object.contentCategory === "number") { - message.contentCategory = object.contentCategory; - break; - } - break; - case "CONTENT_CATEGORY_UNSPECIFIED": - case 0: - message.contentCategory = 0; - break; - case "CONTENT_CATEGORY_IMAGE": - case 1: - message.contentCategory = 1; - break; - case "CONTENT_CATEGORY_AUDIO": - case 2: - message.contentCategory = 2; - break; - case "CONTENT_CATEGORY_VIDEO": - case 3: - message.contentCategory = 3; - break; - } - if (object.textExtractionDisabled != null) - message.textExtractionDisabled = Boolean(object.textExtractionDisabled); - if (object.textExtractionEnabled != null) - message.textExtractionEnabled = Boolean(object.textExtractionEnabled); - if (object.creator != null) - message.creator = String(object.creator); - if (object.updater != null) - message.updater = String(object.updater); - if (object.dispositionTime != null) { - if (typeof object.dispositionTime !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.Document.dispositionTime: object expected"); - message.dispositionTime = $root.google.protobuf.Timestamp.fromObject(object.dispositionTime); - } - if (object.legalHold != null) - message.legalHold = Boolean(object.legalHold); - return message; - }; - - /** - * Creates a plain object from a Document message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.Document - * @static - * @param {google.cloud.contentwarehouse.v1.Document} message Document - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Document.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.properties = []; - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.documentSchemaName = ""; - object.updateTime = null; - object.createTime = null; - object.rawDocumentFileType = options.enums === String ? "RAW_DOCUMENT_FILE_TYPE_UNSPECIFIED" : 0; - object.referenceId = ""; - object.asyncEnabled = false; - object.creator = ""; - object.updater = ""; - object.structuredContentUri = ""; - object.displayUri = ""; - object.title = ""; - object.textExtractionDisabled = false; - object.contentCategory = options.enums === String ? "CONTENT_CATEGORY_UNSPECIFIED" : 0; - object.textExtractionEnabled = false; - object.dispositionTime = null; - object.legalHold = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.documentSchemaName != null && message.hasOwnProperty("documentSchemaName")) - object.documentSchemaName = message.documentSchemaName; - if (message.cloudAiDocument != null && message.hasOwnProperty("cloudAiDocument")) { - object.cloudAiDocument = $root.google.cloud.documentai.v1.Document.toObject(message.cloudAiDocument, options); - if (options.oneofs) - object.structuredContent = "cloudAiDocument"; - } - if (message.rawDocumentPath != null && message.hasOwnProperty("rawDocumentPath")) { - object.rawDocumentPath = message.rawDocumentPath; - if (options.oneofs) - object.rawDocument = "rawDocumentPath"; - } - if (message.inlineRawDocument != null && message.hasOwnProperty("inlineRawDocument")) { - object.inlineRawDocument = options.bytes === String ? $util.base64.encode(message.inlineRawDocument, 0, message.inlineRawDocument.length) : options.bytes === Array ? Array.prototype.slice.call(message.inlineRawDocument) : message.inlineRawDocument; - if (options.oneofs) - object.rawDocument = "inlineRawDocument"; - } - if (message.properties && message.properties.length) { - object.properties = []; - for (var j = 0; j < message.properties.length; ++j) - object.properties[j] = $root.google.cloud.contentwarehouse.v1.Property.toObject(message.properties[j], options); - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.rawDocumentFileType != null && message.hasOwnProperty("rawDocumentFileType")) - object.rawDocumentFileType = options.enums === String ? $root.google.cloud.contentwarehouse.v1.RawDocumentFileType[message.rawDocumentFileType] === undefined ? message.rawDocumentFileType : $root.google.cloud.contentwarehouse.v1.RawDocumentFileType[message.rawDocumentFileType] : message.rawDocumentFileType; - if (message.referenceId != null && message.hasOwnProperty("referenceId")) - object.referenceId = message.referenceId; - if (message.asyncEnabled != null && message.hasOwnProperty("asyncEnabled")) - object.asyncEnabled = message.asyncEnabled; - if (message.creator != null && message.hasOwnProperty("creator")) - object.creator = message.creator; - if (message.updater != null && message.hasOwnProperty("updater")) - object.updater = message.updater; - if (message.plainText != null && message.hasOwnProperty("plainText")) { - object.plainText = message.plainText; - if (options.oneofs) - object.structuredContent = "plainText"; - } - if (message.structuredContentUri != null && message.hasOwnProperty("structuredContentUri")) - object.structuredContentUri = message.structuredContentUri; - if (message.displayUri != null && message.hasOwnProperty("displayUri")) - object.displayUri = message.displayUri; - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.textExtractionDisabled != null && message.hasOwnProperty("textExtractionDisabled")) - object.textExtractionDisabled = message.textExtractionDisabled; - if (message.contentCategory != null && message.hasOwnProperty("contentCategory")) - object.contentCategory = options.enums === String ? $root.google.cloud.contentwarehouse.v1.ContentCategory[message.contentCategory] === undefined ? message.contentCategory : $root.google.cloud.contentwarehouse.v1.ContentCategory[message.contentCategory] : message.contentCategory; - if (message.textExtractionEnabled != null && message.hasOwnProperty("textExtractionEnabled")) - object.textExtractionEnabled = message.textExtractionEnabled; - if (message.dispositionTime != null && message.hasOwnProperty("dispositionTime")) - object.dispositionTime = $root.google.protobuf.Timestamp.toObject(message.dispositionTime, options); - if (message.legalHold != null && message.hasOwnProperty("legalHold")) - object.legalHold = message.legalHold; - return object; - }; - - /** - * Converts this Document to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.Document - * @instance - * @returns {Object.} JSON object - */ - Document.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Document - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.Document - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Document.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.Document"; - }; - - return Document; - })(); - - v1.DocumentReference = (function() { - - /** - * Properties of a DocumentReference. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IDocumentReference - * @property {string|null} [documentName] DocumentReference documentName - * @property {string|null} [displayName] DocumentReference displayName - * @property {string|null} [snippet] DocumentReference snippet - * @property {boolean|null} [documentIsFolder] DocumentReference documentIsFolder - * @property {google.protobuf.ITimestamp|null} [updateTime] DocumentReference updateTime - * @property {google.protobuf.ITimestamp|null} [createTime] DocumentReference createTime - * @property {google.protobuf.ITimestamp|null} [deleteTime] DocumentReference deleteTime - * @property {boolean|null} [documentIsRetentionFolder] DocumentReference documentIsRetentionFolder - * @property {boolean|null} [documentIsLegalHoldFolder] DocumentReference documentIsLegalHoldFolder - */ - - /** - * Constructs a new DocumentReference. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a DocumentReference. - * @implements IDocumentReference - * @constructor - * @param {google.cloud.contentwarehouse.v1.IDocumentReference=} [properties] Properties to set - */ - function DocumentReference(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]]; - } - - /** - * DocumentReference documentName. - * @member {string} documentName - * @memberof google.cloud.contentwarehouse.v1.DocumentReference - * @instance - */ - DocumentReference.prototype.documentName = ""; - - /** - * DocumentReference displayName. - * @member {string} displayName - * @memberof google.cloud.contentwarehouse.v1.DocumentReference - * @instance - */ - DocumentReference.prototype.displayName = ""; - - /** - * DocumentReference snippet. - * @member {string} snippet - * @memberof google.cloud.contentwarehouse.v1.DocumentReference - * @instance - */ - DocumentReference.prototype.snippet = ""; - - /** - * DocumentReference documentIsFolder. - * @member {boolean} documentIsFolder - * @memberof google.cloud.contentwarehouse.v1.DocumentReference - * @instance - */ - DocumentReference.prototype.documentIsFolder = false; - - /** - * DocumentReference updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.contentwarehouse.v1.DocumentReference - * @instance - */ - DocumentReference.prototype.updateTime = null; - - /** - * DocumentReference createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.contentwarehouse.v1.DocumentReference - * @instance - */ - DocumentReference.prototype.createTime = null; - - /** - * DocumentReference deleteTime. - * @member {google.protobuf.ITimestamp|null|undefined} deleteTime - * @memberof google.cloud.contentwarehouse.v1.DocumentReference - * @instance - */ - DocumentReference.prototype.deleteTime = null; - - /** - * DocumentReference documentIsRetentionFolder. - * @member {boolean} documentIsRetentionFolder - * @memberof google.cloud.contentwarehouse.v1.DocumentReference - * @instance - */ - DocumentReference.prototype.documentIsRetentionFolder = false; - - /** - * DocumentReference documentIsLegalHoldFolder. - * @member {boolean} documentIsLegalHoldFolder - * @memberof google.cloud.contentwarehouse.v1.DocumentReference - * @instance - */ - DocumentReference.prototype.documentIsLegalHoldFolder = false; - - /** - * Creates a new DocumentReference instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.DocumentReference - * @static - * @param {google.cloud.contentwarehouse.v1.IDocumentReference=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.DocumentReference} DocumentReference instance - */ - DocumentReference.create = function create(properties) { - return new DocumentReference(properties); - }; - - /** - * Encodes the specified DocumentReference message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DocumentReference.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.DocumentReference - * @static - * @param {google.cloud.contentwarehouse.v1.IDocumentReference} message DocumentReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DocumentReference.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.documentName != null && Object.hasOwnProperty.call(message, "documentName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.documentName); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.snippet != null && Object.hasOwnProperty.call(message, "snippet")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.snippet); - if (message.documentIsFolder != null && Object.hasOwnProperty.call(message, "documentIsFolder")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.documentIsFolder); - 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.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.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) - $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.documentIsRetentionFolder != null && Object.hasOwnProperty.call(message, "documentIsRetentionFolder")) - writer.uint32(/* id 8, wireType 0 =*/64).bool(message.documentIsRetentionFolder); - if (message.documentIsLegalHoldFolder != null && Object.hasOwnProperty.call(message, "documentIsLegalHoldFolder")) - writer.uint32(/* id 9, wireType 0 =*/72).bool(message.documentIsLegalHoldFolder); - return writer; - }; - - /** - * Encodes the specified DocumentReference message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DocumentReference.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.DocumentReference - * @static - * @param {google.cloud.contentwarehouse.v1.IDocumentReference} message DocumentReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DocumentReference.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DocumentReference message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.DocumentReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.DocumentReference} DocumentReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DocumentReference.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.DocumentReference(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.documentName = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - case 3: { - message.snippet = reader.string(); - break; - } - case 4: { - message.documentIsFolder = reader.bool(); - break; - } - case 5: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 6: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 7: { - message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 8: { - message.documentIsRetentionFolder = reader.bool(); - break; - } - case 9: { - message.documentIsLegalHoldFolder = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DocumentReference message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.DocumentReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.DocumentReference} DocumentReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DocumentReference.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DocumentReference message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.DocumentReference - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DocumentReference.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.documentName != null && message.hasOwnProperty("documentName")) - if (!$util.isString(message.documentName)) - return "documentName: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.snippet != null && message.hasOwnProperty("snippet")) - if (!$util.isString(message.snippet)) - return "snippet: string expected"; - if (message.documentIsFolder != null && message.hasOwnProperty("documentIsFolder")) - if (typeof message.documentIsFolder !== "boolean") - return "documentIsFolder: boolean expected"; - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); - if (error) - return "deleteTime." + error; - } - if (message.documentIsRetentionFolder != null && message.hasOwnProperty("documentIsRetentionFolder")) - if (typeof message.documentIsRetentionFolder !== "boolean") - return "documentIsRetentionFolder: boolean expected"; - if (message.documentIsLegalHoldFolder != null && message.hasOwnProperty("documentIsLegalHoldFolder")) - if (typeof message.documentIsLegalHoldFolder !== "boolean") - return "documentIsLegalHoldFolder: boolean expected"; - return null; - }; - - /** - * Creates a DocumentReference message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.DocumentReference - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.DocumentReference} DocumentReference - */ - DocumentReference.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.DocumentReference) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.DocumentReference(); - if (object.documentName != null) - message.documentName = String(object.documentName); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.snippet != null) - message.snippet = String(object.snippet); - if (object.documentIsFolder != null) - message.documentIsFolder = Boolean(object.documentIsFolder); - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.DocumentReference.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.DocumentReference.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.deleteTime != null) { - if (typeof object.deleteTime !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.DocumentReference.deleteTime: object expected"); - message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); - } - if (object.documentIsRetentionFolder != null) - message.documentIsRetentionFolder = Boolean(object.documentIsRetentionFolder); - if (object.documentIsLegalHoldFolder != null) - message.documentIsLegalHoldFolder = Boolean(object.documentIsLegalHoldFolder); - return message; - }; - - /** - * Creates a plain object from a DocumentReference message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.DocumentReference - * @static - * @param {google.cloud.contentwarehouse.v1.DocumentReference} message DocumentReference - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DocumentReference.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.documentName = ""; - object.displayName = ""; - object.snippet = ""; - object.documentIsFolder = false; - object.updateTime = null; - object.createTime = null; - object.deleteTime = null; - object.documentIsRetentionFolder = false; - object.documentIsLegalHoldFolder = false; - } - if (message.documentName != null && message.hasOwnProperty("documentName")) - object.documentName = message.documentName; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.snippet != null && message.hasOwnProperty("snippet")) - object.snippet = message.snippet; - if (message.documentIsFolder != null && message.hasOwnProperty("documentIsFolder")) - object.documentIsFolder = message.documentIsFolder; - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) - object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); - if (message.documentIsRetentionFolder != null && message.hasOwnProperty("documentIsRetentionFolder")) - object.documentIsRetentionFolder = message.documentIsRetentionFolder; - if (message.documentIsLegalHoldFolder != null && message.hasOwnProperty("documentIsLegalHoldFolder")) - object.documentIsLegalHoldFolder = message.documentIsLegalHoldFolder; - return object; - }; - - /** - * Converts this DocumentReference to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.DocumentReference - * @instance - * @returns {Object.} JSON object - */ - DocumentReference.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DocumentReference - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.DocumentReference - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DocumentReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.DocumentReference"; - }; - - return DocumentReference; - })(); - - v1.Property = (function() { - - /** - * Properties of a Property. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IProperty - * @property {string|null} [name] Property name - * @property {google.cloud.contentwarehouse.v1.IIntegerArray|null} [integerValues] Property integerValues - * @property {google.cloud.contentwarehouse.v1.IFloatArray|null} [floatValues] Property floatValues - * @property {google.cloud.contentwarehouse.v1.ITextArray|null} [textValues] Property textValues - * @property {google.cloud.contentwarehouse.v1.IEnumArray|null} [enumValues] Property enumValues - * @property {google.cloud.contentwarehouse.v1.IPropertyArray|null} [propertyValues] Property propertyValues - * @property {google.cloud.contentwarehouse.v1.IDateTimeArray|null} [dateTimeValues] Property dateTimeValues - * @property {google.cloud.contentwarehouse.v1.IMapProperty|null} [mapProperty] Property mapProperty - * @property {google.cloud.contentwarehouse.v1.ITimestampArray|null} [timestampValues] Property timestampValues - */ - - /** - * Constructs a new Property. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a Property. - * @implements IProperty - * @constructor - * @param {google.cloud.contentwarehouse.v1.IProperty=} [properties] Properties to set - */ - function Property(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]]; - } - - /** - * Property name. - * @member {string} name - * @memberof google.cloud.contentwarehouse.v1.Property - * @instance - */ - Property.prototype.name = ""; - - /** - * Property integerValues. - * @member {google.cloud.contentwarehouse.v1.IIntegerArray|null|undefined} integerValues - * @memberof google.cloud.contentwarehouse.v1.Property - * @instance - */ - Property.prototype.integerValues = null; - - /** - * Property floatValues. - * @member {google.cloud.contentwarehouse.v1.IFloatArray|null|undefined} floatValues - * @memberof google.cloud.contentwarehouse.v1.Property - * @instance - */ - Property.prototype.floatValues = null; - - /** - * Property textValues. - * @member {google.cloud.contentwarehouse.v1.ITextArray|null|undefined} textValues - * @memberof google.cloud.contentwarehouse.v1.Property - * @instance - */ - Property.prototype.textValues = null; - - /** - * Property enumValues. - * @member {google.cloud.contentwarehouse.v1.IEnumArray|null|undefined} enumValues - * @memberof google.cloud.contentwarehouse.v1.Property - * @instance - */ - Property.prototype.enumValues = null; - - /** - * Property propertyValues. - * @member {google.cloud.contentwarehouse.v1.IPropertyArray|null|undefined} propertyValues - * @memberof google.cloud.contentwarehouse.v1.Property - * @instance - */ - Property.prototype.propertyValues = null; - - /** - * Property dateTimeValues. - * @member {google.cloud.contentwarehouse.v1.IDateTimeArray|null|undefined} dateTimeValues - * @memberof google.cloud.contentwarehouse.v1.Property - * @instance - */ - Property.prototype.dateTimeValues = null; - - /** - * Property mapProperty. - * @member {google.cloud.contentwarehouse.v1.IMapProperty|null|undefined} mapProperty - * @memberof google.cloud.contentwarehouse.v1.Property - * @instance - */ - Property.prototype.mapProperty = null; - - /** - * Property timestampValues. - * @member {google.cloud.contentwarehouse.v1.ITimestampArray|null|undefined} timestampValues - * @memberof google.cloud.contentwarehouse.v1.Property - * @instance - */ - Property.prototype.timestampValues = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Property values. - * @member {"integerValues"|"floatValues"|"textValues"|"enumValues"|"propertyValues"|"dateTimeValues"|"mapProperty"|"timestampValues"|undefined} values - * @memberof google.cloud.contentwarehouse.v1.Property - * @instance - */ - Object.defineProperty(Property.prototype, "values", { - get: $util.oneOfGetter($oneOfFields = ["integerValues", "floatValues", "textValues", "enumValues", "propertyValues", "dateTimeValues", "mapProperty", "timestampValues"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Property instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.Property - * @static - * @param {google.cloud.contentwarehouse.v1.IProperty=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.Property} Property instance - */ - Property.create = function create(properties) { - return new Property(properties); - }; - - /** - * Encodes the specified Property message. Does not implicitly {@link google.cloud.contentwarehouse.v1.Property.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.Property - * @static - * @param {google.cloud.contentwarehouse.v1.IProperty} message Property message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Property.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.integerValues != null && Object.hasOwnProperty.call(message, "integerValues")) - $root.google.cloud.contentwarehouse.v1.IntegerArray.encode(message.integerValues, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.floatValues != null && Object.hasOwnProperty.call(message, "floatValues")) - $root.google.cloud.contentwarehouse.v1.FloatArray.encode(message.floatValues, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.textValues != null && Object.hasOwnProperty.call(message, "textValues")) - $root.google.cloud.contentwarehouse.v1.TextArray.encode(message.textValues, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.enumValues != null && Object.hasOwnProperty.call(message, "enumValues")) - $root.google.cloud.contentwarehouse.v1.EnumArray.encode(message.enumValues, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.propertyValues != null && Object.hasOwnProperty.call(message, "propertyValues")) - $root.google.cloud.contentwarehouse.v1.PropertyArray.encode(message.propertyValues, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.dateTimeValues != null && Object.hasOwnProperty.call(message, "dateTimeValues")) - $root.google.cloud.contentwarehouse.v1.DateTimeArray.encode(message.dateTimeValues, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.mapProperty != null && Object.hasOwnProperty.call(message, "mapProperty")) - $root.google.cloud.contentwarehouse.v1.MapProperty.encode(message.mapProperty, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.timestampValues != null && Object.hasOwnProperty.call(message, "timestampValues")) - $root.google.cloud.contentwarehouse.v1.TimestampArray.encode(message.timestampValues, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Property message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.Property.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.Property - * @static - * @param {google.cloud.contentwarehouse.v1.IProperty} message Property message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Property.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Property message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.Property - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.Property} Property - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Property.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.Property(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.integerValues = $root.google.cloud.contentwarehouse.v1.IntegerArray.decode(reader, reader.uint32()); - break; - } - case 3: { - message.floatValues = $root.google.cloud.contentwarehouse.v1.FloatArray.decode(reader, reader.uint32()); - break; - } - case 4: { - message.textValues = $root.google.cloud.contentwarehouse.v1.TextArray.decode(reader, reader.uint32()); - break; - } - case 5: { - message.enumValues = $root.google.cloud.contentwarehouse.v1.EnumArray.decode(reader, reader.uint32()); - break; - } - case 6: { - message.propertyValues = $root.google.cloud.contentwarehouse.v1.PropertyArray.decode(reader, reader.uint32()); - break; - } - case 7: { - message.dateTimeValues = $root.google.cloud.contentwarehouse.v1.DateTimeArray.decode(reader, reader.uint32()); - break; - } - case 8: { - message.mapProperty = $root.google.cloud.contentwarehouse.v1.MapProperty.decode(reader, reader.uint32()); - break; - } - case 9: { - message.timestampValues = $root.google.cloud.contentwarehouse.v1.TimestampArray.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Property message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.Property - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.Property} Property - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Property.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Property message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.Property - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Property.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.integerValues != null && message.hasOwnProperty("integerValues")) { - properties.values = 1; - { - var error = $root.google.cloud.contentwarehouse.v1.IntegerArray.verify(message.integerValues); - if (error) - return "integerValues." + error; - } - } - if (message.floatValues != null && message.hasOwnProperty("floatValues")) { - if (properties.values === 1) - return "values: multiple values"; - properties.values = 1; - { - var error = $root.google.cloud.contentwarehouse.v1.FloatArray.verify(message.floatValues); - if (error) - return "floatValues." + error; - } - } - if (message.textValues != null && message.hasOwnProperty("textValues")) { - if (properties.values === 1) - return "values: multiple values"; - properties.values = 1; - { - var error = $root.google.cloud.contentwarehouse.v1.TextArray.verify(message.textValues); - if (error) - return "textValues." + error; - } - } - if (message.enumValues != null && message.hasOwnProperty("enumValues")) { - if (properties.values === 1) - return "values: multiple values"; - properties.values = 1; - { - var error = $root.google.cloud.contentwarehouse.v1.EnumArray.verify(message.enumValues); - if (error) - return "enumValues." + error; - } - } - if (message.propertyValues != null && message.hasOwnProperty("propertyValues")) { - if (properties.values === 1) - return "values: multiple values"; - properties.values = 1; - { - var error = $root.google.cloud.contentwarehouse.v1.PropertyArray.verify(message.propertyValues); - if (error) - return "propertyValues." + error; - } - } - if (message.dateTimeValues != null && message.hasOwnProperty("dateTimeValues")) { - if (properties.values === 1) - return "values: multiple values"; - properties.values = 1; - { - var error = $root.google.cloud.contentwarehouse.v1.DateTimeArray.verify(message.dateTimeValues); - if (error) - return "dateTimeValues." + error; - } - } - if (message.mapProperty != null && message.hasOwnProperty("mapProperty")) { - if (properties.values === 1) - return "values: multiple values"; - properties.values = 1; - { - var error = $root.google.cloud.contentwarehouse.v1.MapProperty.verify(message.mapProperty); - if (error) - return "mapProperty." + error; - } - } - if (message.timestampValues != null && message.hasOwnProperty("timestampValues")) { - if (properties.values === 1) - return "values: multiple values"; - properties.values = 1; - { - var error = $root.google.cloud.contentwarehouse.v1.TimestampArray.verify(message.timestampValues); - if (error) - return "timestampValues." + error; - } - } - return null; - }; - - /** - * Creates a Property message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.Property - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.Property} Property - */ - Property.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.Property) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.Property(); - if (object.name != null) - message.name = String(object.name); - if (object.integerValues != null) { - if (typeof object.integerValues !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.Property.integerValues: object expected"); - message.integerValues = $root.google.cloud.contentwarehouse.v1.IntegerArray.fromObject(object.integerValues); - } - if (object.floatValues != null) { - if (typeof object.floatValues !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.Property.floatValues: object expected"); - message.floatValues = $root.google.cloud.contentwarehouse.v1.FloatArray.fromObject(object.floatValues); - } - if (object.textValues != null) { - if (typeof object.textValues !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.Property.textValues: object expected"); - message.textValues = $root.google.cloud.contentwarehouse.v1.TextArray.fromObject(object.textValues); - } - if (object.enumValues != null) { - if (typeof object.enumValues !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.Property.enumValues: object expected"); - message.enumValues = $root.google.cloud.contentwarehouse.v1.EnumArray.fromObject(object.enumValues); - } - if (object.propertyValues != null) { - if (typeof object.propertyValues !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.Property.propertyValues: object expected"); - message.propertyValues = $root.google.cloud.contentwarehouse.v1.PropertyArray.fromObject(object.propertyValues); - } - if (object.dateTimeValues != null) { - if (typeof object.dateTimeValues !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.Property.dateTimeValues: object expected"); - message.dateTimeValues = $root.google.cloud.contentwarehouse.v1.DateTimeArray.fromObject(object.dateTimeValues); - } - if (object.mapProperty != null) { - if (typeof object.mapProperty !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.Property.mapProperty: object expected"); - message.mapProperty = $root.google.cloud.contentwarehouse.v1.MapProperty.fromObject(object.mapProperty); - } - if (object.timestampValues != null) { - if (typeof object.timestampValues !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.Property.timestampValues: object expected"); - message.timestampValues = $root.google.cloud.contentwarehouse.v1.TimestampArray.fromObject(object.timestampValues); - } - return message; - }; - - /** - * Creates a plain object from a Property message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.Property - * @static - * @param {google.cloud.contentwarehouse.v1.Property} message Property - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Property.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; - if (message.integerValues != null && message.hasOwnProperty("integerValues")) { - object.integerValues = $root.google.cloud.contentwarehouse.v1.IntegerArray.toObject(message.integerValues, options); - if (options.oneofs) - object.values = "integerValues"; - } - if (message.floatValues != null && message.hasOwnProperty("floatValues")) { - object.floatValues = $root.google.cloud.contentwarehouse.v1.FloatArray.toObject(message.floatValues, options); - if (options.oneofs) - object.values = "floatValues"; - } - if (message.textValues != null && message.hasOwnProperty("textValues")) { - object.textValues = $root.google.cloud.contentwarehouse.v1.TextArray.toObject(message.textValues, options); - if (options.oneofs) - object.values = "textValues"; - } - if (message.enumValues != null && message.hasOwnProperty("enumValues")) { - object.enumValues = $root.google.cloud.contentwarehouse.v1.EnumArray.toObject(message.enumValues, options); - if (options.oneofs) - object.values = "enumValues"; - } - if (message.propertyValues != null && message.hasOwnProperty("propertyValues")) { - object.propertyValues = $root.google.cloud.contentwarehouse.v1.PropertyArray.toObject(message.propertyValues, options); - if (options.oneofs) - object.values = "propertyValues"; - } - if (message.dateTimeValues != null && message.hasOwnProperty("dateTimeValues")) { - object.dateTimeValues = $root.google.cloud.contentwarehouse.v1.DateTimeArray.toObject(message.dateTimeValues, options); - if (options.oneofs) - object.values = "dateTimeValues"; - } - if (message.mapProperty != null && message.hasOwnProperty("mapProperty")) { - object.mapProperty = $root.google.cloud.contentwarehouse.v1.MapProperty.toObject(message.mapProperty, options); - if (options.oneofs) - object.values = "mapProperty"; - } - if (message.timestampValues != null && message.hasOwnProperty("timestampValues")) { - object.timestampValues = $root.google.cloud.contentwarehouse.v1.TimestampArray.toObject(message.timestampValues, options); - if (options.oneofs) - object.values = "timestampValues"; - } - return object; - }; - - /** - * Converts this Property to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.Property - * @instance - * @returns {Object.} JSON object - */ - Property.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Property - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.Property - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Property.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.Property"; - }; - - return Property; - })(); - - v1.IntegerArray = (function() { - - /** - * Properties of an IntegerArray. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IIntegerArray - * @property {Array.|null} [values] IntegerArray values - */ - - /** - * Constructs a new IntegerArray. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents an IntegerArray. - * @implements IIntegerArray - * @constructor - * @param {google.cloud.contentwarehouse.v1.IIntegerArray=} [properties] Properties to set - */ - function IntegerArray(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]]; - } - - /** - * IntegerArray values. - * @member {Array.} values - * @memberof google.cloud.contentwarehouse.v1.IntegerArray - * @instance - */ - IntegerArray.prototype.values = $util.emptyArray; - - /** - * Creates a new IntegerArray instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.IntegerArray - * @static - * @param {google.cloud.contentwarehouse.v1.IIntegerArray=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.IntegerArray} IntegerArray instance - */ - IntegerArray.create = function create(properties) { - return new IntegerArray(properties); - }; - - /** - * Encodes the specified IntegerArray message. Does not implicitly {@link google.cloud.contentwarehouse.v1.IntegerArray.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.IntegerArray - * @static - * @param {google.cloud.contentwarehouse.v1.IIntegerArray} message IntegerArray message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IntegerArray.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.values != null && message.values.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.values.length; ++i) - writer.int32(message.values[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified IntegerArray message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.IntegerArray.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.IntegerArray - * @static - * @param {google.cloud.contentwarehouse.v1.IIntegerArray} message IntegerArray message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IntegerArray.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IntegerArray message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.IntegerArray - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.IntegerArray} IntegerArray - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IntegerArray.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.IntegerArray(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.values && message.values.length)) - message.values = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.values.push(reader.int32()); - } else - message.values.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IntegerArray message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.IntegerArray - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.IntegerArray} IntegerArray - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IntegerArray.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IntegerArray message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.IntegerArray - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IntegerArray.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) - if (!$util.isInteger(message.values[i])) - return "values: integer[] expected"; - } - return null; - }; - - /** - * Creates an IntegerArray message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.IntegerArray - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.IntegerArray} IntegerArray - */ - IntegerArray.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.IntegerArray) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.IntegerArray(); - if (object.values) { - if (!Array.isArray(object.values)) - throw TypeError(".google.cloud.contentwarehouse.v1.IntegerArray.values: array expected"); - message.values = []; - for (var i = 0; i < object.values.length; ++i) - message.values[i] = object.values[i] | 0; - } - return message; - }; - - /** - * Creates a plain object from an IntegerArray message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.IntegerArray - * @static - * @param {google.cloud.contentwarehouse.v1.IntegerArray} message IntegerArray - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IntegerArray.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] = message.values[j]; - } - return object; - }; - - /** - * Converts this IntegerArray to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.IntegerArray - * @instance - * @returns {Object.} JSON object - */ - IntegerArray.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for IntegerArray - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.IntegerArray - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - IntegerArray.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.IntegerArray"; - }; - - return IntegerArray; - })(); - - v1.FloatArray = (function() { - - /** - * Properties of a FloatArray. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IFloatArray - * @property {Array.|null} [values] FloatArray values - */ - - /** - * Constructs a new FloatArray. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a FloatArray. - * @implements IFloatArray - * @constructor - * @param {google.cloud.contentwarehouse.v1.IFloatArray=} [properties] Properties to set - */ - function FloatArray(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]]; - } - - /** - * FloatArray values. - * @member {Array.} values - * @memberof google.cloud.contentwarehouse.v1.FloatArray - * @instance - */ - FloatArray.prototype.values = $util.emptyArray; - - /** - * Creates a new FloatArray instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.FloatArray - * @static - * @param {google.cloud.contentwarehouse.v1.IFloatArray=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.FloatArray} FloatArray instance - */ - FloatArray.create = function create(properties) { - return new FloatArray(properties); - }; - - /** - * Encodes the specified FloatArray message. Does not implicitly {@link google.cloud.contentwarehouse.v1.FloatArray.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.FloatArray - * @static - * @param {google.cloud.contentwarehouse.v1.IFloatArray} message FloatArray message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FloatArray.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.values != null && message.values.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.values.length; ++i) - writer.float(message.values[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified FloatArray message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.FloatArray.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.FloatArray - * @static - * @param {google.cloud.contentwarehouse.v1.IFloatArray} message FloatArray message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FloatArray.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FloatArray message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.FloatArray - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.FloatArray} FloatArray - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FloatArray.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.FloatArray(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.values && message.values.length)) - message.values = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.values.push(reader.float()); - } else - message.values.push(reader.float()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FloatArray message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.FloatArray - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.FloatArray} FloatArray - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FloatArray.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FloatArray message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.FloatArray - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FloatArray.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) - if (typeof message.values[i] !== "number") - return "values: number[] expected"; - } - return null; - }; - - /** - * Creates a FloatArray message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.FloatArray - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.FloatArray} FloatArray - */ - FloatArray.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.FloatArray) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.FloatArray(); - if (object.values) { - if (!Array.isArray(object.values)) - throw TypeError(".google.cloud.contentwarehouse.v1.FloatArray.values: array expected"); - message.values = []; - for (var i = 0; i < object.values.length; ++i) - message.values[i] = Number(object.values[i]); - } - return message; - }; - - /** - * Creates a plain object from a FloatArray message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.FloatArray - * @static - * @param {google.cloud.contentwarehouse.v1.FloatArray} message FloatArray - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FloatArray.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] = options.json && !isFinite(message.values[j]) ? String(message.values[j]) : message.values[j]; - } - return object; - }; - - /** - * Converts this FloatArray to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.FloatArray - * @instance - * @returns {Object.} JSON object - */ - FloatArray.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FloatArray - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.FloatArray - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FloatArray.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.FloatArray"; - }; - - return FloatArray; - })(); - - v1.TextArray = (function() { - - /** - * Properties of a TextArray. - * @memberof google.cloud.contentwarehouse.v1 - * @interface ITextArray - * @property {Array.|null} [values] TextArray values - */ - - /** - * Constructs a new TextArray. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a TextArray. - * @implements ITextArray - * @constructor - * @param {google.cloud.contentwarehouse.v1.ITextArray=} [properties] Properties to set - */ - function TextArray(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]]; - } - - /** - * TextArray values. - * @member {Array.} values - * @memberof google.cloud.contentwarehouse.v1.TextArray - * @instance - */ - TextArray.prototype.values = $util.emptyArray; - - /** - * Creates a new TextArray instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.TextArray - * @static - * @param {google.cloud.contentwarehouse.v1.ITextArray=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.TextArray} TextArray instance - */ - TextArray.create = function create(properties) { - return new TextArray(properties); - }; - - /** - * Encodes the specified TextArray message. Does not implicitly {@link google.cloud.contentwarehouse.v1.TextArray.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.TextArray - * @static - * @param {google.cloud.contentwarehouse.v1.ITextArray} message TextArray message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TextArray.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) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.values[i]); - return writer; - }; - - /** - * Encodes the specified TextArray message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.TextArray.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.TextArray - * @static - * @param {google.cloud.contentwarehouse.v1.ITextArray} message TextArray message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TextArray.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TextArray message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.TextArray - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.TextArray} TextArray - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TextArray.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.TextArray(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.values && message.values.length)) - message.values = []; - message.values.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TextArray message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.TextArray - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.TextArray} TextArray - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TextArray.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TextArray message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.TextArray - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TextArray.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) - if (!$util.isString(message.values[i])) - return "values: string[] expected"; - } - return null; - }; - - /** - * Creates a TextArray message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.TextArray - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.TextArray} TextArray - */ - TextArray.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.TextArray) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.TextArray(); - if (object.values) { - if (!Array.isArray(object.values)) - throw TypeError(".google.cloud.contentwarehouse.v1.TextArray.values: array expected"); - message.values = []; - for (var i = 0; i < object.values.length; ++i) - message.values[i] = String(object.values[i]); - } - return message; - }; - - /** - * Creates a plain object from a TextArray message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.TextArray - * @static - * @param {google.cloud.contentwarehouse.v1.TextArray} message TextArray - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TextArray.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] = message.values[j]; - } - return object; - }; - - /** - * Converts this TextArray to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.TextArray - * @instance - * @returns {Object.} JSON object - */ - TextArray.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TextArray - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.TextArray - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TextArray.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.TextArray"; - }; - - return TextArray; - })(); - - v1.EnumArray = (function() { - - /** - * Properties of an EnumArray. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IEnumArray - * @property {Array.|null} [values] EnumArray values - */ - - /** - * Constructs a new EnumArray. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents an EnumArray. - * @implements IEnumArray - * @constructor - * @param {google.cloud.contentwarehouse.v1.IEnumArray=} [properties] Properties to set - */ - function EnumArray(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]]; - } - - /** - * EnumArray values. - * @member {Array.} values - * @memberof google.cloud.contentwarehouse.v1.EnumArray - * @instance - */ - EnumArray.prototype.values = $util.emptyArray; - - /** - * Creates a new EnumArray instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.EnumArray - * @static - * @param {google.cloud.contentwarehouse.v1.IEnumArray=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.EnumArray} EnumArray instance - */ - EnumArray.create = function create(properties) { - return new EnumArray(properties); - }; - - /** - * Encodes the specified EnumArray message. Does not implicitly {@link google.cloud.contentwarehouse.v1.EnumArray.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.EnumArray - * @static - * @param {google.cloud.contentwarehouse.v1.IEnumArray} message EnumArray message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumArray.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) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.values[i]); - return writer; - }; - - /** - * Encodes the specified EnumArray message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.EnumArray.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.EnumArray - * @static - * @param {google.cloud.contentwarehouse.v1.IEnumArray} message EnumArray message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumArray.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumArray message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.EnumArray - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.EnumArray} EnumArray - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumArray.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.EnumArray(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.values && message.values.length)) - message.values = []; - message.values.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumArray message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.EnumArray - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.EnumArray} EnumArray - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumArray.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumArray message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.EnumArray - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumArray.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) - if (!$util.isString(message.values[i])) - return "values: string[] expected"; - } - return null; - }; - - /** - * Creates an EnumArray message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.EnumArray - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.EnumArray} EnumArray - */ - EnumArray.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.EnumArray) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.EnumArray(); - if (object.values) { - if (!Array.isArray(object.values)) - throw TypeError(".google.cloud.contentwarehouse.v1.EnumArray.values: array expected"); - message.values = []; - for (var i = 0; i < object.values.length; ++i) - message.values[i] = String(object.values[i]); - } - return message; - }; - - /** - * Creates a plain object from an EnumArray message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.EnumArray - * @static - * @param {google.cloud.contentwarehouse.v1.EnumArray} message EnumArray - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumArray.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] = message.values[j]; - } - return object; - }; - - /** - * Converts this EnumArray to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.EnumArray - * @instance - * @returns {Object.} JSON object - */ - EnumArray.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumArray - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.EnumArray - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumArray.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.EnumArray"; - }; - - return EnumArray; - })(); - - v1.DateTimeArray = (function() { - - /** - * Properties of a DateTimeArray. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IDateTimeArray - * @property {Array.|null} [values] DateTimeArray values - */ - - /** - * Constructs a new DateTimeArray. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a DateTimeArray. - * @implements IDateTimeArray - * @constructor - * @param {google.cloud.contentwarehouse.v1.IDateTimeArray=} [properties] Properties to set - */ - function DateTimeArray(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]]; - } - - /** - * DateTimeArray values. - * @member {Array.} values - * @memberof google.cloud.contentwarehouse.v1.DateTimeArray - * @instance - */ - DateTimeArray.prototype.values = $util.emptyArray; - - /** - * Creates a new DateTimeArray instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.DateTimeArray - * @static - * @param {google.cloud.contentwarehouse.v1.IDateTimeArray=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.DateTimeArray} DateTimeArray instance - */ - DateTimeArray.create = function create(properties) { - return new DateTimeArray(properties); - }; - - /** - * Encodes the specified DateTimeArray message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DateTimeArray.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.DateTimeArray - * @static - * @param {google.cloud.contentwarehouse.v1.IDateTimeArray} message DateTimeArray message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DateTimeArray.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.type.DateTime.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DateTimeArray message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DateTimeArray.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.DateTimeArray - * @static - * @param {google.cloud.contentwarehouse.v1.IDateTimeArray} message DateTimeArray message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DateTimeArray.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DateTimeArray message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.DateTimeArray - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.DateTimeArray} DateTimeArray - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DateTimeArray.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.DateTimeArray(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.values && message.values.length)) - message.values = []; - message.values.push($root.google.type.DateTime.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DateTimeArray message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.DateTimeArray - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.DateTimeArray} DateTimeArray - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DateTimeArray.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DateTimeArray message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.DateTimeArray - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DateTimeArray.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.type.DateTime.verify(message.values[i]); - if (error) - return "values." + error; - } - } - return null; - }; - - /** - * Creates a DateTimeArray message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.DateTimeArray - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.DateTimeArray} DateTimeArray - */ - DateTimeArray.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.DateTimeArray) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.DateTimeArray(); - if (object.values) { - if (!Array.isArray(object.values)) - throw TypeError(".google.cloud.contentwarehouse.v1.DateTimeArray.values: array expected"); - message.values = []; - for (var i = 0; i < object.values.length; ++i) { - if (typeof object.values[i] !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.DateTimeArray.values: object expected"); - message.values[i] = $root.google.type.DateTime.fromObject(object.values[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a DateTimeArray message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.DateTimeArray - * @static - * @param {google.cloud.contentwarehouse.v1.DateTimeArray} message DateTimeArray - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DateTimeArray.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.type.DateTime.toObject(message.values[j], options); - } - return object; - }; - - /** - * Converts this DateTimeArray to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.DateTimeArray - * @instance - * @returns {Object.} JSON object - */ - DateTimeArray.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DateTimeArray - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.DateTimeArray - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DateTimeArray.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.DateTimeArray"; - }; - - return DateTimeArray; - })(); - - v1.TimestampArray = (function() { - - /** - * Properties of a TimestampArray. - * @memberof google.cloud.contentwarehouse.v1 - * @interface ITimestampArray - * @property {Array.|null} [values] TimestampArray values - */ - - /** - * Constructs a new TimestampArray. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a TimestampArray. - * @implements ITimestampArray - * @constructor - * @param {google.cloud.contentwarehouse.v1.ITimestampArray=} [properties] Properties to set - */ - function TimestampArray(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]]; - } - - /** - * TimestampArray values. - * @member {Array.} values - * @memberof google.cloud.contentwarehouse.v1.TimestampArray - * @instance - */ - TimestampArray.prototype.values = $util.emptyArray; - - /** - * Creates a new TimestampArray instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.TimestampArray - * @static - * @param {google.cloud.contentwarehouse.v1.ITimestampArray=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.TimestampArray} TimestampArray instance - */ - TimestampArray.create = function create(properties) { - return new TimestampArray(properties); - }; - - /** - * Encodes the specified TimestampArray message. Does not implicitly {@link google.cloud.contentwarehouse.v1.TimestampArray.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.TimestampArray - * @static - * @param {google.cloud.contentwarehouse.v1.ITimestampArray} message TimestampArray message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TimestampArray.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.cloud.contentwarehouse.v1.TimestampValue.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TimestampArray message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.TimestampArray.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.TimestampArray - * @static - * @param {google.cloud.contentwarehouse.v1.ITimestampArray} message TimestampArray message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TimestampArray.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TimestampArray message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.TimestampArray - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.TimestampArray} TimestampArray - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TimestampArray.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.TimestampArray(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.values && message.values.length)) - message.values = []; - message.values.push($root.google.cloud.contentwarehouse.v1.TimestampValue.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TimestampArray message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.TimestampArray - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.TimestampArray} TimestampArray - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TimestampArray.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TimestampArray message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.TimestampArray - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TimestampArray.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.cloud.contentwarehouse.v1.TimestampValue.verify(message.values[i]); - if (error) - return "values." + error; - } - } - return null; - }; - - /** - * Creates a TimestampArray message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.TimestampArray - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.TimestampArray} TimestampArray - */ - TimestampArray.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.TimestampArray) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.TimestampArray(); - if (object.values) { - if (!Array.isArray(object.values)) - throw TypeError(".google.cloud.contentwarehouse.v1.TimestampArray.values: array expected"); - message.values = []; - for (var i = 0; i < object.values.length; ++i) { - if (typeof object.values[i] !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.TimestampArray.values: object expected"); - message.values[i] = $root.google.cloud.contentwarehouse.v1.TimestampValue.fromObject(object.values[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a TimestampArray message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.TimestampArray - * @static - * @param {google.cloud.contentwarehouse.v1.TimestampArray} message TimestampArray - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TimestampArray.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.cloud.contentwarehouse.v1.TimestampValue.toObject(message.values[j], options); - } - return object; - }; - - /** - * Converts this TimestampArray to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.TimestampArray - * @instance - * @returns {Object.} JSON object - */ - TimestampArray.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TimestampArray - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.TimestampArray - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TimestampArray.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.TimestampArray"; - }; - - return TimestampArray; - })(); - - v1.TimestampValue = (function() { - - /** - * Properties of a TimestampValue. - * @memberof google.cloud.contentwarehouse.v1 - * @interface ITimestampValue - * @property {google.protobuf.ITimestamp|null} [timestampValue] TimestampValue timestampValue - * @property {string|null} [textValue] TimestampValue textValue - */ - - /** - * Constructs a new TimestampValue. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a TimestampValue. - * @implements ITimestampValue - * @constructor - * @param {google.cloud.contentwarehouse.v1.ITimestampValue=} [properties] Properties to set - */ - function TimestampValue(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]]; - } - - /** - * TimestampValue timestampValue. - * @member {google.protobuf.ITimestamp|null|undefined} timestampValue - * @memberof google.cloud.contentwarehouse.v1.TimestampValue - * @instance - */ - TimestampValue.prototype.timestampValue = null; - - /** - * TimestampValue textValue. - * @member {string|null|undefined} textValue - * @memberof google.cloud.contentwarehouse.v1.TimestampValue - * @instance - */ - TimestampValue.prototype.textValue = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * TimestampValue value. - * @member {"timestampValue"|"textValue"|undefined} value - * @memberof google.cloud.contentwarehouse.v1.TimestampValue - * @instance - */ - Object.defineProperty(TimestampValue.prototype, "value", { - get: $util.oneOfGetter($oneOfFields = ["timestampValue", "textValue"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new TimestampValue instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.TimestampValue - * @static - * @param {google.cloud.contentwarehouse.v1.ITimestampValue=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.TimestampValue} TimestampValue instance - */ - TimestampValue.create = function create(properties) { - return new TimestampValue(properties); - }; - - /** - * Encodes the specified TimestampValue message. Does not implicitly {@link google.cloud.contentwarehouse.v1.TimestampValue.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.TimestampValue - * @static - * @param {google.cloud.contentwarehouse.v1.ITimestampValue} message TimestampValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TimestampValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.timestampValue != null && Object.hasOwnProperty.call(message, "timestampValue")) - $root.google.protobuf.Timestamp.encode(message.timestampValue, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.textValue != null && Object.hasOwnProperty.call(message, "textValue")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.textValue); - return writer; - }; - - /** - * Encodes the specified TimestampValue message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.TimestampValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.TimestampValue - * @static - * @param {google.cloud.contentwarehouse.v1.ITimestampValue} message TimestampValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TimestampValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TimestampValue message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.TimestampValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.TimestampValue} TimestampValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TimestampValue.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.TimestampValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.timestampValue = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 2: { - message.textValue = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TimestampValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.TimestampValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.TimestampValue} TimestampValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TimestampValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TimestampValue message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.TimestampValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TimestampValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.timestampValue != null && message.hasOwnProperty("timestampValue")) { - properties.value = 1; - { - var error = $root.google.protobuf.Timestamp.verify(message.timestampValue); - if (error) - return "timestampValue." + error; - } - } - if (message.textValue != null && message.hasOwnProperty("textValue")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - if (!$util.isString(message.textValue)) - return "textValue: string expected"; - } - return null; - }; - - /** - * Creates a TimestampValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.TimestampValue - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.TimestampValue} TimestampValue - */ - TimestampValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.TimestampValue) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.TimestampValue(); - if (object.timestampValue != null) { - if (typeof object.timestampValue !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.TimestampValue.timestampValue: object expected"); - message.timestampValue = $root.google.protobuf.Timestamp.fromObject(object.timestampValue); - } - if (object.textValue != null) - message.textValue = String(object.textValue); - return message; - }; - - /** - * Creates a plain object from a TimestampValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.TimestampValue - * @static - * @param {google.cloud.contentwarehouse.v1.TimestampValue} message TimestampValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TimestampValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.timestampValue != null && message.hasOwnProperty("timestampValue")) { - object.timestampValue = $root.google.protobuf.Timestamp.toObject(message.timestampValue, options); - if (options.oneofs) - object.value = "timestampValue"; - } - if (message.textValue != null && message.hasOwnProperty("textValue")) { - object.textValue = message.textValue; - if (options.oneofs) - object.value = "textValue"; - } - return object; - }; - - /** - * Converts this TimestampValue to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.TimestampValue - * @instance - * @returns {Object.} JSON object - */ - TimestampValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TimestampValue - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.TimestampValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TimestampValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.TimestampValue"; - }; - - return TimestampValue; - })(); - - v1.PropertyArray = (function() { - - /** - * Properties of a PropertyArray. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IPropertyArray - * @property {Array.|null} [properties] PropertyArray properties - */ - - /** - * Constructs a new PropertyArray. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a PropertyArray. - * @implements IPropertyArray - * @constructor - * @param {google.cloud.contentwarehouse.v1.IPropertyArray=} [properties] Properties to set - */ - function PropertyArray(properties) { - this.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]]; - } - - /** - * PropertyArray properties. - * @member {Array.} properties - * @memberof google.cloud.contentwarehouse.v1.PropertyArray - * @instance - */ - PropertyArray.prototype.properties = $util.emptyArray; - - /** - * Creates a new PropertyArray instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.PropertyArray - * @static - * @param {google.cloud.contentwarehouse.v1.IPropertyArray=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.PropertyArray} PropertyArray instance - */ - PropertyArray.create = function create(properties) { - return new PropertyArray(properties); - }; - - /** - * Encodes the specified PropertyArray message. Does not implicitly {@link google.cloud.contentwarehouse.v1.PropertyArray.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.PropertyArray - * @static - * @param {google.cloud.contentwarehouse.v1.IPropertyArray} message PropertyArray message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PropertyArray.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.properties != null && message.properties.length) - for (var i = 0; i < message.properties.length; ++i) - $root.google.cloud.contentwarehouse.v1.Property.encode(message.properties[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PropertyArray message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.PropertyArray.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.PropertyArray - * @static - * @param {google.cloud.contentwarehouse.v1.IPropertyArray} message PropertyArray message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PropertyArray.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PropertyArray message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.PropertyArray - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.PropertyArray} PropertyArray - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PropertyArray.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.PropertyArray(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.properties && message.properties.length)) - message.properties = []; - message.properties.push($root.google.cloud.contentwarehouse.v1.Property.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PropertyArray message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.PropertyArray - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.PropertyArray} PropertyArray - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PropertyArray.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PropertyArray message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.PropertyArray - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PropertyArray.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.properties != null && message.hasOwnProperty("properties")) { - if (!Array.isArray(message.properties)) - return "properties: array expected"; - for (var i = 0; i < message.properties.length; ++i) { - var error = $root.google.cloud.contentwarehouse.v1.Property.verify(message.properties[i]); - if (error) - return "properties." + error; - } - } - return null; - }; - - /** - * Creates a PropertyArray message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.PropertyArray - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.PropertyArray} PropertyArray - */ - PropertyArray.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.PropertyArray) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.PropertyArray(); - if (object.properties) { - if (!Array.isArray(object.properties)) - throw TypeError(".google.cloud.contentwarehouse.v1.PropertyArray.properties: array expected"); - message.properties = []; - for (var i = 0; i < object.properties.length; ++i) { - if (typeof object.properties[i] !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.PropertyArray.properties: object expected"); - message.properties[i] = $root.google.cloud.contentwarehouse.v1.Property.fromObject(object.properties[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a PropertyArray message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.PropertyArray - * @static - * @param {google.cloud.contentwarehouse.v1.PropertyArray} message PropertyArray - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PropertyArray.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.properties = []; - if (message.properties && message.properties.length) { - object.properties = []; - for (var j = 0; j < message.properties.length; ++j) - object.properties[j] = $root.google.cloud.contentwarehouse.v1.Property.toObject(message.properties[j], options); - } - return object; - }; - - /** - * Converts this PropertyArray to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.PropertyArray - * @instance - * @returns {Object.} JSON object - */ - PropertyArray.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PropertyArray - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.PropertyArray - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PropertyArray.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.PropertyArray"; - }; - - return PropertyArray; - })(); - - v1.MapProperty = (function() { - - /** - * Properties of a MapProperty. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IMapProperty - * @property {Object.|null} [fields] MapProperty fields - */ - - /** - * Constructs a new MapProperty. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a MapProperty. - * @implements IMapProperty - * @constructor - * @param {google.cloud.contentwarehouse.v1.IMapProperty=} [properties] Properties to set - */ - function MapProperty(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]]; - } - - /** - * MapProperty fields. - * @member {Object.} fields - * @memberof google.cloud.contentwarehouse.v1.MapProperty - * @instance - */ - MapProperty.prototype.fields = $util.emptyObject; - - /** - * Creates a new MapProperty instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.MapProperty - * @static - * @param {google.cloud.contentwarehouse.v1.IMapProperty=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.MapProperty} MapProperty instance - */ - MapProperty.create = function create(properties) { - return new MapProperty(properties); - }; - - /** - * Encodes the specified MapProperty message. Does not implicitly {@link google.cloud.contentwarehouse.v1.MapProperty.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.MapProperty - * @static - * @param {google.cloud.contentwarehouse.v1.IMapProperty} message MapProperty message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MapProperty.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) - for (var keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.contentwarehouse.v1.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - return writer; - }; - - /** - * Encodes the specified MapProperty message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.MapProperty.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.MapProperty - * @static - * @param {google.cloud.contentwarehouse.v1.IMapProperty} message MapProperty message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MapProperty.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MapProperty message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.MapProperty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.MapProperty} MapProperty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MapProperty.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.MapProperty(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (message.fields === $util.emptyObject) - message.fields = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.cloud.contentwarehouse.v1.Value.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.fields[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MapProperty message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.MapProperty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.MapProperty} MapProperty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MapProperty.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MapProperty message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.MapProperty - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MapProperty.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fields != null && message.hasOwnProperty("fields")) { - if (!$util.isObject(message.fields)) - return "fields: object expected"; - var key = Object.keys(message.fields); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.contentwarehouse.v1.Value.verify(message.fields[key[i]]); - if (error) - return "fields." + error; - } - } - return null; - }; - - /** - * Creates a MapProperty message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.MapProperty - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.MapProperty} MapProperty - */ - MapProperty.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.MapProperty) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.MapProperty(); - if (object.fields) { - if (typeof object.fields !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.MapProperty.fields: object expected"); - message.fields = {}; - for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { - if (typeof object.fields[keys[i]] !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.MapProperty.fields: object expected"); - message.fields[keys[i]] = $root.google.cloud.contentwarehouse.v1.Value.fromObject(object.fields[keys[i]]); - } - } - return message; - }; - - /** - * Creates a plain object from a MapProperty message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.MapProperty - * @static - * @param {google.cloud.contentwarehouse.v1.MapProperty} message MapProperty - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MapProperty.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.fields = {}; - var keys2; - if (message.fields && (keys2 = Object.keys(message.fields)).length) { - object.fields = {}; - for (var j = 0; j < keys2.length; ++j) - object.fields[keys2[j]] = $root.google.cloud.contentwarehouse.v1.Value.toObject(message.fields[keys2[j]], options); - } - return object; - }; - - /** - * Converts this MapProperty to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.MapProperty - * @instance - * @returns {Object.} JSON object - */ - MapProperty.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MapProperty - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.MapProperty - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MapProperty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.MapProperty"; - }; - - return MapProperty; - })(); - - v1.Value = (function() { - - /** - * Properties of a Value. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IValue - * @property {number|null} [floatValue] Value floatValue - * @property {number|null} [intValue] Value intValue - * @property {string|null} [stringValue] Value stringValue - * @property {google.cloud.contentwarehouse.v1.IEnumValue|null} [enumValue] Value enumValue - * @property {google.type.IDateTime|null} [datetimeValue] Value datetimeValue - * @property {google.cloud.contentwarehouse.v1.ITimestampValue|null} [timestampValue] Value timestampValue - * @property {boolean|null} [booleanValue] Value booleanValue - */ - - /** - * Constructs a new Value. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a Value. - * @implements IValue - * @constructor - * @param {google.cloud.contentwarehouse.v1.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 floatValue. - * @member {number|null|undefined} floatValue - * @memberof google.cloud.contentwarehouse.v1.Value - * @instance - */ - Value.prototype.floatValue = null; - - /** - * Value intValue. - * @member {number|null|undefined} intValue - * @memberof google.cloud.contentwarehouse.v1.Value - * @instance - */ - Value.prototype.intValue = null; - - /** - * Value stringValue. - * @member {string|null|undefined} stringValue - * @memberof google.cloud.contentwarehouse.v1.Value - * @instance - */ - Value.prototype.stringValue = null; - - /** - * Value enumValue. - * @member {google.cloud.contentwarehouse.v1.IEnumValue|null|undefined} enumValue - * @memberof google.cloud.contentwarehouse.v1.Value - * @instance - */ - Value.prototype.enumValue = null; - - /** - * Value datetimeValue. - * @member {google.type.IDateTime|null|undefined} datetimeValue - * @memberof google.cloud.contentwarehouse.v1.Value - * @instance - */ - Value.prototype.datetimeValue = null; - - /** - * Value timestampValue. - * @member {google.cloud.contentwarehouse.v1.ITimestampValue|null|undefined} timestampValue - * @memberof google.cloud.contentwarehouse.v1.Value - * @instance - */ - Value.prototype.timestampValue = null; - - /** - * Value booleanValue. - * @member {boolean|null|undefined} booleanValue - * @memberof google.cloud.contentwarehouse.v1.Value - * @instance - */ - Value.prototype.booleanValue = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Value kind. - * @member {"floatValue"|"intValue"|"stringValue"|"enumValue"|"datetimeValue"|"timestampValue"|"booleanValue"|undefined} kind - * @memberof google.cloud.contentwarehouse.v1.Value - * @instance - */ - Object.defineProperty(Value.prototype, "kind", { - get: $util.oneOfGetter($oneOfFields = ["floatValue", "intValue", "stringValue", "enumValue", "datetimeValue", "timestampValue", "booleanValue"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Value instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.Value - * @static - * @param {google.cloud.contentwarehouse.v1.IValue=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.Value} Value instance - */ - Value.create = function create(properties) { - return new Value(properties); - }; - - /** - * Encodes the specified Value message. Does not implicitly {@link google.cloud.contentwarehouse.v1.Value.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.Value - * @static - * @param {google.cloud.contentwarehouse.v1.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.floatValue != null && Object.hasOwnProperty.call(message, "floatValue")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.floatValue); - if (message.intValue != null && Object.hasOwnProperty.call(message, "intValue")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.intValue); - if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); - if (message.enumValue != null && Object.hasOwnProperty.call(message, "enumValue")) - $root.google.cloud.contentwarehouse.v1.EnumValue.encode(message.enumValue, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.datetimeValue != null && Object.hasOwnProperty.call(message, "datetimeValue")) - $root.google.type.DateTime.encode(message.datetimeValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.timestampValue != null && Object.hasOwnProperty.call(message, "timestampValue")) - $root.google.cloud.contentwarehouse.v1.TimestampValue.encode(message.timestampValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.booleanValue != null && Object.hasOwnProperty.call(message, "booleanValue")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.booleanValue); - return writer; - }; - - /** - * Encodes the specified Value message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.Value - * @static - * @param {google.cloud.contentwarehouse.v1.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.cloud.contentwarehouse.v1.Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.floatValue = reader.float(); - break; - } - case 2: { - message.intValue = reader.int32(); - break; - } - case 3: { - message.stringValue = reader.string(); - break; - } - case 4: { - message.enumValue = $root.google.cloud.contentwarehouse.v1.EnumValue.decode(reader, reader.uint32()); - break; - } - case 5: { - message.datetimeValue = $root.google.type.DateTime.decode(reader, reader.uint32()); - break; - } - case 6: { - message.timestampValue = $root.google.cloud.contentwarehouse.v1.TimestampValue.decode(reader, reader.uint32()); - break; - } - case 7: { - message.booleanValue = reader.bool(); - 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.cloud.contentwarehouse.v1.Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.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.cloud.contentwarehouse.v1.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.floatValue != null && message.hasOwnProperty("floatValue")) { - properties.kind = 1; - if (typeof message.floatValue !== "number") - return "floatValue: number expected"; - } - if (message.intValue != null && message.hasOwnProperty("intValue")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - if (!$util.isInteger(message.intValue)) - return "intValue: integer expected"; - } - if (message.stringValue != null && message.hasOwnProperty("stringValue")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - if (!$util.isString(message.stringValue)) - return "stringValue: string expected"; - } - if (message.enumValue != null && message.hasOwnProperty("enumValue")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - { - var error = $root.google.cloud.contentwarehouse.v1.EnumValue.verify(message.enumValue); - if (error) - return "enumValue." + error; - } - } - if (message.datetimeValue != null && message.hasOwnProperty("datetimeValue")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - { - var error = $root.google.type.DateTime.verify(message.datetimeValue); - if (error) - return "datetimeValue." + error; - } - } - if (message.timestampValue != null && message.hasOwnProperty("timestampValue")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - { - var error = $root.google.cloud.contentwarehouse.v1.TimestampValue.verify(message.timestampValue); - if (error) - return "timestampValue." + error; - } - } - if (message.booleanValue != null && message.hasOwnProperty("booleanValue")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - if (typeof message.booleanValue !== "boolean") - return "booleanValue: boolean expected"; - } - return null; - }; - - /** - * Creates a Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.Value - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.Value} Value - */ - Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.Value) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.Value(); - if (object.floatValue != null) - message.floatValue = Number(object.floatValue); - if (object.intValue != null) - message.intValue = object.intValue | 0; - if (object.stringValue != null) - message.stringValue = String(object.stringValue); - if (object.enumValue != null) { - if (typeof object.enumValue !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.Value.enumValue: object expected"); - message.enumValue = $root.google.cloud.contentwarehouse.v1.EnumValue.fromObject(object.enumValue); - } - if (object.datetimeValue != null) { - if (typeof object.datetimeValue !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.Value.datetimeValue: object expected"); - message.datetimeValue = $root.google.type.DateTime.fromObject(object.datetimeValue); - } - if (object.timestampValue != null) { - if (typeof object.timestampValue !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.Value.timestampValue: object expected"); - message.timestampValue = $root.google.cloud.contentwarehouse.v1.TimestampValue.fromObject(object.timestampValue); - } - if (object.booleanValue != null) - message.booleanValue = Boolean(object.booleanValue); - return message; - }; - - /** - * Creates a plain object from a Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.Value - * @static - * @param {google.cloud.contentwarehouse.v1.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.floatValue != null && message.hasOwnProperty("floatValue")) { - object.floatValue = options.json && !isFinite(message.floatValue) ? String(message.floatValue) : message.floatValue; - if (options.oneofs) - object.kind = "floatValue"; - } - if (message.intValue != null && message.hasOwnProperty("intValue")) { - object.intValue = message.intValue; - if (options.oneofs) - object.kind = "intValue"; - } - if (message.stringValue != null && message.hasOwnProperty("stringValue")) { - object.stringValue = message.stringValue; - if (options.oneofs) - object.kind = "stringValue"; - } - if (message.enumValue != null && message.hasOwnProperty("enumValue")) { - object.enumValue = $root.google.cloud.contentwarehouse.v1.EnumValue.toObject(message.enumValue, options); - if (options.oneofs) - object.kind = "enumValue"; - } - if (message.datetimeValue != null && message.hasOwnProperty("datetimeValue")) { - object.datetimeValue = $root.google.type.DateTime.toObject(message.datetimeValue, options); - if (options.oneofs) - object.kind = "datetimeValue"; - } - if (message.timestampValue != null && message.hasOwnProperty("timestampValue")) { - object.timestampValue = $root.google.cloud.contentwarehouse.v1.TimestampValue.toObject(message.timestampValue, options); - if (options.oneofs) - object.kind = "timestampValue"; - } - if (message.booleanValue != null && message.hasOwnProperty("booleanValue")) { - object.booleanValue = message.booleanValue; - if (options.oneofs) - object.kind = "booleanValue"; - } - return object; - }; - - /** - * Converts this Value to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.Value - * @instance - * @returns {Object.} JSON object - */ - Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Value - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.Value - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.Value"; - }; - - return Value; - })(); - - v1.EnumValue = (function() { - - /** - * Properties of an EnumValue. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IEnumValue - * @property {string|null} [value] EnumValue value - */ - - /** - * Constructs a new EnumValue. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents an EnumValue. - * @implements IEnumValue - * @constructor - * @param {google.cloud.contentwarehouse.v1.IEnumValue=} [properties] Properties to set - */ - function EnumValue(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]]; - } - - /** - * EnumValue value. - * @member {string} value - * @memberof google.cloud.contentwarehouse.v1.EnumValue - * @instance - */ - EnumValue.prototype.value = ""; - - /** - * Creates a new EnumValue instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.EnumValue - * @static - * @param {google.cloud.contentwarehouse.v1.IEnumValue=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.EnumValue} EnumValue instance - */ - EnumValue.create = function create(properties) { - return new EnumValue(properties); - }; - - /** - * Encodes the specified EnumValue message. Does not implicitly {@link google.cloud.contentwarehouse.v1.EnumValue.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.EnumValue - * @static - * @param {google.cloud.contentwarehouse.v1.IEnumValue} message EnumValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); - return writer; - }; - - /** - * Encodes the specified EnumValue message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.EnumValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.EnumValue - * @static - * @param {google.cloud.contentwarehouse.v1.IEnumValue} message EnumValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValue message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.EnumValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.EnumValue} EnumValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValue.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.EnumValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.EnumValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.EnumValue} EnumValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumValue message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.EnumValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; - return null; - }; - - /** - * Creates an EnumValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.EnumValue - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.EnumValue} EnumValue - */ - EnumValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.EnumValue) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.EnumValue(); - if (object.value != null) - message.value = String(object.value); - return message; - }; - - /** - * Creates a plain object from an EnumValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.EnumValue - * @static - * @param {google.cloud.contentwarehouse.v1.EnumValue} message EnumValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = ""; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; - - /** - * Converts this EnumValue to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.EnumValue - * @instance - * @returns {Object.} JSON object - */ - EnumValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumValue - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.EnumValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.EnumValue"; - }; - - return EnumValue; - })(); - - /** - * RawDocumentFileType enum. - * @name google.cloud.contentwarehouse.v1.RawDocumentFileType - * @enum {number} - * @property {number} RAW_DOCUMENT_FILE_TYPE_UNSPECIFIED=0 RAW_DOCUMENT_FILE_TYPE_UNSPECIFIED value - * @property {number} RAW_DOCUMENT_FILE_TYPE_PDF=1 RAW_DOCUMENT_FILE_TYPE_PDF value - * @property {number} RAW_DOCUMENT_FILE_TYPE_DOCX=2 RAW_DOCUMENT_FILE_TYPE_DOCX value - * @property {number} RAW_DOCUMENT_FILE_TYPE_XLSX=3 RAW_DOCUMENT_FILE_TYPE_XLSX value - * @property {number} RAW_DOCUMENT_FILE_TYPE_PPTX=4 RAW_DOCUMENT_FILE_TYPE_PPTX value - * @property {number} RAW_DOCUMENT_FILE_TYPE_TEXT=5 RAW_DOCUMENT_FILE_TYPE_TEXT value - * @property {number} RAW_DOCUMENT_FILE_TYPE_TIFF=6 RAW_DOCUMENT_FILE_TYPE_TIFF value - */ - v1.RawDocumentFileType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RAW_DOCUMENT_FILE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "RAW_DOCUMENT_FILE_TYPE_PDF"] = 1; - values[valuesById[2] = "RAW_DOCUMENT_FILE_TYPE_DOCX"] = 2; - values[valuesById[3] = "RAW_DOCUMENT_FILE_TYPE_XLSX"] = 3; - values[valuesById[4] = "RAW_DOCUMENT_FILE_TYPE_PPTX"] = 4; - values[valuesById[5] = "RAW_DOCUMENT_FILE_TYPE_TEXT"] = 5; - values[valuesById[6] = "RAW_DOCUMENT_FILE_TYPE_TIFF"] = 6; - return values; - })(); - - /** - * ContentCategory enum. - * @name google.cloud.contentwarehouse.v1.ContentCategory - * @enum {number} - * @property {number} CONTENT_CATEGORY_UNSPECIFIED=0 CONTENT_CATEGORY_UNSPECIFIED value - * @property {number} CONTENT_CATEGORY_IMAGE=1 CONTENT_CATEGORY_IMAGE value - * @property {number} CONTENT_CATEGORY_AUDIO=2 CONTENT_CATEGORY_AUDIO value - * @property {number} CONTENT_CATEGORY_VIDEO=3 CONTENT_CATEGORY_VIDEO value - */ - v1.ContentCategory = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CONTENT_CATEGORY_UNSPECIFIED"] = 0; - values[valuesById[1] = "CONTENT_CATEGORY_IMAGE"] = 1; - values[valuesById[2] = "CONTENT_CATEGORY_AUDIO"] = 2; - values[valuesById[3] = "CONTENT_CATEGORY_VIDEO"] = 3; - return values; - })(); - - v1.DocumentLinkService = (function() { - - /** - * Constructs a new DocumentLinkService service. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a DocumentLinkService - * @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 DocumentLinkService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (DocumentLinkService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = DocumentLinkService; - - /** - * Creates new DocumentLinkService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.contentwarehouse.v1.DocumentLinkService - * @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 {DocumentLinkService} RPC service. Useful where requests and/or responses are streamed. - */ - DocumentLinkService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentLinkService|listLinkedTargets}. - * @memberof google.cloud.contentwarehouse.v1.DocumentLinkService - * @typedef ListLinkedTargetsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse} [response] ListLinkedTargetsResponse - */ - - /** - * Calls ListLinkedTargets. - * @function listLinkedTargets - * @memberof google.cloud.contentwarehouse.v1.DocumentLinkService - * @instance - * @param {google.cloud.contentwarehouse.v1.IListLinkedTargetsRequest} request ListLinkedTargetsRequest message or plain object - * @param {google.cloud.contentwarehouse.v1.DocumentLinkService.ListLinkedTargetsCallback} callback Node-style callback called with the error, if any, and ListLinkedTargetsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentLinkService.prototype.listLinkedTargets = function listLinkedTargets(request, callback) { - return this.rpcCall(listLinkedTargets, $root.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest, $root.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse, request, callback); - }, "name", { value: "ListLinkedTargets" }); - - /** - * Calls ListLinkedTargets. - * @function listLinkedTargets - * @memberof google.cloud.contentwarehouse.v1.DocumentLinkService - * @instance - * @param {google.cloud.contentwarehouse.v1.IListLinkedTargetsRequest} request ListLinkedTargetsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentLinkService|listLinkedSources}. - * @memberof google.cloud.contentwarehouse.v1.DocumentLinkService - * @typedef ListLinkedSourcesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse} [response] ListLinkedSourcesResponse - */ - - /** - * Calls ListLinkedSources. - * @function listLinkedSources - * @memberof google.cloud.contentwarehouse.v1.DocumentLinkService - * @instance - * @param {google.cloud.contentwarehouse.v1.IListLinkedSourcesRequest} request ListLinkedSourcesRequest message or plain object - * @param {google.cloud.contentwarehouse.v1.DocumentLinkService.ListLinkedSourcesCallback} callback Node-style callback called with the error, if any, and ListLinkedSourcesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentLinkService.prototype.listLinkedSources = function listLinkedSources(request, callback) { - return this.rpcCall(listLinkedSources, $root.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest, $root.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse, request, callback); - }, "name", { value: "ListLinkedSources" }); - - /** - * Calls ListLinkedSources. - * @function listLinkedSources - * @memberof google.cloud.contentwarehouse.v1.DocumentLinkService - * @instance - * @param {google.cloud.contentwarehouse.v1.IListLinkedSourcesRequest} request ListLinkedSourcesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentLinkService|createDocumentLink}. - * @memberof google.cloud.contentwarehouse.v1.DocumentLinkService - * @typedef CreateDocumentLinkCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.contentwarehouse.v1.DocumentLink} [response] DocumentLink - */ - - /** - * Calls CreateDocumentLink. - * @function createDocumentLink - * @memberof google.cloud.contentwarehouse.v1.DocumentLinkService - * @instance - * @param {google.cloud.contentwarehouse.v1.ICreateDocumentLinkRequest} request CreateDocumentLinkRequest message or plain object - * @param {google.cloud.contentwarehouse.v1.DocumentLinkService.CreateDocumentLinkCallback} callback Node-style callback called with the error, if any, and DocumentLink - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentLinkService.prototype.createDocumentLink = function createDocumentLink(request, callback) { - return this.rpcCall(createDocumentLink, $root.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest, $root.google.cloud.contentwarehouse.v1.DocumentLink, request, callback); - }, "name", { value: "CreateDocumentLink" }); - - /** - * Calls CreateDocumentLink. - * @function createDocumentLink - * @memberof google.cloud.contentwarehouse.v1.DocumentLinkService - * @instance - * @param {google.cloud.contentwarehouse.v1.ICreateDocumentLinkRequest} request CreateDocumentLinkRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentLinkService|deleteDocumentLink}. - * @memberof google.cloud.contentwarehouse.v1.DocumentLinkService - * @typedef DeleteDocumentLinkCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteDocumentLink. - * @function deleteDocumentLink - * @memberof google.cloud.contentwarehouse.v1.DocumentLinkService - * @instance - * @param {google.cloud.contentwarehouse.v1.IDeleteDocumentLinkRequest} request DeleteDocumentLinkRequest message or plain object - * @param {google.cloud.contentwarehouse.v1.DocumentLinkService.DeleteDocumentLinkCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentLinkService.prototype.deleteDocumentLink = function deleteDocumentLink(request, callback) { - return this.rpcCall(deleteDocumentLink, $root.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteDocumentLink" }); - - /** - * Calls DeleteDocumentLink. - * @function deleteDocumentLink - * @memberof google.cloud.contentwarehouse.v1.DocumentLinkService - * @instance - * @param {google.cloud.contentwarehouse.v1.IDeleteDocumentLinkRequest} request DeleteDocumentLinkRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return DocumentLinkService; - })(); - - v1.ListLinkedTargetsResponse = (function() { - - /** - * Properties of a ListLinkedTargetsResponse. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IListLinkedTargetsResponse - * @property {Array.|null} [documentLinks] ListLinkedTargetsResponse documentLinks - * @property {string|null} [nextPageToken] ListLinkedTargetsResponse nextPageToken - */ - - /** - * Constructs a new ListLinkedTargetsResponse. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a ListLinkedTargetsResponse. - * @implements IListLinkedTargetsResponse - * @constructor - * @param {google.cloud.contentwarehouse.v1.IListLinkedTargetsResponse=} [properties] Properties to set - */ - function ListLinkedTargetsResponse(properties) { - this.documentLinks = []; - 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]]; - } - - /** - * ListLinkedTargetsResponse documentLinks. - * @member {Array.} documentLinks - * @memberof google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse - * @instance - */ - ListLinkedTargetsResponse.prototype.documentLinks = $util.emptyArray; - - /** - * ListLinkedTargetsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse - * @instance - */ - ListLinkedTargetsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListLinkedTargetsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse - * @static - * @param {google.cloud.contentwarehouse.v1.IListLinkedTargetsResponse=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse} ListLinkedTargetsResponse instance - */ - ListLinkedTargetsResponse.create = function create(properties) { - return new ListLinkedTargetsResponse(properties); - }; - - /** - * Encodes the specified ListLinkedTargetsResponse message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse - * @static - * @param {google.cloud.contentwarehouse.v1.IListLinkedTargetsResponse} message ListLinkedTargetsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListLinkedTargetsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.documentLinks != null && message.documentLinks.length) - for (var i = 0; i < message.documentLinks.length; ++i) - $root.google.cloud.contentwarehouse.v1.DocumentLink.encode(message.documentLinks[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 ListLinkedTargetsResponse message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse - * @static - * @param {google.cloud.contentwarehouse.v1.IListLinkedTargetsResponse} message ListLinkedTargetsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListLinkedTargetsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListLinkedTargetsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse} ListLinkedTargetsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListLinkedTargetsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.documentLinks && message.documentLinks.length)) - message.documentLinks = []; - message.documentLinks.push($root.google.cloud.contentwarehouse.v1.DocumentLink.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListLinkedTargetsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse} ListLinkedTargetsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListLinkedTargetsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListLinkedTargetsResponse message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListLinkedTargetsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.documentLinks != null && message.hasOwnProperty("documentLinks")) { - if (!Array.isArray(message.documentLinks)) - return "documentLinks: array expected"; - for (var i = 0; i < message.documentLinks.length; ++i) { - var error = $root.google.cloud.contentwarehouse.v1.DocumentLink.verify(message.documentLinks[i]); - if (error) - return "documentLinks." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListLinkedTargetsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse} ListLinkedTargetsResponse - */ - ListLinkedTargetsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse(); - if (object.documentLinks) { - if (!Array.isArray(object.documentLinks)) - throw TypeError(".google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse.documentLinks: array expected"); - message.documentLinks = []; - for (var i = 0; i < object.documentLinks.length; ++i) { - if (typeof object.documentLinks[i] !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse.documentLinks: object expected"); - message.documentLinks[i] = $root.google.cloud.contentwarehouse.v1.DocumentLink.fromObject(object.documentLinks[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListLinkedTargetsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse - * @static - * @param {google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse} message ListLinkedTargetsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListLinkedTargetsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.documentLinks = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.documentLinks && message.documentLinks.length) { - object.documentLinks = []; - for (var j = 0; j < message.documentLinks.length; ++j) - object.documentLinks[j] = $root.google.cloud.contentwarehouse.v1.DocumentLink.toObject(message.documentLinks[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListLinkedTargetsResponse to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse - * @instance - * @returns {Object.} JSON object - */ - ListLinkedTargetsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListLinkedTargetsResponse - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListLinkedTargetsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse"; - }; - - return ListLinkedTargetsResponse; - })(); - - v1.ListLinkedTargetsRequest = (function() { - - /** - * Properties of a ListLinkedTargetsRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IListLinkedTargetsRequest - * @property {string|null} [parent] ListLinkedTargetsRequest parent - * @property {google.cloud.contentwarehouse.v1.IRequestMetadata|null} [requestMetadata] ListLinkedTargetsRequest requestMetadata - */ - - /** - * Constructs a new ListLinkedTargetsRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a ListLinkedTargetsRequest. - * @implements IListLinkedTargetsRequest - * @constructor - * @param {google.cloud.contentwarehouse.v1.IListLinkedTargetsRequest=} [properties] Properties to set - */ - function ListLinkedTargetsRequest(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]]; - } - - /** - * ListLinkedTargetsRequest parent. - * @member {string} parent - * @memberof google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest - * @instance - */ - ListLinkedTargetsRequest.prototype.parent = ""; - - /** - * ListLinkedTargetsRequest requestMetadata. - * @member {google.cloud.contentwarehouse.v1.IRequestMetadata|null|undefined} requestMetadata - * @memberof google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest - * @instance - */ - ListLinkedTargetsRequest.prototype.requestMetadata = null; - - /** - * Creates a new ListLinkedTargetsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IListLinkedTargetsRequest=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest} ListLinkedTargetsRequest instance - */ - ListLinkedTargetsRequest.create = function create(properties) { - return new ListLinkedTargetsRequest(properties); - }; - - /** - * Encodes the specified ListLinkedTargetsRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IListLinkedTargetsRequest} message ListLinkedTargetsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListLinkedTargetsRequest.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.requestMetadata != null && Object.hasOwnProperty.call(message, "requestMetadata")) - $root.google.cloud.contentwarehouse.v1.RequestMetadata.encode(message.requestMetadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ListLinkedTargetsRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IListLinkedTargetsRequest} message ListLinkedTargetsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListLinkedTargetsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListLinkedTargetsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest} ListLinkedTargetsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListLinkedTargetsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListLinkedTargetsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest} ListLinkedTargetsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListLinkedTargetsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListLinkedTargetsRequest message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListLinkedTargetsRequest.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.requestMetadata != null && message.hasOwnProperty("requestMetadata")) { - var error = $root.google.cloud.contentwarehouse.v1.RequestMetadata.verify(message.requestMetadata); - if (error) - return "requestMetadata." + error; - } - return null; - }; - - /** - * Creates a ListLinkedTargetsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest} ListLinkedTargetsRequest - */ - ListLinkedTargetsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.requestMetadata != null) { - if (typeof object.requestMetadata !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest.requestMetadata: object expected"); - message.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.fromObject(object.requestMetadata); - } - return message; - }; - - /** - * Creates a plain object from a ListLinkedTargetsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest - * @static - * @param {google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest} message ListLinkedTargetsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListLinkedTargetsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.requestMetadata = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.requestMetadata != null && message.hasOwnProperty("requestMetadata")) - object.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.toObject(message.requestMetadata, options); - return object; - }; - - /** - * Converts this ListLinkedTargetsRequest to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest - * @instance - * @returns {Object.} JSON object - */ - ListLinkedTargetsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListLinkedTargetsRequest - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListLinkedTargetsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest"; - }; - - return ListLinkedTargetsRequest; - })(); - - v1.ListLinkedSourcesResponse = (function() { - - /** - * Properties of a ListLinkedSourcesResponse. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IListLinkedSourcesResponse - * @property {Array.|null} [documentLinks] ListLinkedSourcesResponse documentLinks - * @property {string|null} [nextPageToken] ListLinkedSourcesResponse nextPageToken - */ - - /** - * Constructs a new ListLinkedSourcesResponse. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a ListLinkedSourcesResponse. - * @implements IListLinkedSourcesResponse - * @constructor - * @param {google.cloud.contentwarehouse.v1.IListLinkedSourcesResponse=} [properties] Properties to set - */ - function ListLinkedSourcesResponse(properties) { - this.documentLinks = []; - 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]]; - } - - /** - * ListLinkedSourcesResponse documentLinks. - * @member {Array.} documentLinks - * @memberof google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse - * @instance - */ - ListLinkedSourcesResponse.prototype.documentLinks = $util.emptyArray; - - /** - * ListLinkedSourcesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse - * @instance - */ - ListLinkedSourcesResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListLinkedSourcesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse - * @static - * @param {google.cloud.contentwarehouse.v1.IListLinkedSourcesResponse=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse} ListLinkedSourcesResponse instance - */ - ListLinkedSourcesResponse.create = function create(properties) { - return new ListLinkedSourcesResponse(properties); - }; - - /** - * Encodes the specified ListLinkedSourcesResponse message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse - * @static - * @param {google.cloud.contentwarehouse.v1.IListLinkedSourcesResponse} message ListLinkedSourcesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListLinkedSourcesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.documentLinks != null && message.documentLinks.length) - for (var i = 0; i < message.documentLinks.length; ++i) - $root.google.cloud.contentwarehouse.v1.DocumentLink.encode(message.documentLinks[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 ListLinkedSourcesResponse message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse - * @static - * @param {google.cloud.contentwarehouse.v1.IListLinkedSourcesResponse} message ListLinkedSourcesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListLinkedSourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListLinkedSourcesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse} ListLinkedSourcesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListLinkedSourcesResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.documentLinks && message.documentLinks.length)) - message.documentLinks = []; - message.documentLinks.push($root.google.cloud.contentwarehouse.v1.DocumentLink.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListLinkedSourcesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse} ListLinkedSourcesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListLinkedSourcesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListLinkedSourcesResponse message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListLinkedSourcesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.documentLinks != null && message.hasOwnProperty("documentLinks")) { - if (!Array.isArray(message.documentLinks)) - return "documentLinks: array expected"; - for (var i = 0; i < message.documentLinks.length; ++i) { - var error = $root.google.cloud.contentwarehouse.v1.DocumentLink.verify(message.documentLinks[i]); - if (error) - return "documentLinks." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListLinkedSourcesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse} ListLinkedSourcesResponse - */ - ListLinkedSourcesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse(); - if (object.documentLinks) { - if (!Array.isArray(object.documentLinks)) - throw TypeError(".google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse.documentLinks: array expected"); - message.documentLinks = []; - for (var i = 0; i < object.documentLinks.length; ++i) { - if (typeof object.documentLinks[i] !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse.documentLinks: object expected"); - message.documentLinks[i] = $root.google.cloud.contentwarehouse.v1.DocumentLink.fromObject(object.documentLinks[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListLinkedSourcesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse - * @static - * @param {google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse} message ListLinkedSourcesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListLinkedSourcesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.documentLinks = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.documentLinks && message.documentLinks.length) { - object.documentLinks = []; - for (var j = 0; j < message.documentLinks.length; ++j) - object.documentLinks[j] = $root.google.cloud.contentwarehouse.v1.DocumentLink.toObject(message.documentLinks[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListLinkedSourcesResponse to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse - * @instance - * @returns {Object.} JSON object - */ - ListLinkedSourcesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListLinkedSourcesResponse - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListLinkedSourcesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse"; - }; - - return ListLinkedSourcesResponse; - })(); - - v1.ListLinkedSourcesRequest = (function() { - - /** - * Properties of a ListLinkedSourcesRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IListLinkedSourcesRequest - * @property {string|null} [parent] ListLinkedSourcesRequest parent - * @property {number|null} [pageSize] ListLinkedSourcesRequest pageSize - * @property {string|null} [pageToken] ListLinkedSourcesRequest pageToken - * @property {google.cloud.contentwarehouse.v1.IRequestMetadata|null} [requestMetadata] ListLinkedSourcesRequest requestMetadata - */ - - /** - * Constructs a new ListLinkedSourcesRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a ListLinkedSourcesRequest. - * @implements IListLinkedSourcesRequest - * @constructor - * @param {google.cloud.contentwarehouse.v1.IListLinkedSourcesRequest=} [properties] Properties to set - */ - function ListLinkedSourcesRequest(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]]; - } - - /** - * ListLinkedSourcesRequest parent. - * @member {string} parent - * @memberof google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest - * @instance - */ - ListLinkedSourcesRequest.prototype.parent = ""; - - /** - * ListLinkedSourcesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest - * @instance - */ - ListLinkedSourcesRequest.prototype.pageSize = 0; - - /** - * ListLinkedSourcesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest - * @instance - */ - ListLinkedSourcesRequest.prototype.pageToken = ""; - - /** - * ListLinkedSourcesRequest requestMetadata. - * @member {google.cloud.contentwarehouse.v1.IRequestMetadata|null|undefined} requestMetadata - * @memberof google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest - * @instance - */ - ListLinkedSourcesRequest.prototype.requestMetadata = null; - - /** - * Creates a new ListLinkedSourcesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IListLinkedSourcesRequest=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest} ListLinkedSourcesRequest instance - */ - ListLinkedSourcesRequest.create = function create(properties) { - return new ListLinkedSourcesRequest(properties); - }; - - /** - * Encodes the specified ListLinkedSourcesRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IListLinkedSourcesRequest} message ListLinkedSourcesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListLinkedSourcesRequest.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.requestMetadata != null && Object.hasOwnProperty.call(message, "requestMetadata")) - $root.google.cloud.contentwarehouse.v1.RequestMetadata.encode(message.requestMetadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ListLinkedSourcesRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IListLinkedSourcesRequest} message ListLinkedSourcesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListLinkedSourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListLinkedSourcesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest} ListLinkedSourcesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListLinkedSourcesRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 3: { - message.pageSize = reader.int32(); - break; - } - case 4: { - message.pageToken = reader.string(); - break; - } - case 2: { - message.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListLinkedSourcesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest} ListLinkedSourcesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListLinkedSourcesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListLinkedSourcesRequest message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListLinkedSourcesRequest.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.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.requestMetadata != null && message.hasOwnProperty("requestMetadata")) { - var error = $root.google.cloud.contentwarehouse.v1.RequestMetadata.verify(message.requestMetadata); - if (error) - return "requestMetadata." + error; - } - return null; - }; - - /** - * Creates a ListLinkedSourcesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest} ListLinkedSourcesRequest - */ - ListLinkedSourcesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.requestMetadata != null) { - if (typeof object.requestMetadata !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest.requestMetadata: object expected"); - message.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.fromObject(object.requestMetadata); - } - return message; - }; - - /** - * Creates a plain object from a ListLinkedSourcesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest - * @static - * @param {google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest} message ListLinkedSourcesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListLinkedSourcesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.requestMetadata = null; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.requestMetadata != null && message.hasOwnProperty("requestMetadata")) - object.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.toObject(message.requestMetadata, options); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListLinkedSourcesRequest to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest - * @instance - * @returns {Object.} JSON object - */ - ListLinkedSourcesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListLinkedSourcesRequest - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListLinkedSourcesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest"; - }; - - return ListLinkedSourcesRequest; - })(); - - v1.DocumentLink = (function() { - - /** - * Properties of a DocumentLink. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IDocumentLink - * @property {string|null} [name] DocumentLink name - * @property {google.cloud.contentwarehouse.v1.IDocumentReference|null} [sourceDocumentReference] DocumentLink sourceDocumentReference - * @property {google.cloud.contentwarehouse.v1.IDocumentReference|null} [targetDocumentReference] DocumentLink targetDocumentReference - * @property {string|null} [description] DocumentLink description - * @property {google.protobuf.ITimestamp|null} [updateTime] DocumentLink updateTime - * @property {google.protobuf.ITimestamp|null} [createTime] DocumentLink createTime - * @property {google.cloud.contentwarehouse.v1.DocumentLink.State|null} [state] DocumentLink state - */ - - /** - * Constructs a new DocumentLink. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a DocumentLink. - * @implements IDocumentLink - * @constructor - * @param {google.cloud.contentwarehouse.v1.IDocumentLink=} [properties] Properties to set - */ - function DocumentLink(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]]; - } - - /** - * DocumentLink name. - * @member {string} name - * @memberof google.cloud.contentwarehouse.v1.DocumentLink - * @instance - */ - DocumentLink.prototype.name = ""; - - /** - * DocumentLink sourceDocumentReference. - * @member {google.cloud.contentwarehouse.v1.IDocumentReference|null|undefined} sourceDocumentReference - * @memberof google.cloud.contentwarehouse.v1.DocumentLink - * @instance - */ - DocumentLink.prototype.sourceDocumentReference = null; - - /** - * DocumentLink targetDocumentReference. - * @member {google.cloud.contentwarehouse.v1.IDocumentReference|null|undefined} targetDocumentReference - * @memberof google.cloud.contentwarehouse.v1.DocumentLink - * @instance - */ - DocumentLink.prototype.targetDocumentReference = null; - - /** - * DocumentLink description. - * @member {string} description - * @memberof google.cloud.contentwarehouse.v1.DocumentLink - * @instance - */ - DocumentLink.prototype.description = ""; - - /** - * DocumentLink updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.contentwarehouse.v1.DocumentLink - * @instance - */ - DocumentLink.prototype.updateTime = null; - - /** - * DocumentLink createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.contentwarehouse.v1.DocumentLink - * @instance - */ - DocumentLink.prototype.createTime = null; - - /** - * DocumentLink state. - * @member {google.cloud.contentwarehouse.v1.DocumentLink.State} state - * @memberof google.cloud.contentwarehouse.v1.DocumentLink - * @instance - */ - DocumentLink.prototype.state = 0; - - /** - * Creates a new DocumentLink instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.DocumentLink - * @static - * @param {google.cloud.contentwarehouse.v1.IDocumentLink=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.DocumentLink} DocumentLink instance - */ - DocumentLink.create = function create(properties) { - return new DocumentLink(properties); - }; - - /** - * Encodes the specified DocumentLink message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DocumentLink.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.DocumentLink - * @static - * @param {google.cloud.contentwarehouse.v1.IDocumentLink} message DocumentLink message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DocumentLink.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.sourceDocumentReference != null && Object.hasOwnProperty.call(message, "sourceDocumentReference")) - $root.google.cloud.contentwarehouse.v1.DocumentReference.encode(message.sourceDocumentReference, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.targetDocumentReference != null && Object.hasOwnProperty.call(message, "targetDocumentReference")) - $root.google.cloud.contentwarehouse.v1.DocumentReference.encode(message.targetDocumentReference, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.description); - 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.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.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); - return writer; - }; - - /** - * Encodes the specified DocumentLink message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DocumentLink.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.DocumentLink - * @static - * @param {google.cloud.contentwarehouse.v1.IDocumentLink} message DocumentLink message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DocumentLink.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DocumentLink message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.DocumentLink - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.DocumentLink} DocumentLink - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DocumentLink.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.DocumentLink(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.sourceDocumentReference = $root.google.cloud.contentwarehouse.v1.DocumentReference.decode(reader, reader.uint32()); - break; - } - case 3: { - message.targetDocumentReference = $root.google.cloud.contentwarehouse.v1.DocumentReference.decode(reader, reader.uint32()); - break; - } - case 4: { - message.description = reader.string(); - break; - } - case 5: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 6: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 7: { - message.state = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DocumentLink message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.DocumentLink - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.DocumentLink} DocumentLink - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DocumentLink.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DocumentLink message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.DocumentLink - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DocumentLink.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.sourceDocumentReference != null && message.hasOwnProperty("sourceDocumentReference")) { - var error = $root.google.cloud.contentwarehouse.v1.DocumentReference.verify(message.sourceDocumentReference); - if (error) - return "sourceDocumentReference." + error; - } - if (message.targetDocumentReference != null && message.hasOwnProperty("targetDocumentReference")) { - var error = $root.google.cloud.contentwarehouse.v1.DocumentReference.verify(message.targetDocumentReference); - if (error) - return "targetDocumentReference." + error; - } - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: 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.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: - break; - } - return null; - }; - - /** - * Creates a DocumentLink message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.DocumentLink - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.DocumentLink} DocumentLink - */ - DocumentLink.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.DocumentLink) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.DocumentLink(); - if (object.name != null) - message.name = String(object.name); - if (object.sourceDocumentReference != null) { - if (typeof object.sourceDocumentReference !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.DocumentLink.sourceDocumentReference: object expected"); - message.sourceDocumentReference = $root.google.cloud.contentwarehouse.v1.DocumentReference.fromObject(object.sourceDocumentReference); - } - if (object.targetDocumentReference != null) { - if (typeof object.targetDocumentReference !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.DocumentLink.targetDocumentReference: object expected"); - message.targetDocumentReference = $root.google.cloud.contentwarehouse.v1.DocumentReference.fromObject(object.targetDocumentReference); - } - if (object.description != null) - message.description = String(object.description); - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.DocumentLink.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.DocumentLink.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "ACTIVE": - case 1: - message.state = 1; - break; - case "SOFT_DELETED": - case 2: - message.state = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a DocumentLink message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.DocumentLink - * @static - * @param {google.cloud.contentwarehouse.v1.DocumentLink} message DocumentLink - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DocumentLink.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.sourceDocumentReference = null; - object.targetDocumentReference = null; - object.description = ""; - object.updateTime = null; - object.createTime = null; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.sourceDocumentReference != null && message.hasOwnProperty("sourceDocumentReference")) - object.sourceDocumentReference = $root.google.cloud.contentwarehouse.v1.DocumentReference.toObject(message.sourceDocumentReference, options); - if (message.targetDocumentReference != null && message.hasOwnProperty("targetDocumentReference")) - object.targetDocumentReference = $root.google.cloud.contentwarehouse.v1.DocumentReference.toObject(message.targetDocumentReference, options); - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, 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.cloud.contentwarehouse.v1.DocumentLink.State[message.state] === undefined ? message.state : $root.google.cloud.contentwarehouse.v1.DocumentLink.State[message.state] : message.state; - return object; - }; - - /** - * Converts this DocumentLink to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.DocumentLink - * @instance - * @returns {Object.} JSON object - */ - DocumentLink.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DocumentLink - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.DocumentLink - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DocumentLink.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.DocumentLink"; - }; - - /** - * State enum. - * @name google.cloud.contentwarehouse.v1.DocumentLink.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} ACTIVE=1 ACTIVE value - * @property {number} SOFT_DELETED=2 SOFT_DELETED value - */ - DocumentLink.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ACTIVE"] = 1; - values[valuesById[2] = "SOFT_DELETED"] = 2; - return values; - })(); - - return DocumentLink; - })(); - - v1.CreateDocumentLinkRequest = (function() { - - /** - * Properties of a CreateDocumentLinkRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @interface ICreateDocumentLinkRequest - * @property {string|null} [parent] CreateDocumentLinkRequest parent - * @property {google.cloud.contentwarehouse.v1.IDocumentLink|null} [documentLink] CreateDocumentLinkRequest documentLink - * @property {google.cloud.contentwarehouse.v1.IRequestMetadata|null} [requestMetadata] CreateDocumentLinkRequest requestMetadata - */ - - /** - * Constructs a new CreateDocumentLinkRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a CreateDocumentLinkRequest. - * @implements ICreateDocumentLinkRequest - * @constructor - * @param {google.cloud.contentwarehouse.v1.ICreateDocumentLinkRequest=} [properties] Properties to set - */ - function CreateDocumentLinkRequest(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]]; - } - - /** - * CreateDocumentLinkRequest parent. - * @member {string} parent - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest - * @instance - */ - CreateDocumentLinkRequest.prototype.parent = ""; - - /** - * CreateDocumentLinkRequest documentLink. - * @member {google.cloud.contentwarehouse.v1.IDocumentLink|null|undefined} documentLink - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest - * @instance - */ - CreateDocumentLinkRequest.prototype.documentLink = null; - - /** - * CreateDocumentLinkRequest requestMetadata. - * @member {google.cloud.contentwarehouse.v1.IRequestMetadata|null|undefined} requestMetadata - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest - * @instance - */ - CreateDocumentLinkRequest.prototype.requestMetadata = null; - - /** - * Creates a new CreateDocumentLinkRequest instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest - * @static - * @param {google.cloud.contentwarehouse.v1.ICreateDocumentLinkRequest=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest} CreateDocumentLinkRequest instance - */ - CreateDocumentLinkRequest.create = function create(properties) { - return new CreateDocumentLinkRequest(properties); - }; - - /** - * Encodes the specified CreateDocumentLinkRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest - * @static - * @param {google.cloud.contentwarehouse.v1.ICreateDocumentLinkRequest} message CreateDocumentLinkRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateDocumentLinkRequest.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.documentLink != null && Object.hasOwnProperty.call(message, "documentLink")) - $root.google.cloud.contentwarehouse.v1.DocumentLink.encode(message.documentLink, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestMetadata != null && Object.hasOwnProperty.call(message, "requestMetadata")) - $root.google.cloud.contentwarehouse.v1.RequestMetadata.encode(message.requestMetadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateDocumentLinkRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest - * @static - * @param {google.cloud.contentwarehouse.v1.ICreateDocumentLinkRequest} message CreateDocumentLinkRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateDocumentLinkRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateDocumentLinkRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest} CreateDocumentLinkRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateDocumentLinkRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.documentLink = $root.google.cloud.contentwarehouse.v1.DocumentLink.decode(reader, reader.uint32()); - break; - } - case 3: { - message.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateDocumentLinkRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest} CreateDocumentLinkRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateDocumentLinkRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateDocumentLinkRequest message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateDocumentLinkRequest.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.documentLink != null && message.hasOwnProperty("documentLink")) { - var error = $root.google.cloud.contentwarehouse.v1.DocumentLink.verify(message.documentLink); - if (error) - return "documentLink." + error; - } - if (message.requestMetadata != null && message.hasOwnProperty("requestMetadata")) { - var error = $root.google.cloud.contentwarehouse.v1.RequestMetadata.verify(message.requestMetadata); - if (error) - return "requestMetadata." + error; - } - return null; - }; - - /** - * Creates a CreateDocumentLinkRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest} CreateDocumentLinkRequest - */ - CreateDocumentLinkRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.documentLink != null) { - if (typeof object.documentLink !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest.documentLink: object expected"); - message.documentLink = $root.google.cloud.contentwarehouse.v1.DocumentLink.fromObject(object.documentLink); - } - if (object.requestMetadata != null) { - if (typeof object.requestMetadata !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest.requestMetadata: object expected"); - message.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.fromObject(object.requestMetadata); - } - return message; - }; - - /** - * Creates a plain object from a CreateDocumentLinkRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest - * @static - * @param {google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest} message CreateDocumentLinkRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateDocumentLinkRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.documentLink = null; - object.requestMetadata = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.documentLink != null && message.hasOwnProperty("documentLink")) - object.documentLink = $root.google.cloud.contentwarehouse.v1.DocumentLink.toObject(message.documentLink, options); - if (message.requestMetadata != null && message.hasOwnProperty("requestMetadata")) - object.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.toObject(message.requestMetadata, options); - return object; - }; - - /** - * Converts this CreateDocumentLinkRequest to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest - * @instance - * @returns {Object.} JSON object - */ - CreateDocumentLinkRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateDocumentLinkRequest - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateDocumentLinkRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest"; - }; - - return CreateDocumentLinkRequest; - })(); - - v1.DeleteDocumentLinkRequest = (function() { - - /** - * Properties of a DeleteDocumentLinkRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IDeleteDocumentLinkRequest - * @property {string|null} [name] DeleteDocumentLinkRequest name - * @property {google.cloud.contentwarehouse.v1.IRequestMetadata|null} [requestMetadata] DeleteDocumentLinkRequest requestMetadata - */ - - /** - * Constructs a new DeleteDocumentLinkRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a DeleteDocumentLinkRequest. - * @implements IDeleteDocumentLinkRequest - * @constructor - * @param {google.cloud.contentwarehouse.v1.IDeleteDocumentLinkRequest=} [properties] Properties to set - */ - function DeleteDocumentLinkRequest(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]]; - } - - /** - * DeleteDocumentLinkRequest name. - * @member {string} name - * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest - * @instance - */ - DeleteDocumentLinkRequest.prototype.name = ""; - - /** - * DeleteDocumentLinkRequest requestMetadata. - * @member {google.cloud.contentwarehouse.v1.IRequestMetadata|null|undefined} requestMetadata - * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest - * @instance - */ - DeleteDocumentLinkRequest.prototype.requestMetadata = null; - - /** - * Creates a new DeleteDocumentLinkRequest instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IDeleteDocumentLinkRequest=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest} DeleteDocumentLinkRequest instance - */ - DeleteDocumentLinkRequest.create = function create(properties) { - return new DeleteDocumentLinkRequest(properties); - }; - - /** - * Encodes the specified DeleteDocumentLinkRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IDeleteDocumentLinkRequest} message DeleteDocumentLinkRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteDocumentLinkRequest.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.requestMetadata != null && Object.hasOwnProperty.call(message, "requestMetadata")) - $root.google.cloud.contentwarehouse.v1.RequestMetadata.encode(message.requestMetadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DeleteDocumentLinkRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IDeleteDocumentLinkRequest} message DeleteDocumentLinkRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteDocumentLinkRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteDocumentLinkRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest} DeleteDocumentLinkRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteDocumentLinkRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteDocumentLinkRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest} DeleteDocumentLinkRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteDocumentLinkRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteDocumentLinkRequest message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteDocumentLinkRequest.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.requestMetadata != null && message.hasOwnProperty("requestMetadata")) { - var error = $root.google.cloud.contentwarehouse.v1.RequestMetadata.verify(message.requestMetadata); - if (error) - return "requestMetadata." + error; - } - return null; - }; - - /** - * Creates a DeleteDocumentLinkRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest} DeleteDocumentLinkRequest - */ - DeleteDocumentLinkRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestMetadata != null) { - if (typeof object.requestMetadata !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest.requestMetadata: object expected"); - message.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.fromObject(object.requestMetadata); - } - return message; - }; - - /** - * Creates a plain object from a DeleteDocumentLinkRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest - * @static - * @param {google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest} message DeleteDocumentLinkRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteDocumentLinkRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.requestMetadata = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestMetadata != null && message.hasOwnProperty("requestMetadata")) - object.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.toObject(message.requestMetadata, options); - return object; - }; - - /** - * Converts this DeleteDocumentLinkRequest to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteDocumentLinkRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteDocumentLinkRequest - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteDocumentLinkRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest"; - }; - - return DeleteDocumentLinkRequest; - })(); - - v1.DocumentSchema = (function() { - - /** - * Properties of a DocumentSchema. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IDocumentSchema - * @property {string|null} [name] DocumentSchema name - * @property {string|null} [displayName] DocumentSchema displayName - * @property {Array.|null} [propertyDefinitions] DocumentSchema propertyDefinitions - * @property {boolean|null} [documentIsFolder] DocumentSchema documentIsFolder - * @property {google.protobuf.ITimestamp|null} [updateTime] DocumentSchema updateTime - * @property {google.protobuf.ITimestamp|null} [createTime] DocumentSchema createTime - * @property {string|null} [description] DocumentSchema description - */ - - /** - * Constructs a new DocumentSchema. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a DocumentSchema. - * @implements IDocumentSchema - * @constructor - * @param {google.cloud.contentwarehouse.v1.IDocumentSchema=} [properties] Properties to set - */ - function DocumentSchema(properties) { - this.propertyDefinitions = []; - 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]]; - } - - /** - * DocumentSchema name. - * @member {string} name - * @memberof google.cloud.contentwarehouse.v1.DocumentSchema - * @instance - */ - DocumentSchema.prototype.name = ""; - - /** - * DocumentSchema displayName. - * @member {string} displayName - * @memberof google.cloud.contentwarehouse.v1.DocumentSchema - * @instance - */ - DocumentSchema.prototype.displayName = ""; - - /** - * DocumentSchema propertyDefinitions. - * @member {Array.} propertyDefinitions - * @memberof google.cloud.contentwarehouse.v1.DocumentSchema - * @instance - */ - DocumentSchema.prototype.propertyDefinitions = $util.emptyArray; - - /** - * DocumentSchema documentIsFolder. - * @member {boolean} documentIsFolder - * @memberof google.cloud.contentwarehouse.v1.DocumentSchema - * @instance - */ - DocumentSchema.prototype.documentIsFolder = false; - - /** - * DocumentSchema updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.contentwarehouse.v1.DocumentSchema - * @instance - */ - DocumentSchema.prototype.updateTime = null; - - /** - * DocumentSchema createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.contentwarehouse.v1.DocumentSchema - * @instance - */ - DocumentSchema.prototype.createTime = null; - - /** - * DocumentSchema description. - * @member {string} description - * @memberof google.cloud.contentwarehouse.v1.DocumentSchema - * @instance - */ - DocumentSchema.prototype.description = ""; - - /** - * Creates a new DocumentSchema instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.DocumentSchema - * @static - * @param {google.cloud.contentwarehouse.v1.IDocumentSchema=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.DocumentSchema} DocumentSchema instance - */ - DocumentSchema.create = function create(properties) { - return new DocumentSchema(properties); - }; - - /** - * Encodes the specified DocumentSchema message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DocumentSchema.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.DocumentSchema - * @static - * @param {google.cloud.contentwarehouse.v1.IDocumentSchema} message DocumentSchema message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DocumentSchema.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.propertyDefinitions != null && message.propertyDefinitions.length) - for (var i = 0; i < message.propertyDefinitions.length; ++i) - $root.google.cloud.contentwarehouse.v1.PropertyDefinition.encode(message.propertyDefinitions[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.documentIsFolder != null && Object.hasOwnProperty.call(message, "documentIsFolder")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.documentIsFolder); - 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.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.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.description); - return writer; - }; - - /** - * Encodes the specified DocumentSchema message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DocumentSchema.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.DocumentSchema - * @static - * @param {google.cloud.contentwarehouse.v1.IDocumentSchema} message DocumentSchema message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DocumentSchema.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DocumentSchema message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.DocumentSchema - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.DocumentSchema} DocumentSchema - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DocumentSchema.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.DocumentSchema(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - case 3: { - if (!(message.propertyDefinitions && message.propertyDefinitions.length)) - message.propertyDefinitions = []; - message.propertyDefinitions.push($root.google.cloud.contentwarehouse.v1.PropertyDefinition.decode(reader, reader.uint32())); - break; - } - case 4: { - message.documentIsFolder = reader.bool(); - break; - } - case 5: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 6: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 7: { - message.description = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DocumentSchema message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.DocumentSchema - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.DocumentSchema} DocumentSchema - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DocumentSchema.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DocumentSchema message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.DocumentSchema - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DocumentSchema.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.propertyDefinitions != null && message.hasOwnProperty("propertyDefinitions")) { - if (!Array.isArray(message.propertyDefinitions)) - return "propertyDefinitions: array expected"; - for (var i = 0; i < message.propertyDefinitions.length; ++i) { - var error = $root.google.cloud.contentwarehouse.v1.PropertyDefinition.verify(message.propertyDefinitions[i]); - if (error) - return "propertyDefinitions." + error; - } - } - if (message.documentIsFolder != null && message.hasOwnProperty("documentIsFolder")) - if (typeof message.documentIsFolder !== "boolean") - return "documentIsFolder: boolean expected"; - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - return null; - }; - - /** - * Creates a DocumentSchema message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.DocumentSchema - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.DocumentSchema} DocumentSchema - */ - DocumentSchema.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.DocumentSchema) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.DocumentSchema(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.propertyDefinitions) { - if (!Array.isArray(object.propertyDefinitions)) - throw TypeError(".google.cloud.contentwarehouse.v1.DocumentSchema.propertyDefinitions: array expected"); - message.propertyDefinitions = []; - for (var i = 0; i < object.propertyDefinitions.length; ++i) { - if (typeof object.propertyDefinitions[i] !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.DocumentSchema.propertyDefinitions: object expected"); - message.propertyDefinitions[i] = $root.google.cloud.contentwarehouse.v1.PropertyDefinition.fromObject(object.propertyDefinitions[i]); - } - } - if (object.documentIsFolder != null) - message.documentIsFolder = Boolean(object.documentIsFolder); - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.DocumentSchema.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.DocumentSchema.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.description != null) - message.description = String(object.description); - return message; - }; - - /** - * Creates a plain object from a DocumentSchema message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.DocumentSchema - * @static - * @param {google.cloud.contentwarehouse.v1.DocumentSchema} message DocumentSchema - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DocumentSchema.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.propertyDefinitions = []; - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.documentIsFolder = false; - object.updateTime = null; - object.createTime = null; - 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.propertyDefinitions && message.propertyDefinitions.length) { - object.propertyDefinitions = []; - for (var j = 0; j < message.propertyDefinitions.length; ++j) - object.propertyDefinitions[j] = $root.google.cloud.contentwarehouse.v1.PropertyDefinition.toObject(message.propertyDefinitions[j], options); - } - if (message.documentIsFolder != null && message.hasOwnProperty("documentIsFolder")) - object.documentIsFolder = message.documentIsFolder; - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - return object; - }; - - /** - * Converts this DocumentSchema to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.DocumentSchema - * @instance - * @returns {Object.} JSON object - */ - DocumentSchema.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DocumentSchema - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.DocumentSchema - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DocumentSchema.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.DocumentSchema"; - }; - - return DocumentSchema; - })(); - - v1.PropertyDefinition = (function() { - - /** - * Properties of a PropertyDefinition. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IPropertyDefinition - * @property {string|null} [name] PropertyDefinition name - * @property {string|null} [displayName] PropertyDefinition displayName - * @property {boolean|null} [isRepeatable] PropertyDefinition isRepeatable - * @property {boolean|null} [isFilterable] PropertyDefinition isFilterable - * @property {boolean|null} [isSearchable] PropertyDefinition isSearchable - * @property {boolean|null} [isMetadata] PropertyDefinition isMetadata - * @property {boolean|null} [isRequired] PropertyDefinition isRequired - * @property {google.cloud.contentwarehouse.v1.PropertyDefinition.RetrievalImportance|null} [retrievalImportance] PropertyDefinition retrievalImportance - * @property {google.cloud.contentwarehouse.v1.IIntegerTypeOptions|null} [integerTypeOptions] PropertyDefinition integerTypeOptions - * @property {google.cloud.contentwarehouse.v1.IFloatTypeOptions|null} [floatTypeOptions] PropertyDefinition floatTypeOptions - * @property {google.cloud.contentwarehouse.v1.ITextTypeOptions|null} [textTypeOptions] PropertyDefinition textTypeOptions - * @property {google.cloud.contentwarehouse.v1.IPropertyTypeOptions|null} [propertyTypeOptions] PropertyDefinition propertyTypeOptions - * @property {google.cloud.contentwarehouse.v1.IEnumTypeOptions|null} [enumTypeOptions] PropertyDefinition enumTypeOptions - * @property {google.cloud.contentwarehouse.v1.IDateTimeTypeOptions|null} [dateTimeTypeOptions] PropertyDefinition dateTimeTypeOptions - * @property {google.cloud.contentwarehouse.v1.IMapTypeOptions|null} [mapTypeOptions] PropertyDefinition mapTypeOptions - * @property {google.cloud.contentwarehouse.v1.ITimestampTypeOptions|null} [timestampTypeOptions] PropertyDefinition timestampTypeOptions - * @property {Array.|null} [schemaSources] PropertyDefinition schemaSources - */ - - /** - * Constructs a new PropertyDefinition. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a PropertyDefinition. - * @implements IPropertyDefinition - * @constructor - * @param {google.cloud.contentwarehouse.v1.IPropertyDefinition=} [properties] Properties to set - */ - function PropertyDefinition(properties) { - this.schemaSources = []; - 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]]; - } - - /** - * PropertyDefinition name. - * @member {string} name - * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition - * @instance - */ - PropertyDefinition.prototype.name = ""; - - /** - * PropertyDefinition displayName. - * @member {string} displayName - * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition - * @instance - */ - PropertyDefinition.prototype.displayName = ""; - - /** - * PropertyDefinition isRepeatable. - * @member {boolean} isRepeatable - * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition - * @instance - */ - PropertyDefinition.prototype.isRepeatable = false; - - /** - * PropertyDefinition isFilterable. - * @member {boolean} isFilterable - * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition - * @instance - */ - PropertyDefinition.prototype.isFilterable = false; - - /** - * PropertyDefinition isSearchable. - * @member {boolean} isSearchable - * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition - * @instance - */ - PropertyDefinition.prototype.isSearchable = false; - - /** - * PropertyDefinition isMetadata. - * @member {boolean} isMetadata - * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition - * @instance - */ - PropertyDefinition.prototype.isMetadata = false; - - /** - * PropertyDefinition isRequired. - * @member {boolean} isRequired - * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition - * @instance - */ - PropertyDefinition.prototype.isRequired = false; - - /** - * PropertyDefinition retrievalImportance. - * @member {google.cloud.contentwarehouse.v1.PropertyDefinition.RetrievalImportance} retrievalImportance - * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition - * @instance - */ - PropertyDefinition.prototype.retrievalImportance = 0; - - /** - * PropertyDefinition integerTypeOptions. - * @member {google.cloud.contentwarehouse.v1.IIntegerTypeOptions|null|undefined} integerTypeOptions - * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition - * @instance - */ - PropertyDefinition.prototype.integerTypeOptions = null; - - /** - * PropertyDefinition floatTypeOptions. - * @member {google.cloud.contentwarehouse.v1.IFloatTypeOptions|null|undefined} floatTypeOptions - * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition - * @instance - */ - PropertyDefinition.prototype.floatTypeOptions = null; - - /** - * PropertyDefinition textTypeOptions. - * @member {google.cloud.contentwarehouse.v1.ITextTypeOptions|null|undefined} textTypeOptions - * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition - * @instance - */ - PropertyDefinition.prototype.textTypeOptions = null; - - /** - * PropertyDefinition propertyTypeOptions. - * @member {google.cloud.contentwarehouse.v1.IPropertyTypeOptions|null|undefined} propertyTypeOptions - * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition - * @instance - */ - PropertyDefinition.prototype.propertyTypeOptions = null; - - /** - * PropertyDefinition enumTypeOptions. - * @member {google.cloud.contentwarehouse.v1.IEnumTypeOptions|null|undefined} enumTypeOptions - * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition - * @instance - */ - PropertyDefinition.prototype.enumTypeOptions = null; - - /** - * PropertyDefinition dateTimeTypeOptions. - * @member {google.cloud.contentwarehouse.v1.IDateTimeTypeOptions|null|undefined} dateTimeTypeOptions - * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition - * @instance - */ - PropertyDefinition.prototype.dateTimeTypeOptions = null; - - /** - * PropertyDefinition mapTypeOptions. - * @member {google.cloud.contentwarehouse.v1.IMapTypeOptions|null|undefined} mapTypeOptions - * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition - * @instance - */ - PropertyDefinition.prototype.mapTypeOptions = null; - - /** - * PropertyDefinition timestampTypeOptions. - * @member {google.cloud.contentwarehouse.v1.ITimestampTypeOptions|null|undefined} timestampTypeOptions - * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition - * @instance - */ - PropertyDefinition.prototype.timestampTypeOptions = null; - - /** - * PropertyDefinition schemaSources. - * @member {Array.} schemaSources - * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition - * @instance - */ - PropertyDefinition.prototype.schemaSources = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * PropertyDefinition valueTypeOptions. - * @member {"integerTypeOptions"|"floatTypeOptions"|"textTypeOptions"|"propertyTypeOptions"|"enumTypeOptions"|"dateTimeTypeOptions"|"mapTypeOptions"|"timestampTypeOptions"|undefined} valueTypeOptions - * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition - * @instance - */ - Object.defineProperty(PropertyDefinition.prototype, "valueTypeOptions", { - get: $util.oneOfGetter($oneOfFields = ["integerTypeOptions", "floatTypeOptions", "textTypeOptions", "propertyTypeOptions", "enumTypeOptions", "dateTimeTypeOptions", "mapTypeOptions", "timestampTypeOptions"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new PropertyDefinition instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition - * @static - * @param {google.cloud.contentwarehouse.v1.IPropertyDefinition=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.PropertyDefinition} PropertyDefinition instance - */ - PropertyDefinition.create = function create(properties) { - return new PropertyDefinition(properties); - }; - - /** - * Encodes the specified PropertyDefinition message. Does not implicitly {@link google.cloud.contentwarehouse.v1.PropertyDefinition.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition - * @static - * @param {google.cloud.contentwarehouse.v1.IPropertyDefinition} message PropertyDefinition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PropertyDefinition.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.isRepeatable != null && Object.hasOwnProperty.call(message, "isRepeatable")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isRepeatable); - if (message.isFilterable != null && Object.hasOwnProperty.call(message, "isFilterable")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.isFilterable); - if (message.isSearchable != null && Object.hasOwnProperty.call(message, "isSearchable")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.isSearchable); - if (message.isMetadata != null && Object.hasOwnProperty.call(message, "isMetadata")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.isMetadata); - if (message.integerTypeOptions != null && Object.hasOwnProperty.call(message, "integerTypeOptions")) - $root.google.cloud.contentwarehouse.v1.IntegerTypeOptions.encode(message.integerTypeOptions, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.floatTypeOptions != null && Object.hasOwnProperty.call(message, "floatTypeOptions")) - $root.google.cloud.contentwarehouse.v1.FloatTypeOptions.encode(message.floatTypeOptions, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.textTypeOptions != null && Object.hasOwnProperty.call(message, "textTypeOptions")) - $root.google.cloud.contentwarehouse.v1.TextTypeOptions.encode(message.textTypeOptions, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.propertyTypeOptions != null && Object.hasOwnProperty.call(message, "propertyTypeOptions")) - $root.google.cloud.contentwarehouse.v1.PropertyTypeOptions.encode(message.propertyTypeOptions, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.enumTypeOptions != null && Object.hasOwnProperty.call(message, "enumTypeOptions")) - $root.google.cloud.contentwarehouse.v1.EnumTypeOptions.encode(message.enumTypeOptions, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.displayName); - if (message.dateTimeTypeOptions != null && Object.hasOwnProperty.call(message, "dateTimeTypeOptions")) - $root.google.cloud.contentwarehouse.v1.DateTimeTypeOptions.encode(message.dateTimeTypeOptions, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.isRequired != null && Object.hasOwnProperty.call(message, "isRequired")) - writer.uint32(/* id 14, wireType 0 =*/112).bool(message.isRequired); - if (message.mapTypeOptions != null && Object.hasOwnProperty.call(message, "mapTypeOptions")) - $root.google.cloud.contentwarehouse.v1.MapTypeOptions.encode(message.mapTypeOptions, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.timestampTypeOptions != null && Object.hasOwnProperty.call(message, "timestampTypeOptions")) - $root.google.cloud.contentwarehouse.v1.TimestampTypeOptions.encode(message.timestampTypeOptions, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); - if (message.retrievalImportance != null && Object.hasOwnProperty.call(message, "retrievalImportance")) - writer.uint32(/* id 18, wireType 0 =*/144).int32(message.retrievalImportance); - if (message.schemaSources != null && message.schemaSources.length) - for (var i = 0; i < message.schemaSources.length; ++i) - $root.google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource.encode(message.schemaSources[i], writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PropertyDefinition message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.PropertyDefinition.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition - * @static - * @param {google.cloud.contentwarehouse.v1.IPropertyDefinition} message PropertyDefinition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PropertyDefinition.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PropertyDefinition message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.PropertyDefinition} PropertyDefinition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PropertyDefinition.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.PropertyDefinition(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 12: { - message.displayName = reader.string(); - break; - } - case 2: { - message.isRepeatable = reader.bool(); - break; - } - case 3: { - message.isFilterable = reader.bool(); - break; - } - case 4: { - message.isSearchable = reader.bool(); - break; - } - case 5: { - message.isMetadata = reader.bool(); - break; - } - case 14: { - message.isRequired = reader.bool(); - break; - } - case 18: { - message.retrievalImportance = reader.int32(); - break; - } - case 7: { - message.integerTypeOptions = $root.google.cloud.contentwarehouse.v1.IntegerTypeOptions.decode(reader, reader.uint32()); - break; - } - case 8: { - message.floatTypeOptions = $root.google.cloud.contentwarehouse.v1.FloatTypeOptions.decode(reader, reader.uint32()); - break; - } - case 9: { - message.textTypeOptions = $root.google.cloud.contentwarehouse.v1.TextTypeOptions.decode(reader, reader.uint32()); - break; - } - case 10: { - message.propertyTypeOptions = $root.google.cloud.contentwarehouse.v1.PropertyTypeOptions.decode(reader, reader.uint32()); - break; - } - case 11: { - message.enumTypeOptions = $root.google.cloud.contentwarehouse.v1.EnumTypeOptions.decode(reader, reader.uint32()); - break; - } - case 13: { - message.dateTimeTypeOptions = $root.google.cloud.contentwarehouse.v1.DateTimeTypeOptions.decode(reader, reader.uint32()); - break; - } - case 15: { - message.mapTypeOptions = $root.google.cloud.contentwarehouse.v1.MapTypeOptions.decode(reader, reader.uint32()); - break; - } - case 16: { - message.timestampTypeOptions = $root.google.cloud.contentwarehouse.v1.TimestampTypeOptions.decode(reader, reader.uint32()); - break; - } - case 19: { - if (!(message.schemaSources && message.schemaSources.length)) - message.schemaSources = []; - message.schemaSources.push($root.google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PropertyDefinition message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.PropertyDefinition} PropertyDefinition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PropertyDefinition.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PropertyDefinition message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PropertyDefinition.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.isRepeatable != null && message.hasOwnProperty("isRepeatable")) - if (typeof message.isRepeatable !== "boolean") - return "isRepeatable: boolean expected"; - if (message.isFilterable != null && message.hasOwnProperty("isFilterable")) - if (typeof message.isFilterable !== "boolean") - return "isFilterable: boolean expected"; - if (message.isSearchable != null && message.hasOwnProperty("isSearchable")) - if (typeof message.isSearchable !== "boolean") - return "isSearchable: boolean expected"; - if (message.isMetadata != null && message.hasOwnProperty("isMetadata")) - if (typeof message.isMetadata !== "boolean") - return "isMetadata: boolean expected"; - if (message.isRequired != null && message.hasOwnProperty("isRequired")) - if (typeof message.isRequired !== "boolean") - return "isRequired: boolean expected"; - if (message.retrievalImportance != null && message.hasOwnProperty("retrievalImportance")) - switch (message.retrievalImportance) { - default: - return "retrievalImportance: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - if (message.integerTypeOptions != null && message.hasOwnProperty("integerTypeOptions")) { - properties.valueTypeOptions = 1; - { - var error = $root.google.cloud.contentwarehouse.v1.IntegerTypeOptions.verify(message.integerTypeOptions); - if (error) - return "integerTypeOptions." + error; - } - } - if (message.floatTypeOptions != null && message.hasOwnProperty("floatTypeOptions")) { - if (properties.valueTypeOptions === 1) - return "valueTypeOptions: multiple values"; - properties.valueTypeOptions = 1; - { - var error = $root.google.cloud.contentwarehouse.v1.FloatTypeOptions.verify(message.floatTypeOptions); - if (error) - return "floatTypeOptions." + error; - } - } - if (message.textTypeOptions != null && message.hasOwnProperty("textTypeOptions")) { - if (properties.valueTypeOptions === 1) - return "valueTypeOptions: multiple values"; - properties.valueTypeOptions = 1; - { - var error = $root.google.cloud.contentwarehouse.v1.TextTypeOptions.verify(message.textTypeOptions); - if (error) - return "textTypeOptions." + error; - } - } - if (message.propertyTypeOptions != null && message.hasOwnProperty("propertyTypeOptions")) { - if (properties.valueTypeOptions === 1) - return "valueTypeOptions: multiple values"; - properties.valueTypeOptions = 1; - { - var error = $root.google.cloud.contentwarehouse.v1.PropertyTypeOptions.verify(message.propertyTypeOptions); - if (error) - return "propertyTypeOptions." + error; - } - } - if (message.enumTypeOptions != null && message.hasOwnProperty("enumTypeOptions")) { - if (properties.valueTypeOptions === 1) - return "valueTypeOptions: multiple values"; - properties.valueTypeOptions = 1; - { - var error = $root.google.cloud.contentwarehouse.v1.EnumTypeOptions.verify(message.enumTypeOptions); - if (error) - return "enumTypeOptions." + error; - } - } - if (message.dateTimeTypeOptions != null && message.hasOwnProperty("dateTimeTypeOptions")) { - if (properties.valueTypeOptions === 1) - return "valueTypeOptions: multiple values"; - properties.valueTypeOptions = 1; - { - var error = $root.google.cloud.contentwarehouse.v1.DateTimeTypeOptions.verify(message.dateTimeTypeOptions); - if (error) - return "dateTimeTypeOptions." + error; - } - } - if (message.mapTypeOptions != null && message.hasOwnProperty("mapTypeOptions")) { - if (properties.valueTypeOptions === 1) - return "valueTypeOptions: multiple values"; - properties.valueTypeOptions = 1; - { - var error = $root.google.cloud.contentwarehouse.v1.MapTypeOptions.verify(message.mapTypeOptions); - if (error) - return "mapTypeOptions." + error; - } - } - if (message.timestampTypeOptions != null && message.hasOwnProperty("timestampTypeOptions")) { - if (properties.valueTypeOptions === 1) - return "valueTypeOptions: multiple values"; - properties.valueTypeOptions = 1; - { - var error = $root.google.cloud.contentwarehouse.v1.TimestampTypeOptions.verify(message.timestampTypeOptions); - if (error) - return "timestampTypeOptions." + error; - } - } - if (message.schemaSources != null && message.hasOwnProperty("schemaSources")) { - if (!Array.isArray(message.schemaSources)) - return "schemaSources: array expected"; - for (var i = 0; i < message.schemaSources.length; ++i) { - var error = $root.google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource.verify(message.schemaSources[i]); - if (error) - return "schemaSources." + error; - } - } - return null; - }; - - /** - * Creates a PropertyDefinition message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.PropertyDefinition} PropertyDefinition - */ - PropertyDefinition.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.PropertyDefinition) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.PropertyDefinition(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.isRepeatable != null) - message.isRepeatable = Boolean(object.isRepeatable); - if (object.isFilterable != null) - message.isFilterable = Boolean(object.isFilterable); - if (object.isSearchable != null) - message.isSearchable = Boolean(object.isSearchable); - if (object.isMetadata != null) - message.isMetadata = Boolean(object.isMetadata); - if (object.isRequired != null) - message.isRequired = Boolean(object.isRequired); - switch (object.retrievalImportance) { - default: - if (typeof object.retrievalImportance === "number") { - message.retrievalImportance = object.retrievalImportance; - break; - } - break; - case "RETRIEVAL_IMPORTANCE_UNSPECIFIED": - case 0: - message.retrievalImportance = 0; - break; - case "HIGHEST": - case 1: - message.retrievalImportance = 1; - break; - case "HIGHER": - case 2: - message.retrievalImportance = 2; - break; - case "HIGH": - case 3: - message.retrievalImportance = 3; - break; - case "MEDIUM": - case 4: - message.retrievalImportance = 4; - break; - case "LOW": - case 5: - message.retrievalImportance = 5; - break; - case "LOWEST": - case 6: - message.retrievalImportance = 6; - break; - } - if (object.integerTypeOptions != null) { - if (typeof object.integerTypeOptions !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.PropertyDefinition.integerTypeOptions: object expected"); - message.integerTypeOptions = $root.google.cloud.contentwarehouse.v1.IntegerTypeOptions.fromObject(object.integerTypeOptions); - } - if (object.floatTypeOptions != null) { - if (typeof object.floatTypeOptions !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.PropertyDefinition.floatTypeOptions: object expected"); - message.floatTypeOptions = $root.google.cloud.contentwarehouse.v1.FloatTypeOptions.fromObject(object.floatTypeOptions); - } - if (object.textTypeOptions != null) { - if (typeof object.textTypeOptions !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.PropertyDefinition.textTypeOptions: object expected"); - message.textTypeOptions = $root.google.cloud.contentwarehouse.v1.TextTypeOptions.fromObject(object.textTypeOptions); - } - if (object.propertyTypeOptions != null) { - if (typeof object.propertyTypeOptions !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.PropertyDefinition.propertyTypeOptions: object expected"); - message.propertyTypeOptions = $root.google.cloud.contentwarehouse.v1.PropertyTypeOptions.fromObject(object.propertyTypeOptions); - } - if (object.enumTypeOptions != null) { - if (typeof object.enumTypeOptions !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.PropertyDefinition.enumTypeOptions: object expected"); - message.enumTypeOptions = $root.google.cloud.contentwarehouse.v1.EnumTypeOptions.fromObject(object.enumTypeOptions); - } - if (object.dateTimeTypeOptions != null) { - if (typeof object.dateTimeTypeOptions !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.PropertyDefinition.dateTimeTypeOptions: object expected"); - message.dateTimeTypeOptions = $root.google.cloud.contentwarehouse.v1.DateTimeTypeOptions.fromObject(object.dateTimeTypeOptions); - } - if (object.mapTypeOptions != null) { - if (typeof object.mapTypeOptions !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.PropertyDefinition.mapTypeOptions: object expected"); - message.mapTypeOptions = $root.google.cloud.contentwarehouse.v1.MapTypeOptions.fromObject(object.mapTypeOptions); - } - if (object.timestampTypeOptions != null) { - if (typeof object.timestampTypeOptions !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.PropertyDefinition.timestampTypeOptions: object expected"); - message.timestampTypeOptions = $root.google.cloud.contentwarehouse.v1.TimestampTypeOptions.fromObject(object.timestampTypeOptions); - } - if (object.schemaSources) { - if (!Array.isArray(object.schemaSources)) - throw TypeError(".google.cloud.contentwarehouse.v1.PropertyDefinition.schemaSources: array expected"); - message.schemaSources = []; - for (var i = 0; i < object.schemaSources.length; ++i) { - if (typeof object.schemaSources[i] !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.PropertyDefinition.schemaSources: object expected"); - message.schemaSources[i] = $root.google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource.fromObject(object.schemaSources[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a PropertyDefinition message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition - * @static - * @param {google.cloud.contentwarehouse.v1.PropertyDefinition} message PropertyDefinition - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PropertyDefinition.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.schemaSources = []; - if (options.defaults) { - object.name = ""; - object.isRepeatable = false; - object.isFilterable = false; - object.isSearchable = false; - object.isMetadata = false; - object.displayName = ""; - object.isRequired = false; - object.retrievalImportance = options.enums === String ? "RETRIEVAL_IMPORTANCE_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.isRepeatable != null && message.hasOwnProperty("isRepeatable")) - object.isRepeatable = message.isRepeatable; - if (message.isFilterable != null && message.hasOwnProperty("isFilterable")) - object.isFilterable = message.isFilterable; - if (message.isSearchable != null && message.hasOwnProperty("isSearchable")) - object.isSearchable = message.isSearchable; - if (message.isMetadata != null && message.hasOwnProperty("isMetadata")) - object.isMetadata = message.isMetadata; - if (message.integerTypeOptions != null && message.hasOwnProperty("integerTypeOptions")) { - object.integerTypeOptions = $root.google.cloud.contentwarehouse.v1.IntegerTypeOptions.toObject(message.integerTypeOptions, options); - if (options.oneofs) - object.valueTypeOptions = "integerTypeOptions"; - } - if (message.floatTypeOptions != null && message.hasOwnProperty("floatTypeOptions")) { - object.floatTypeOptions = $root.google.cloud.contentwarehouse.v1.FloatTypeOptions.toObject(message.floatTypeOptions, options); - if (options.oneofs) - object.valueTypeOptions = "floatTypeOptions"; - } - if (message.textTypeOptions != null && message.hasOwnProperty("textTypeOptions")) { - object.textTypeOptions = $root.google.cloud.contentwarehouse.v1.TextTypeOptions.toObject(message.textTypeOptions, options); - if (options.oneofs) - object.valueTypeOptions = "textTypeOptions"; - } - if (message.propertyTypeOptions != null && message.hasOwnProperty("propertyTypeOptions")) { - object.propertyTypeOptions = $root.google.cloud.contentwarehouse.v1.PropertyTypeOptions.toObject(message.propertyTypeOptions, options); - if (options.oneofs) - object.valueTypeOptions = "propertyTypeOptions"; - } - if (message.enumTypeOptions != null && message.hasOwnProperty("enumTypeOptions")) { - object.enumTypeOptions = $root.google.cloud.contentwarehouse.v1.EnumTypeOptions.toObject(message.enumTypeOptions, options); - if (options.oneofs) - object.valueTypeOptions = "enumTypeOptions"; - } - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.dateTimeTypeOptions != null && message.hasOwnProperty("dateTimeTypeOptions")) { - object.dateTimeTypeOptions = $root.google.cloud.contentwarehouse.v1.DateTimeTypeOptions.toObject(message.dateTimeTypeOptions, options); - if (options.oneofs) - object.valueTypeOptions = "dateTimeTypeOptions"; - } - if (message.isRequired != null && message.hasOwnProperty("isRequired")) - object.isRequired = message.isRequired; - if (message.mapTypeOptions != null && message.hasOwnProperty("mapTypeOptions")) { - object.mapTypeOptions = $root.google.cloud.contentwarehouse.v1.MapTypeOptions.toObject(message.mapTypeOptions, options); - if (options.oneofs) - object.valueTypeOptions = "mapTypeOptions"; - } - if (message.timestampTypeOptions != null && message.hasOwnProperty("timestampTypeOptions")) { - object.timestampTypeOptions = $root.google.cloud.contentwarehouse.v1.TimestampTypeOptions.toObject(message.timestampTypeOptions, options); - if (options.oneofs) - object.valueTypeOptions = "timestampTypeOptions"; - } - if (message.retrievalImportance != null && message.hasOwnProperty("retrievalImportance")) - object.retrievalImportance = options.enums === String ? $root.google.cloud.contentwarehouse.v1.PropertyDefinition.RetrievalImportance[message.retrievalImportance] === undefined ? message.retrievalImportance : $root.google.cloud.contentwarehouse.v1.PropertyDefinition.RetrievalImportance[message.retrievalImportance] : message.retrievalImportance; - if (message.schemaSources && message.schemaSources.length) { - object.schemaSources = []; - for (var j = 0; j < message.schemaSources.length; ++j) - object.schemaSources[j] = $root.google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource.toObject(message.schemaSources[j], options); - } - return object; - }; - - /** - * Converts this PropertyDefinition to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition - * @instance - * @returns {Object.} JSON object - */ - PropertyDefinition.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PropertyDefinition - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PropertyDefinition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.PropertyDefinition"; - }; - - /** - * RetrievalImportance enum. - * @name google.cloud.contentwarehouse.v1.PropertyDefinition.RetrievalImportance - * @enum {number} - * @property {number} RETRIEVAL_IMPORTANCE_UNSPECIFIED=0 RETRIEVAL_IMPORTANCE_UNSPECIFIED value - * @property {number} HIGHEST=1 HIGHEST value - * @property {number} HIGHER=2 HIGHER value - * @property {number} HIGH=3 HIGH value - * @property {number} MEDIUM=4 MEDIUM value - * @property {number} LOW=5 LOW value - * @property {number} LOWEST=6 LOWEST value - */ - PropertyDefinition.RetrievalImportance = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RETRIEVAL_IMPORTANCE_UNSPECIFIED"] = 0; - values[valuesById[1] = "HIGHEST"] = 1; - values[valuesById[2] = "HIGHER"] = 2; - values[valuesById[3] = "HIGH"] = 3; - values[valuesById[4] = "MEDIUM"] = 4; - values[valuesById[5] = "LOW"] = 5; - values[valuesById[6] = "LOWEST"] = 6; - return values; - })(); - - PropertyDefinition.SchemaSource = (function() { - - /** - * Properties of a SchemaSource. - * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition - * @interface ISchemaSource - * @property {string|null} [name] SchemaSource name - * @property {string|null} [processorType] SchemaSource processorType - */ - - /** - * Constructs a new SchemaSource. - * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition - * @classdesc Represents a SchemaSource. - * @implements ISchemaSource - * @constructor - * @param {google.cloud.contentwarehouse.v1.PropertyDefinition.ISchemaSource=} [properties] Properties to set - */ - function SchemaSource(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]]; - } - - /** - * SchemaSource name. - * @member {string} name - * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource - * @instance - */ - SchemaSource.prototype.name = ""; - - /** - * SchemaSource processorType. - * @member {string} processorType - * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource - * @instance - */ - SchemaSource.prototype.processorType = ""; - - /** - * Creates a new SchemaSource instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource - * @static - * @param {google.cloud.contentwarehouse.v1.PropertyDefinition.ISchemaSource=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource} SchemaSource instance - */ - SchemaSource.create = function create(properties) { - return new SchemaSource(properties); - }; - - /** - * Encodes the specified SchemaSource message. Does not implicitly {@link google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource - * @static - * @param {google.cloud.contentwarehouse.v1.PropertyDefinition.ISchemaSource} message SchemaSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SchemaSource.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.processorType != null && Object.hasOwnProperty.call(message, "processorType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.processorType); - return writer; - }; - - /** - * Encodes the specified SchemaSource message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource - * @static - * @param {google.cloud.contentwarehouse.v1.PropertyDefinition.ISchemaSource} message SchemaSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SchemaSource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SchemaSource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource} SchemaSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SchemaSource.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.processorType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SchemaSource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource} SchemaSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SchemaSource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SchemaSource message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SchemaSource.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.processorType != null && message.hasOwnProperty("processorType")) - if (!$util.isString(message.processorType)) - return "processorType: string expected"; - return null; - }; - - /** - * Creates a SchemaSource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource} SchemaSource - */ - SchemaSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource(); - if (object.name != null) - message.name = String(object.name); - if (object.processorType != null) - message.processorType = String(object.processorType); - return message; - }; - - /** - * Creates a plain object from a SchemaSource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource - * @static - * @param {google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource} message SchemaSource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SchemaSource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.processorType = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.processorType != null && message.hasOwnProperty("processorType")) - object.processorType = message.processorType; - return object; - }; - - /** - * Converts this SchemaSource to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource - * @instance - * @returns {Object.} JSON object - */ - SchemaSource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SchemaSource - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SchemaSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.PropertyDefinition.SchemaSource"; - }; - - return SchemaSource; - })(); - - return PropertyDefinition; - })(); - - v1.IntegerTypeOptions = (function() { - - /** - * Properties of an IntegerTypeOptions. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IIntegerTypeOptions - */ - - /** - * Constructs a new IntegerTypeOptions. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents an IntegerTypeOptions. - * @implements IIntegerTypeOptions - * @constructor - * @param {google.cloud.contentwarehouse.v1.IIntegerTypeOptions=} [properties] Properties to set - */ - function IntegerTypeOptions(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 IntegerTypeOptions instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.IntegerTypeOptions - * @static - * @param {google.cloud.contentwarehouse.v1.IIntegerTypeOptions=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.IntegerTypeOptions} IntegerTypeOptions instance - */ - IntegerTypeOptions.create = function create(properties) { - return new IntegerTypeOptions(properties); - }; - - /** - * Encodes the specified IntegerTypeOptions message. Does not implicitly {@link google.cloud.contentwarehouse.v1.IntegerTypeOptions.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.IntegerTypeOptions - * @static - * @param {google.cloud.contentwarehouse.v1.IIntegerTypeOptions} message IntegerTypeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IntegerTypeOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified IntegerTypeOptions message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.IntegerTypeOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.IntegerTypeOptions - * @static - * @param {google.cloud.contentwarehouse.v1.IIntegerTypeOptions} message IntegerTypeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IntegerTypeOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IntegerTypeOptions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.IntegerTypeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.IntegerTypeOptions} IntegerTypeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IntegerTypeOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.IntegerTypeOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IntegerTypeOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.IntegerTypeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.IntegerTypeOptions} IntegerTypeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IntegerTypeOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IntegerTypeOptions message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.IntegerTypeOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IntegerTypeOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates an IntegerTypeOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.IntegerTypeOptions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.IntegerTypeOptions} IntegerTypeOptions - */ - IntegerTypeOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.IntegerTypeOptions) - return object; - return new $root.google.cloud.contentwarehouse.v1.IntegerTypeOptions(); - }; - - /** - * Creates a plain object from an IntegerTypeOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.IntegerTypeOptions - * @static - * @param {google.cloud.contentwarehouse.v1.IntegerTypeOptions} message IntegerTypeOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IntegerTypeOptions.toObject = function toObject() { - return {}; - }; - - /** - * Converts this IntegerTypeOptions to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.IntegerTypeOptions - * @instance - * @returns {Object.} JSON object - */ - IntegerTypeOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for IntegerTypeOptions - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.IntegerTypeOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - IntegerTypeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.IntegerTypeOptions"; - }; - - return IntegerTypeOptions; - })(); - - v1.FloatTypeOptions = (function() { - - /** - * Properties of a FloatTypeOptions. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IFloatTypeOptions - */ - - /** - * Constructs a new FloatTypeOptions. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a FloatTypeOptions. - * @implements IFloatTypeOptions - * @constructor - * @param {google.cloud.contentwarehouse.v1.IFloatTypeOptions=} [properties] Properties to set - */ - function FloatTypeOptions(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 FloatTypeOptions instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.FloatTypeOptions - * @static - * @param {google.cloud.contentwarehouse.v1.IFloatTypeOptions=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.FloatTypeOptions} FloatTypeOptions instance - */ - FloatTypeOptions.create = function create(properties) { - return new FloatTypeOptions(properties); - }; - - /** - * Encodes the specified FloatTypeOptions message. Does not implicitly {@link google.cloud.contentwarehouse.v1.FloatTypeOptions.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.FloatTypeOptions - * @static - * @param {google.cloud.contentwarehouse.v1.IFloatTypeOptions} message FloatTypeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FloatTypeOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified FloatTypeOptions message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.FloatTypeOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.FloatTypeOptions - * @static - * @param {google.cloud.contentwarehouse.v1.IFloatTypeOptions} message FloatTypeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FloatTypeOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FloatTypeOptions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.FloatTypeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.FloatTypeOptions} FloatTypeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FloatTypeOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.FloatTypeOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FloatTypeOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.FloatTypeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.FloatTypeOptions} FloatTypeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FloatTypeOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FloatTypeOptions message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.FloatTypeOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FloatTypeOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a FloatTypeOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.FloatTypeOptions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.FloatTypeOptions} FloatTypeOptions - */ - FloatTypeOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.FloatTypeOptions) - return object; - return new $root.google.cloud.contentwarehouse.v1.FloatTypeOptions(); - }; - - /** - * Creates a plain object from a FloatTypeOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.FloatTypeOptions - * @static - * @param {google.cloud.contentwarehouse.v1.FloatTypeOptions} message FloatTypeOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FloatTypeOptions.toObject = function toObject() { - return {}; - }; - - /** - * Converts this FloatTypeOptions to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.FloatTypeOptions - * @instance - * @returns {Object.} JSON object - */ - FloatTypeOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FloatTypeOptions - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.FloatTypeOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FloatTypeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.FloatTypeOptions"; - }; - - return FloatTypeOptions; - })(); - - v1.TextTypeOptions = (function() { - - /** - * Properties of a TextTypeOptions. - * @memberof google.cloud.contentwarehouse.v1 - * @interface ITextTypeOptions - */ - - /** - * Constructs a new TextTypeOptions. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a TextTypeOptions. - * @implements ITextTypeOptions - * @constructor - * @param {google.cloud.contentwarehouse.v1.ITextTypeOptions=} [properties] Properties to set - */ - function TextTypeOptions(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 TextTypeOptions instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.TextTypeOptions - * @static - * @param {google.cloud.contentwarehouse.v1.ITextTypeOptions=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.TextTypeOptions} TextTypeOptions instance - */ - TextTypeOptions.create = function create(properties) { - return new TextTypeOptions(properties); - }; - - /** - * Encodes the specified TextTypeOptions message. Does not implicitly {@link google.cloud.contentwarehouse.v1.TextTypeOptions.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.TextTypeOptions - * @static - * @param {google.cloud.contentwarehouse.v1.ITextTypeOptions} message TextTypeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TextTypeOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified TextTypeOptions message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.TextTypeOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.TextTypeOptions - * @static - * @param {google.cloud.contentwarehouse.v1.ITextTypeOptions} message TextTypeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TextTypeOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TextTypeOptions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.TextTypeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.TextTypeOptions} TextTypeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TextTypeOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.TextTypeOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TextTypeOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.TextTypeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.TextTypeOptions} TextTypeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TextTypeOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TextTypeOptions message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.TextTypeOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TextTypeOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a TextTypeOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.TextTypeOptions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.TextTypeOptions} TextTypeOptions - */ - TextTypeOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.TextTypeOptions) - return object; - return new $root.google.cloud.contentwarehouse.v1.TextTypeOptions(); - }; - - /** - * Creates a plain object from a TextTypeOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.TextTypeOptions - * @static - * @param {google.cloud.contentwarehouse.v1.TextTypeOptions} message TextTypeOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TextTypeOptions.toObject = function toObject() { - return {}; - }; - - /** - * Converts this TextTypeOptions to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.TextTypeOptions - * @instance - * @returns {Object.} JSON object - */ - TextTypeOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TextTypeOptions - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.TextTypeOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TextTypeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.TextTypeOptions"; - }; - - return TextTypeOptions; - })(); - - v1.DateTimeTypeOptions = (function() { - - /** - * Properties of a DateTimeTypeOptions. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IDateTimeTypeOptions - */ - - /** - * Constructs a new DateTimeTypeOptions. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a DateTimeTypeOptions. - * @implements IDateTimeTypeOptions - * @constructor - * @param {google.cloud.contentwarehouse.v1.IDateTimeTypeOptions=} [properties] Properties to set - */ - function DateTimeTypeOptions(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 DateTimeTypeOptions instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.DateTimeTypeOptions - * @static - * @param {google.cloud.contentwarehouse.v1.IDateTimeTypeOptions=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.DateTimeTypeOptions} DateTimeTypeOptions instance - */ - DateTimeTypeOptions.create = function create(properties) { - return new DateTimeTypeOptions(properties); - }; - - /** - * Encodes the specified DateTimeTypeOptions message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DateTimeTypeOptions.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.DateTimeTypeOptions - * @static - * @param {google.cloud.contentwarehouse.v1.IDateTimeTypeOptions} message DateTimeTypeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DateTimeTypeOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified DateTimeTypeOptions message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DateTimeTypeOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.DateTimeTypeOptions - * @static - * @param {google.cloud.contentwarehouse.v1.IDateTimeTypeOptions} message DateTimeTypeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DateTimeTypeOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DateTimeTypeOptions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.DateTimeTypeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.DateTimeTypeOptions} DateTimeTypeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DateTimeTypeOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.DateTimeTypeOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DateTimeTypeOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.DateTimeTypeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.DateTimeTypeOptions} DateTimeTypeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DateTimeTypeOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DateTimeTypeOptions message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.DateTimeTypeOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DateTimeTypeOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a DateTimeTypeOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.DateTimeTypeOptions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.DateTimeTypeOptions} DateTimeTypeOptions - */ - DateTimeTypeOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.DateTimeTypeOptions) - return object; - return new $root.google.cloud.contentwarehouse.v1.DateTimeTypeOptions(); - }; - - /** - * Creates a plain object from a DateTimeTypeOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.DateTimeTypeOptions - * @static - * @param {google.cloud.contentwarehouse.v1.DateTimeTypeOptions} message DateTimeTypeOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DateTimeTypeOptions.toObject = function toObject() { - return {}; - }; - - /** - * Converts this DateTimeTypeOptions to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.DateTimeTypeOptions - * @instance - * @returns {Object.} JSON object - */ - DateTimeTypeOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DateTimeTypeOptions - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.DateTimeTypeOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DateTimeTypeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.DateTimeTypeOptions"; - }; - - return DateTimeTypeOptions; - })(); - - v1.MapTypeOptions = (function() { - - /** - * Properties of a MapTypeOptions. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IMapTypeOptions - */ - - /** - * Constructs a new MapTypeOptions. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a MapTypeOptions. - * @implements IMapTypeOptions - * @constructor - * @param {google.cloud.contentwarehouse.v1.IMapTypeOptions=} [properties] Properties to set - */ - function MapTypeOptions(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 MapTypeOptions instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.MapTypeOptions - * @static - * @param {google.cloud.contentwarehouse.v1.IMapTypeOptions=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.MapTypeOptions} MapTypeOptions instance - */ - MapTypeOptions.create = function create(properties) { - return new MapTypeOptions(properties); - }; - - /** - * Encodes the specified MapTypeOptions message. Does not implicitly {@link google.cloud.contentwarehouse.v1.MapTypeOptions.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.MapTypeOptions - * @static - * @param {google.cloud.contentwarehouse.v1.IMapTypeOptions} message MapTypeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MapTypeOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified MapTypeOptions message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.MapTypeOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.MapTypeOptions - * @static - * @param {google.cloud.contentwarehouse.v1.IMapTypeOptions} message MapTypeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MapTypeOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MapTypeOptions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.MapTypeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.MapTypeOptions} MapTypeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MapTypeOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.MapTypeOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MapTypeOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.MapTypeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.MapTypeOptions} MapTypeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MapTypeOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MapTypeOptions message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.MapTypeOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MapTypeOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a MapTypeOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.MapTypeOptions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.MapTypeOptions} MapTypeOptions - */ - MapTypeOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.MapTypeOptions) - return object; - return new $root.google.cloud.contentwarehouse.v1.MapTypeOptions(); - }; - - /** - * Creates a plain object from a MapTypeOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.MapTypeOptions - * @static - * @param {google.cloud.contentwarehouse.v1.MapTypeOptions} message MapTypeOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MapTypeOptions.toObject = function toObject() { - return {}; - }; - - /** - * Converts this MapTypeOptions to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.MapTypeOptions - * @instance - * @returns {Object.} JSON object - */ - MapTypeOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MapTypeOptions - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.MapTypeOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MapTypeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.MapTypeOptions"; - }; - - return MapTypeOptions; - })(); - - v1.TimestampTypeOptions = (function() { - - /** - * Properties of a TimestampTypeOptions. - * @memberof google.cloud.contentwarehouse.v1 - * @interface ITimestampTypeOptions - */ - - /** - * Constructs a new TimestampTypeOptions. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a TimestampTypeOptions. - * @implements ITimestampTypeOptions - * @constructor - * @param {google.cloud.contentwarehouse.v1.ITimestampTypeOptions=} [properties] Properties to set - */ - function TimestampTypeOptions(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 TimestampTypeOptions instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.TimestampTypeOptions - * @static - * @param {google.cloud.contentwarehouse.v1.ITimestampTypeOptions=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.TimestampTypeOptions} TimestampTypeOptions instance - */ - TimestampTypeOptions.create = function create(properties) { - return new TimestampTypeOptions(properties); - }; - - /** - * Encodes the specified TimestampTypeOptions message. Does not implicitly {@link google.cloud.contentwarehouse.v1.TimestampTypeOptions.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.TimestampTypeOptions - * @static - * @param {google.cloud.contentwarehouse.v1.ITimestampTypeOptions} message TimestampTypeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TimestampTypeOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified TimestampTypeOptions message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.TimestampTypeOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.TimestampTypeOptions - * @static - * @param {google.cloud.contentwarehouse.v1.ITimestampTypeOptions} message TimestampTypeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TimestampTypeOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TimestampTypeOptions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.TimestampTypeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.TimestampTypeOptions} TimestampTypeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TimestampTypeOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.TimestampTypeOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TimestampTypeOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.TimestampTypeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.TimestampTypeOptions} TimestampTypeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TimestampTypeOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TimestampTypeOptions message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.TimestampTypeOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TimestampTypeOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a TimestampTypeOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.TimestampTypeOptions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.TimestampTypeOptions} TimestampTypeOptions - */ - TimestampTypeOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.TimestampTypeOptions) - return object; - return new $root.google.cloud.contentwarehouse.v1.TimestampTypeOptions(); - }; - - /** - * Creates a plain object from a TimestampTypeOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.TimestampTypeOptions - * @static - * @param {google.cloud.contentwarehouse.v1.TimestampTypeOptions} message TimestampTypeOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TimestampTypeOptions.toObject = function toObject() { - return {}; - }; - - /** - * Converts this TimestampTypeOptions to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.TimestampTypeOptions - * @instance - * @returns {Object.} JSON object - */ - TimestampTypeOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TimestampTypeOptions - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.TimestampTypeOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TimestampTypeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.TimestampTypeOptions"; - }; - - return TimestampTypeOptions; - })(); - - v1.PropertyTypeOptions = (function() { - - /** - * Properties of a PropertyTypeOptions. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IPropertyTypeOptions - * @property {Array.|null} [propertyDefinitions] PropertyTypeOptions propertyDefinitions - */ - - /** - * Constructs a new PropertyTypeOptions. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a PropertyTypeOptions. - * @implements IPropertyTypeOptions - * @constructor - * @param {google.cloud.contentwarehouse.v1.IPropertyTypeOptions=} [properties] Properties to set - */ - function PropertyTypeOptions(properties) { - this.propertyDefinitions = []; - 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]]; - } - - /** - * PropertyTypeOptions propertyDefinitions. - * @member {Array.} propertyDefinitions - * @memberof google.cloud.contentwarehouse.v1.PropertyTypeOptions - * @instance - */ - PropertyTypeOptions.prototype.propertyDefinitions = $util.emptyArray; - - /** - * Creates a new PropertyTypeOptions instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.PropertyTypeOptions - * @static - * @param {google.cloud.contentwarehouse.v1.IPropertyTypeOptions=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.PropertyTypeOptions} PropertyTypeOptions instance - */ - PropertyTypeOptions.create = function create(properties) { - return new PropertyTypeOptions(properties); - }; - - /** - * Encodes the specified PropertyTypeOptions message. Does not implicitly {@link google.cloud.contentwarehouse.v1.PropertyTypeOptions.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.PropertyTypeOptions - * @static - * @param {google.cloud.contentwarehouse.v1.IPropertyTypeOptions} message PropertyTypeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PropertyTypeOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.propertyDefinitions != null && message.propertyDefinitions.length) - for (var i = 0; i < message.propertyDefinitions.length; ++i) - $root.google.cloud.contentwarehouse.v1.PropertyDefinition.encode(message.propertyDefinitions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PropertyTypeOptions message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.PropertyTypeOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.PropertyTypeOptions - * @static - * @param {google.cloud.contentwarehouse.v1.IPropertyTypeOptions} message PropertyTypeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PropertyTypeOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PropertyTypeOptions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.PropertyTypeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.PropertyTypeOptions} PropertyTypeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PropertyTypeOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.PropertyTypeOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.propertyDefinitions && message.propertyDefinitions.length)) - message.propertyDefinitions = []; - message.propertyDefinitions.push($root.google.cloud.contentwarehouse.v1.PropertyDefinition.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PropertyTypeOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.PropertyTypeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.PropertyTypeOptions} PropertyTypeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PropertyTypeOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PropertyTypeOptions message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.PropertyTypeOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PropertyTypeOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.propertyDefinitions != null && message.hasOwnProperty("propertyDefinitions")) { - if (!Array.isArray(message.propertyDefinitions)) - return "propertyDefinitions: array expected"; - for (var i = 0; i < message.propertyDefinitions.length; ++i) { - var error = $root.google.cloud.contentwarehouse.v1.PropertyDefinition.verify(message.propertyDefinitions[i]); - if (error) - return "propertyDefinitions." + error; - } - } - return null; - }; - - /** - * Creates a PropertyTypeOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.PropertyTypeOptions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.PropertyTypeOptions} PropertyTypeOptions - */ - PropertyTypeOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.PropertyTypeOptions) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.PropertyTypeOptions(); - if (object.propertyDefinitions) { - if (!Array.isArray(object.propertyDefinitions)) - throw TypeError(".google.cloud.contentwarehouse.v1.PropertyTypeOptions.propertyDefinitions: array expected"); - message.propertyDefinitions = []; - for (var i = 0; i < object.propertyDefinitions.length; ++i) { - if (typeof object.propertyDefinitions[i] !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.PropertyTypeOptions.propertyDefinitions: object expected"); - message.propertyDefinitions[i] = $root.google.cloud.contentwarehouse.v1.PropertyDefinition.fromObject(object.propertyDefinitions[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a PropertyTypeOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.PropertyTypeOptions - * @static - * @param {google.cloud.contentwarehouse.v1.PropertyTypeOptions} message PropertyTypeOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PropertyTypeOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.propertyDefinitions = []; - if (message.propertyDefinitions && message.propertyDefinitions.length) { - object.propertyDefinitions = []; - for (var j = 0; j < message.propertyDefinitions.length; ++j) - object.propertyDefinitions[j] = $root.google.cloud.contentwarehouse.v1.PropertyDefinition.toObject(message.propertyDefinitions[j], options); - } - return object; - }; - - /** - * Converts this PropertyTypeOptions to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.PropertyTypeOptions - * @instance - * @returns {Object.} JSON object - */ - PropertyTypeOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PropertyTypeOptions - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.PropertyTypeOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PropertyTypeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.PropertyTypeOptions"; - }; - - return PropertyTypeOptions; - })(); - - v1.EnumTypeOptions = (function() { - - /** - * Properties of an EnumTypeOptions. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IEnumTypeOptions - * @property {Array.|null} [possibleValues] EnumTypeOptions possibleValues - * @property {boolean|null} [validationCheckDisabled] EnumTypeOptions validationCheckDisabled - */ - - /** - * Constructs a new EnumTypeOptions. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents an EnumTypeOptions. - * @implements IEnumTypeOptions - * @constructor - * @param {google.cloud.contentwarehouse.v1.IEnumTypeOptions=} [properties] Properties to set - */ - function EnumTypeOptions(properties) { - this.possibleValues = []; - 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]]; - } - - /** - * EnumTypeOptions possibleValues. - * @member {Array.} possibleValues - * @memberof google.cloud.contentwarehouse.v1.EnumTypeOptions - * @instance - */ - EnumTypeOptions.prototype.possibleValues = $util.emptyArray; - - /** - * EnumTypeOptions validationCheckDisabled. - * @member {boolean} validationCheckDisabled - * @memberof google.cloud.contentwarehouse.v1.EnumTypeOptions - * @instance - */ - EnumTypeOptions.prototype.validationCheckDisabled = false; - - /** - * Creates a new EnumTypeOptions instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.EnumTypeOptions - * @static - * @param {google.cloud.contentwarehouse.v1.IEnumTypeOptions=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.EnumTypeOptions} EnumTypeOptions instance - */ - EnumTypeOptions.create = function create(properties) { - return new EnumTypeOptions(properties); - }; - - /** - * Encodes the specified EnumTypeOptions message. Does not implicitly {@link google.cloud.contentwarehouse.v1.EnumTypeOptions.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.EnumTypeOptions - * @static - * @param {google.cloud.contentwarehouse.v1.IEnumTypeOptions} message EnumTypeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumTypeOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.possibleValues != null && message.possibleValues.length) - for (var i = 0; i < message.possibleValues.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.possibleValues[i]); - if (message.validationCheckDisabled != null && Object.hasOwnProperty.call(message, "validationCheckDisabled")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validationCheckDisabled); - return writer; - }; - - /** - * Encodes the specified EnumTypeOptions message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.EnumTypeOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.EnumTypeOptions - * @static - * @param {google.cloud.contentwarehouse.v1.IEnumTypeOptions} message EnumTypeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumTypeOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumTypeOptions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.EnumTypeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.EnumTypeOptions} EnumTypeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumTypeOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.EnumTypeOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.possibleValues && message.possibleValues.length)) - message.possibleValues = []; - message.possibleValues.push(reader.string()); - break; - } - case 2: { - message.validationCheckDisabled = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumTypeOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.EnumTypeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.EnumTypeOptions} EnumTypeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumTypeOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumTypeOptions message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.EnumTypeOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumTypeOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.possibleValues != null && message.hasOwnProperty("possibleValues")) { - if (!Array.isArray(message.possibleValues)) - return "possibleValues: array expected"; - for (var i = 0; i < message.possibleValues.length; ++i) - if (!$util.isString(message.possibleValues[i])) - return "possibleValues: string[] expected"; - } - if (message.validationCheckDisabled != null && message.hasOwnProperty("validationCheckDisabled")) - if (typeof message.validationCheckDisabled !== "boolean") - return "validationCheckDisabled: boolean expected"; - return null; - }; - - /** - * Creates an EnumTypeOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.EnumTypeOptions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.EnumTypeOptions} EnumTypeOptions - */ - EnumTypeOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.EnumTypeOptions) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.EnumTypeOptions(); - if (object.possibleValues) { - if (!Array.isArray(object.possibleValues)) - throw TypeError(".google.cloud.contentwarehouse.v1.EnumTypeOptions.possibleValues: array expected"); - message.possibleValues = []; - for (var i = 0; i < object.possibleValues.length; ++i) - message.possibleValues[i] = String(object.possibleValues[i]); - } - if (object.validationCheckDisabled != null) - message.validationCheckDisabled = Boolean(object.validationCheckDisabled); - return message; - }; - - /** - * Creates a plain object from an EnumTypeOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.EnumTypeOptions - * @static - * @param {google.cloud.contentwarehouse.v1.EnumTypeOptions} message EnumTypeOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumTypeOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.possibleValues = []; - if (options.defaults) - object.validationCheckDisabled = false; - if (message.possibleValues && message.possibleValues.length) { - object.possibleValues = []; - for (var j = 0; j < message.possibleValues.length; ++j) - object.possibleValues[j] = message.possibleValues[j]; - } - if (message.validationCheckDisabled != null && message.hasOwnProperty("validationCheckDisabled")) - object.validationCheckDisabled = message.validationCheckDisabled; - return object; - }; - - /** - * Converts this EnumTypeOptions to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.EnumTypeOptions - * @instance - * @returns {Object.} JSON object - */ - EnumTypeOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumTypeOptions - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.EnumTypeOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumTypeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.EnumTypeOptions"; - }; - - return EnumTypeOptions; - })(); - - v1.DocumentSchemaService = (function() { - - /** - * Constructs a new DocumentSchemaService service. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a DocumentSchemaService - * @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 DocumentSchemaService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (DocumentSchemaService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = DocumentSchemaService; - - /** - * Creates new DocumentSchemaService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.contentwarehouse.v1.DocumentSchemaService - * @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 {DocumentSchemaService} RPC service. Useful where requests and/or responses are streamed. - */ - DocumentSchemaService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentSchemaService|createDocumentSchema}. - * @memberof google.cloud.contentwarehouse.v1.DocumentSchemaService - * @typedef CreateDocumentSchemaCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.contentwarehouse.v1.DocumentSchema} [response] DocumentSchema - */ - - /** - * Calls CreateDocumentSchema. - * @function createDocumentSchema - * @memberof google.cloud.contentwarehouse.v1.DocumentSchemaService - * @instance - * @param {google.cloud.contentwarehouse.v1.ICreateDocumentSchemaRequest} request CreateDocumentSchemaRequest message or plain object - * @param {google.cloud.contentwarehouse.v1.DocumentSchemaService.CreateDocumentSchemaCallback} callback Node-style callback called with the error, if any, and DocumentSchema - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentSchemaService.prototype.createDocumentSchema = function createDocumentSchema(request, callback) { - return this.rpcCall(createDocumentSchema, $root.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest, $root.google.cloud.contentwarehouse.v1.DocumentSchema, request, callback); - }, "name", { value: "CreateDocumentSchema" }); - - /** - * Calls CreateDocumentSchema. - * @function createDocumentSchema - * @memberof google.cloud.contentwarehouse.v1.DocumentSchemaService - * @instance - * @param {google.cloud.contentwarehouse.v1.ICreateDocumentSchemaRequest} request CreateDocumentSchemaRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentSchemaService|updateDocumentSchema}. - * @memberof google.cloud.contentwarehouse.v1.DocumentSchemaService - * @typedef UpdateDocumentSchemaCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.contentwarehouse.v1.DocumentSchema} [response] DocumentSchema - */ - - /** - * Calls UpdateDocumentSchema. - * @function updateDocumentSchema - * @memberof google.cloud.contentwarehouse.v1.DocumentSchemaService - * @instance - * @param {google.cloud.contentwarehouse.v1.IUpdateDocumentSchemaRequest} request UpdateDocumentSchemaRequest message or plain object - * @param {google.cloud.contentwarehouse.v1.DocumentSchemaService.UpdateDocumentSchemaCallback} callback Node-style callback called with the error, if any, and DocumentSchema - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentSchemaService.prototype.updateDocumentSchema = function updateDocumentSchema(request, callback) { - return this.rpcCall(updateDocumentSchema, $root.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest, $root.google.cloud.contentwarehouse.v1.DocumentSchema, request, callback); - }, "name", { value: "UpdateDocumentSchema" }); - - /** - * Calls UpdateDocumentSchema. - * @function updateDocumentSchema - * @memberof google.cloud.contentwarehouse.v1.DocumentSchemaService - * @instance - * @param {google.cloud.contentwarehouse.v1.IUpdateDocumentSchemaRequest} request UpdateDocumentSchemaRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentSchemaService|getDocumentSchema}. - * @memberof google.cloud.contentwarehouse.v1.DocumentSchemaService - * @typedef GetDocumentSchemaCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.contentwarehouse.v1.DocumentSchema} [response] DocumentSchema - */ - - /** - * Calls GetDocumentSchema. - * @function getDocumentSchema - * @memberof google.cloud.contentwarehouse.v1.DocumentSchemaService - * @instance - * @param {google.cloud.contentwarehouse.v1.IGetDocumentSchemaRequest} request GetDocumentSchemaRequest message or plain object - * @param {google.cloud.contentwarehouse.v1.DocumentSchemaService.GetDocumentSchemaCallback} callback Node-style callback called with the error, if any, and DocumentSchema - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentSchemaService.prototype.getDocumentSchema = function getDocumentSchema(request, callback) { - return this.rpcCall(getDocumentSchema, $root.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest, $root.google.cloud.contentwarehouse.v1.DocumentSchema, request, callback); - }, "name", { value: "GetDocumentSchema" }); - - /** - * Calls GetDocumentSchema. - * @function getDocumentSchema - * @memberof google.cloud.contentwarehouse.v1.DocumentSchemaService - * @instance - * @param {google.cloud.contentwarehouse.v1.IGetDocumentSchemaRequest} request GetDocumentSchemaRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentSchemaService|deleteDocumentSchema}. - * @memberof google.cloud.contentwarehouse.v1.DocumentSchemaService - * @typedef DeleteDocumentSchemaCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteDocumentSchema. - * @function deleteDocumentSchema - * @memberof google.cloud.contentwarehouse.v1.DocumentSchemaService - * @instance - * @param {google.cloud.contentwarehouse.v1.IDeleteDocumentSchemaRequest} request DeleteDocumentSchemaRequest message or plain object - * @param {google.cloud.contentwarehouse.v1.DocumentSchemaService.DeleteDocumentSchemaCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentSchemaService.prototype.deleteDocumentSchema = function deleteDocumentSchema(request, callback) { - return this.rpcCall(deleteDocumentSchema, $root.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteDocumentSchema" }); - - /** - * Calls DeleteDocumentSchema. - * @function deleteDocumentSchema - * @memberof google.cloud.contentwarehouse.v1.DocumentSchemaService - * @instance - * @param {google.cloud.contentwarehouse.v1.IDeleteDocumentSchemaRequest} request DeleteDocumentSchemaRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentSchemaService|listDocumentSchemas}. - * @memberof google.cloud.contentwarehouse.v1.DocumentSchemaService - * @typedef ListDocumentSchemasCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse} [response] ListDocumentSchemasResponse - */ - - /** - * Calls ListDocumentSchemas. - * @function listDocumentSchemas - * @memberof google.cloud.contentwarehouse.v1.DocumentSchemaService - * @instance - * @param {google.cloud.contentwarehouse.v1.IListDocumentSchemasRequest} request ListDocumentSchemasRequest message or plain object - * @param {google.cloud.contentwarehouse.v1.DocumentSchemaService.ListDocumentSchemasCallback} callback Node-style callback called with the error, if any, and ListDocumentSchemasResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentSchemaService.prototype.listDocumentSchemas = function listDocumentSchemas(request, callback) { - return this.rpcCall(listDocumentSchemas, $root.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest, $root.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse, request, callback); - }, "name", { value: "ListDocumentSchemas" }); - - /** - * Calls ListDocumentSchemas. - * @function listDocumentSchemas - * @memberof google.cloud.contentwarehouse.v1.DocumentSchemaService - * @instance - * @param {google.cloud.contentwarehouse.v1.IListDocumentSchemasRequest} request ListDocumentSchemasRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return DocumentSchemaService; - })(); - - v1.CreateDocumentSchemaRequest = (function() { - - /** - * Properties of a CreateDocumentSchemaRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @interface ICreateDocumentSchemaRequest - * @property {string|null} [parent] CreateDocumentSchemaRequest parent - * @property {google.cloud.contentwarehouse.v1.IDocumentSchema|null} [documentSchema] CreateDocumentSchemaRequest documentSchema - */ - - /** - * Constructs a new CreateDocumentSchemaRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a CreateDocumentSchemaRequest. - * @implements ICreateDocumentSchemaRequest - * @constructor - * @param {google.cloud.contentwarehouse.v1.ICreateDocumentSchemaRequest=} [properties] Properties to set - */ - function CreateDocumentSchemaRequest(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]]; - } - - /** - * CreateDocumentSchemaRequest parent. - * @member {string} parent - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest - * @instance - */ - CreateDocumentSchemaRequest.prototype.parent = ""; - - /** - * CreateDocumentSchemaRequest documentSchema. - * @member {google.cloud.contentwarehouse.v1.IDocumentSchema|null|undefined} documentSchema - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest - * @instance - */ - CreateDocumentSchemaRequest.prototype.documentSchema = null; - - /** - * Creates a new CreateDocumentSchemaRequest instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest - * @static - * @param {google.cloud.contentwarehouse.v1.ICreateDocumentSchemaRequest=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest} CreateDocumentSchemaRequest instance - */ - CreateDocumentSchemaRequest.create = function create(properties) { - return new CreateDocumentSchemaRequest(properties); - }; - - /** - * Encodes the specified CreateDocumentSchemaRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest - * @static - * @param {google.cloud.contentwarehouse.v1.ICreateDocumentSchemaRequest} message CreateDocumentSchemaRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateDocumentSchemaRequest.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.documentSchema != null && Object.hasOwnProperty.call(message, "documentSchema")) - $root.google.cloud.contentwarehouse.v1.DocumentSchema.encode(message.documentSchema, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateDocumentSchemaRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest - * @static - * @param {google.cloud.contentwarehouse.v1.ICreateDocumentSchemaRequest} message CreateDocumentSchemaRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateDocumentSchemaRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateDocumentSchemaRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest} CreateDocumentSchemaRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateDocumentSchemaRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.documentSchema = $root.google.cloud.contentwarehouse.v1.DocumentSchema.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateDocumentSchemaRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest} CreateDocumentSchemaRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateDocumentSchemaRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateDocumentSchemaRequest message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateDocumentSchemaRequest.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.documentSchema != null && message.hasOwnProperty("documentSchema")) { - var error = $root.google.cloud.contentwarehouse.v1.DocumentSchema.verify(message.documentSchema); - if (error) - return "documentSchema." + error; - } - return null; - }; - - /** - * Creates a CreateDocumentSchemaRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest} CreateDocumentSchemaRequest - */ - CreateDocumentSchemaRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.documentSchema != null) { - if (typeof object.documentSchema !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest.documentSchema: object expected"); - message.documentSchema = $root.google.cloud.contentwarehouse.v1.DocumentSchema.fromObject(object.documentSchema); - } - return message; - }; - - /** - * Creates a plain object from a CreateDocumentSchemaRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest - * @static - * @param {google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest} message CreateDocumentSchemaRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateDocumentSchemaRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.documentSchema = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.documentSchema != null && message.hasOwnProperty("documentSchema")) - object.documentSchema = $root.google.cloud.contentwarehouse.v1.DocumentSchema.toObject(message.documentSchema, options); - return object; - }; - - /** - * Converts this CreateDocumentSchemaRequest to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest - * @instance - * @returns {Object.} JSON object - */ - CreateDocumentSchemaRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateDocumentSchemaRequest - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateDocumentSchemaRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest"; - }; - - return CreateDocumentSchemaRequest; - })(); - - v1.GetDocumentSchemaRequest = (function() { - - /** - * Properties of a GetDocumentSchemaRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IGetDocumentSchemaRequest - * @property {string|null} [name] GetDocumentSchemaRequest name - */ - - /** - * Constructs a new GetDocumentSchemaRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a GetDocumentSchemaRequest. - * @implements IGetDocumentSchemaRequest - * @constructor - * @param {google.cloud.contentwarehouse.v1.IGetDocumentSchemaRequest=} [properties] Properties to set - */ - function GetDocumentSchemaRequest(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]]; - } - - /** - * GetDocumentSchemaRequest name. - * @member {string} name - * @memberof google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest - * @instance - */ - GetDocumentSchemaRequest.prototype.name = ""; - - /** - * Creates a new GetDocumentSchemaRequest instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IGetDocumentSchemaRequest=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest} GetDocumentSchemaRequest instance - */ - GetDocumentSchemaRequest.create = function create(properties) { - return new GetDocumentSchemaRequest(properties); - }; - - /** - * Encodes the specified GetDocumentSchemaRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IGetDocumentSchemaRequest} message GetDocumentSchemaRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDocumentSchemaRequest.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 GetDocumentSchemaRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IGetDocumentSchemaRequest} message GetDocumentSchemaRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDocumentSchemaRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetDocumentSchemaRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest} GetDocumentSchemaRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDocumentSchemaRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetDocumentSchemaRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest} GetDocumentSchemaRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDocumentSchemaRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetDocumentSchemaRequest message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDocumentSchemaRequest.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 GetDocumentSchemaRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest} GetDocumentSchemaRequest - */ - GetDocumentSchemaRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetDocumentSchemaRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest - * @static - * @param {google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest} message GetDocumentSchemaRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDocumentSchemaRequest.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 GetDocumentSchemaRequest to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest - * @instance - * @returns {Object.} JSON object - */ - GetDocumentSchemaRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetDocumentSchemaRequest - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetDocumentSchemaRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest"; - }; - - return GetDocumentSchemaRequest; - })(); - - v1.UpdateDocumentSchemaRequest = (function() { - - /** - * Properties of an UpdateDocumentSchemaRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IUpdateDocumentSchemaRequest - * @property {string|null} [name] UpdateDocumentSchemaRequest name - * @property {google.cloud.contentwarehouse.v1.IDocumentSchema|null} [documentSchema] UpdateDocumentSchemaRequest documentSchema - */ - - /** - * Constructs a new UpdateDocumentSchemaRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents an UpdateDocumentSchemaRequest. - * @implements IUpdateDocumentSchemaRequest - * @constructor - * @param {google.cloud.contentwarehouse.v1.IUpdateDocumentSchemaRequest=} [properties] Properties to set - */ - function UpdateDocumentSchemaRequest(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]]; - } - - /** - * UpdateDocumentSchemaRequest name. - * @member {string} name - * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest - * @instance - */ - UpdateDocumentSchemaRequest.prototype.name = ""; - - /** - * UpdateDocumentSchemaRequest documentSchema. - * @member {google.cloud.contentwarehouse.v1.IDocumentSchema|null|undefined} documentSchema - * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest - * @instance - */ - UpdateDocumentSchemaRequest.prototype.documentSchema = null; - - /** - * Creates a new UpdateDocumentSchemaRequest instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IUpdateDocumentSchemaRequest=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest} UpdateDocumentSchemaRequest instance - */ - UpdateDocumentSchemaRequest.create = function create(properties) { - return new UpdateDocumentSchemaRequest(properties); - }; - - /** - * Encodes the specified UpdateDocumentSchemaRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IUpdateDocumentSchemaRequest} message UpdateDocumentSchemaRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateDocumentSchemaRequest.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.documentSchema != null && Object.hasOwnProperty.call(message, "documentSchema")) - $root.google.cloud.contentwarehouse.v1.DocumentSchema.encode(message.documentSchema, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateDocumentSchemaRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IUpdateDocumentSchemaRequest} message UpdateDocumentSchemaRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateDocumentSchemaRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateDocumentSchemaRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest} UpdateDocumentSchemaRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateDocumentSchemaRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.documentSchema = $root.google.cloud.contentwarehouse.v1.DocumentSchema.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateDocumentSchemaRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest} UpdateDocumentSchemaRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateDocumentSchemaRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateDocumentSchemaRequest message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateDocumentSchemaRequest.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.documentSchema != null && message.hasOwnProperty("documentSchema")) { - var error = $root.google.cloud.contentwarehouse.v1.DocumentSchema.verify(message.documentSchema); - if (error) - return "documentSchema." + error; - } - return null; - }; - - /** - * Creates an UpdateDocumentSchemaRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest} UpdateDocumentSchemaRequest - */ - UpdateDocumentSchemaRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.documentSchema != null) { - if (typeof object.documentSchema !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest.documentSchema: object expected"); - message.documentSchema = $root.google.cloud.contentwarehouse.v1.DocumentSchema.fromObject(object.documentSchema); - } - return message; - }; - - /** - * Creates a plain object from an UpdateDocumentSchemaRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest - * @static - * @param {google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest} message UpdateDocumentSchemaRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateDocumentSchemaRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.documentSchema = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.documentSchema != null && message.hasOwnProperty("documentSchema")) - object.documentSchema = $root.google.cloud.contentwarehouse.v1.DocumentSchema.toObject(message.documentSchema, options); - return object; - }; - - /** - * Converts this UpdateDocumentSchemaRequest to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateDocumentSchemaRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateDocumentSchemaRequest - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateDocumentSchemaRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest"; - }; - - return UpdateDocumentSchemaRequest; - })(); - - v1.DeleteDocumentSchemaRequest = (function() { - - /** - * Properties of a DeleteDocumentSchemaRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IDeleteDocumentSchemaRequest - * @property {string|null} [name] DeleteDocumentSchemaRequest name - */ - - /** - * Constructs a new DeleteDocumentSchemaRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a DeleteDocumentSchemaRequest. - * @implements IDeleteDocumentSchemaRequest - * @constructor - * @param {google.cloud.contentwarehouse.v1.IDeleteDocumentSchemaRequest=} [properties] Properties to set - */ - function DeleteDocumentSchemaRequest(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]]; - } - - /** - * DeleteDocumentSchemaRequest name. - * @member {string} name - * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest - * @instance - */ - DeleteDocumentSchemaRequest.prototype.name = ""; - - /** - * Creates a new DeleteDocumentSchemaRequest instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IDeleteDocumentSchemaRequest=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest} DeleteDocumentSchemaRequest instance - */ - DeleteDocumentSchemaRequest.create = function create(properties) { - return new DeleteDocumentSchemaRequest(properties); - }; - - /** - * Encodes the specified DeleteDocumentSchemaRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IDeleteDocumentSchemaRequest} message DeleteDocumentSchemaRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteDocumentSchemaRequest.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 DeleteDocumentSchemaRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IDeleteDocumentSchemaRequest} message DeleteDocumentSchemaRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteDocumentSchemaRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteDocumentSchemaRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest} DeleteDocumentSchemaRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteDocumentSchemaRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteDocumentSchemaRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest} DeleteDocumentSchemaRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteDocumentSchemaRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteDocumentSchemaRequest message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteDocumentSchemaRequest.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 DeleteDocumentSchemaRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest} DeleteDocumentSchemaRequest - */ - DeleteDocumentSchemaRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteDocumentSchemaRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest - * @static - * @param {google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest} message DeleteDocumentSchemaRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteDocumentSchemaRequest.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 DeleteDocumentSchemaRequest to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteDocumentSchemaRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteDocumentSchemaRequest - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteDocumentSchemaRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest"; - }; - - return DeleteDocumentSchemaRequest; - })(); - - v1.ListDocumentSchemasRequest = (function() { - - /** - * Properties of a ListDocumentSchemasRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IListDocumentSchemasRequest - * @property {string|null} [parent] ListDocumentSchemasRequest parent - * @property {number|null} [pageSize] ListDocumentSchemasRequest pageSize - * @property {string|null} [pageToken] ListDocumentSchemasRequest pageToken - */ - - /** - * Constructs a new ListDocumentSchemasRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a ListDocumentSchemasRequest. - * @implements IListDocumentSchemasRequest - * @constructor - * @param {google.cloud.contentwarehouse.v1.IListDocumentSchemasRequest=} [properties] Properties to set - */ - function ListDocumentSchemasRequest(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]]; - } - - /** - * ListDocumentSchemasRequest parent. - * @member {string} parent - * @memberof google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest - * @instance - */ - ListDocumentSchemasRequest.prototype.parent = ""; - - /** - * ListDocumentSchemasRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest - * @instance - */ - ListDocumentSchemasRequest.prototype.pageSize = 0; - - /** - * ListDocumentSchemasRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest - * @instance - */ - ListDocumentSchemasRequest.prototype.pageToken = ""; - - /** - * Creates a new ListDocumentSchemasRequest instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IListDocumentSchemasRequest=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest} ListDocumentSchemasRequest instance - */ - ListDocumentSchemasRequest.create = function create(properties) { - return new ListDocumentSchemasRequest(properties); - }; - - /** - * Encodes the specified ListDocumentSchemasRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IListDocumentSchemasRequest} message ListDocumentSchemasRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDocumentSchemasRequest.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.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); - return writer; - }; - - /** - * Encodes the specified ListDocumentSchemasRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IListDocumentSchemasRequest} message ListDocumentSchemasRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDocumentSchemasRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListDocumentSchemasRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest} ListDocumentSchemasRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDocumentSchemasRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListDocumentSchemasRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest} ListDocumentSchemasRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDocumentSchemasRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListDocumentSchemasRequest message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListDocumentSchemasRequest.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.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"; - return null; - }; - - /** - * Creates a ListDocumentSchemasRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest} ListDocumentSchemasRequest - */ - ListDocumentSchemasRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListDocumentSchemasRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest - * @static - * @param {google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest} message ListDocumentSchemasRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListDocumentSchemasRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListDocumentSchemasRequest to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest - * @instance - * @returns {Object.} JSON object - */ - ListDocumentSchemasRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListDocumentSchemasRequest - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListDocumentSchemasRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest"; - }; - - return ListDocumentSchemasRequest; - })(); - - v1.ListDocumentSchemasResponse = (function() { - - /** - * Properties of a ListDocumentSchemasResponse. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IListDocumentSchemasResponse - * @property {Array.|null} [documentSchemas] ListDocumentSchemasResponse documentSchemas - * @property {string|null} [nextPageToken] ListDocumentSchemasResponse nextPageToken - */ - - /** - * Constructs a new ListDocumentSchemasResponse. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a ListDocumentSchemasResponse. - * @implements IListDocumentSchemasResponse - * @constructor - * @param {google.cloud.contentwarehouse.v1.IListDocumentSchemasResponse=} [properties] Properties to set - */ - function ListDocumentSchemasResponse(properties) { - this.documentSchemas = []; - 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]]; - } - - /** - * ListDocumentSchemasResponse documentSchemas. - * @member {Array.} documentSchemas - * @memberof google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse - * @instance - */ - ListDocumentSchemasResponse.prototype.documentSchemas = $util.emptyArray; - - /** - * ListDocumentSchemasResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse - * @instance - */ - ListDocumentSchemasResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListDocumentSchemasResponse instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse - * @static - * @param {google.cloud.contentwarehouse.v1.IListDocumentSchemasResponse=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse} ListDocumentSchemasResponse instance - */ - ListDocumentSchemasResponse.create = function create(properties) { - return new ListDocumentSchemasResponse(properties); - }; - - /** - * Encodes the specified ListDocumentSchemasResponse message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse - * @static - * @param {google.cloud.contentwarehouse.v1.IListDocumentSchemasResponse} message ListDocumentSchemasResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDocumentSchemasResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.documentSchemas != null && message.documentSchemas.length) - for (var i = 0; i < message.documentSchemas.length; ++i) - $root.google.cloud.contentwarehouse.v1.DocumentSchema.encode(message.documentSchemas[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 ListDocumentSchemasResponse message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse - * @static - * @param {google.cloud.contentwarehouse.v1.IListDocumentSchemasResponse} message ListDocumentSchemasResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDocumentSchemasResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListDocumentSchemasResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse} ListDocumentSchemasResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDocumentSchemasResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.documentSchemas && message.documentSchemas.length)) - message.documentSchemas = []; - message.documentSchemas.push($root.google.cloud.contentwarehouse.v1.DocumentSchema.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListDocumentSchemasResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse} ListDocumentSchemasResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDocumentSchemasResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListDocumentSchemasResponse message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListDocumentSchemasResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.documentSchemas != null && message.hasOwnProperty("documentSchemas")) { - if (!Array.isArray(message.documentSchemas)) - return "documentSchemas: array expected"; - for (var i = 0; i < message.documentSchemas.length; ++i) { - var error = $root.google.cloud.contentwarehouse.v1.DocumentSchema.verify(message.documentSchemas[i]); - if (error) - return "documentSchemas." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListDocumentSchemasResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse} ListDocumentSchemasResponse - */ - ListDocumentSchemasResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse(); - if (object.documentSchemas) { - if (!Array.isArray(object.documentSchemas)) - throw TypeError(".google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse.documentSchemas: array expected"); - message.documentSchemas = []; - for (var i = 0; i < object.documentSchemas.length; ++i) { - if (typeof object.documentSchemas[i] !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse.documentSchemas: object expected"); - message.documentSchemas[i] = $root.google.cloud.contentwarehouse.v1.DocumentSchema.fromObject(object.documentSchemas[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListDocumentSchemasResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse - * @static - * @param {google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse} message ListDocumentSchemasResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListDocumentSchemasResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.documentSchemas = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.documentSchemas && message.documentSchemas.length) { - object.documentSchemas = []; - for (var j = 0; j < message.documentSchemas.length; ++j) - object.documentSchemas[j] = $root.google.cloud.contentwarehouse.v1.DocumentSchema.toObject(message.documentSchemas[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListDocumentSchemasResponse to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse - * @instance - * @returns {Object.} JSON object - */ - ListDocumentSchemasResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListDocumentSchemasResponse - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListDocumentSchemasResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse"; - }; - - return ListDocumentSchemasResponse; - })(); - - v1.DocumentService = (function() { - - /** - * Constructs a new DocumentService service. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a DocumentService - * @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 DocumentService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (DocumentService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = DocumentService; - - /** - * Creates new DocumentService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.contentwarehouse.v1.DocumentService - * @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 {DocumentService} RPC service. Useful where requests and/or responses are streamed. - */ - DocumentService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentService|createDocument}. - * @memberof google.cloud.contentwarehouse.v1.DocumentService - * @typedef CreateDocumentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.contentwarehouse.v1.CreateDocumentResponse} [response] CreateDocumentResponse - */ - - /** - * Calls CreateDocument. - * @function createDocument - * @memberof google.cloud.contentwarehouse.v1.DocumentService - * @instance - * @param {google.cloud.contentwarehouse.v1.ICreateDocumentRequest} request CreateDocumentRequest message or plain object - * @param {google.cloud.contentwarehouse.v1.DocumentService.CreateDocumentCallback} callback Node-style callback called with the error, if any, and CreateDocumentResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentService.prototype.createDocument = function createDocument(request, callback) { - return this.rpcCall(createDocument, $root.google.cloud.contentwarehouse.v1.CreateDocumentRequest, $root.google.cloud.contentwarehouse.v1.CreateDocumentResponse, request, callback); - }, "name", { value: "CreateDocument" }); - - /** - * Calls CreateDocument. - * @function createDocument - * @memberof google.cloud.contentwarehouse.v1.DocumentService - * @instance - * @param {google.cloud.contentwarehouse.v1.ICreateDocumentRequest} request CreateDocumentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentService|getDocument}. - * @memberof google.cloud.contentwarehouse.v1.DocumentService - * @typedef GetDocumentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.contentwarehouse.v1.Document} [response] Document - */ - - /** - * Calls GetDocument. - * @function getDocument - * @memberof google.cloud.contentwarehouse.v1.DocumentService - * @instance - * @param {google.cloud.contentwarehouse.v1.IGetDocumentRequest} request GetDocumentRequest message or plain object - * @param {google.cloud.contentwarehouse.v1.DocumentService.GetDocumentCallback} callback Node-style callback called with the error, if any, and Document - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentService.prototype.getDocument = function getDocument(request, callback) { - return this.rpcCall(getDocument, $root.google.cloud.contentwarehouse.v1.GetDocumentRequest, $root.google.cloud.contentwarehouse.v1.Document, request, callback); - }, "name", { value: "GetDocument" }); - - /** - * Calls GetDocument. - * @function getDocument - * @memberof google.cloud.contentwarehouse.v1.DocumentService - * @instance - * @param {google.cloud.contentwarehouse.v1.IGetDocumentRequest} request GetDocumentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentService|updateDocument}. - * @memberof google.cloud.contentwarehouse.v1.DocumentService - * @typedef UpdateDocumentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.contentwarehouse.v1.UpdateDocumentResponse} [response] UpdateDocumentResponse - */ - - /** - * Calls UpdateDocument. - * @function updateDocument - * @memberof google.cloud.contentwarehouse.v1.DocumentService - * @instance - * @param {google.cloud.contentwarehouse.v1.IUpdateDocumentRequest} request UpdateDocumentRequest message or plain object - * @param {google.cloud.contentwarehouse.v1.DocumentService.UpdateDocumentCallback} callback Node-style callback called with the error, if any, and UpdateDocumentResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentService.prototype.updateDocument = function updateDocument(request, callback) { - return this.rpcCall(updateDocument, $root.google.cloud.contentwarehouse.v1.UpdateDocumentRequest, $root.google.cloud.contentwarehouse.v1.UpdateDocumentResponse, request, callback); - }, "name", { value: "UpdateDocument" }); - - /** - * Calls UpdateDocument. - * @function updateDocument - * @memberof google.cloud.contentwarehouse.v1.DocumentService - * @instance - * @param {google.cloud.contentwarehouse.v1.IUpdateDocumentRequest} request UpdateDocumentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentService|deleteDocument}. - * @memberof google.cloud.contentwarehouse.v1.DocumentService - * @typedef DeleteDocumentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteDocument. - * @function deleteDocument - * @memberof google.cloud.contentwarehouse.v1.DocumentService - * @instance - * @param {google.cloud.contentwarehouse.v1.IDeleteDocumentRequest} request DeleteDocumentRequest message or plain object - * @param {google.cloud.contentwarehouse.v1.DocumentService.DeleteDocumentCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentService.prototype.deleteDocument = function deleteDocument(request, callback) { - return this.rpcCall(deleteDocument, $root.google.cloud.contentwarehouse.v1.DeleteDocumentRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteDocument" }); - - /** - * Calls DeleteDocument. - * @function deleteDocument - * @memberof google.cloud.contentwarehouse.v1.DocumentService - * @instance - * @param {google.cloud.contentwarehouse.v1.IDeleteDocumentRequest} request DeleteDocumentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentService|searchDocuments}. - * @memberof google.cloud.contentwarehouse.v1.DocumentService - * @typedef SearchDocumentsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.contentwarehouse.v1.SearchDocumentsResponse} [response] SearchDocumentsResponse - */ - - /** - * Calls SearchDocuments. - * @function searchDocuments - * @memberof google.cloud.contentwarehouse.v1.DocumentService - * @instance - * @param {google.cloud.contentwarehouse.v1.ISearchDocumentsRequest} request SearchDocumentsRequest message or plain object - * @param {google.cloud.contentwarehouse.v1.DocumentService.SearchDocumentsCallback} callback Node-style callback called with the error, if any, and SearchDocumentsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentService.prototype.searchDocuments = function searchDocuments(request, callback) { - return this.rpcCall(searchDocuments, $root.google.cloud.contentwarehouse.v1.SearchDocumentsRequest, $root.google.cloud.contentwarehouse.v1.SearchDocumentsResponse, request, callback); - }, "name", { value: "SearchDocuments" }); - - /** - * Calls SearchDocuments. - * @function searchDocuments - * @memberof google.cloud.contentwarehouse.v1.DocumentService - * @instance - * @param {google.cloud.contentwarehouse.v1.ISearchDocumentsRequest} request SearchDocumentsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentService|lockDocument}. - * @memberof google.cloud.contentwarehouse.v1.DocumentService - * @typedef LockDocumentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.contentwarehouse.v1.Document} [response] Document - */ - - /** - * Calls LockDocument. - * @function lockDocument - * @memberof google.cloud.contentwarehouse.v1.DocumentService - * @instance - * @param {google.cloud.contentwarehouse.v1.ILockDocumentRequest} request LockDocumentRequest message or plain object - * @param {google.cloud.contentwarehouse.v1.DocumentService.LockDocumentCallback} callback Node-style callback called with the error, if any, and Document - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentService.prototype.lockDocument = function lockDocument(request, callback) { - return this.rpcCall(lockDocument, $root.google.cloud.contentwarehouse.v1.LockDocumentRequest, $root.google.cloud.contentwarehouse.v1.Document, request, callback); - }, "name", { value: "LockDocument" }); - - /** - * Calls LockDocument. - * @function lockDocument - * @memberof google.cloud.contentwarehouse.v1.DocumentService - * @instance - * @param {google.cloud.contentwarehouse.v1.ILockDocumentRequest} request LockDocumentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentService|fetchAcl}. - * @memberof google.cloud.contentwarehouse.v1.DocumentService - * @typedef FetchAclCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.contentwarehouse.v1.FetchAclResponse} [response] FetchAclResponse - */ - - /** - * Calls FetchAcl. - * @function fetchAcl - * @memberof google.cloud.contentwarehouse.v1.DocumentService - * @instance - * @param {google.cloud.contentwarehouse.v1.IFetchAclRequest} request FetchAclRequest message or plain object - * @param {google.cloud.contentwarehouse.v1.DocumentService.FetchAclCallback} callback Node-style callback called with the error, if any, and FetchAclResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentService.prototype.fetchAcl = function fetchAcl(request, callback) { - return this.rpcCall(fetchAcl, $root.google.cloud.contentwarehouse.v1.FetchAclRequest, $root.google.cloud.contentwarehouse.v1.FetchAclResponse, request, callback); - }, "name", { value: "FetchAcl" }); - - /** - * Calls FetchAcl. - * @function fetchAcl - * @memberof google.cloud.contentwarehouse.v1.DocumentService - * @instance - * @param {google.cloud.contentwarehouse.v1.IFetchAclRequest} request FetchAclRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.DocumentService|setAcl}. - * @memberof google.cloud.contentwarehouse.v1.DocumentService - * @typedef SetAclCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.contentwarehouse.v1.SetAclResponse} [response] SetAclResponse - */ - - /** - * Calls SetAcl. - * @function setAcl - * @memberof google.cloud.contentwarehouse.v1.DocumentService - * @instance - * @param {google.cloud.contentwarehouse.v1.ISetAclRequest} request SetAclRequest message or plain object - * @param {google.cloud.contentwarehouse.v1.DocumentService.SetAclCallback} callback Node-style callback called with the error, if any, and SetAclResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentService.prototype.setAcl = function setAcl(request, callback) { - return this.rpcCall(setAcl, $root.google.cloud.contentwarehouse.v1.SetAclRequest, $root.google.cloud.contentwarehouse.v1.SetAclResponse, request, callback); - }, "name", { value: "SetAcl" }); - - /** - * Calls SetAcl. - * @function setAcl - * @memberof google.cloud.contentwarehouse.v1.DocumentService - * @instance - * @param {google.cloud.contentwarehouse.v1.ISetAclRequest} request SetAclRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return DocumentService; - })(); - - v1.CreateDocumentResponse = (function() { - - /** - * Properties of a CreateDocumentResponse. - * @memberof google.cloud.contentwarehouse.v1 - * @interface ICreateDocumentResponse - * @property {google.cloud.contentwarehouse.v1.IDocument|null} [document] CreateDocumentResponse document - * @property {google.cloud.contentwarehouse.v1.IRuleEngineOutput|null} [ruleEngineOutput] CreateDocumentResponse ruleEngineOutput - * @property {google.cloud.contentwarehouse.v1.IResponseMetadata|null} [metadata] CreateDocumentResponse metadata - * @property {Array.|null} [longRunningOperations] CreateDocumentResponse longRunningOperations - */ - - /** - * Constructs a new CreateDocumentResponse. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a CreateDocumentResponse. - * @implements ICreateDocumentResponse - * @constructor - * @param {google.cloud.contentwarehouse.v1.ICreateDocumentResponse=} [properties] Properties to set - */ - function CreateDocumentResponse(properties) { - this.longRunningOperations = []; - 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]]; - } - - /** - * CreateDocumentResponse document. - * @member {google.cloud.contentwarehouse.v1.IDocument|null|undefined} document - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentResponse - * @instance - */ - CreateDocumentResponse.prototype.document = null; - - /** - * CreateDocumentResponse ruleEngineOutput. - * @member {google.cloud.contentwarehouse.v1.IRuleEngineOutput|null|undefined} ruleEngineOutput - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentResponse - * @instance - */ - CreateDocumentResponse.prototype.ruleEngineOutput = null; - - /** - * CreateDocumentResponse metadata. - * @member {google.cloud.contentwarehouse.v1.IResponseMetadata|null|undefined} metadata - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentResponse - * @instance - */ - CreateDocumentResponse.prototype.metadata = null; - - /** - * CreateDocumentResponse longRunningOperations. - * @member {Array.} longRunningOperations - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentResponse - * @instance - */ - CreateDocumentResponse.prototype.longRunningOperations = $util.emptyArray; - - /** - * Creates a new CreateDocumentResponse instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentResponse - * @static - * @param {google.cloud.contentwarehouse.v1.ICreateDocumentResponse=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.CreateDocumentResponse} CreateDocumentResponse instance - */ - CreateDocumentResponse.create = function create(properties) { - return new CreateDocumentResponse(properties); - }; - - /** - * Encodes the specified CreateDocumentResponse message. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateDocumentResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentResponse - * @static - * @param {google.cloud.contentwarehouse.v1.ICreateDocumentResponse} message CreateDocumentResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateDocumentResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.document != null && Object.hasOwnProperty.call(message, "document")) - $root.google.cloud.contentwarehouse.v1.Document.encode(message.document, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.ruleEngineOutput != null && Object.hasOwnProperty.call(message, "ruleEngineOutput")) - $root.google.cloud.contentwarehouse.v1.RuleEngineOutput.encode(message.ruleEngineOutput, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.google.cloud.contentwarehouse.v1.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.longRunningOperations != null && message.longRunningOperations.length) - for (var i = 0; i < message.longRunningOperations.length; ++i) - $root.google.longrunning.Operation.encode(message.longRunningOperations[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateDocumentResponse message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateDocumentResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentResponse - * @static - * @param {google.cloud.contentwarehouse.v1.ICreateDocumentResponse} message CreateDocumentResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateDocumentResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateDocumentResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.CreateDocumentResponse} CreateDocumentResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateDocumentResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.CreateDocumentResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.document = $root.google.cloud.contentwarehouse.v1.Document.decode(reader, reader.uint32()); - break; - } - case 2: { - message.ruleEngineOutput = $root.google.cloud.contentwarehouse.v1.RuleEngineOutput.decode(reader, reader.uint32()); - break; - } - case 3: { - message.metadata = $root.google.cloud.contentwarehouse.v1.ResponseMetadata.decode(reader, reader.uint32()); - break; - } - case 4: { - if (!(message.longRunningOperations && message.longRunningOperations.length)) - message.longRunningOperations = []; - message.longRunningOperations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateDocumentResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.CreateDocumentResponse} CreateDocumentResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateDocumentResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateDocumentResponse message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateDocumentResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.document != null && message.hasOwnProperty("document")) { - var error = $root.google.cloud.contentwarehouse.v1.Document.verify(message.document); - if (error) - return "document." + error; - } - if (message.ruleEngineOutput != null && message.hasOwnProperty("ruleEngineOutput")) { - var error = $root.google.cloud.contentwarehouse.v1.RuleEngineOutput.verify(message.ruleEngineOutput); - if (error) - return "ruleEngineOutput." + error; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.google.cloud.contentwarehouse.v1.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - if (message.longRunningOperations != null && message.hasOwnProperty("longRunningOperations")) { - if (!Array.isArray(message.longRunningOperations)) - return "longRunningOperations: array expected"; - for (var i = 0; i < message.longRunningOperations.length; ++i) { - var error = $root.google.longrunning.Operation.verify(message.longRunningOperations[i]); - if (error) - return "longRunningOperations." + error; - } - } - return null; - }; - - /** - * Creates a CreateDocumentResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.CreateDocumentResponse} CreateDocumentResponse - */ - CreateDocumentResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.CreateDocumentResponse) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.CreateDocumentResponse(); - if (object.document != null) { - if (typeof object.document !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.CreateDocumentResponse.document: object expected"); - message.document = $root.google.cloud.contentwarehouse.v1.Document.fromObject(object.document); - } - if (object.ruleEngineOutput != null) { - if (typeof object.ruleEngineOutput !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.CreateDocumentResponse.ruleEngineOutput: object expected"); - message.ruleEngineOutput = $root.google.cloud.contentwarehouse.v1.RuleEngineOutput.fromObject(object.ruleEngineOutput); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.CreateDocumentResponse.metadata: object expected"); - message.metadata = $root.google.cloud.contentwarehouse.v1.ResponseMetadata.fromObject(object.metadata); - } - if (object.longRunningOperations) { - if (!Array.isArray(object.longRunningOperations)) - throw TypeError(".google.cloud.contentwarehouse.v1.CreateDocumentResponse.longRunningOperations: array expected"); - message.longRunningOperations = []; - for (var i = 0; i < object.longRunningOperations.length; ++i) { - if (typeof object.longRunningOperations[i] !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.CreateDocumentResponse.longRunningOperations: object expected"); - message.longRunningOperations[i] = $root.google.longrunning.Operation.fromObject(object.longRunningOperations[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a CreateDocumentResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentResponse - * @static - * @param {google.cloud.contentwarehouse.v1.CreateDocumentResponse} message CreateDocumentResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateDocumentResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.longRunningOperations = []; - if (options.defaults) { - object.document = null; - object.ruleEngineOutput = null; - object.metadata = null; - } - if (message.document != null && message.hasOwnProperty("document")) - object.document = $root.google.cloud.contentwarehouse.v1.Document.toObject(message.document, options); - if (message.ruleEngineOutput != null && message.hasOwnProperty("ruleEngineOutput")) - object.ruleEngineOutput = $root.google.cloud.contentwarehouse.v1.RuleEngineOutput.toObject(message.ruleEngineOutput, options); - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.google.cloud.contentwarehouse.v1.ResponseMetadata.toObject(message.metadata, options); - if (message.longRunningOperations && message.longRunningOperations.length) { - object.longRunningOperations = []; - for (var j = 0; j < message.longRunningOperations.length; ++j) - object.longRunningOperations[j] = $root.google.longrunning.Operation.toObject(message.longRunningOperations[j], options); - } - return object; - }; - - /** - * Converts this CreateDocumentResponse to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentResponse - * @instance - * @returns {Object.} JSON object - */ - CreateDocumentResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateDocumentResponse - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateDocumentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.CreateDocumentResponse"; - }; - - return CreateDocumentResponse; - })(); - - v1.UpdateDocumentResponse = (function() { - - /** - * Properties of an UpdateDocumentResponse. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IUpdateDocumentResponse - * @property {google.cloud.contentwarehouse.v1.IDocument|null} [document] UpdateDocumentResponse document - * @property {google.cloud.contentwarehouse.v1.IRuleEngineOutput|null} [ruleEngineOutput] UpdateDocumentResponse ruleEngineOutput - * @property {google.cloud.contentwarehouse.v1.IResponseMetadata|null} [metadata] UpdateDocumentResponse metadata - */ - - /** - * Constructs a new UpdateDocumentResponse. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents an UpdateDocumentResponse. - * @implements IUpdateDocumentResponse - * @constructor - * @param {google.cloud.contentwarehouse.v1.IUpdateDocumentResponse=} [properties] Properties to set - */ - function UpdateDocumentResponse(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]]; - } - - /** - * UpdateDocumentResponse document. - * @member {google.cloud.contentwarehouse.v1.IDocument|null|undefined} document - * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentResponse - * @instance - */ - UpdateDocumentResponse.prototype.document = null; - - /** - * UpdateDocumentResponse ruleEngineOutput. - * @member {google.cloud.contentwarehouse.v1.IRuleEngineOutput|null|undefined} ruleEngineOutput - * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentResponse - * @instance - */ - UpdateDocumentResponse.prototype.ruleEngineOutput = null; - - /** - * UpdateDocumentResponse metadata. - * @member {google.cloud.contentwarehouse.v1.IResponseMetadata|null|undefined} metadata - * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentResponse - * @instance - */ - UpdateDocumentResponse.prototype.metadata = null; - - /** - * Creates a new UpdateDocumentResponse instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentResponse - * @static - * @param {google.cloud.contentwarehouse.v1.IUpdateDocumentResponse=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.UpdateDocumentResponse} UpdateDocumentResponse instance - */ - UpdateDocumentResponse.create = function create(properties) { - return new UpdateDocumentResponse(properties); - }; - - /** - * Encodes the specified UpdateDocumentResponse message. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateDocumentResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentResponse - * @static - * @param {google.cloud.contentwarehouse.v1.IUpdateDocumentResponse} message UpdateDocumentResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateDocumentResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.document != null && Object.hasOwnProperty.call(message, "document")) - $root.google.cloud.contentwarehouse.v1.Document.encode(message.document, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.ruleEngineOutput != null && Object.hasOwnProperty.call(message, "ruleEngineOutput")) - $root.google.cloud.contentwarehouse.v1.RuleEngineOutput.encode(message.ruleEngineOutput, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.google.cloud.contentwarehouse.v1.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateDocumentResponse message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateDocumentResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentResponse - * @static - * @param {google.cloud.contentwarehouse.v1.IUpdateDocumentResponse} message UpdateDocumentResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateDocumentResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateDocumentResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.UpdateDocumentResponse} UpdateDocumentResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateDocumentResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.UpdateDocumentResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.document = $root.google.cloud.contentwarehouse.v1.Document.decode(reader, reader.uint32()); - break; - } - case 2: { - message.ruleEngineOutput = $root.google.cloud.contentwarehouse.v1.RuleEngineOutput.decode(reader, reader.uint32()); - break; - } - case 3: { - message.metadata = $root.google.cloud.contentwarehouse.v1.ResponseMetadata.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateDocumentResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.UpdateDocumentResponse} UpdateDocumentResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateDocumentResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateDocumentResponse message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateDocumentResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.document != null && message.hasOwnProperty("document")) { - var error = $root.google.cloud.contentwarehouse.v1.Document.verify(message.document); - if (error) - return "document." + error; - } - if (message.ruleEngineOutput != null && message.hasOwnProperty("ruleEngineOutput")) { - var error = $root.google.cloud.contentwarehouse.v1.RuleEngineOutput.verify(message.ruleEngineOutput); - if (error) - return "ruleEngineOutput." + error; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.google.cloud.contentwarehouse.v1.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates an UpdateDocumentResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.UpdateDocumentResponse} UpdateDocumentResponse - */ - UpdateDocumentResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.UpdateDocumentResponse) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.UpdateDocumentResponse(); - if (object.document != null) { - if (typeof object.document !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.UpdateDocumentResponse.document: object expected"); - message.document = $root.google.cloud.contentwarehouse.v1.Document.fromObject(object.document); - } - if (object.ruleEngineOutput != null) { - if (typeof object.ruleEngineOutput !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.UpdateDocumentResponse.ruleEngineOutput: object expected"); - message.ruleEngineOutput = $root.google.cloud.contentwarehouse.v1.RuleEngineOutput.fromObject(object.ruleEngineOutput); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.UpdateDocumentResponse.metadata: object expected"); - message.metadata = $root.google.cloud.contentwarehouse.v1.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from an UpdateDocumentResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentResponse - * @static - * @param {google.cloud.contentwarehouse.v1.UpdateDocumentResponse} message UpdateDocumentResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateDocumentResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.document = null; - object.ruleEngineOutput = null; - object.metadata = null; - } - if (message.document != null && message.hasOwnProperty("document")) - object.document = $root.google.cloud.contentwarehouse.v1.Document.toObject(message.document, options); - if (message.ruleEngineOutput != null && message.hasOwnProperty("ruleEngineOutput")) - object.ruleEngineOutput = $root.google.cloud.contentwarehouse.v1.RuleEngineOutput.toObject(message.ruleEngineOutput, options); - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.google.cloud.contentwarehouse.v1.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this UpdateDocumentResponse to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentResponse - * @instance - * @returns {Object.} JSON object - */ - UpdateDocumentResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateDocumentResponse - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateDocumentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.UpdateDocumentResponse"; - }; - - return UpdateDocumentResponse; - })(); - - v1.QAResult = (function() { - - /** - * Properties of a QAResult. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IQAResult - * @property {Array.|null} [highlights] QAResult highlights - * @property {number|null} [confidenceScore] QAResult confidenceScore - */ - - /** - * Constructs a new QAResult. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a QAResult. - * @implements IQAResult - * @constructor - * @param {google.cloud.contentwarehouse.v1.IQAResult=} [properties] Properties to set - */ - function QAResult(properties) { - this.highlights = []; - 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]]; - } - - /** - * QAResult highlights. - * @member {Array.} highlights - * @memberof google.cloud.contentwarehouse.v1.QAResult - * @instance - */ - QAResult.prototype.highlights = $util.emptyArray; - - /** - * QAResult confidenceScore. - * @member {number} confidenceScore - * @memberof google.cloud.contentwarehouse.v1.QAResult - * @instance - */ - QAResult.prototype.confidenceScore = 0; - - /** - * Creates a new QAResult instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.QAResult - * @static - * @param {google.cloud.contentwarehouse.v1.IQAResult=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.QAResult} QAResult instance - */ - QAResult.create = function create(properties) { - return new QAResult(properties); - }; - - /** - * Encodes the specified QAResult message. Does not implicitly {@link google.cloud.contentwarehouse.v1.QAResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.QAResult - * @static - * @param {google.cloud.contentwarehouse.v1.IQAResult} message QAResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QAResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.highlights != null && message.highlights.length) - for (var i = 0; i < message.highlights.length; ++i) - $root.google.cloud.contentwarehouse.v1.QAResult.Highlight.encode(message.highlights[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.confidenceScore != null && Object.hasOwnProperty.call(message, "confidenceScore")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidenceScore); - return writer; - }; - - /** - * Encodes the specified QAResult message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.QAResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.QAResult - * @static - * @param {google.cloud.contentwarehouse.v1.IQAResult} message QAResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QAResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QAResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.QAResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.QAResult} QAResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QAResult.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.QAResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.highlights && message.highlights.length)) - message.highlights = []; - message.highlights.push($root.google.cloud.contentwarehouse.v1.QAResult.Highlight.decode(reader, reader.uint32())); - break; - } - case 2: { - message.confidenceScore = reader.float(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QAResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.QAResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.QAResult} QAResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QAResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QAResult message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.QAResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QAResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.highlights != null && message.hasOwnProperty("highlights")) { - if (!Array.isArray(message.highlights)) - return "highlights: array expected"; - for (var i = 0; i < message.highlights.length; ++i) { - var error = $root.google.cloud.contentwarehouse.v1.QAResult.Highlight.verify(message.highlights[i]); - if (error) - return "highlights." + error; - } - } - if (message.confidenceScore != null && message.hasOwnProperty("confidenceScore")) - if (typeof message.confidenceScore !== "number") - return "confidenceScore: number expected"; - return null; - }; - - /** - * Creates a QAResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.QAResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.QAResult} QAResult - */ - QAResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.QAResult) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.QAResult(); - if (object.highlights) { - if (!Array.isArray(object.highlights)) - throw TypeError(".google.cloud.contentwarehouse.v1.QAResult.highlights: array expected"); - message.highlights = []; - for (var i = 0; i < object.highlights.length; ++i) { - if (typeof object.highlights[i] !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.QAResult.highlights: object expected"); - message.highlights[i] = $root.google.cloud.contentwarehouse.v1.QAResult.Highlight.fromObject(object.highlights[i]); - } - } - if (object.confidenceScore != null) - message.confidenceScore = Number(object.confidenceScore); - return message; - }; - - /** - * Creates a plain object from a QAResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.QAResult - * @static - * @param {google.cloud.contentwarehouse.v1.QAResult} message QAResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QAResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.highlights = []; - if (options.defaults) - object.confidenceScore = 0; - if (message.highlights && message.highlights.length) { - object.highlights = []; - for (var j = 0; j < message.highlights.length; ++j) - object.highlights[j] = $root.google.cloud.contentwarehouse.v1.QAResult.Highlight.toObject(message.highlights[j], options); - } - if (message.confidenceScore != null && message.hasOwnProperty("confidenceScore")) - object.confidenceScore = options.json && !isFinite(message.confidenceScore) ? String(message.confidenceScore) : message.confidenceScore; - return object; - }; - - /** - * Converts this QAResult to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.QAResult - * @instance - * @returns {Object.} JSON object - */ - QAResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for QAResult - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.QAResult - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - QAResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.QAResult"; - }; - - QAResult.Highlight = (function() { - - /** - * Properties of a Highlight. - * @memberof google.cloud.contentwarehouse.v1.QAResult - * @interface IHighlight - * @property {number|null} [startIndex] Highlight startIndex - * @property {number|null} [endIndex] Highlight endIndex - */ - - /** - * Constructs a new Highlight. - * @memberof google.cloud.contentwarehouse.v1.QAResult - * @classdesc Represents a Highlight. - * @implements IHighlight - * @constructor - * @param {google.cloud.contentwarehouse.v1.QAResult.IHighlight=} [properties] Properties to set - */ - function Highlight(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]]; - } - - /** - * Highlight startIndex. - * @member {number} startIndex - * @memberof google.cloud.contentwarehouse.v1.QAResult.Highlight - * @instance - */ - Highlight.prototype.startIndex = 0; - - /** - * Highlight endIndex. - * @member {number} endIndex - * @memberof google.cloud.contentwarehouse.v1.QAResult.Highlight - * @instance - */ - Highlight.prototype.endIndex = 0; - - /** - * Creates a new Highlight instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.QAResult.Highlight - * @static - * @param {google.cloud.contentwarehouse.v1.QAResult.IHighlight=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.QAResult.Highlight} Highlight instance - */ - Highlight.create = function create(properties) { - return new Highlight(properties); - }; - - /** - * Encodes the specified Highlight message. Does not implicitly {@link google.cloud.contentwarehouse.v1.QAResult.Highlight.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.QAResult.Highlight - * @static - * @param {google.cloud.contentwarehouse.v1.QAResult.IHighlight} message Highlight message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Highlight.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startIndex != null && Object.hasOwnProperty.call(message, "startIndex")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.startIndex); - if (message.endIndex != null && Object.hasOwnProperty.call(message, "endIndex")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.endIndex); - return writer; - }; - - /** - * Encodes the specified Highlight message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.QAResult.Highlight.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.QAResult.Highlight - * @static - * @param {google.cloud.contentwarehouse.v1.QAResult.IHighlight} message Highlight message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Highlight.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Highlight message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.QAResult.Highlight - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.QAResult.Highlight} Highlight - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Highlight.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.QAResult.Highlight(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.startIndex = reader.int32(); - break; - } - case 2: { - message.endIndex = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Highlight message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.QAResult.Highlight - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.QAResult.Highlight} Highlight - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Highlight.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Highlight message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.QAResult.Highlight - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Highlight.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.startIndex != null && message.hasOwnProperty("startIndex")) - if (!$util.isInteger(message.startIndex)) - return "startIndex: integer expected"; - if (message.endIndex != null && message.hasOwnProperty("endIndex")) - if (!$util.isInteger(message.endIndex)) - return "endIndex: integer expected"; - return null; - }; - - /** - * Creates a Highlight message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.QAResult.Highlight - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.QAResult.Highlight} Highlight - */ - Highlight.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.QAResult.Highlight) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.QAResult.Highlight(); - if (object.startIndex != null) - message.startIndex = object.startIndex | 0; - if (object.endIndex != null) - message.endIndex = object.endIndex | 0; - return message; - }; - - /** - * Creates a plain object from a Highlight message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.QAResult.Highlight - * @static - * @param {google.cloud.contentwarehouse.v1.QAResult.Highlight} message Highlight - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Highlight.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.startIndex = 0; - object.endIndex = 0; - } - if (message.startIndex != null && message.hasOwnProperty("startIndex")) - object.startIndex = message.startIndex; - if (message.endIndex != null && message.hasOwnProperty("endIndex")) - object.endIndex = message.endIndex; - return object; - }; - - /** - * Converts this Highlight to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.QAResult.Highlight - * @instance - * @returns {Object.} JSON object - */ - Highlight.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Highlight - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.QAResult.Highlight - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Highlight.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.QAResult.Highlight"; - }; - - return Highlight; - })(); - - return QAResult; - })(); - - v1.SearchDocumentsResponse = (function() { - - /** - * Properties of a SearchDocumentsResponse. - * @memberof google.cloud.contentwarehouse.v1 - * @interface ISearchDocumentsResponse - * @property {Array.|null} [matchingDocuments] SearchDocumentsResponse matchingDocuments - * @property {string|null} [nextPageToken] SearchDocumentsResponse nextPageToken - * @property {number|null} [totalSize] SearchDocumentsResponse totalSize - * @property {google.cloud.contentwarehouse.v1.IResponseMetadata|null} [metadata] SearchDocumentsResponse metadata - * @property {Array.|null} [histogramQueryResults] SearchDocumentsResponse histogramQueryResults - * @property {string|null} [questionAnswer] SearchDocumentsResponse questionAnswer - */ - - /** - * Constructs a new SearchDocumentsResponse. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a SearchDocumentsResponse. - * @implements ISearchDocumentsResponse - * @constructor - * @param {google.cloud.contentwarehouse.v1.ISearchDocumentsResponse=} [properties] Properties to set - */ - function SearchDocumentsResponse(properties) { - this.matchingDocuments = []; - this.histogramQueryResults = []; - 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]]; - } - - /** - * SearchDocumentsResponse matchingDocuments. - * @member {Array.} matchingDocuments - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse - * @instance - */ - SearchDocumentsResponse.prototype.matchingDocuments = $util.emptyArray; - - /** - * SearchDocumentsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse - * @instance - */ - SearchDocumentsResponse.prototype.nextPageToken = ""; - - /** - * SearchDocumentsResponse totalSize. - * @member {number} totalSize - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse - * @instance - */ - SearchDocumentsResponse.prototype.totalSize = 0; - - /** - * SearchDocumentsResponse metadata. - * @member {google.cloud.contentwarehouse.v1.IResponseMetadata|null|undefined} metadata - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse - * @instance - */ - SearchDocumentsResponse.prototype.metadata = null; - - /** - * SearchDocumentsResponse histogramQueryResults. - * @member {Array.} histogramQueryResults - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse - * @instance - */ - SearchDocumentsResponse.prototype.histogramQueryResults = $util.emptyArray; - - /** - * SearchDocumentsResponse questionAnswer. - * @member {string} questionAnswer - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse - * @instance - */ - SearchDocumentsResponse.prototype.questionAnswer = ""; - - /** - * Creates a new SearchDocumentsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse - * @static - * @param {google.cloud.contentwarehouse.v1.ISearchDocumentsResponse=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.SearchDocumentsResponse} SearchDocumentsResponse instance - */ - SearchDocumentsResponse.create = function create(properties) { - return new SearchDocumentsResponse(properties); - }; - - /** - * Encodes the specified SearchDocumentsResponse message. Does not implicitly {@link google.cloud.contentwarehouse.v1.SearchDocumentsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse - * @static - * @param {google.cloud.contentwarehouse.v1.ISearchDocumentsResponse} message SearchDocumentsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchDocumentsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.matchingDocuments != null && message.matchingDocuments.length) - for (var i = 0; i < message.matchingDocuments.length; ++i) - $root.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument.encode(message.matchingDocuments[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); - if (message.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalSize); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.google.cloud.contentwarehouse.v1.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.histogramQueryResults != null && message.histogramQueryResults.length) - for (var i = 0; i < message.histogramQueryResults.length; ++i) - $root.google.cloud.contentwarehouse.v1.HistogramQueryResult.encode(message.histogramQueryResults[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.questionAnswer != null && Object.hasOwnProperty.call(message, "questionAnswer")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.questionAnswer); - return writer; - }; - - /** - * Encodes the specified SearchDocumentsResponse message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.SearchDocumentsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse - * @static - * @param {google.cloud.contentwarehouse.v1.ISearchDocumentsResponse} message SearchDocumentsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchDocumentsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SearchDocumentsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.SearchDocumentsResponse} SearchDocumentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchDocumentsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.SearchDocumentsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.matchingDocuments && message.matchingDocuments.length)) - message.matchingDocuments = []; - message.matchingDocuments.push($root.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - message.totalSize = reader.int32(); - break; - } - case 4: { - message.metadata = $root.google.cloud.contentwarehouse.v1.ResponseMetadata.decode(reader, reader.uint32()); - break; - } - case 6: { - if (!(message.histogramQueryResults && message.histogramQueryResults.length)) - message.histogramQueryResults = []; - message.histogramQueryResults.push($root.google.cloud.contentwarehouse.v1.HistogramQueryResult.decode(reader, reader.uint32())); - break; - } - case 7: { - message.questionAnswer = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SearchDocumentsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.SearchDocumentsResponse} SearchDocumentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchDocumentsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SearchDocumentsResponse message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SearchDocumentsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.matchingDocuments != null && message.hasOwnProperty("matchingDocuments")) { - if (!Array.isArray(message.matchingDocuments)) - return "matchingDocuments: array expected"; - for (var i = 0; i < message.matchingDocuments.length; ++i) { - var error = $root.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument.verify(message.matchingDocuments[i]); - if (error) - return "matchingDocuments." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - if (!$util.isInteger(message.totalSize)) - return "totalSize: integer expected"; - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.google.cloud.contentwarehouse.v1.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - if (message.histogramQueryResults != null && message.hasOwnProperty("histogramQueryResults")) { - if (!Array.isArray(message.histogramQueryResults)) - return "histogramQueryResults: array expected"; - for (var i = 0; i < message.histogramQueryResults.length; ++i) { - var error = $root.google.cloud.contentwarehouse.v1.HistogramQueryResult.verify(message.histogramQueryResults[i]); - if (error) - return "histogramQueryResults." + error; - } - } - if (message.questionAnswer != null && message.hasOwnProperty("questionAnswer")) - if (!$util.isString(message.questionAnswer)) - return "questionAnswer: string expected"; - return null; - }; - - /** - * Creates a SearchDocumentsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.SearchDocumentsResponse} SearchDocumentsResponse - */ - SearchDocumentsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.SearchDocumentsResponse) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.SearchDocumentsResponse(); - if (object.matchingDocuments) { - if (!Array.isArray(object.matchingDocuments)) - throw TypeError(".google.cloud.contentwarehouse.v1.SearchDocumentsResponse.matchingDocuments: array expected"); - message.matchingDocuments = []; - for (var i = 0; i < object.matchingDocuments.length; ++i) { - if (typeof object.matchingDocuments[i] !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.SearchDocumentsResponse.matchingDocuments: object expected"); - message.matchingDocuments[i] = $root.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument.fromObject(object.matchingDocuments[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.totalSize != null) - message.totalSize = object.totalSize | 0; - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.SearchDocumentsResponse.metadata: object expected"); - message.metadata = $root.google.cloud.contentwarehouse.v1.ResponseMetadata.fromObject(object.metadata); - } - if (object.histogramQueryResults) { - if (!Array.isArray(object.histogramQueryResults)) - throw TypeError(".google.cloud.contentwarehouse.v1.SearchDocumentsResponse.histogramQueryResults: array expected"); - message.histogramQueryResults = []; - for (var i = 0; i < object.histogramQueryResults.length; ++i) { - if (typeof object.histogramQueryResults[i] !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.SearchDocumentsResponse.histogramQueryResults: object expected"); - message.histogramQueryResults[i] = $root.google.cloud.contentwarehouse.v1.HistogramQueryResult.fromObject(object.histogramQueryResults[i]); - } - } - if (object.questionAnswer != null) - message.questionAnswer = String(object.questionAnswer); - return message; - }; - - /** - * Creates a plain object from a SearchDocumentsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse - * @static - * @param {google.cloud.contentwarehouse.v1.SearchDocumentsResponse} message SearchDocumentsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SearchDocumentsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.matchingDocuments = []; - object.histogramQueryResults = []; - } - if (options.defaults) { - object.nextPageToken = ""; - object.totalSize = 0; - object.metadata = null; - object.questionAnswer = ""; - } - if (message.matchingDocuments && message.matchingDocuments.length) { - object.matchingDocuments = []; - for (var j = 0; j < message.matchingDocuments.length; ++j) - object.matchingDocuments[j] = $root.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument.toObject(message.matchingDocuments[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - object.totalSize = message.totalSize; - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.google.cloud.contentwarehouse.v1.ResponseMetadata.toObject(message.metadata, options); - if (message.histogramQueryResults && message.histogramQueryResults.length) { - object.histogramQueryResults = []; - for (var j = 0; j < message.histogramQueryResults.length; ++j) - object.histogramQueryResults[j] = $root.google.cloud.contentwarehouse.v1.HistogramQueryResult.toObject(message.histogramQueryResults[j], options); - } - if (message.questionAnswer != null && message.hasOwnProperty("questionAnswer")) - object.questionAnswer = message.questionAnswer; - return object; - }; - - /** - * Converts this SearchDocumentsResponse to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse - * @instance - * @returns {Object.} JSON object - */ - SearchDocumentsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SearchDocumentsResponse - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SearchDocumentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.SearchDocumentsResponse"; - }; - - SearchDocumentsResponse.MatchingDocument = (function() { - - /** - * Properties of a MatchingDocument. - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse - * @interface IMatchingDocument - * @property {google.cloud.contentwarehouse.v1.IDocument|null} [document] MatchingDocument document - * @property {string|null} [searchTextSnippet] MatchingDocument searchTextSnippet - * @property {google.cloud.contentwarehouse.v1.IQAResult|null} [qaResult] MatchingDocument qaResult - * @property {Array.|null} [matchedTokenPageIndices] MatchingDocument matchedTokenPageIndices - */ - - /** - * Constructs a new MatchingDocument. - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse - * @classdesc Represents a MatchingDocument. - * @implements IMatchingDocument - * @constructor - * @param {google.cloud.contentwarehouse.v1.SearchDocumentsResponse.IMatchingDocument=} [properties] Properties to set - */ - function MatchingDocument(properties) { - this.matchedTokenPageIndices = []; - 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]]; - } - - /** - * MatchingDocument document. - * @member {google.cloud.contentwarehouse.v1.IDocument|null|undefined} document - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument - * @instance - */ - MatchingDocument.prototype.document = null; - - /** - * MatchingDocument searchTextSnippet. - * @member {string} searchTextSnippet - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument - * @instance - */ - MatchingDocument.prototype.searchTextSnippet = ""; - - /** - * MatchingDocument qaResult. - * @member {google.cloud.contentwarehouse.v1.IQAResult|null|undefined} qaResult - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument - * @instance - */ - MatchingDocument.prototype.qaResult = null; - - /** - * MatchingDocument matchedTokenPageIndices. - * @member {Array.} matchedTokenPageIndices - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument - * @instance - */ - MatchingDocument.prototype.matchedTokenPageIndices = $util.emptyArray; - - /** - * Creates a new MatchingDocument instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument - * @static - * @param {google.cloud.contentwarehouse.v1.SearchDocumentsResponse.IMatchingDocument=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument} MatchingDocument instance - */ - MatchingDocument.create = function create(properties) { - return new MatchingDocument(properties); - }; - - /** - * Encodes the specified MatchingDocument message. Does not implicitly {@link google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument - * @static - * @param {google.cloud.contentwarehouse.v1.SearchDocumentsResponse.IMatchingDocument} message MatchingDocument message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MatchingDocument.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.document != null && Object.hasOwnProperty.call(message, "document")) - $root.google.cloud.contentwarehouse.v1.Document.encode(message.document, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.searchTextSnippet != null && Object.hasOwnProperty.call(message, "searchTextSnippet")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.searchTextSnippet); - if (message.qaResult != null && Object.hasOwnProperty.call(message, "qaResult")) - $root.google.cloud.contentwarehouse.v1.QAResult.encode(message.qaResult, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.matchedTokenPageIndices != null && message.matchedTokenPageIndices.length) { - writer.uint32(/* id 4, wireType 2 =*/34).fork(); - for (var i = 0; i < message.matchedTokenPageIndices.length; ++i) - writer.int64(message.matchedTokenPageIndices[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified MatchingDocument message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument - * @static - * @param {google.cloud.contentwarehouse.v1.SearchDocumentsResponse.IMatchingDocument} message MatchingDocument message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MatchingDocument.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MatchingDocument message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument} MatchingDocument - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MatchingDocument.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.document = $root.google.cloud.contentwarehouse.v1.Document.decode(reader, reader.uint32()); - break; - } - case 2: { - message.searchTextSnippet = reader.string(); - break; - } - case 3: { - message.qaResult = $root.google.cloud.contentwarehouse.v1.QAResult.decode(reader, reader.uint32()); - break; - } - case 4: { - if (!(message.matchedTokenPageIndices && message.matchedTokenPageIndices.length)) - message.matchedTokenPageIndices = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.matchedTokenPageIndices.push(reader.int64()); - } else - message.matchedTokenPageIndices.push(reader.int64()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MatchingDocument message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument} MatchingDocument - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MatchingDocument.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MatchingDocument message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MatchingDocument.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.document != null && message.hasOwnProperty("document")) { - var error = $root.google.cloud.contentwarehouse.v1.Document.verify(message.document); - if (error) - return "document." + error; - } - if (message.searchTextSnippet != null && message.hasOwnProperty("searchTextSnippet")) - if (!$util.isString(message.searchTextSnippet)) - return "searchTextSnippet: string expected"; - if (message.qaResult != null && message.hasOwnProperty("qaResult")) { - var error = $root.google.cloud.contentwarehouse.v1.QAResult.verify(message.qaResult); - if (error) - return "qaResult." + error; - } - if (message.matchedTokenPageIndices != null && message.hasOwnProperty("matchedTokenPageIndices")) { - if (!Array.isArray(message.matchedTokenPageIndices)) - return "matchedTokenPageIndices: array expected"; - for (var i = 0; i < message.matchedTokenPageIndices.length; ++i) - if (!$util.isInteger(message.matchedTokenPageIndices[i]) && !(message.matchedTokenPageIndices[i] && $util.isInteger(message.matchedTokenPageIndices[i].low) && $util.isInteger(message.matchedTokenPageIndices[i].high))) - return "matchedTokenPageIndices: integer|Long[] expected"; - } - return null; - }; - - /** - * Creates a MatchingDocument message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument} MatchingDocument - */ - MatchingDocument.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument(); - if (object.document != null) { - if (typeof object.document !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument.document: object expected"); - message.document = $root.google.cloud.contentwarehouse.v1.Document.fromObject(object.document); - } - if (object.searchTextSnippet != null) - message.searchTextSnippet = String(object.searchTextSnippet); - if (object.qaResult != null) { - if (typeof object.qaResult !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument.qaResult: object expected"); - message.qaResult = $root.google.cloud.contentwarehouse.v1.QAResult.fromObject(object.qaResult); - } - if (object.matchedTokenPageIndices) { - if (!Array.isArray(object.matchedTokenPageIndices)) - throw TypeError(".google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument.matchedTokenPageIndices: array expected"); - message.matchedTokenPageIndices = []; - for (var i = 0; i < object.matchedTokenPageIndices.length; ++i) - if ($util.Long) - (message.matchedTokenPageIndices[i] = $util.Long.fromValue(object.matchedTokenPageIndices[i])).unsigned = false; - else if (typeof object.matchedTokenPageIndices[i] === "string") - message.matchedTokenPageIndices[i] = parseInt(object.matchedTokenPageIndices[i], 10); - else if (typeof object.matchedTokenPageIndices[i] === "number") - message.matchedTokenPageIndices[i] = object.matchedTokenPageIndices[i]; - else if (typeof object.matchedTokenPageIndices[i] === "object") - message.matchedTokenPageIndices[i] = new $util.LongBits(object.matchedTokenPageIndices[i].low >>> 0, object.matchedTokenPageIndices[i].high >>> 0).toNumber(); - } - return message; - }; - - /** - * Creates a plain object from a MatchingDocument message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument - * @static - * @param {google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument} message MatchingDocument - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MatchingDocument.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.matchedTokenPageIndices = []; - if (options.defaults) { - object.document = null; - object.searchTextSnippet = ""; - object.qaResult = null; - } - if (message.document != null && message.hasOwnProperty("document")) - object.document = $root.google.cloud.contentwarehouse.v1.Document.toObject(message.document, options); - if (message.searchTextSnippet != null && message.hasOwnProperty("searchTextSnippet")) - object.searchTextSnippet = message.searchTextSnippet; - if (message.qaResult != null && message.hasOwnProperty("qaResult")) - object.qaResult = $root.google.cloud.contentwarehouse.v1.QAResult.toObject(message.qaResult, options); - if (message.matchedTokenPageIndices && message.matchedTokenPageIndices.length) { - object.matchedTokenPageIndices = []; - for (var j = 0; j < message.matchedTokenPageIndices.length; ++j) - if (typeof message.matchedTokenPageIndices[j] === "number") - object.matchedTokenPageIndices[j] = options.longs === String ? String(message.matchedTokenPageIndices[j]) : message.matchedTokenPageIndices[j]; - else - object.matchedTokenPageIndices[j] = options.longs === String ? $util.Long.prototype.toString.call(message.matchedTokenPageIndices[j]) : options.longs === Number ? new $util.LongBits(message.matchedTokenPageIndices[j].low >>> 0, message.matchedTokenPageIndices[j].high >>> 0).toNumber() : message.matchedTokenPageIndices[j]; - } - return object; - }; - - /** - * Converts this MatchingDocument to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument - * @instance - * @returns {Object.} JSON object - */ - MatchingDocument.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MatchingDocument - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MatchingDocument.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument"; - }; - - return MatchingDocument; - })(); - - return SearchDocumentsResponse; - })(); - - v1.FetchAclResponse = (function() { - - /** - * Properties of a FetchAclResponse. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IFetchAclResponse - * @property {google.iam.v1.IPolicy|null} [policy] FetchAclResponse policy - * @property {google.cloud.contentwarehouse.v1.IResponseMetadata|null} [metadata] FetchAclResponse metadata - */ - - /** - * Constructs a new FetchAclResponse. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a FetchAclResponse. - * @implements IFetchAclResponse - * @constructor - * @param {google.cloud.contentwarehouse.v1.IFetchAclResponse=} [properties] Properties to set - */ - function FetchAclResponse(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]]; - } - - /** - * FetchAclResponse policy. - * @member {google.iam.v1.IPolicy|null|undefined} policy - * @memberof google.cloud.contentwarehouse.v1.FetchAclResponse - * @instance - */ - FetchAclResponse.prototype.policy = null; - - /** - * FetchAclResponse metadata. - * @member {google.cloud.contentwarehouse.v1.IResponseMetadata|null|undefined} metadata - * @memberof google.cloud.contentwarehouse.v1.FetchAclResponse - * @instance - */ - FetchAclResponse.prototype.metadata = null; - - /** - * Creates a new FetchAclResponse instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.FetchAclResponse - * @static - * @param {google.cloud.contentwarehouse.v1.IFetchAclResponse=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.FetchAclResponse} FetchAclResponse instance - */ - FetchAclResponse.create = function create(properties) { - return new FetchAclResponse(properties); - }; - - /** - * Encodes the specified FetchAclResponse message. Does not implicitly {@link google.cloud.contentwarehouse.v1.FetchAclResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.FetchAclResponse - * @static - * @param {google.cloud.contentwarehouse.v1.IFetchAclResponse} message FetchAclResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FetchAclResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) - $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.google.cloud.contentwarehouse.v1.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FetchAclResponse message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.FetchAclResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.FetchAclResponse - * @static - * @param {google.cloud.contentwarehouse.v1.IFetchAclResponse} message FetchAclResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FetchAclResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FetchAclResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.FetchAclResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.FetchAclResponse} FetchAclResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FetchAclResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.FetchAclResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); - break; - } - case 2: { - message.metadata = $root.google.cloud.contentwarehouse.v1.ResponseMetadata.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FetchAclResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.FetchAclResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.FetchAclResponse} FetchAclResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FetchAclResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FetchAclResponse message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.FetchAclResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FetchAclResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.policy != null && message.hasOwnProperty("policy")) { - var error = $root.google.iam.v1.Policy.verify(message.policy); - if (error) - return "policy." + error; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.google.cloud.contentwarehouse.v1.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a FetchAclResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.FetchAclResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.FetchAclResponse} FetchAclResponse - */ - FetchAclResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.FetchAclResponse) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.FetchAclResponse(); - if (object.policy != null) { - if (typeof object.policy !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.FetchAclResponse.policy: object expected"); - message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.FetchAclResponse.metadata: object expected"); - message.metadata = $root.google.cloud.contentwarehouse.v1.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a FetchAclResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.FetchAclResponse - * @static - * @param {google.cloud.contentwarehouse.v1.FetchAclResponse} message FetchAclResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FetchAclResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.policy = null; - object.metadata = null; - } - if (message.policy != null && message.hasOwnProperty("policy")) - object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.google.cloud.contentwarehouse.v1.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this FetchAclResponse to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.FetchAclResponse - * @instance - * @returns {Object.} JSON object - */ - FetchAclResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FetchAclResponse - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.FetchAclResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FetchAclResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.FetchAclResponse"; - }; - - return FetchAclResponse; - })(); - - v1.SetAclResponse = (function() { - - /** - * Properties of a SetAclResponse. - * @memberof google.cloud.contentwarehouse.v1 - * @interface ISetAclResponse - * @property {google.iam.v1.IPolicy|null} [policy] SetAclResponse policy - * @property {google.cloud.contentwarehouse.v1.IResponseMetadata|null} [metadata] SetAclResponse metadata - */ - - /** - * Constructs a new SetAclResponse. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a SetAclResponse. - * @implements ISetAclResponse - * @constructor - * @param {google.cloud.contentwarehouse.v1.ISetAclResponse=} [properties] Properties to set - */ - function SetAclResponse(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]]; - } - - /** - * SetAclResponse policy. - * @member {google.iam.v1.IPolicy|null|undefined} policy - * @memberof google.cloud.contentwarehouse.v1.SetAclResponse - * @instance - */ - SetAclResponse.prototype.policy = null; - - /** - * SetAclResponse metadata. - * @member {google.cloud.contentwarehouse.v1.IResponseMetadata|null|undefined} metadata - * @memberof google.cloud.contentwarehouse.v1.SetAclResponse - * @instance - */ - SetAclResponse.prototype.metadata = null; - - /** - * Creates a new SetAclResponse instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.SetAclResponse - * @static - * @param {google.cloud.contentwarehouse.v1.ISetAclResponse=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.SetAclResponse} SetAclResponse instance - */ - SetAclResponse.create = function create(properties) { - return new SetAclResponse(properties); - }; - - /** - * Encodes the specified SetAclResponse message. Does not implicitly {@link google.cloud.contentwarehouse.v1.SetAclResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.SetAclResponse - * @static - * @param {google.cloud.contentwarehouse.v1.ISetAclResponse} message SetAclResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SetAclResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) - $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.google.cloud.contentwarehouse.v1.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SetAclResponse message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.SetAclResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.SetAclResponse - * @static - * @param {google.cloud.contentwarehouse.v1.ISetAclResponse} message SetAclResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SetAclResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SetAclResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.SetAclResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.SetAclResponse} SetAclResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SetAclResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.SetAclResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); - break; - } - case 2: { - message.metadata = $root.google.cloud.contentwarehouse.v1.ResponseMetadata.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SetAclResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.SetAclResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.SetAclResponse} SetAclResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SetAclResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SetAclResponse message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.SetAclResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SetAclResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.policy != null && message.hasOwnProperty("policy")) { - var error = $root.google.iam.v1.Policy.verify(message.policy); - if (error) - return "policy." + error; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.google.cloud.contentwarehouse.v1.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a SetAclResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.SetAclResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.SetAclResponse} SetAclResponse - */ - SetAclResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.SetAclResponse) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.SetAclResponse(); - if (object.policy != null) { - if (typeof object.policy !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.SetAclResponse.policy: object expected"); - message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.SetAclResponse.metadata: object expected"); - message.metadata = $root.google.cloud.contentwarehouse.v1.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a SetAclResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.SetAclResponse - * @static - * @param {google.cloud.contentwarehouse.v1.SetAclResponse} message SetAclResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SetAclResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.policy = null; - object.metadata = null; - } - if (message.policy != null && message.hasOwnProperty("policy")) - object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.google.cloud.contentwarehouse.v1.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this SetAclResponse to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.SetAclResponse - * @instance - * @returns {Object.} JSON object - */ - SetAclResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SetAclResponse - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.SetAclResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SetAclResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.SetAclResponse"; - }; - - return SetAclResponse; - })(); - - v1.CloudAIDocumentOption = (function() { - - /** - * Properties of a CloudAIDocumentOption. - * @memberof google.cloud.contentwarehouse.v1 - * @interface ICloudAIDocumentOption - * @property {boolean|null} [enableEntitiesConversions] CloudAIDocumentOption enableEntitiesConversions - * @property {Object.|null} [customizedEntitiesPropertiesConversions] CloudAIDocumentOption customizedEntitiesPropertiesConversions - */ - - /** - * Constructs a new CloudAIDocumentOption. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a CloudAIDocumentOption. - * @implements ICloudAIDocumentOption - * @constructor - * @param {google.cloud.contentwarehouse.v1.ICloudAIDocumentOption=} [properties] Properties to set - */ - function CloudAIDocumentOption(properties) { - this.customizedEntitiesPropertiesConversions = {}; - 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]]; - } - - /** - * CloudAIDocumentOption enableEntitiesConversions. - * @member {boolean} enableEntitiesConversions - * @memberof google.cloud.contentwarehouse.v1.CloudAIDocumentOption - * @instance - */ - CloudAIDocumentOption.prototype.enableEntitiesConversions = false; - - /** - * CloudAIDocumentOption customizedEntitiesPropertiesConversions. - * @member {Object.} customizedEntitiesPropertiesConversions - * @memberof google.cloud.contentwarehouse.v1.CloudAIDocumentOption - * @instance - */ - CloudAIDocumentOption.prototype.customizedEntitiesPropertiesConversions = $util.emptyObject; - - /** - * Creates a new CloudAIDocumentOption instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.CloudAIDocumentOption - * @static - * @param {google.cloud.contentwarehouse.v1.ICloudAIDocumentOption=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.CloudAIDocumentOption} CloudAIDocumentOption instance - */ - CloudAIDocumentOption.create = function create(properties) { - return new CloudAIDocumentOption(properties); - }; - - /** - * Encodes the specified CloudAIDocumentOption message. Does not implicitly {@link google.cloud.contentwarehouse.v1.CloudAIDocumentOption.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.CloudAIDocumentOption - * @static - * @param {google.cloud.contentwarehouse.v1.ICloudAIDocumentOption} message CloudAIDocumentOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudAIDocumentOption.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.enableEntitiesConversions != null && Object.hasOwnProperty.call(message, "enableEntitiesConversions")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableEntitiesConversions); - if (message.customizedEntitiesPropertiesConversions != null && Object.hasOwnProperty.call(message, "customizedEntitiesPropertiesConversions")) - for (var keys = Object.keys(message.customizedEntitiesPropertiesConversions), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.customizedEntitiesPropertiesConversions[keys[i]]).ldelim(); - return writer; - }; - - /** - * Encodes the specified CloudAIDocumentOption message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.CloudAIDocumentOption.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.CloudAIDocumentOption - * @static - * @param {google.cloud.contentwarehouse.v1.ICloudAIDocumentOption} message CloudAIDocumentOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudAIDocumentOption.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CloudAIDocumentOption message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.CloudAIDocumentOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.CloudAIDocumentOption} CloudAIDocumentOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudAIDocumentOption.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.CloudAIDocumentOption(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.enableEntitiesConversions = reader.bool(); - break; - } - case 2: { - if (message.customizedEntitiesPropertiesConversions === $util.emptyObject) - message.customizedEntitiesPropertiesConversions = {}; - 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.customizedEntitiesPropertiesConversions[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CloudAIDocumentOption message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.CloudAIDocumentOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.CloudAIDocumentOption} CloudAIDocumentOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudAIDocumentOption.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CloudAIDocumentOption message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.CloudAIDocumentOption - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CloudAIDocumentOption.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.enableEntitiesConversions != null && message.hasOwnProperty("enableEntitiesConversions")) - if (typeof message.enableEntitiesConversions !== "boolean") - return "enableEntitiesConversions: boolean expected"; - if (message.customizedEntitiesPropertiesConversions != null && message.hasOwnProperty("customizedEntitiesPropertiesConversions")) { - if (!$util.isObject(message.customizedEntitiesPropertiesConversions)) - return "customizedEntitiesPropertiesConversions: object expected"; - var key = Object.keys(message.customizedEntitiesPropertiesConversions); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.customizedEntitiesPropertiesConversions[key[i]])) - return "customizedEntitiesPropertiesConversions: string{k:string} expected"; - } - return null; - }; - - /** - * Creates a CloudAIDocumentOption message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.CloudAIDocumentOption - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.CloudAIDocumentOption} CloudAIDocumentOption - */ - CloudAIDocumentOption.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.CloudAIDocumentOption) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.CloudAIDocumentOption(); - if (object.enableEntitiesConversions != null) - message.enableEntitiesConversions = Boolean(object.enableEntitiesConversions); - if (object.customizedEntitiesPropertiesConversions) { - if (typeof object.customizedEntitiesPropertiesConversions !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.CloudAIDocumentOption.customizedEntitiesPropertiesConversions: object expected"); - message.customizedEntitiesPropertiesConversions = {}; - for (var keys = Object.keys(object.customizedEntitiesPropertiesConversions), i = 0; i < keys.length; ++i) - message.customizedEntitiesPropertiesConversions[keys[i]] = String(object.customizedEntitiesPropertiesConversions[keys[i]]); - } - return message; - }; - - /** - * Creates a plain object from a CloudAIDocumentOption message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.CloudAIDocumentOption - * @static - * @param {google.cloud.contentwarehouse.v1.CloudAIDocumentOption} message CloudAIDocumentOption - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CloudAIDocumentOption.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.customizedEntitiesPropertiesConversions = {}; - if (options.defaults) - object.enableEntitiesConversions = false; - if (message.enableEntitiesConversions != null && message.hasOwnProperty("enableEntitiesConversions")) - object.enableEntitiesConversions = message.enableEntitiesConversions; - var keys2; - if (message.customizedEntitiesPropertiesConversions && (keys2 = Object.keys(message.customizedEntitiesPropertiesConversions)).length) { - object.customizedEntitiesPropertiesConversions = {}; - for (var j = 0; j < keys2.length; ++j) - object.customizedEntitiesPropertiesConversions[keys2[j]] = message.customizedEntitiesPropertiesConversions[keys2[j]]; - } - return object; - }; - - /** - * Converts this CloudAIDocumentOption to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.CloudAIDocumentOption - * @instance - * @returns {Object.} JSON object - */ - CloudAIDocumentOption.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CloudAIDocumentOption - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.CloudAIDocumentOption - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CloudAIDocumentOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.CloudAIDocumentOption"; - }; - - return CloudAIDocumentOption; - })(); - - v1.CreateDocumentRequest = (function() { - - /** - * Properties of a CreateDocumentRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @interface ICreateDocumentRequest - * @property {string|null} [parent] CreateDocumentRequest parent - * @property {google.cloud.contentwarehouse.v1.IDocument|null} [document] CreateDocumentRequest document - * @property {google.cloud.contentwarehouse.v1.IRequestMetadata|null} [requestMetadata] CreateDocumentRequest requestMetadata - * @property {google.iam.v1.IPolicy|null} [policy] CreateDocumentRequest policy - * @property {google.cloud.contentwarehouse.v1.ICloudAIDocumentOption|null} [cloudAiDocumentOption] CreateDocumentRequest cloudAiDocumentOption - * @property {google.protobuf.IFieldMask|null} [createMask] CreateDocumentRequest createMask - */ - - /** - * Constructs a new CreateDocumentRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a CreateDocumentRequest. - * @implements ICreateDocumentRequest - * @constructor - * @param {google.cloud.contentwarehouse.v1.ICreateDocumentRequest=} [properties] Properties to set - */ - function CreateDocumentRequest(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]]; - } - - /** - * CreateDocumentRequest parent. - * @member {string} parent - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentRequest - * @instance - */ - CreateDocumentRequest.prototype.parent = ""; - - /** - * CreateDocumentRequest document. - * @member {google.cloud.contentwarehouse.v1.IDocument|null|undefined} document - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentRequest - * @instance - */ - CreateDocumentRequest.prototype.document = null; - - /** - * CreateDocumentRequest requestMetadata. - * @member {google.cloud.contentwarehouse.v1.IRequestMetadata|null|undefined} requestMetadata - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentRequest - * @instance - */ - CreateDocumentRequest.prototype.requestMetadata = null; - - /** - * CreateDocumentRequest policy. - * @member {google.iam.v1.IPolicy|null|undefined} policy - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentRequest - * @instance - */ - CreateDocumentRequest.prototype.policy = null; - - /** - * CreateDocumentRequest cloudAiDocumentOption. - * @member {google.cloud.contentwarehouse.v1.ICloudAIDocumentOption|null|undefined} cloudAiDocumentOption - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentRequest - * @instance - */ - CreateDocumentRequest.prototype.cloudAiDocumentOption = null; - - /** - * CreateDocumentRequest createMask. - * @member {google.protobuf.IFieldMask|null|undefined} createMask - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentRequest - * @instance - */ - CreateDocumentRequest.prototype.createMask = null; - - /** - * Creates a new CreateDocumentRequest instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentRequest - * @static - * @param {google.cloud.contentwarehouse.v1.ICreateDocumentRequest=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.CreateDocumentRequest} CreateDocumentRequest instance - */ - CreateDocumentRequest.create = function create(properties) { - return new CreateDocumentRequest(properties); - }; - - /** - * Encodes the specified CreateDocumentRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateDocumentRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentRequest - * @static - * @param {google.cloud.contentwarehouse.v1.ICreateDocumentRequest} message CreateDocumentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateDocumentRequest.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.document != null && Object.hasOwnProperty.call(message, "document")) - $root.google.cloud.contentwarehouse.v1.Document.encode(message.document, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestMetadata != null && Object.hasOwnProperty.call(message, "requestMetadata")) - $root.google.cloud.contentwarehouse.v1.RequestMetadata.encode(message.requestMetadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) - $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.cloudAiDocumentOption != null && Object.hasOwnProperty.call(message, "cloudAiDocumentOption")) - $root.google.cloud.contentwarehouse.v1.CloudAIDocumentOption.encode(message.cloudAiDocumentOption, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.createMask != null && Object.hasOwnProperty.call(message, "createMask")) - $root.google.protobuf.FieldMask.encode(message.createMask, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateDocumentRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentRequest - * @static - * @param {google.cloud.contentwarehouse.v1.ICreateDocumentRequest} message CreateDocumentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateDocumentRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.CreateDocumentRequest} CreateDocumentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateDocumentRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.CreateDocumentRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.document = $root.google.cloud.contentwarehouse.v1.Document.decode(reader, reader.uint32()); - break; - } - case 3: { - message.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.decode(reader, reader.uint32()); - break; - } - case 4: { - message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); - break; - } - case 5: { - message.cloudAiDocumentOption = $root.google.cloud.contentwarehouse.v1.CloudAIDocumentOption.decode(reader, reader.uint32()); - break; - } - case 6: { - message.createMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateDocumentRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.CreateDocumentRequest} CreateDocumentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateDocumentRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateDocumentRequest message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateDocumentRequest.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.document != null && message.hasOwnProperty("document")) { - var error = $root.google.cloud.contentwarehouse.v1.Document.verify(message.document); - if (error) - return "document." + error; - } - if (message.requestMetadata != null && message.hasOwnProperty("requestMetadata")) { - var error = $root.google.cloud.contentwarehouse.v1.RequestMetadata.verify(message.requestMetadata); - if (error) - return "requestMetadata." + error; - } - if (message.policy != null && message.hasOwnProperty("policy")) { - var error = $root.google.iam.v1.Policy.verify(message.policy); - if (error) - return "policy." + error; - } - if (message.cloudAiDocumentOption != null && message.hasOwnProperty("cloudAiDocumentOption")) { - var error = $root.google.cloud.contentwarehouse.v1.CloudAIDocumentOption.verify(message.cloudAiDocumentOption); - if (error) - return "cloudAiDocumentOption." + error; - } - if (message.createMask != null && message.hasOwnProperty("createMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.createMask); - if (error) - return "createMask." + error; - } - return null; - }; - - /** - * Creates a CreateDocumentRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.CreateDocumentRequest} CreateDocumentRequest - */ - CreateDocumentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.CreateDocumentRequest) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.CreateDocumentRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.document != null) { - if (typeof object.document !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.CreateDocumentRequest.document: object expected"); - message.document = $root.google.cloud.contentwarehouse.v1.Document.fromObject(object.document); - } - if (object.requestMetadata != null) { - if (typeof object.requestMetadata !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.CreateDocumentRequest.requestMetadata: object expected"); - message.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.fromObject(object.requestMetadata); - } - if (object.policy != null) { - if (typeof object.policy !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.CreateDocumentRequest.policy: object expected"); - message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); - } - if (object.cloudAiDocumentOption != null) { - if (typeof object.cloudAiDocumentOption !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.CreateDocumentRequest.cloudAiDocumentOption: object expected"); - message.cloudAiDocumentOption = $root.google.cloud.contentwarehouse.v1.CloudAIDocumentOption.fromObject(object.cloudAiDocumentOption); - } - if (object.createMask != null) { - if (typeof object.createMask !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.CreateDocumentRequest.createMask: object expected"); - message.createMask = $root.google.protobuf.FieldMask.fromObject(object.createMask); - } - return message; - }; - - /** - * Creates a plain object from a CreateDocumentRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentRequest - * @static - * @param {google.cloud.contentwarehouse.v1.CreateDocumentRequest} message CreateDocumentRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateDocumentRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.document = null; - object.requestMetadata = null; - object.policy = null; - object.cloudAiDocumentOption = null; - object.createMask = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.document != null && message.hasOwnProperty("document")) - object.document = $root.google.cloud.contentwarehouse.v1.Document.toObject(message.document, options); - if (message.requestMetadata != null && message.hasOwnProperty("requestMetadata")) - object.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.toObject(message.requestMetadata, options); - if (message.policy != null && message.hasOwnProperty("policy")) - object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); - if (message.cloudAiDocumentOption != null && message.hasOwnProperty("cloudAiDocumentOption")) - object.cloudAiDocumentOption = $root.google.cloud.contentwarehouse.v1.CloudAIDocumentOption.toObject(message.cloudAiDocumentOption, options); - if (message.createMask != null && message.hasOwnProperty("createMask")) - object.createMask = $root.google.protobuf.FieldMask.toObject(message.createMask, options); - return object; - }; - - /** - * Converts this CreateDocumentRequest to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentRequest - * @instance - * @returns {Object.} JSON object - */ - CreateDocumentRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateDocumentRequest - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.CreateDocumentRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateDocumentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.CreateDocumentRequest"; - }; - - return CreateDocumentRequest; - })(); - - v1.GetDocumentRequest = (function() { - - /** - * Properties of a GetDocumentRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IGetDocumentRequest - * @property {string|null} [name] GetDocumentRequest name - * @property {google.cloud.contentwarehouse.v1.IRequestMetadata|null} [requestMetadata] GetDocumentRequest requestMetadata - */ - - /** - * Constructs a new GetDocumentRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a GetDocumentRequest. - * @implements IGetDocumentRequest - * @constructor - * @param {google.cloud.contentwarehouse.v1.IGetDocumentRequest=} [properties] Properties to set - */ - function GetDocumentRequest(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]]; - } - - /** - * GetDocumentRequest name. - * @member {string} name - * @memberof google.cloud.contentwarehouse.v1.GetDocumentRequest - * @instance - */ - GetDocumentRequest.prototype.name = ""; - - /** - * GetDocumentRequest requestMetadata. - * @member {google.cloud.contentwarehouse.v1.IRequestMetadata|null|undefined} requestMetadata - * @memberof google.cloud.contentwarehouse.v1.GetDocumentRequest - * @instance - */ - GetDocumentRequest.prototype.requestMetadata = null; - - /** - * Creates a new GetDocumentRequest instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.GetDocumentRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IGetDocumentRequest=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.GetDocumentRequest} GetDocumentRequest instance - */ - GetDocumentRequest.create = function create(properties) { - return new GetDocumentRequest(properties); - }; - - /** - * Encodes the specified GetDocumentRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.GetDocumentRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.GetDocumentRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IGetDocumentRequest} message GetDocumentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDocumentRequest.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.requestMetadata != null && Object.hasOwnProperty.call(message, "requestMetadata")) - $root.google.cloud.contentwarehouse.v1.RequestMetadata.encode(message.requestMetadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.GetDocumentRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.GetDocumentRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IGetDocumentRequest} message GetDocumentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetDocumentRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.GetDocumentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.GetDocumentRequest} GetDocumentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDocumentRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.GetDocumentRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetDocumentRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.GetDocumentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.GetDocumentRequest} GetDocumentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDocumentRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetDocumentRequest message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.GetDocumentRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDocumentRequest.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.requestMetadata != null && message.hasOwnProperty("requestMetadata")) { - var error = $root.google.cloud.contentwarehouse.v1.RequestMetadata.verify(message.requestMetadata); - if (error) - return "requestMetadata." + error; - } - return null; - }; - - /** - * Creates a GetDocumentRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.GetDocumentRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.GetDocumentRequest} GetDocumentRequest - */ - GetDocumentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.GetDocumentRequest) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.GetDocumentRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestMetadata != null) { - if (typeof object.requestMetadata !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.GetDocumentRequest.requestMetadata: object expected"); - message.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.fromObject(object.requestMetadata); - } - return message; - }; - - /** - * Creates a plain object from a GetDocumentRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.GetDocumentRequest - * @static - * @param {google.cloud.contentwarehouse.v1.GetDocumentRequest} message GetDocumentRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDocumentRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.requestMetadata = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestMetadata != null && message.hasOwnProperty("requestMetadata")) - object.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.toObject(message.requestMetadata, options); - return object; - }; - - /** - * Converts this GetDocumentRequest to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.GetDocumentRequest - * @instance - * @returns {Object.} JSON object - */ - GetDocumentRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetDocumentRequest - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.GetDocumentRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetDocumentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.GetDocumentRequest"; - }; - - return GetDocumentRequest; - })(); - - v1.UpdateDocumentRequest = (function() { - - /** - * Properties of an UpdateDocumentRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IUpdateDocumentRequest - * @property {string|null} [name] UpdateDocumentRequest name - * @property {google.cloud.contentwarehouse.v1.IDocument|null} [document] UpdateDocumentRequest document - * @property {google.cloud.contentwarehouse.v1.IRequestMetadata|null} [requestMetadata] UpdateDocumentRequest requestMetadata - * @property {google.cloud.contentwarehouse.v1.ICloudAIDocumentOption|null} [cloudAiDocumentOption] UpdateDocumentRequest cloudAiDocumentOption - * @property {google.cloud.contentwarehouse.v1.IUpdateOptions|null} [updateOptions] UpdateDocumentRequest updateOptions - */ - - /** - * Constructs a new UpdateDocumentRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents an UpdateDocumentRequest. - * @implements IUpdateDocumentRequest - * @constructor - * @param {google.cloud.contentwarehouse.v1.IUpdateDocumentRequest=} [properties] Properties to set - */ - function UpdateDocumentRequest(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]]; - } - - /** - * UpdateDocumentRequest name. - * @member {string} name - * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentRequest - * @instance - */ - UpdateDocumentRequest.prototype.name = ""; - - /** - * UpdateDocumentRequest document. - * @member {google.cloud.contentwarehouse.v1.IDocument|null|undefined} document - * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentRequest - * @instance - */ - UpdateDocumentRequest.prototype.document = null; - - /** - * UpdateDocumentRequest requestMetadata. - * @member {google.cloud.contentwarehouse.v1.IRequestMetadata|null|undefined} requestMetadata - * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentRequest - * @instance - */ - UpdateDocumentRequest.prototype.requestMetadata = null; - - /** - * UpdateDocumentRequest cloudAiDocumentOption. - * @member {google.cloud.contentwarehouse.v1.ICloudAIDocumentOption|null|undefined} cloudAiDocumentOption - * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentRequest - * @instance - */ - UpdateDocumentRequest.prototype.cloudAiDocumentOption = null; - - /** - * UpdateDocumentRequest updateOptions. - * @member {google.cloud.contentwarehouse.v1.IUpdateOptions|null|undefined} updateOptions - * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentRequest - * @instance - */ - UpdateDocumentRequest.prototype.updateOptions = null; - - /** - * Creates a new UpdateDocumentRequest instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IUpdateDocumentRequest=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.UpdateDocumentRequest} UpdateDocumentRequest instance - */ - UpdateDocumentRequest.create = function create(properties) { - return new UpdateDocumentRequest(properties); - }; - - /** - * Encodes the specified UpdateDocumentRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateDocumentRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IUpdateDocumentRequest} message UpdateDocumentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateDocumentRequest.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.document != null && Object.hasOwnProperty.call(message, "document")) - $root.google.cloud.contentwarehouse.v1.Document.encode(message.document, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestMetadata != null && Object.hasOwnProperty.call(message, "requestMetadata")) - $root.google.cloud.contentwarehouse.v1.RequestMetadata.encode(message.requestMetadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.cloudAiDocumentOption != null && Object.hasOwnProperty.call(message, "cloudAiDocumentOption")) - $root.google.cloud.contentwarehouse.v1.CloudAIDocumentOption.encode(message.cloudAiDocumentOption, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.updateOptions != null && Object.hasOwnProperty.call(message, "updateOptions")) - $root.google.cloud.contentwarehouse.v1.UpdateOptions.encode(message.updateOptions, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateDocumentRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IUpdateDocumentRequest} message UpdateDocumentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateDocumentRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.UpdateDocumentRequest} UpdateDocumentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateDocumentRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.UpdateDocumentRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.document = $root.google.cloud.contentwarehouse.v1.Document.decode(reader, reader.uint32()); - break; - } - case 3: { - message.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.decode(reader, reader.uint32()); - break; - } - case 5: { - message.cloudAiDocumentOption = $root.google.cloud.contentwarehouse.v1.CloudAIDocumentOption.decode(reader, reader.uint32()); - break; - } - case 6: { - message.updateOptions = $root.google.cloud.contentwarehouse.v1.UpdateOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateDocumentRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.UpdateDocumentRequest} UpdateDocumentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateDocumentRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateDocumentRequest message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateDocumentRequest.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.document != null && message.hasOwnProperty("document")) { - var error = $root.google.cloud.contentwarehouse.v1.Document.verify(message.document); - if (error) - return "document." + error; - } - if (message.requestMetadata != null && message.hasOwnProperty("requestMetadata")) { - var error = $root.google.cloud.contentwarehouse.v1.RequestMetadata.verify(message.requestMetadata); - if (error) - return "requestMetadata." + error; - } - if (message.cloudAiDocumentOption != null && message.hasOwnProperty("cloudAiDocumentOption")) { - var error = $root.google.cloud.contentwarehouse.v1.CloudAIDocumentOption.verify(message.cloudAiDocumentOption); - if (error) - return "cloudAiDocumentOption." + error; - } - if (message.updateOptions != null && message.hasOwnProperty("updateOptions")) { - var error = $root.google.cloud.contentwarehouse.v1.UpdateOptions.verify(message.updateOptions); - if (error) - return "updateOptions." + error; - } - return null; - }; - - /** - * Creates an UpdateDocumentRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.UpdateDocumentRequest} UpdateDocumentRequest - */ - UpdateDocumentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.UpdateDocumentRequest) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.UpdateDocumentRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.document != null) { - if (typeof object.document !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.UpdateDocumentRequest.document: object expected"); - message.document = $root.google.cloud.contentwarehouse.v1.Document.fromObject(object.document); - } - if (object.requestMetadata != null) { - if (typeof object.requestMetadata !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.UpdateDocumentRequest.requestMetadata: object expected"); - message.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.fromObject(object.requestMetadata); - } - if (object.cloudAiDocumentOption != null) { - if (typeof object.cloudAiDocumentOption !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.UpdateDocumentRequest.cloudAiDocumentOption: object expected"); - message.cloudAiDocumentOption = $root.google.cloud.contentwarehouse.v1.CloudAIDocumentOption.fromObject(object.cloudAiDocumentOption); - } - if (object.updateOptions != null) { - if (typeof object.updateOptions !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.UpdateDocumentRequest.updateOptions: object expected"); - message.updateOptions = $root.google.cloud.contentwarehouse.v1.UpdateOptions.fromObject(object.updateOptions); - } - return message; - }; - - /** - * Creates a plain object from an UpdateDocumentRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentRequest - * @static - * @param {google.cloud.contentwarehouse.v1.UpdateDocumentRequest} message UpdateDocumentRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateDocumentRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.document = null; - object.requestMetadata = null; - object.cloudAiDocumentOption = null; - object.updateOptions = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.document != null && message.hasOwnProperty("document")) - object.document = $root.google.cloud.contentwarehouse.v1.Document.toObject(message.document, options); - if (message.requestMetadata != null && message.hasOwnProperty("requestMetadata")) - object.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.toObject(message.requestMetadata, options); - if (message.cloudAiDocumentOption != null && message.hasOwnProperty("cloudAiDocumentOption")) - object.cloudAiDocumentOption = $root.google.cloud.contentwarehouse.v1.CloudAIDocumentOption.toObject(message.cloudAiDocumentOption, options); - if (message.updateOptions != null && message.hasOwnProperty("updateOptions")) - object.updateOptions = $root.google.cloud.contentwarehouse.v1.UpdateOptions.toObject(message.updateOptions, options); - return object; - }; - - /** - * Converts this UpdateDocumentRequest to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateDocumentRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateDocumentRequest - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.UpdateDocumentRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateDocumentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.UpdateDocumentRequest"; - }; - - return UpdateDocumentRequest; - })(); - - v1.DeleteDocumentRequest = (function() { - - /** - * Properties of a DeleteDocumentRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IDeleteDocumentRequest - * @property {string|null} [name] DeleteDocumentRequest name - * @property {google.cloud.contentwarehouse.v1.IRequestMetadata|null} [requestMetadata] DeleteDocumentRequest requestMetadata - */ - - /** - * Constructs a new DeleteDocumentRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a DeleteDocumentRequest. - * @implements IDeleteDocumentRequest - * @constructor - * @param {google.cloud.contentwarehouse.v1.IDeleteDocumentRequest=} [properties] Properties to set - */ - function DeleteDocumentRequest(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]]; - } - - /** - * DeleteDocumentRequest name. - * @member {string} name - * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentRequest - * @instance - */ - DeleteDocumentRequest.prototype.name = ""; - - /** - * DeleteDocumentRequest requestMetadata. - * @member {google.cloud.contentwarehouse.v1.IRequestMetadata|null|undefined} requestMetadata - * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentRequest - * @instance - */ - DeleteDocumentRequest.prototype.requestMetadata = null; - - /** - * Creates a new DeleteDocumentRequest instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IDeleteDocumentRequest=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.DeleteDocumentRequest} DeleteDocumentRequest instance - */ - DeleteDocumentRequest.create = function create(properties) { - return new DeleteDocumentRequest(properties); - }; - - /** - * Encodes the specified DeleteDocumentRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DeleteDocumentRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IDeleteDocumentRequest} message DeleteDocumentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteDocumentRequest.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.requestMetadata != null && Object.hasOwnProperty.call(message, "requestMetadata")) - $root.google.cloud.contentwarehouse.v1.RequestMetadata.encode(message.requestMetadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DeleteDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DeleteDocumentRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IDeleteDocumentRequest} message DeleteDocumentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteDocumentRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.DeleteDocumentRequest} DeleteDocumentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteDocumentRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.DeleteDocumentRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteDocumentRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.DeleteDocumentRequest} DeleteDocumentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteDocumentRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteDocumentRequest message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteDocumentRequest.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.requestMetadata != null && message.hasOwnProperty("requestMetadata")) { - var error = $root.google.cloud.contentwarehouse.v1.RequestMetadata.verify(message.requestMetadata); - if (error) - return "requestMetadata." + error; - } - return null; - }; - - /** - * Creates a DeleteDocumentRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.DeleteDocumentRequest} DeleteDocumentRequest - */ - DeleteDocumentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.DeleteDocumentRequest) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.DeleteDocumentRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestMetadata != null) { - if (typeof object.requestMetadata !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.DeleteDocumentRequest.requestMetadata: object expected"); - message.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.fromObject(object.requestMetadata); - } - return message; - }; - - /** - * Creates a plain object from a DeleteDocumentRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentRequest - * @static - * @param {google.cloud.contentwarehouse.v1.DeleteDocumentRequest} message DeleteDocumentRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteDocumentRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.requestMetadata = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestMetadata != null && message.hasOwnProperty("requestMetadata")) - object.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.toObject(message.requestMetadata, options); - return object; - }; - - /** - * Converts this DeleteDocumentRequest to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteDocumentRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteDocumentRequest - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteDocumentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.DeleteDocumentRequest"; - }; - - return DeleteDocumentRequest; - })(); - - v1.SearchDocumentsRequest = (function() { - - /** - * Properties of a SearchDocumentsRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @interface ISearchDocumentsRequest - * @property {string|null} [parent] SearchDocumentsRequest parent - * @property {google.cloud.contentwarehouse.v1.IRequestMetadata|null} [requestMetadata] SearchDocumentsRequest requestMetadata - * @property {google.cloud.contentwarehouse.v1.IDocumentQuery|null} [documentQuery] SearchDocumentsRequest documentQuery - * @property {number|null} [offset] SearchDocumentsRequest offset - * @property {number|null} [pageSize] SearchDocumentsRequest pageSize - * @property {string|null} [pageToken] SearchDocumentsRequest pageToken - * @property {string|null} [orderBy] SearchDocumentsRequest orderBy - * @property {Array.|null} [histogramQueries] SearchDocumentsRequest histogramQueries - * @property {boolean|null} [requireTotalSize] SearchDocumentsRequest requireTotalSize - * @property {google.cloud.contentwarehouse.v1.SearchDocumentsRequest.TotalResultSize|null} [totalResultSize] SearchDocumentsRequest totalResultSize - * @property {number|null} [qaSizeLimit] SearchDocumentsRequest qaSizeLimit - */ - - /** - * Constructs a new SearchDocumentsRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a SearchDocumentsRequest. - * @implements ISearchDocumentsRequest - * @constructor - * @param {google.cloud.contentwarehouse.v1.ISearchDocumentsRequest=} [properties] Properties to set - */ - function SearchDocumentsRequest(properties) { - this.histogramQueries = []; - 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]]; - } - - /** - * SearchDocumentsRequest parent. - * @member {string} parent - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsRequest - * @instance - */ - SearchDocumentsRequest.prototype.parent = ""; - - /** - * SearchDocumentsRequest requestMetadata. - * @member {google.cloud.contentwarehouse.v1.IRequestMetadata|null|undefined} requestMetadata - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsRequest - * @instance - */ - SearchDocumentsRequest.prototype.requestMetadata = null; - - /** - * SearchDocumentsRequest documentQuery. - * @member {google.cloud.contentwarehouse.v1.IDocumentQuery|null|undefined} documentQuery - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsRequest - * @instance - */ - SearchDocumentsRequest.prototype.documentQuery = null; - - /** - * SearchDocumentsRequest offset. - * @member {number} offset - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsRequest - * @instance - */ - SearchDocumentsRequest.prototype.offset = 0; - - /** - * SearchDocumentsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsRequest - * @instance - */ - SearchDocumentsRequest.prototype.pageSize = 0; - - /** - * SearchDocumentsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsRequest - * @instance - */ - SearchDocumentsRequest.prototype.pageToken = ""; - - /** - * SearchDocumentsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsRequest - * @instance - */ - SearchDocumentsRequest.prototype.orderBy = ""; - - /** - * SearchDocumentsRequest histogramQueries. - * @member {Array.} histogramQueries - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsRequest - * @instance - */ - SearchDocumentsRequest.prototype.histogramQueries = $util.emptyArray; - - /** - * SearchDocumentsRequest requireTotalSize. - * @member {boolean} requireTotalSize - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsRequest - * @instance - */ - SearchDocumentsRequest.prototype.requireTotalSize = false; - - /** - * SearchDocumentsRequest totalResultSize. - * @member {google.cloud.contentwarehouse.v1.SearchDocumentsRequest.TotalResultSize} totalResultSize - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsRequest - * @instance - */ - SearchDocumentsRequest.prototype.totalResultSize = 0; - - /** - * SearchDocumentsRequest qaSizeLimit. - * @member {number} qaSizeLimit - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsRequest - * @instance - */ - SearchDocumentsRequest.prototype.qaSizeLimit = 0; - - /** - * Creates a new SearchDocumentsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsRequest - * @static - * @param {google.cloud.contentwarehouse.v1.ISearchDocumentsRequest=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.SearchDocumentsRequest} SearchDocumentsRequest instance - */ - SearchDocumentsRequest.create = function create(properties) { - return new SearchDocumentsRequest(properties); - }; - - /** - * Encodes the specified SearchDocumentsRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.SearchDocumentsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsRequest - * @static - * @param {google.cloud.contentwarehouse.v1.ISearchDocumentsRequest} message SearchDocumentsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchDocumentsRequest.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.requestMetadata != null && Object.hasOwnProperty.call(message, "requestMetadata")) - $root.google.cloud.contentwarehouse.v1.RequestMetadata.encode(message.requestMetadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.documentQuery != null && Object.hasOwnProperty.call(message, "documentQuery")) - $root.google.cloud.contentwarehouse.v1.DocumentQuery.encode(message.documentQuery, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.offset); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.pageToken); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.orderBy); - if (message.histogramQueries != null && message.histogramQueries.length) - for (var i = 0; i < message.histogramQueries.length; ++i) - $root.google.cloud.contentwarehouse.v1.HistogramQuery.encode(message.histogramQueries[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.requireTotalSize != null && Object.hasOwnProperty.call(message, "requireTotalSize")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.requireTotalSize); - if (message.qaSizeLimit != null && Object.hasOwnProperty.call(message, "qaSizeLimit")) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.qaSizeLimit); - if (message.totalResultSize != null && Object.hasOwnProperty.call(message, "totalResultSize")) - writer.uint32(/* id 12, wireType 0 =*/96).int32(message.totalResultSize); - return writer; - }; - - /** - * Encodes the specified SearchDocumentsRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.SearchDocumentsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsRequest - * @static - * @param {google.cloud.contentwarehouse.v1.ISearchDocumentsRequest} message SearchDocumentsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchDocumentsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SearchDocumentsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.SearchDocumentsRequest} SearchDocumentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchDocumentsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.SearchDocumentsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 3: { - message.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.decode(reader, reader.uint32()); - break; - } - case 4: { - message.documentQuery = $root.google.cloud.contentwarehouse.v1.DocumentQuery.decode(reader, reader.uint32()); - break; - } - case 5: { - message.offset = reader.int32(); - break; - } - case 6: { - message.pageSize = reader.int32(); - break; - } - case 7: { - message.pageToken = reader.string(); - break; - } - case 8: { - message.orderBy = reader.string(); - break; - } - case 9: { - if (!(message.histogramQueries && message.histogramQueries.length)) - message.histogramQueries = []; - message.histogramQueries.push($root.google.cloud.contentwarehouse.v1.HistogramQuery.decode(reader, reader.uint32())); - break; - } - case 10: { - message.requireTotalSize = reader.bool(); - break; - } - case 12: { - message.totalResultSize = reader.int32(); - break; - } - case 11: { - message.qaSizeLimit = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SearchDocumentsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.SearchDocumentsRequest} SearchDocumentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchDocumentsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SearchDocumentsRequest message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SearchDocumentsRequest.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.requestMetadata != null && message.hasOwnProperty("requestMetadata")) { - var error = $root.google.cloud.contentwarehouse.v1.RequestMetadata.verify(message.requestMetadata); - if (error) - return "requestMetadata." + error; - } - if (message.documentQuery != null && message.hasOwnProperty("documentQuery")) { - var error = $root.google.cloud.contentwarehouse.v1.DocumentQuery.verify(message.documentQuery); - if (error) - return "documentQuery." + error; - } - if (message.offset != null && message.hasOwnProperty("offset")) - if (!$util.isInteger(message.offset)) - return "offset: integer 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.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - if (message.histogramQueries != null && message.hasOwnProperty("histogramQueries")) { - if (!Array.isArray(message.histogramQueries)) - return "histogramQueries: array expected"; - for (var i = 0; i < message.histogramQueries.length; ++i) { - var error = $root.google.cloud.contentwarehouse.v1.HistogramQuery.verify(message.histogramQueries[i]); - if (error) - return "histogramQueries." + error; - } - } - if (message.requireTotalSize != null && message.hasOwnProperty("requireTotalSize")) - if (typeof message.requireTotalSize !== "boolean") - return "requireTotalSize: boolean expected"; - if (message.totalResultSize != null && message.hasOwnProperty("totalResultSize")) - switch (message.totalResultSize) { - default: - return "totalResultSize: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.qaSizeLimit != null && message.hasOwnProperty("qaSizeLimit")) - if (!$util.isInteger(message.qaSizeLimit)) - return "qaSizeLimit: integer expected"; - return null; - }; - - /** - * Creates a SearchDocumentsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.SearchDocumentsRequest} SearchDocumentsRequest - */ - SearchDocumentsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.SearchDocumentsRequest) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.SearchDocumentsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.requestMetadata != null) { - if (typeof object.requestMetadata !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.SearchDocumentsRequest.requestMetadata: object expected"); - message.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.fromObject(object.requestMetadata); - } - if (object.documentQuery != null) { - if (typeof object.documentQuery !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.SearchDocumentsRequest.documentQuery: object expected"); - message.documentQuery = $root.google.cloud.contentwarehouse.v1.DocumentQuery.fromObject(object.documentQuery); - } - if (object.offset != null) - message.offset = object.offset | 0; - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - if (object.histogramQueries) { - if (!Array.isArray(object.histogramQueries)) - throw TypeError(".google.cloud.contentwarehouse.v1.SearchDocumentsRequest.histogramQueries: array expected"); - message.histogramQueries = []; - for (var i = 0; i < object.histogramQueries.length; ++i) { - if (typeof object.histogramQueries[i] !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.SearchDocumentsRequest.histogramQueries: object expected"); - message.histogramQueries[i] = $root.google.cloud.contentwarehouse.v1.HistogramQuery.fromObject(object.histogramQueries[i]); - } - } - if (object.requireTotalSize != null) - message.requireTotalSize = Boolean(object.requireTotalSize); - switch (object.totalResultSize) { - default: - if (typeof object.totalResultSize === "number") { - message.totalResultSize = object.totalResultSize; - break; - } - break; - case "TOTAL_RESULT_SIZE_UNSPECIFIED": - case 0: - message.totalResultSize = 0; - break; - case "ESTIMATED_SIZE": - case 1: - message.totalResultSize = 1; - break; - case "ACTUAL_SIZE": - case 2: - message.totalResultSize = 2; - break; - } - if (object.qaSizeLimit != null) - message.qaSizeLimit = object.qaSizeLimit | 0; - return message; - }; - - /** - * Creates a plain object from a SearchDocumentsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsRequest - * @static - * @param {google.cloud.contentwarehouse.v1.SearchDocumentsRequest} message SearchDocumentsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SearchDocumentsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.histogramQueries = []; - if (options.defaults) { - object.parent = ""; - object.requestMetadata = null; - object.documentQuery = null; - object.offset = 0; - object.pageSize = 0; - object.pageToken = ""; - object.orderBy = ""; - object.requireTotalSize = false; - object.qaSizeLimit = 0; - object.totalResultSize = options.enums === String ? "TOTAL_RESULT_SIZE_UNSPECIFIED" : 0; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.requestMetadata != null && message.hasOwnProperty("requestMetadata")) - object.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.toObject(message.requestMetadata, options); - if (message.documentQuery != null && message.hasOwnProperty("documentQuery")) - object.documentQuery = $root.google.cloud.contentwarehouse.v1.DocumentQuery.toObject(message.documentQuery, options); - if (message.offset != null && message.hasOwnProperty("offset")) - object.offset = message.offset; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - if (message.histogramQueries && message.histogramQueries.length) { - object.histogramQueries = []; - for (var j = 0; j < message.histogramQueries.length; ++j) - object.histogramQueries[j] = $root.google.cloud.contentwarehouse.v1.HistogramQuery.toObject(message.histogramQueries[j], options); - } - if (message.requireTotalSize != null && message.hasOwnProperty("requireTotalSize")) - object.requireTotalSize = message.requireTotalSize; - if (message.qaSizeLimit != null && message.hasOwnProperty("qaSizeLimit")) - object.qaSizeLimit = message.qaSizeLimit; - if (message.totalResultSize != null && message.hasOwnProperty("totalResultSize")) - object.totalResultSize = options.enums === String ? $root.google.cloud.contentwarehouse.v1.SearchDocumentsRequest.TotalResultSize[message.totalResultSize] === undefined ? message.totalResultSize : $root.google.cloud.contentwarehouse.v1.SearchDocumentsRequest.TotalResultSize[message.totalResultSize] : message.totalResultSize; - return object; - }; - - /** - * Converts this SearchDocumentsRequest to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsRequest - * @instance - * @returns {Object.} JSON object - */ - SearchDocumentsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SearchDocumentsRequest - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.SearchDocumentsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SearchDocumentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.SearchDocumentsRequest"; - }; - - /** - * TotalResultSize enum. - * @name google.cloud.contentwarehouse.v1.SearchDocumentsRequest.TotalResultSize - * @enum {number} - * @property {number} TOTAL_RESULT_SIZE_UNSPECIFIED=0 TOTAL_RESULT_SIZE_UNSPECIFIED value - * @property {number} ESTIMATED_SIZE=1 ESTIMATED_SIZE value - * @property {number} ACTUAL_SIZE=2 ACTUAL_SIZE value - */ - SearchDocumentsRequest.TotalResultSize = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TOTAL_RESULT_SIZE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ESTIMATED_SIZE"] = 1; - values[valuesById[2] = "ACTUAL_SIZE"] = 2; - return values; - })(); - - return SearchDocumentsRequest; - })(); - - v1.LockDocumentRequest = (function() { - - /** - * Properties of a LockDocumentRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @interface ILockDocumentRequest - * @property {string|null} [name] LockDocumentRequest name - * @property {string|null} [collectionId] LockDocumentRequest collectionId - * @property {google.cloud.contentwarehouse.v1.IUserInfo|null} [lockingUser] LockDocumentRequest lockingUser - */ - - /** - * Constructs a new LockDocumentRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a LockDocumentRequest. - * @implements ILockDocumentRequest - * @constructor - * @param {google.cloud.contentwarehouse.v1.ILockDocumentRequest=} [properties] Properties to set - */ - function LockDocumentRequest(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]]; - } - - /** - * LockDocumentRequest name. - * @member {string} name - * @memberof google.cloud.contentwarehouse.v1.LockDocumentRequest - * @instance - */ - LockDocumentRequest.prototype.name = ""; - - /** - * LockDocumentRequest collectionId. - * @member {string} collectionId - * @memberof google.cloud.contentwarehouse.v1.LockDocumentRequest - * @instance - */ - LockDocumentRequest.prototype.collectionId = ""; - - /** - * LockDocumentRequest lockingUser. - * @member {google.cloud.contentwarehouse.v1.IUserInfo|null|undefined} lockingUser - * @memberof google.cloud.contentwarehouse.v1.LockDocumentRequest - * @instance - */ - LockDocumentRequest.prototype.lockingUser = null; - - /** - * Creates a new LockDocumentRequest instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.LockDocumentRequest - * @static - * @param {google.cloud.contentwarehouse.v1.ILockDocumentRequest=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.LockDocumentRequest} LockDocumentRequest instance - */ - LockDocumentRequest.create = function create(properties) { - return new LockDocumentRequest(properties); - }; - - /** - * Encodes the specified LockDocumentRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.LockDocumentRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.LockDocumentRequest - * @static - * @param {google.cloud.contentwarehouse.v1.ILockDocumentRequest} message LockDocumentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LockDocumentRequest.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.collectionId != null && Object.hasOwnProperty.call(message, "collectionId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.collectionId); - if (message.lockingUser != null && Object.hasOwnProperty.call(message, "lockingUser")) - $root.google.cloud.contentwarehouse.v1.UserInfo.encode(message.lockingUser, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified LockDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.LockDocumentRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.LockDocumentRequest - * @static - * @param {google.cloud.contentwarehouse.v1.ILockDocumentRequest} message LockDocumentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LockDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LockDocumentRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.LockDocumentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.LockDocumentRequest} LockDocumentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LockDocumentRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.LockDocumentRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.collectionId = reader.string(); - break; - } - case 3: { - message.lockingUser = $root.google.cloud.contentwarehouse.v1.UserInfo.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LockDocumentRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.LockDocumentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.LockDocumentRequest} LockDocumentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LockDocumentRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LockDocumentRequest message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.LockDocumentRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LockDocumentRequest.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.collectionId != null && message.hasOwnProperty("collectionId")) - if (!$util.isString(message.collectionId)) - return "collectionId: string expected"; - if (message.lockingUser != null && message.hasOwnProperty("lockingUser")) { - var error = $root.google.cloud.contentwarehouse.v1.UserInfo.verify(message.lockingUser); - if (error) - return "lockingUser." + error; - } - return null; - }; - - /** - * Creates a LockDocumentRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.LockDocumentRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.LockDocumentRequest} LockDocumentRequest - */ - LockDocumentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.LockDocumentRequest) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.LockDocumentRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.collectionId != null) - message.collectionId = String(object.collectionId); - if (object.lockingUser != null) { - if (typeof object.lockingUser !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.LockDocumentRequest.lockingUser: object expected"); - message.lockingUser = $root.google.cloud.contentwarehouse.v1.UserInfo.fromObject(object.lockingUser); - } - return message; - }; - - /** - * Creates a plain object from a LockDocumentRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.LockDocumentRequest - * @static - * @param {google.cloud.contentwarehouse.v1.LockDocumentRequest} message LockDocumentRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LockDocumentRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.collectionId = ""; - object.lockingUser = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.collectionId != null && message.hasOwnProperty("collectionId")) - object.collectionId = message.collectionId; - if (message.lockingUser != null && message.hasOwnProperty("lockingUser")) - object.lockingUser = $root.google.cloud.contentwarehouse.v1.UserInfo.toObject(message.lockingUser, options); - return object; - }; - - /** - * Converts this LockDocumentRequest to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.LockDocumentRequest - * @instance - * @returns {Object.} JSON object - */ - LockDocumentRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LockDocumentRequest - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.LockDocumentRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LockDocumentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.LockDocumentRequest"; - }; - - return LockDocumentRequest; - })(); - - v1.FetchAclRequest = (function() { - - /** - * Properties of a FetchAclRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IFetchAclRequest - * @property {string|null} [resource] FetchAclRequest resource - * @property {google.cloud.contentwarehouse.v1.IRequestMetadata|null} [requestMetadata] FetchAclRequest requestMetadata - * @property {boolean|null} [projectOwner] FetchAclRequest projectOwner - */ - - /** - * Constructs a new FetchAclRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a FetchAclRequest. - * @implements IFetchAclRequest - * @constructor - * @param {google.cloud.contentwarehouse.v1.IFetchAclRequest=} [properties] Properties to set - */ - function FetchAclRequest(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]]; - } - - /** - * FetchAclRequest resource. - * @member {string} resource - * @memberof google.cloud.contentwarehouse.v1.FetchAclRequest - * @instance - */ - FetchAclRequest.prototype.resource = ""; - - /** - * FetchAclRequest requestMetadata. - * @member {google.cloud.contentwarehouse.v1.IRequestMetadata|null|undefined} requestMetadata - * @memberof google.cloud.contentwarehouse.v1.FetchAclRequest - * @instance - */ - FetchAclRequest.prototype.requestMetadata = null; - - /** - * FetchAclRequest projectOwner. - * @member {boolean} projectOwner - * @memberof google.cloud.contentwarehouse.v1.FetchAclRequest - * @instance - */ - FetchAclRequest.prototype.projectOwner = false; - - /** - * Creates a new FetchAclRequest instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.FetchAclRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IFetchAclRequest=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.FetchAclRequest} FetchAclRequest instance - */ - FetchAclRequest.create = function create(properties) { - return new FetchAclRequest(properties); - }; - - /** - * Encodes the specified FetchAclRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.FetchAclRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.FetchAclRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IFetchAclRequest} message FetchAclRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FetchAclRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); - if (message.requestMetadata != null && Object.hasOwnProperty.call(message, "requestMetadata")) - $root.google.cloud.contentwarehouse.v1.RequestMetadata.encode(message.requestMetadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.projectOwner != null && Object.hasOwnProperty.call(message, "projectOwner")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.projectOwner); - return writer; - }; - - /** - * Encodes the specified FetchAclRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.FetchAclRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.FetchAclRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IFetchAclRequest} message FetchAclRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FetchAclRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FetchAclRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.FetchAclRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.FetchAclRequest} FetchAclRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FetchAclRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.FetchAclRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.resource = reader.string(); - break; - } - case 2: { - message.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.decode(reader, reader.uint32()); - break; - } - case 3: { - message.projectOwner = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FetchAclRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.FetchAclRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.FetchAclRequest} FetchAclRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FetchAclRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FetchAclRequest message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.FetchAclRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FetchAclRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.resource != null && message.hasOwnProperty("resource")) - if (!$util.isString(message.resource)) - return "resource: string expected"; - if (message.requestMetadata != null && message.hasOwnProperty("requestMetadata")) { - var error = $root.google.cloud.contentwarehouse.v1.RequestMetadata.verify(message.requestMetadata); - if (error) - return "requestMetadata." + error; - } - if (message.projectOwner != null && message.hasOwnProperty("projectOwner")) - if (typeof message.projectOwner !== "boolean") - return "projectOwner: boolean expected"; - return null; - }; - - /** - * Creates a FetchAclRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.FetchAclRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.FetchAclRequest} FetchAclRequest - */ - FetchAclRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.FetchAclRequest) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.FetchAclRequest(); - if (object.resource != null) - message.resource = String(object.resource); - if (object.requestMetadata != null) { - if (typeof object.requestMetadata !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.FetchAclRequest.requestMetadata: object expected"); - message.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.fromObject(object.requestMetadata); - } - if (object.projectOwner != null) - message.projectOwner = Boolean(object.projectOwner); - return message; - }; - - /** - * Creates a plain object from a FetchAclRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.FetchAclRequest - * @static - * @param {google.cloud.contentwarehouse.v1.FetchAclRequest} message FetchAclRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FetchAclRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.resource = ""; - object.requestMetadata = null; - object.projectOwner = false; - } - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = message.resource; - if (message.requestMetadata != null && message.hasOwnProperty("requestMetadata")) - object.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.toObject(message.requestMetadata, options); - if (message.projectOwner != null && message.hasOwnProperty("projectOwner")) - object.projectOwner = message.projectOwner; - return object; - }; - - /** - * Converts this FetchAclRequest to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.FetchAclRequest - * @instance - * @returns {Object.} JSON object - */ - FetchAclRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FetchAclRequest - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.FetchAclRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FetchAclRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.FetchAclRequest"; - }; - - return FetchAclRequest; - })(); - - v1.SetAclRequest = (function() { - - /** - * Properties of a SetAclRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @interface ISetAclRequest - * @property {string|null} [resource] SetAclRequest resource - * @property {google.iam.v1.IPolicy|null} [policy] SetAclRequest policy - * @property {google.cloud.contentwarehouse.v1.IRequestMetadata|null} [requestMetadata] SetAclRequest requestMetadata - * @property {boolean|null} [projectOwner] SetAclRequest projectOwner - */ - - /** - * Constructs a new SetAclRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a SetAclRequest. - * @implements ISetAclRequest - * @constructor - * @param {google.cloud.contentwarehouse.v1.ISetAclRequest=} [properties] Properties to set - */ - function SetAclRequest(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]]; - } - - /** - * SetAclRequest resource. - * @member {string} resource - * @memberof google.cloud.contentwarehouse.v1.SetAclRequest - * @instance - */ - SetAclRequest.prototype.resource = ""; - - /** - * SetAclRequest policy. - * @member {google.iam.v1.IPolicy|null|undefined} policy - * @memberof google.cloud.contentwarehouse.v1.SetAclRequest - * @instance - */ - SetAclRequest.prototype.policy = null; - - /** - * SetAclRequest requestMetadata. - * @member {google.cloud.contentwarehouse.v1.IRequestMetadata|null|undefined} requestMetadata - * @memberof google.cloud.contentwarehouse.v1.SetAclRequest - * @instance - */ - SetAclRequest.prototype.requestMetadata = null; - - /** - * SetAclRequest projectOwner. - * @member {boolean} projectOwner - * @memberof google.cloud.contentwarehouse.v1.SetAclRequest - * @instance - */ - SetAclRequest.prototype.projectOwner = false; - - /** - * Creates a new SetAclRequest instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.SetAclRequest - * @static - * @param {google.cloud.contentwarehouse.v1.ISetAclRequest=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.SetAclRequest} SetAclRequest instance - */ - SetAclRequest.create = function create(properties) { - return new SetAclRequest(properties); - }; - - /** - * Encodes the specified SetAclRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.SetAclRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.SetAclRequest - * @static - * @param {google.cloud.contentwarehouse.v1.ISetAclRequest} message SetAclRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SetAclRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); - if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) - $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestMetadata != null && Object.hasOwnProperty.call(message, "requestMetadata")) - $root.google.cloud.contentwarehouse.v1.RequestMetadata.encode(message.requestMetadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.projectOwner != null && Object.hasOwnProperty.call(message, "projectOwner")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.projectOwner); - return writer; - }; - - /** - * Encodes the specified SetAclRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.SetAclRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.SetAclRequest - * @static - * @param {google.cloud.contentwarehouse.v1.ISetAclRequest} message SetAclRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SetAclRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SetAclRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.SetAclRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.SetAclRequest} SetAclRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SetAclRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.SetAclRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.resource = reader.string(); - break; - } - case 2: { - message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); - break; - } - case 3: { - message.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.decode(reader, reader.uint32()); - break; - } - case 4: { - message.projectOwner = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SetAclRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.SetAclRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.SetAclRequest} SetAclRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SetAclRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SetAclRequest message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.SetAclRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SetAclRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.resource != null && message.hasOwnProperty("resource")) - if (!$util.isString(message.resource)) - return "resource: string expected"; - if (message.policy != null && message.hasOwnProperty("policy")) { - var error = $root.google.iam.v1.Policy.verify(message.policy); - if (error) - return "policy." + error; - } - if (message.requestMetadata != null && message.hasOwnProperty("requestMetadata")) { - var error = $root.google.cloud.contentwarehouse.v1.RequestMetadata.verify(message.requestMetadata); - if (error) - return "requestMetadata." + error; - } - if (message.projectOwner != null && message.hasOwnProperty("projectOwner")) - if (typeof message.projectOwner !== "boolean") - return "projectOwner: boolean expected"; - return null; - }; - - /** - * Creates a SetAclRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.SetAclRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.SetAclRequest} SetAclRequest - */ - SetAclRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.SetAclRequest) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.SetAclRequest(); - if (object.resource != null) - message.resource = String(object.resource); - if (object.policy != null) { - if (typeof object.policy !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.SetAclRequest.policy: object expected"); - message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); - } - if (object.requestMetadata != null) { - if (typeof object.requestMetadata !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.SetAclRequest.requestMetadata: object expected"); - message.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.fromObject(object.requestMetadata); - } - if (object.projectOwner != null) - message.projectOwner = Boolean(object.projectOwner); - return message; - }; - - /** - * Creates a plain object from a SetAclRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.SetAclRequest - * @static - * @param {google.cloud.contentwarehouse.v1.SetAclRequest} message SetAclRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SetAclRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.resource = ""; - object.policy = null; - object.requestMetadata = null; - object.projectOwner = false; - } - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = message.resource; - if (message.policy != null && message.hasOwnProperty("policy")) - object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); - if (message.requestMetadata != null && message.hasOwnProperty("requestMetadata")) - object.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.toObject(message.requestMetadata, options); - if (message.projectOwner != null && message.hasOwnProperty("projectOwner")) - object.projectOwner = message.projectOwner; - return object; - }; - - /** - * Converts this SetAclRequest to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.SetAclRequest - * @instance - * @returns {Object.} JSON object - */ - SetAclRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SetAclRequest - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.SetAclRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SetAclRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.SetAclRequest"; - }; - - return SetAclRequest; - })(); - - v1.DocumentQuery = (function() { - - /** - * Properties of a DocumentQuery. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IDocumentQuery - * @property {string|null} [query] DocumentQuery query - * @property {boolean|null} [isNlQuery] DocumentQuery isNlQuery - * @property {string|null} [customPropertyFilter] DocumentQuery customPropertyFilter - * @property {Array.|null} [timeFilters] DocumentQuery timeFilters - * @property {Array.|null} [documentSchemaNames] DocumentQuery documentSchemaNames - * @property {Array.|null} [propertyFilter] DocumentQuery propertyFilter - * @property {google.cloud.contentwarehouse.v1.IFileTypeFilter|null} [fileTypeFilter] DocumentQuery fileTypeFilter - * @property {string|null} [folderNameFilter] DocumentQuery folderNameFilter - * @property {Array.|null} [documentNameFilter] DocumentQuery documentNameFilter - * @property {Array.|null} [queryContext] DocumentQuery queryContext - * @property {Array.|null} [documentCreatorFilter] DocumentQuery documentCreatorFilter - * @property {google.cloud.contentwarehouse.v1.ICustomWeightsMetadata|null} [customWeightsMetadata] DocumentQuery customWeightsMetadata - */ - - /** - * Constructs a new DocumentQuery. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a DocumentQuery. - * @implements IDocumentQuery - * @constructor - * @param {google.cloud.contentwarehouse.v1.IDocumentQuery=} [properties] Properties to set - */ - function DocumentQuery(properties) { - this.timeFilters = []; - this.documentSchemaNames = []; - this.propertyFilter = []; - this.documentNameFilter = []; - this.queryContext = []; - this.documentCreatorFilter = []; - 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]]; - } - - /** - * DocumentQuery query. - * @member {string} query - * @memberof google.cloud.contentwarehouse.v1.DocumentQuery - * @instance - */ - DocumentQuery.prototype.query = ""; - - /** - * DocumentQuery isNlQuery. - * @member {boolean} isNlQuery - * @memberof google.cloud.contentwarehouse.v1.DocumentQuery - * @instance - */ - DocumentQuery.prototype.isNlQuery = false; - - /** - * DocumentQuery customPropertyFilter. - * @member {string} customPropertyFilter - * @memberof google.cloud.contentwarehouse.v1.DocumentQuery - * @instance - */ - DocumentQuery.prototype.customPropertyFilter = ""; - - /** - * DocumentQuery timeFilters. - * @member {Array.} timeFilters - * @memberof google.cloud.contentwarehouse.v1.DocumentQuery - * @instance - */ - DocumentQuery.prototype.timeFilters = $util.emptyArray; - - /** - * DocumentQuery documentSchemaNames. - * @member {Array.} documentSchemaNames - * @memberof google.cloud.contentwarehouse.v1.DocumentQuery - * @instance - */ - DocumentQuery.prototype.documentSchemaNames = $util.emptyArray; - - /** - * DocumentQuery propertyFilter. - * @member {Array.} propertyFilter - * @memberof google.cloud.contentwarehouse.v1.DocumentQuery - * @instance - */ - DocumentQuery.prototype.propertyFilter = $util.emptyArray; - - /** - * DocumentQuery fileTypeFilter. - * @member {google.cloud.contentwarehouse.v1.IFileTypeFilter|null|undefined} fileTypeFilter - * @memberof google.cloud.contentwarehouse.v1.DocumentQuery - * @instance - */ - DocumentQuery.prototype.fileTypeFilter = null; - - /** - * DocumentQuery folderNameFilter. - * @member {string} folderNameFilter - * @memberof google.cloud.contentwarehouse.v1.DocumentQuery - * @instance - */ - DocumentQuery.prototype.folderNameFilter = ""; - - /** - * DocumentQuery documentNameFilter. - * @member {Array.} documentNameFilter - * @memberof google.cloud.contentwarehouse.v1.DocumentQuery - * @instance - */ - DocumentQuery.prototype.documentNameFilter = $util.emptyArray; - - /** - * DocumentQuery queryContext. - * @member {Array.} queryContext - * @memberof google.cloud.contentwarehouse.v1.DocumentQuery - * @instance - */ - DocumentQuery.prototype.queryContext = $util.emptyArray; - - /** - * DocumentQuery documentCreatorFilter. - * @member {Array.} documentCreatorFilter - * @memberof google.cloud.contentwarehouse.v1.DocumentQuery - * @instance - */ - DocumentQuery.prototype.documentCreatorFilter = $util.emptyArray; - - /** - * DocumentQuery customWeightsMetadata. - * @member {google.cloud.contentwarehouse.v1.ICustomWeightsMetadata|null|undefined} customWeightsMetadata - * @memberof google.cloud.contentwarehouse.v1.DocumentQuery - * @instance - */ - DocumentQuery.prototype.customWeightsMetadata = null; - - /** - * Creates a new DocumentQuery instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.DocumentQuery - * @static - * @param {google.cloud.contentwarehouse.v1.IDocumentQuery=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.DocumentQuery} DocumentQuery instance - */ - DocumentQuery.create = function create(properties) { - return new DocumentQuery(properties); - }; - - /** - * Encodes the specified DocumentQuery message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DocumentQuery.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.DocumentQuery - * @static - * @param {google.cloud.contentwarehouse.v1.IDocumentQuery} message DocumentQuery message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DocumentQuery.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.query != null && Object.hasOwnProperty.call(message, "query")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.query); - if (message.customPropertyFilter != null && Object.hasOwnProperty.call(message, "customPropertyFilter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.customPropertyFilter); - if (message.timeFilters != null && message.timeFilters.length) - for (var i = 0; i < message.timeFilters.length; ++i) - $root.google.cloud.contentwarehouse.v1.TimeFilter.encode(message.timeFilters[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.documentSchemaNames != null && message.documentSchemaNames.length) - for (var i = 0; i < message.documentSchemaNames.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.documentSchemaNames[i]); - if (message.propertyFilter != null && message.propertyFilter.length) - for (var i = 0; i < message.propertyFilter.length; ++i) - $root.google.cloud.contentwarehouse.v1.PropertyFilter.encode(message.propertyFilter[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.fileTypeFilter != null && Object.hasOwnProperty.call(message, "fileTypeFilter")) - $root.google.cloud.contentwarehouse.v1.FileTypeFilter.encode(message.fileTypeFilter, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.folderNameFilter != null && Object.hasOwnProperty.call(message, "folderNameFilter")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.folderNameFilter); - if (message.queryContext != null && message.queryContext.length) - for (var i = 0; i < message.queryContext.length; ++i) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.queryContext[i]); - if (message.documentCreatorFilter != null && message.documentCreatorFilter.length) - for (var i = 0; i < message.documentCreatorFilter.length; ++i) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.documentCreatorFilter[i]); - if (message.isNlQuery != null && Object.hasOwnProperty.call(message, "isNlQuery")) - writer.uint32(/* id 12, wireType 0 =*/96).bool(message.isNlQuery); - if (message.customWeightsMetadata != null && Object.hasOwnProperty.call(message, "customWeightsMetadata")) - $root.google.cloud.contentwarehouse.v1.CustomWeightsMetadata.encode(message.customWeightsMetadata, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.documentNameFilter != null && message.documentNameFilter.length) - for (var i = 0; i < message.documentNameFilter.length; ++i) - writer.uint32(/* id 14, wireType 2 =*/114).string(message.documentNameFilter[i]); - return writer; - }; - - /** - * Encodes the specified DocumentQuery message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DocumentQuery.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.DocumentQuery - * @static - * @param {google.cloud.contentwarehouse.v1.IDocumentQuery} message DocumentQuery message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DocumentQuery.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DocumentQuery message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.DocumentQuery - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.DocumentQuery} DocumentQuery - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DocumentQuery.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.DocumentQuery(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.query = reader.string(); - break; - } - case 12: { - message.isNlQuery = reader.bool(); - break; - } - case 4: { - message.customPropertyFilter = reader.string(); - break; - } - case 5: { - if (!(message.timeFilters && message.timeFilters.length)) - message.timeFilters = []; - message.timeFilters.push($root.google.cloud.contentwarehouse.v1.TimeFilter.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.documentSchemaNames && message.documentSchemaNames.length)) - message.documentSchemaNames = []; - message.documentSchemaNames.push(reader.string()); - break; - } - case 7: { - if (!(message.propertyFilter && message.propertyFilter.length)) - message.propertyFilter = []; - message.propertyFilter.push($root.google.cloud.contentwarehouse.v1.PropertyFilter.decode(reader, reader.uint32())); - break; - } - case 8: { - message.fileTypeFilter = $root.google.cloud.contentwarehouse.v1.FileTypeFilter.decode(reader, reader.uint32()); - break; - } - case 9: { - message.folderNameFilter = reader.string(); - break; - } - case 14: { - if (!(message.documentNameFilter && message.documentNameFilter.length)) - message.documentNameFilter = []; - message.documentNameFilter.push(reader.string()); - break; - } - case 10: { - if (!(message.queryContext && message.queryContext.length)) - message.queryContext = []; - message.queryContext.push(reader.string()); - break; - } - case 11: { - if (!(message.documentCreatorFilter && message.documentCreatorFilter.length)) - message.documentCreatorFilter = []; - message.documentCreatorFilter.push(reader.string()); - break; - } - case 13: { - message.customWeightsMetadata = $root.google.cloud.contentwarehouse.v1.CustomWeightsMetadata.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DocumentQuery message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.DocumentQuery - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.DocumentQuery} DocumentQuery - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DocumentQuery.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DocumentQuery message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.DocumentQuery - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DocumentQuery.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.query != null && message.hasOwnProperty("query")) - if (!$util.isString(message.query)) - return "query: string expected"; - if (message.isNlQuery != null && message.hasOwnProperty("isNlQuery")) - if (typeof message.isNlQuery !== "boolean") - return "isNlQuery: boolean expected"; - if (message.customPropertyFilter != null && message.hasOwnProperty("customPropertyFilter")) - if (!$util.isString(message.customPropertyFilter)) - return "customPropertyFilter: string expected"; - if (message.timeFilters != null && message.hasOwnProperty("timeFilters")) { - if (!Array.isArray(message.timeFilters)) - return "timeFilters: array expected"; - for (var i = 0; i < message.timeFilters.length; ++i) { - var error = $root.google.cloud.contentwarehouse.v1.TimeFilter.verify(message.timeFilters[i]); - if (error) - return "timeFilters." + error; - } - } - if (message.documentSchemaNames != null && message.hasOwnProperty("documentSchemaNames")) { - if (!Array.isArray(message.documentSchemaNames)) - return "documentSchemaNames: array expected"; - for (var i = 0; i < message.documentSchemaNames.length; ++i) - if (!$util.isString(message.documentSchemaNames[i])) - return "documentSchemaNames: string[] expected"; - } - if (message.propertyFilter != null && message.hasOwnProperty("propertyFilter")) { - if (!Array.isArray(message.propertyFilter)) - return "propertyFilter: array expected"; - for (var i = 0; i < message.propertyFilter.length; ++i) { - var error = $root.google.cloud.contentwarehouse.v1.PropertyFilter.verify(message.propertyFilter[i]); - if (error) - return "propertyFilter." + error; - } - } - if (message.fileTypeFilter != null && message.hasOwnProperty("fileTypeFilter")) { - var error = $root.google.cloud.contentwarehouse.v1.FileTypeFilter.verify(message.fileTypeFilter); - if (error) - return "fileTypeFilter." + error; - } - if (message.folderNameFilter != null && message.hasOwnProperty("folderNameFilter")) - if (!$util.isString(message.folderNameFilter)) - return "folderNameFilter: string expected"; - if (message.documentNameFilter != null && message.hasOwnProperty("documentNameFilter")) { - if (!Array.isArray(message.documentNameFilter)) - return "documentNameFilter: array expected"; - for (var i = 0; i < message.documentNameFilter.length; ++i) - if (!$util.isString(message.documentNameFilter[i])) - return "documentNameFilter: string[] expected"; - } - if (message.queryContext != null && message.hasOwnProperty("queryContext")) { - if (!Array.isArray(message.queryContext)) - return "queryContext: array expected"; - for (var i = 0; i < message.queryContext.length; ++i) - if (!$util.isString(message.queryContext[i])) - return "queryContext: string[] expected"; - } - if (message.documentCreatorFilter != null && message.hasOwnProperty("documentCreatorFilter")) { - if (!Array.isArray(message.documentCreatorFilter)) - return "documentCreatorFilter: array expected"; - for (var i = 0; i < message.documentCreatorFilter.length; ++i) - if (!$util.isString(message.documentCreatorFilter[i])) - return "documentCreatorFilter: string[] expected"; - } - if (message.customWeightsMetadata != null && message.hasOwnProperty("customWeightsMetadata")) { - var error = $root.google.cloud.contentwarehouse.v1.CustomWeightsMetadata.verify(message.customWeightsMetadata); - if (error) - return "customWeightsMetadata." + error; - } - return null; - }; - - /** - * Creates a DocumentQuery message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.DocumentQuery - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.DocumentQuery} DocumentQuery - */ - DocumentQuery.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.DocumentQuery) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.DocumentQuery(); - if (object.query != null) - message.query = String(object.query); - if (object.isNlQuery != null) - message.isNlQuery = Boolean(object.isNlQuery); - if (object.customPropertyFilter != null) - message.customPropertyFilter = String(object.customPropertyFilter); - if (object.timeFilters) { - if (!Array.isArray(object.timeFilters)) - throw TypeError(".google.cloud.contentwarehouse.v1.DocumentQuery.timeFilters: array expected"); - message.timeFilters = []; - for (var i = 0; i < object.timeFilters.length; ++i) { - if (typeof object.timeFilters[i] !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.DocumentQuery.timeFilters: object expected"); - message.timeFilters[i] = $root.google.cloud.contentwarehouse.v1.TimeFilter.fromObject(object.timeFilters[i]); - } - } - if (object.documentSchemaNames) { - if (!Array.isArray(object.documentSchemaNames)) - throw TypeError(".google.cloud.contentwarehouse.v1.DocumentQuery.documentSchemaNames: array expected"); - message.documentSchemaNames = []; - for (var i = 0; i < object.documentSchemaNames.length; ++i) - message.documentSchemaNames[i] = String(object.documentSchemaNames[i]); - } - if (object.propertyFilter) { - if (!Array.isArray(object.propertyFilter)) - throw TypeError(".google.cloud.contentwarehouse.v1.DocumentQuery.propertyFilter: array expected"); - message.propertyFilter = []; - for (var i = 0; i < object.propertyFilter.length; ++i) { - if (typeof object.propertyFilter[i] !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.DocumentQuery.propertyFilter: object expected"); - message.propertyFilter[i] = $root.google.cloud.contentwarehouse.v1.PropertyFilter.fromObject(object.propertyFilter[i]); - } - } - if (object.fileTypeFilter != null) { - if (typeof object.fileTypeFilter !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.DocumentQuery.fileTypeFilter: object expected"); - message.fileTypeFilter = $root.google.cloud.contentwarehouse.v1.FileTypeFilter.fromObject(object.fileTypeFilter); - } - if (object.folderNameFilter != null) - message.folderNameFilter = String(object.folderNameFilter); - if (object.documentNameFilter) { - if (!Array.isArray(object.documentNameFilter)) - throw TypeError(".google.cloud.contentwarehouse.v1.DocumentQuery.documentNameFilter: array expected"); - message.documentNameFilter = []; - for (var i = 0; i < object.documentNameFilter.length; ++i) - message.documentNameFilter[i] = String(object.documentNameFilter[i]); - } - if (object.queryContext) { - if (!Array.isArray(object.queryContext)) - throw TypeError(".google.cloud.contentwarehouse.v1.DocumentQuery.queryContext: array expected"); - message.queryContext = []; - for (var i = 0; i < object.queryContext.length; ++i) - message.queryContext[i] = String(object.queryContext[i]); - } - if (object.documentCreatorFilter) { - if (!Array.isArray(object.documentCreatorFilter)) - throw TypeError(".google.cloud.contentwarehouse.v1.DocumentQuery.documentCreatorFilter: array expected"); - message.documentCreatorFilter = []; - for (var i = 0; i < object.documentCreatorFilter.length; ++i) - message.documentCreatorFilter[i] = String(object.documentCreatorFilter[i]); - } - if (object.customWeightsMetadata != null) { - if (typeof object.customWeightsMetadata !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.DocumentQuery.customWeightsMetadata: object expected"); - message.customWeightsMetadata = $root.google.cloud.contentwarehouse.v1.CustomWeightsMetadata.fromObject(object.customWeightsMetadata); - } - return message; - }; - - /** - * Creates a plain object from a DocumentQuery message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.DocumentQuery - * @static - * @param {google.cloud.contentwarehouse.v1.DocumentQuery} message DocumentQuery - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DocumentQuery.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.timeFilters = []; - object.documentSchemaNames = []; - object.propertyFilter = []; - object.queryContext = []; - object.documentCreatorFilter = []; - object.documentNameFilter = []; - } - if (options.defaults) { - object.query = ""; - object.customPropertyFilter = ""; - object.fileTypeFilter = null; - object.folderNameFilter = ""; - object.isNlQuery = false; - object.customWeightsMetadata = null; - } - if (message.query != null && message.hasOwnProperty("query")) - object.query = message.query; - if (message.customPropertyFilter != null && message.hasOwnProperty("customPropertyFilter")) - object.customPropertyFilter = message.customPropertyFilter; - if (message.timeFilters && message.timeFilters.length) { - object.timeFilters = []; - for (var j = 0; j < message.timeFilters.length; ++j) - object.timeFilters[j] = $root.google.cloud.contentwarehouse.v1.TimeFilter.toObject(message.timeFilters[j], options); - } - if (message.documentSchemaNames && message.documentSchemaNames.length) { - object.documentSchemaNames = []; - for (var j = 0; j < message.documentSchemaNames.length; ++j) - object.documentSchemaNames[j] = message.documentSchemaNames[j]; - } - if (message.propertyFilter && message.propertyFilter.length) { - object.propertyFilter = []; - for (var j = 0; j < message.propertyFilter.length; ++j) - object.propertyFilter[j] = $root.google.cloud.contentwarehouse.v1.PropertyFilter.toObject(message.propertyFilter[j], options); - } - if (message.fileTypeFilter != null && message.hasOwnProperty("fileTypeFilter")) - object.fileTypeFilter = $root.google.cloud.contentwarehouse.v1.FileTypeFilter.toObject(message.fileTypeFilter, options); - if (message.folderNameFilter != null && message.hasOwnProperty("folderNameFilter")) - object.folderNameFilter = message.folderNameFilter; - if (message.queryContext && message.queryContext.length) { - object.queryContext = []; - for (var j = 0; j < message.queryContext.length; ++j) - object.queryContext[j] = message.queryContext[j]; - } - if (message.documentCreatorFilter && message.documentCreatorFilter.length) { - object.documentCreatorFilter = []; - for (var j = 0; j < message.documentCreatorFilter.length; ++j) - object.documentCreatorFilter[j] = message.documentCreatorFilter[j]; - } - if (message.isNlQuery != null && message.hasOwnProperty("isNlQuery")) - object.isNlQuery = message.isNlQuery; - if (message.customWeightsMetadata != null && message.hasOwnProperty("customWeightsMetadata")) - object.customWeightsMetadata = $root.google.cloud.contentwarehouse.v1.CustomWeightsMetadata.toObject(message.customWeightsMetadata, options); - if (message.documentNameFilter && message.documentNameFilter.length) { - object.documentNameFilter = []; - for (var j = 0; j < message.documentNameFilter.length; ++j) - object.documentNameFilter[j] = message.documentNameFilter[j]; - } - return object; - }; - - /** - * Converts this DocumentQuery to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.DocumentQuery - * @instance - * @returns {Object.} JSON object - */ - DocumentQuery.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DocumentQuery - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.DocumentQuery - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DocumentQuery.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.DocumentQuery"; - }; - - return DocumentQuery; - })(); - - v1.TimeFilter = (function() { - - /** - * Properties of a TimeFilter. - * @memberof google.cloud.contentwarehouse.v1 - * @interface ITimeFilter - * @property {google.type.IInterval|null} [timeRange] TimeFilter timeRange - * @property {google.cloud.contentwarehouse.v1.TimeFilter.TimeField|null} [timeField] TimeFilter timeField - */ - - /** - * Constructs a new TimeFilter. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a TimeFilter. - * @implements ITimeFilter - * @constructor - * @param {google.cloud.contentwarehouse.v1.ITimeFilter=} [properties] Properties to set - */ - function TimeFilter(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]]; - } - - /** - * TimeFilter timeRange. - * @member {google.type.IInterval|null|undefined} timeRange - * @memberof google.cloud.contentwarehouse.v1.TimeFilter - * @instance - */ - TimeFilter.prototype.timeRange = null; - - /** - * TimeFilter timeField. - * @member {google.cloud.contentwarehouse.v1.TimeFilter.TimeField} timeField - * @memberof google.cloud.contentwarehouse.v1.TimeFilter - * @instance - */ - TimeFilter.prototype.timeField = 0; - - /** - * Creates a new TimeFilter instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.TimeFilter - * @static - * @param {google.cloud.contentwarehouse.v1.ITimeFilter=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.TimeFilter} TimeFilter instance - */ - TimeFilter.create = function create(properties) { - return new TimeFilter(properties); - }; - - /** - * Encodes the specified TimeFilter message. Does not implicitly {@link google.cloud.contentwarehouse.v1.TimeFilter.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.TimeFilter - * @static - * @param {google.cloud.contentwarehouse.v1.ITimeFilter} message TimeFilter message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TimeFilter.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.timeRange != null && Object.hasOwnProperty.call(message, "timeRange")) - $root.google.type.Interval.encode(message.timeRange, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.timeField != null && Object.hasOwnProperty.call(message, "timeField")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.timeField); - return writer; - }; - - /** - * Encodes the specified TimeFilter message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.TimeFilter.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.TimeFilter - * @static - * @param {google.cloud.contentwarehouse.v1.ITimeFilter} message TimeFilter message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TimeFilter.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TimeFilter message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.TimeFilter - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.TimeFilter} TimeFilter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TimeFilter.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.TimeFilter(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.timeRange = $root.google.type.Interval.decode(reader, reader.uint32()); - break; - } - case 2: { - message.timeField = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TimeFilter message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.TimeFilter - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.TimeFilter} TimeFilter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TimeFilter.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TimeFilter message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.TimeFilter - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TimeFilter.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.timeRange != null && message.hasOwnProperty("timeRange")) { - var error = $root.google.type.Interval.verify(message.timeRange); - if (error) - return "timeRange." + error; - } - if (message.timeField != null && message.hasOwnProperty("timeField")) - switch (message.timeField) { - default: - return "timeField: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - return null; - }; - - /** - * Creates a TimeFilter message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.TimeFilter - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.TimeFilter} TimeFilter - */ - TimeFilter.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.TimeFilter) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.TimeFilter(); - if (object.timeRange != null) { - if (typeof object.timeRange !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.TimeFilter.timeRange: object expected"); - message.timeRange = $root.google.type.Interval.fromObject(object.timeRange); - } - switch (object.timeField) { - default: - if (typeof object.timeField === "number") { - message.timeField = object.timeField; - break; - } - break; - case "TIME_FIELD_UNSPECIFIED": - case 0: - message.timeField = 0; - break; - case "CREATE_TIME": - case 1: - message.timeField = 1; - break; - case "UPDATE_TIME": - case 2: - message.timeField = 2; - break; - case "DISPOSITION_TIME": - case 3: - message.timeField = 3; - break; - } - return message; - }; - - /** - * Creates a plain object from a TimeFilter message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.TimeFilter - * @static - * @param {google.cloud.contentwarehouse.v1.TimeFilter} message TimeFilter - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TimeFilter.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.timeRange = null; - object.timeField = options.enums === String ? "TIME_FIELD_UNSPECIFIED" : 0; - } - if (message.timeRange != null && message.hasOwnProperty("timeRange")) - object.timeRange = $root.google.type.Interval.toObject(message.timeRange, options); - if (message.timeField != null && message.hasOwnProperty("timeField")) - object.timeField = options.enums === String ? $root.google.cloud.contentwarehouse.v1.TimeFilter.TimeField[message.timeField] === undefined ? message.timeField : $root.google.cloud.contentwarehouse.v1.TimeFilter.TimeField[message.timeField] : message.timeField; - return object; - }; - - /** - * Converts this TimeFilter to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.TimeFilter - * @instance - * @returns {Object.} JSON object - */ - TimeFilter.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TimeFilter - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.TimeFilter - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TimeFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.TimeFilter"; - }; - - /** - * TimeField enum. - * @name google.cloud.contentwarehouse.v1.TimeFilter.TimeField - * @enum {number} - * @property {number} TIME_FIELD_UNSPECIFIED=0 TIME_FIELD_UNSPECIFIED value - * @property {number} CREATE_TIME=1 CREATE_TIME value - * @property {number} UPDATE_TIME=2 UPDATE_TIME value - * @property {number} DISPOSITION_TIME=3 DISPOSITION_TIME value - */ - TimeFilter.TimeField = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TIME_FIELD_UNSPECIFIED"] = 0; - values[valuesById[1] = "CREATE_TIME"] = 1; - values[valuesById[2] = "UPDATE_TIME"] = 2; - values[valuesById[3] = "DISPOSITION_TIME"] = 3; - return values; - })(); - - return TimeFilter; - })(); - - v1.PropertyFilter = (function() { - - /** - * Properties of a PropertyFilter. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IPropertyFilter - * @property {string|null} [documentSchemaName] PropertyFilter documentSchemaName - * @property {string|null} [condition] PropertyFilter condition - */ - - /** - * Constructs a new PropertyFilter. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a PropertyFilter. - * @implements IPropertyFilter - * @constructor - * @param {google.cloud.contentwarehouse.v1.IPropertyFilter=} [properties] Properties to set - */ - function PropertyFilter(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]]; - } - - /** - * PropertyFilter documentSchemaName. - * @member {string} documentSchemaName - * @memberof google.cloud.contentwarehouse.v1.PropertyFilter - * @instance - */ - PropertyFilter.prototype.documentSchemaName = ""; - - /** - * PropertyFilter condition. - * @member {string} condition - * @memberof google.cloud.contentwarehouse.v1.PropertyFilter - * @instance - */ - PropertyFilter.prototype.condition = ""; - - /** - * Creates a new PropertyFilter instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.PropertyFilter - * @static - * @param {google.cloud.contentwarehouse.v1.IPropertyFilter=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.PropertyFilter} PropertyFilter instance - */ - PropertyFilter.create = function create(properties) { - return new PropertyFilter(properties); - }; - - /** - * Encodes the specified PropertyFilter message. Does not implicitly {@link google.cloud.contentwarehouse.v1.PropertyFilter.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.PropertyFilter - * @static - * @param {google.cloud.contentwarehouse.v1.IPropertyFilter} message PropertyFilter message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PropertyFilter.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.documentSchemaName != null && Object.hasOwnProperty.call(message, "documentSchemaName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.documentSchemaName); - if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.condition); - return writer; - }; - - /** - * Encodes the specified PropertyFilter message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.PropertyFilter.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.PropertyFilter - * @static - * @param {google.cloud.contentwarehouse.v1.IPropertyFilter} message PropertyFilter message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PropertyFilter.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PropertyFilter message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.PropertyFilter - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.PropertyFilter} PropertyFilter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PropertyFilter.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.PropertyFilter(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.documentSchemaName = reader.string(); - break; - } - case 2: { - message.condition = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PropertyFilter message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.PropertyFilter - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.PropertyFilter} PropertyFilter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PropertyFilter.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PropertyFilter message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.PropertyFilter - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PropertyFilter.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.documentSchemaName != null && message.hasOwnProperty("documentSchemaName")) - if (!$util.isString(message.documentSchemaName)) - return "documentSchemaName: string expected"; - if (message.condition != null && message.hasOwnProperty("condition")) - if (!$util.isString(message.condition)) - return "condition: string expected"; - return null; - }; - - /** - * Creates a PropertyFilter message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.PropertyFilter - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.PropertyFilter} PropertyFilter - */ - PropertyFilter.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.PropertyFilter) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.PropertyFilter(); - if (object.documentSchemaName != null) - message.documentSchemaName = String(object.documentSchemaName); - if (object.condition != null) - message.condition = String(object.condition); - return message; - }; - - /** - * Creates a plain object from a PropertyFilter message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.PropertyFilter - * @static - * @param {google.cloud.contentwarehouse.v1.PropertyFilter} message PropertyFilter - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PropertyFilter.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.documentSchemaName = ""; - object.condition = ""; - } - if (message.documentSchemaName != null && message.hasOwnProperty("documentSchemaName")) - object.documentSchemaName = message.documentSchemaName; - if (message.condition != null && message.hasOwnProperty("condition")) - object.condition = message.condition; - return object; - }; - - /** - * Converts this PropertyFilter to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.PropertyFilter - * @instance - * @returns {Object.} JSON object - */ - PropertyFilter.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PropertyFilter - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.PropertyFilter - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PropertyFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.PropertyFilter"; - }; - - return PropertyFilter; - })(); - - v1.FileTypeFilter = (function() { - - /** - * Properties of a FileTypeFilter. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IFileTypeFilter - * @property {google.cloud.contentwarehouse.v1.FileTypeFilter.FileType|null} [fileType] FileTypeFilter fileType - */ - - /** - * Constructs a new FileTypeFilter. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a FileTypeFilter. - * @implements IFileTypeFilter - * @constructor - * @param {google.cloud.contentwarehouse.v1.IFileTypeFilter=} [properties] Properties to set - */ - function FileTypeFilter(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]]; - } - - /** - * FileTypeFilter fileType. - * @member {google.cloud.contentwarehouse.v1.FileTypeFilter.FileType} fileType - * @memberof google.cloud.contentwarehouse.v1.FileTypeFilter - * @instance - */ - FileTypeFilter.prototype.fileType = 0; - - /** - * Creates a new FileTypeFilter instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.FileTypeFilter - * @static - * @param {google.cloud.contentwarehouse.v1.IFileTypeFilter=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.FileTypeFilter} FileTypeFilter instance - */ - FileTypeFilter.create = function create(properties) { - return new FileTypeFilter(properties); - }; - - /** - * Encodes the specified FileTypeFilter message. Does not implicitly {@link google.cloud.contentwarehouse.v1.FileTypeFilter.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.FileTypeFilter - * @static - * @param {google.cloud.contentwarehouse.v1.IFileTypeFilter} message FileTypeFilter message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileTypeFilter.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fileType != null && Object.hasOwnProperty.call(message, "fileType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fileType); - return writer; - }; - - /** - * Encodes the specified FileTypeFilter message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.FileTypeFilter.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.FileTypeFilter - * @static - * @param {google.cloud.contentwarehouse.v1.IFileTypeFilter} message FileTypeFilter message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileTypeFilter.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileTypeFilter message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.FileTypeFilter - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.FileTypeFilter} FileTypeFilter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileTypeFilter.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.FileTypeFilter(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.fileType = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileTypeFilter message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.FileTypeFilter - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.FileTypeFilter} FileTypeFilter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileTypeFilter.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileTypeFilter message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.FileTypeFilter - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileTypeFilter.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fileType != null && message.hasOwnProperty("fileType")) - switch (message.fileType) { - default: - return "fileType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - return null; - }; - - /** - * Creates a FileTypeFilter message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.FileTypeFilter - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.FileTypeFilter} FileTypeFilter - */ - FileTypeFilter.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.FileTypeFilter) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.FileTypeFilter(); - switch (object.fileType) { - default: - if (typeof object.fileType === "number") { - message.fileType = object.fileType; - break; - } - break; - case "FILE_TYPE_UNSPECIFIED": - case 0: - message.fileType = 0; - break; - case "ALL": - case 1: - message.fileType = 1; - break; - case "FOLDER": - case 2: - message.fileType = 2; - break; - case "DOCUMENT": - case 3: - message.fileType = 3; - break; - case "ROOT_FOLDER": - case 4: - message.fileType = 4; - break; - } - return message; - }; - - /** - * Creates a plain object from a FileTypeFilter message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.FileTypeFilter - * @static - * @param {google.cloud.contentwarehouse.v1.FileTypeFilter} message FileTypeFilter - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileTypeFilter.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.fileType = options.enums === String ? "FILE_TYPE_UNSPECIFIED" : 0; - if (message.fileType != null && message.hasOwnProperty("fileType")) - object.fileType = options.enums === String ? $root.google.cloud.contentwarehouse.v1.FileTypeFilter.FileType[message.fileType] === undefined ? message.fileType : $root.google.cloud.contentwarehouse.v1.FileTypeFilter.FileType[message.fileType] : message.fileType; - return object; - }; - - /** - * Converts this FileTypeFilter to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.FileTypeFilter - * @instance - * @returns {Object.} JSON object - */ - FileTypeFilter.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileTypeFilter - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.FileTypeFilter - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileTypeFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.FileTypeFilter"; - }; - - /** - * FileType enum. - * @name google.cloud.contentwarehouse.v1.FileTypeFilter.FileType - * @enum {number} - * @property {number} FILE_TYPE_UNSPECIFIED=0 FILE_TYPE_UNSPECIFIED value - * @property {number} ALL=1 ALL value - * @property {number} FOLDER=2 FOLDER value - * @property {number} DOCUMENT=3 DOCUMENT value - * @property {number} ROOT_FOLDER=4 ROOT_FOLDER value - */ - FileTypeFilter.FileType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FILE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ALL"] = 1; - values[valuesById[2] = "FOLDER"] = 2; - values[valuesById[3] = "DOCUMENT"] = 3; - values[valuesById[4] = "ROOT_FOLDER"] = 4; - return values; - })(); - - return FileTypeFilter; - })(); - - v1.CustomWeightsMetadata = (function() { - - /** - * Properties of a CustomWeightsMetadata. - * @memberof google.cloud.contentwarehouse.v1 - * @interface ICustomWeightsMetadata - * @property {Array.|null} [weightedSchemaProperties] CustomWeightsMetadata weightedSchemaProperties - */ - - /** - * Constructs a new CustomWeightsMetadata. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a CustomWeightsMetadata. - * @implements ICustomWeightsMetadata - * @constructor - * @param {google.cloud.contentwarehouse.v1.ICustomWeightsMetadata=} [properties] Properties to set - */ - function CustomWeightsMetadata(properties) { - this.weightedSchemaProperties = []; - 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]]; - } - - /** - * CustomWeightsMetadata weightedSchemaProperties. - * @member {Array.} weightedSchemaProperties - * @memberof google.cloud.contentwarehouse.v1.CustomWeightsMetadata - * @instance - */ - CustomWeightsMetadata.prototype.weightedSchemaProperties = $util.emptyArray; - - /** - * Creates a new CustomWeightsMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.CustomWeightsMetadata - * @static - * @param {google.cloud.contentwarehouse.v1.ICustomWeightsMetadata=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.CustomWeightsMetadata} CustomWeightsMetadata instance - */ - CustomWeightsMetadata.create = function create(properties) { - return new CustomWeightsMetadata(properties); - }; - - /** - * Encodes the specified CustomWeightsMetadata message. Does not implicitly {@link google.cloud.contentwarehouse.v1.CustomWeightsMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.CustomWeightsMetadata - * @static - * @param {google.cloud.contentwarehouse.v1.ICustomWeightsMetadata} message CustomWeightsMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomWeightsMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.weightedSchemaProperties != null && message.weightedSchemaProperties.length) - for (var i = 0; i < message.weightedSchemaProperties.length; ++i) - $root.google.cloud.contentwarehouse.v1.WeightedSchemaProperty.encode(message.weightedSchemaProperties[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CustomWeightsMetadata message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.CustomWeightsMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.CustomWeightsMetadata - * @static - * @param {google.cloud.contentwarehouse.v1.ICustomWeightsMetadata} message CustomWeightsMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomWeightsMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CustomWeightsMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.CustomWeightsMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.CustomWeightsMetadata} CustomWeightsMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomWeightsMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.CustomWeightsMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.weightedSchemaProperties && message.weightedSchemaProperties.length)) - message.weightedSchemaProperties = []; - message.weightedSchemaProperties.push($root.google.cloud.contentwarehouse.v1.WeightedSchemaProperty.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CustomWeightsMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.CustomWeightsMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.CustomWeightsMetadata} CustomWeightsMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomWeightsMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CustomWeightsMetadata message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.CustomWeightsMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CustomWeightsMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.weightedSchemaProperties != null && message.hasOwnProperty("weightedSchemaProperties")) { - if (!Array.isArray(message.weightedSchemaProperties)) - return "weightedSchemaProperties: array expected"; - for (var i = 0; i < message.weightedSchemaProperties.length; ++i) { - var error = $root.google.cloud.contentwarehouse.v1.WeightedSchemaProperty.verify(message.weightedSchemaProperties[i]); - if (error) - return "weightedSchemaProperties." + error; - } - } - return null; - }; - - /** - * Creates a CustomWeightsMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.CustomWeightsMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.CustomWeightsMetadata} CustomWeightsMetadata - */ - CustomWeightsMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.CustomWeightsMetadata) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.CustomWeightsMetadata(); - if (object.weightedSchemaProperties) { - if (!Array.isArray(object.weightedSchemaProperties)) - throw TypeError(".google.cloud.contentwarehouse.v1.CustomWeightsMetadata.weightedSchemaProperties: array expected"); - message.weightedSchemaProperties = []; - for (var i = 0; i < object.weightedSchemaProperties.length; ++i) { - if (typeof object.weightedSchemaProperties[i] !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.CustomWeightsMetadata.weightedSchemaProperties: object expected"); - message.weightedSchemaProperties[i] = $root.google.cloud.contentwarehouse.v1.WeightedSchemaProperty.fromObject(object.weightedSchemaProperties[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a CustomWeightsMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.CustomWeightsMetadata - * @static - * @param {google.cloud.contentwarehouse.v1.CustomWeightsMetadata} message CustomWeightsMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CustomWeightsMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.weightedSchemaProperties = []; - if (message.weightedSchemaProperties && message.weightedSchemaProperties.length) { - object.weightedSchemaProperties = []; - for (var j = 0; j < message.weightedSchemaProperties.length; ++j) - object.weightedSchemaProperties[j] = $root.google.cloud.contentwarehouse.v1.WeightedSchemaProperty.toObject(message.weightedSchemaProperties[j], options); - } - return object; - }; - - /** - * Converts this CustomWeightsMetadata to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.CustomWeightsMetadata - * @instance - * @returns {Object.} JSON object - */ - CustomWeightsMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CustomWeightsMetadata - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.CustomWeightsMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CustomWeightsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.CustomWeightsMetadata"; - }; - - return CustomWeightsMetadata; - })(); - - v1.WeightedSchemaProperty = (function() { - - /** - * Properties of a WeightedSchemaProperty. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IWeightedSchemaProperty - * @property {string|null} [documentSchemaName] WeightedSchemaProperty documentSchemaName - * @property {Array.|null} [propertyNames] WeightedSchemaProperty propertyNames - */ - - /** - * Constructs a new WeightedSchemaProperty. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a WeightedSchemaProperty. - * @implements IWeightedSchemaProperty - * @constructor - * @param {google.cloud.contentwarehouse.v1.IWeightedSchemaProperty=} [properties] Properties to set - */ - function WeightedSchemaProperty(properties) { - this.propertyNames = []; - 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]]; - } - - /** - * WeightedSchemaProperty documentSchemaName. - * @member {string} documentSchemaName - * @memberof google.cloud.contentwarehouse.v1.WeightedSchemaProperty - * @instance - */ - WeightedSchemaProperty.prototype.documentSchemaName = ""; - - /** - * WeightedSchemaProperty propertyNames. - * @member {Array.} propertyNames - * @memberof google.cloud.contentwarehouse.v1.WeightedSchemaProperty - * @instance - */ - WeightedSchemaProperty.prototype.propertyNames = $util.emptyArray; - - /** - * Creates a new WeightedSchemaProperty instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.WeightedSchemaProperty - * @static - * @param {google.cloud.contentwarehouse.v1.IWeightedSchemaProperty=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.WeightedSchemaProperty} WeightedSchemaProperty instance - */ - WeightedSchemaProperty.create = function create(properties) { - return new WeightedSchemaProperty(properties); - }; - - /** - * Encodes the specified WeightedSchemaProperty message. Does not implicitly {@link google.cloud.contentwarehouse.v1.WeightedSchemaProperty.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.WeightedSchemaProperty - * @static - * @param {google.cloud.contentwarehouse.v1.IWeightedSchemaProperty} message WeightedSchemaProperty message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WeightedSchemaProperty.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.documentSchemaName != null && Object.hasOwnProperty.call(message, "documentSchemaName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.documentSchemaName); - if (message.propertyNames != null && message.propertyNames.length) - for (var i = 0; i < message.propertyNames.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.propertyNames[i]); - return writer; - }; - - /** - * Encodes the specified WeightedSchemaProperty message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.WeightedSchemaProperty.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.WeightedSchemaProperty - * @static - * @param {google.cloud.contentwarehouse.v1.IWeightedSchemaProperty} message WeightedSchemaProperty message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WeightedSchemaProperty.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WeightedSchemaProperty message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.WeightedSchemaProperty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.WeightedSchemaProperty} WeightedSchemaProperty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WeightedSchemaProperty.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.WeightedSchemaProperty(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.documentSchemaName = reader.string(); - break; - } - case 2: { - if (!(message.propertyNames && message.propertyNames.length)) - message.propertyNames = []; - message.propertyNames.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WeightedSchemaProperty message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.WeightedSchemaProperty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.WeightedSchemaProperty} WeightedSchemaProperty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WeightedSchemaProperty.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WeightedSchemaProperty message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.WeightedSchemaProperty - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WeightedSchemaProperty.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.documentSchemaName != null && message.hasOwnProperty("documentSchemaName")) - if (!$util.isString(message.documentSchemaName)) - return "documentSchemaName: string expected"; - if (message.propertyNames != null && message.hasOwnProperty("propertyNames")) { - if (!Array.isArray(message.propertyNames)) - return "propertyNames: array expected"; - for (var i = 0; i < message.propertyNames.length; ++i) - if (!$util.isString(message.propertyNames[i])) - return "propertyNames: string[] expected"; - } - return null; - }; - - /** - * Creates a WeightedSchemaProperty message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.WeightedSchemaProperty - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.WeightedSchemaProperty} WeightedSchemaProperty - */ - WeightedSchemaProperty.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.WeightedSchemaProperty) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.WeightedSchemaProperty(); - if (object.documentSchemaName != null) - message.documentSchemaName = String(object.documentSchemaName); - if (object.propertyNames) { - if (!Array.isArray(object.propertyNames)) - throw TypeError(".google.cloud.contentwarehouse.v1.WeightedSchemaProperty.propertyNames: array expected"); - message.propertyNames = []; - for (var i = 0; i < object.propertyNames.length; ++i) - message.propertyNames[i] = String(object.propertyNames[i]); - } - return message; - }; - - /** - * Creates a plain object from a WeightedSchemaProperty message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.WeightedSchemaProperty - * @static - * @param {google.cloud.contentwarehouse.v1.WeightedSchemaProperty} message WeightedSchemaProperty - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WeightedSchemaProperty.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.propertyNames = []; - if (options.defaults) - object.documentSchemaName = ""; - if (message.documentSchemaName != null && message.hasOwnProperty("documentSchemaName")) - object.documentSchemaName = message.documentSchemaName; - if (message.propertyNames && message.propertyNames.length) { - object.propertyNames = []; - for (var j = 0; j < message.propertyNames.length; ++j) - object.propertyNames[j] = message.propertyNames[j]; - } - return object; - }; - - /** - * Converts this WeightedSchemaProperty to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.WeightedSchemaProperty - * @instance - * @returns {Object.} JSON object - */ - WeightedSchemaProperty.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for WeightedSchemaProperty - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.WeightedSchemaProperty - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WeightedSchemaProperty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.WeightedSchemaProperty"; - }; - - return WeightedSchemaProperty; - })(); - - v1.HistogramQuery = (function() { - - /** - * Properties of a HistogramQuery. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IHistogramQuery - * @property {string|null} [histogramQuery] HistogramQuery histogramQuery - * @property {boolean|null} [requirePreciseResultSize] HistogramQuery requirePreciseResultSize - * @property {google.cloud.contentwarehouse.v1.IHistogramQueryPropertyNameFilter|null} [filters] HistogramQuery filters - */ - - /** - * Constructs a new HistogramQuery. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a HistogramQuery. - * @implements IHistogramQuery - * @constructor - * @param {google.cloud.contentwarehouse.v1.IHistogramQuery=} [properties] Properties to set - */ - function HistogramQuery(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]]; - } - - /** - * HistogramQuery histogramQuery. - * @member {string} histogramQuery - * @memberof google.cloud.contentwarehouse.v1.HistogramQuery - * @instance - */ - HistogramQuery.prototype.histogramQuery = ""; - - /** - * HistogramQuery requirePreciseResultSize. - * @member {boolean} requirePreciseResultSize - * @memberof google.cloud.contentwarehouse.v1.HistogramQuery - * @instance - */ - HistogramQuery.prototype.requirePreciseResultSize = false; - - /** - * HistogramQuery filters. - * @member {google.cloud.contentwarehouse.v1.IHistogramQueryPropertyNameFilter|null|undefined} filters - * @memberof google.cloud.contentwarehouse.v1.HistogramQuery - * @instance - */ - HistogramQuery.prototype.filters = null; - - /** - * Creates a new HistogramQuery instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.HistogramQuery - * @static - * @param {google.cloud.contentwarehouse.v1.IHistogramQuery=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.HistogramQuery} HistogramQuery instance - */ - HistogramQuery.create = function create(properties) { - return new HistogramQuery(properties); - }; - - /** - * Encodes the specified HistogramQuery message. Does not implicitly {@link google.cloud.contentwarehouse.v1.HistogramQuery.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.HistogramQuery - * @static - * @param {google.cloud.contentwarehouse.v1.IHistogramQuery} message HistogramQuery message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HistogramQuery.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.histogramQuery != null && Object.hasOwnProperty.call(message, "histogramQuery")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.histogramQuery); - if (message.requirePreciseResultSize != null && Object.hasOwnProperty.call(message, "requirePreciseResultSize")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.requirePreciseResultSize); - if (message.filters != null && Object.hasOwnProperty.call(message, "filters")) - $root.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.encode(message.filters, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified HistogramQuery message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.HistogramQuery.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.HistogramQuery - * @static - * @param {google.cloud.contentwarehouse.v1.IHistogramQuery} message HistogramQuery message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HistogramQuery.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a HistogramQuery message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.HistogramQuery - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.HistogramQuery} HistogramQuery - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HistogramQuery.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.HistogramQuery(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.histogramQuery = reader.string(); - break; - } - case 2: { - message.requirePreciseResultSize = reader.bool(); - break; - } - case 3: { - message.filters = $root.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a HistogramQuery message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.HistogramQuery - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.HistogramQuery} HistogramQuery - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HistogramQuery.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a HistogramQuery message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.HistogramQuery - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - HistogramQuery.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.histogramQuery != null && message.hasOwnProperty("histogramQuery")) - if (!$util.isString(message.histogramQuery)) - return "histogramQuery: string expected"; - if (message.requirePreciseResultSize != null && message.hasOwnProperty("requirePreciseResultSize")) - if (typeof message.requirePreciseResultSize !== "boolean") - return "requirePreciseResultSize: boolean expected"; - if (message.filters != null && message.hasOwnProperty("filters")) { - var error = $root.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.verify(message.filters); - if (error) - return "filters." + error; - } - return null; - }; - - /** - * Creates a HistogramQuery message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.HistogramQuery - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.HistogramQuery} HistogramQuery - */ - HistogramQuery.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.HistogramQuery) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.HistogramQuery(); - if (object.histogramQuery != null) - message.histogramQuery = String(object.histogramQuery); - if (object.requirePreciseResultSize != null) - message.requirePreciseResultSize = Boolean(object.requirePreciseResultSize); - if (object.filters != null) { - if (typeof object.filters !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.HistogramQuery.filters: object expected"); - message.filters = $root.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.fromObject(object.filters); - } - return message; - }; - - /** - * Creates a plain object from a HistogramQuery message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.HistogramQuery - * @static - * @param {google.cloud.contentwarehouse.v1.HistogramQuery} message HistogramQuery - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HistogramQuery.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.histogramQuery = ""; - object.requirePreciseResultSize = false; - object.filters = null; - } - if (message.histogramQuery != null && message.hasOwnProperty("histogramQuery")) - object.histogramQuery = message.histogramQuery; - if (message.requirePreciseResultSize != null && message.hasOwnProperty("requirePreciseResultSize")) - object.requirePreciseResultSize = message.requirePreciseResultSize; - if (message.filters != null && message.hasOwnProperty("filters")) - object.filters = $root.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.toObject(message.filters, options); - return object; - }; - - /** - * Converts this HistogramQuery to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.HistogramQuery - * @instance - * @returns {Object.} JSON object - */ - HistogramQuery.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for HistogramQuery - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.HistogramQuery - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - HistogramQuery.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.HistogramQuery"; - }; - - return HistogramQuery; - })(); - - v1.HistogramQueryPropertyNameFilter = (function() { - - /** - * Properties of a HistogramQueryPropertyNameFilter. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IHistogramQueryPropertyNameFilter - * @property {Array.|null} [documentSchemas] HistogramQueryPropertyNameFilter documentSchemas - * @property {Array.|null} [propertyNames] HistogramQueryPropertyNameFilter propertyNames - * @property {google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.HistogramYAxis|null} [yAxis] HistogramQueryPropertyNameFilter yAxis - */ - - /** - * Constructs a new HistogramQueryPropertyNameFilter. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a HistogramQueryPropertyNameFilter. - * @implements IHistogramQueryPropertyNameFilter - * @constructor - * @param {google.cloud.contentwarehouse.v1.IHistogramQueryPropertyNameFilter=} [properties] Properties to set - */ - function HistogramQueryPropertyNameFilter(properties) { - this.documentSchemas = []; - this.propertyNames = []; - 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]]; - } - - /** - * HistogramQueryPropertyNameFilter documentSchemas. - * @member {Array.} documentSchemas - * @memberof google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter - * @instance - */ - HistogramQueryPropertyNameFilter.prototype.documentSchemas = $util.emptyArray; - - /** - * HistogramQueryPropertyNameFilter propertyNames. - * @member {Array.} propertyNames - * @memberof google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter - * @instance - */ - HistogramQueryPropertyNameFilter.prototype.propertyNames = $util.emptyArray; - - /** - * HistogramQueryPropertyNameFilter yAxis. - * @member {google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.HistogramYAxis} yAxis - * @memberof google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter - * @instance - */ - HistogramQueryPropertyNameFilter.prototype.yAxis = 0; - - /** - * Creates a new HistogramQueryPropertyNameFilter instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter - * @static - * @param {google.cloud.contentwarehouse.v1.IHistogramQueryPropertyNameFilter=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter} HistogramQueryPropertyNameFilter instance - */ - HistogramQueryPropertyNameFilter.create = function create(properties) { - return new HistogramQueryPropertyNameFilter(properties); - }; - - /** - * Encodes the specified HistogramQueryPropertyNameFilter message. Does not implicitly {@link google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter - * @static - * @param {google.cloud.contentwarehouse.v1.IHistogramQueryPropertyNameFilter} message HistogramQueryPropertyNameFilter message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HistogramQueryPropertyNameFilter.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.documentSchemas != null && message.documentSchemas.length) - for (var i = 0; i < message.documentSchemas.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.documentSchemas[i]); - if (message.propertyNames != null && message.propertyNames.length) - for (var i = 0; i < message.propertyNames.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.propertyNames[i]); - if (message.yAxis != null && Object.hasOwnProperty.call(message, "yAxis")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.yAxis); - return writer; - }; - - /** - * Encodes the specified HistogramQueryPropertyNameFilter message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter - * @static - * @param {google.cloud.contentwarehouse.v1.IHistogramQueryPropertyNameFilter} message HistogramQueryPropertyNameFilter message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HistogramQueryPropertyNameFilter.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a HistogramQueryPropertyNameFilter message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter} HistogramQueryPropertyNameFilter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HistogramQueryPropertyNameFilter.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.documentSchemas && message.documentSchemas.length)) - message.documentSchemas = []; - message.documentSchemas.push(reader.string()); - break; - } - case 2: { - if (!(message.propertyNames && message.propertyNames.length)) - message.propertyNames = []; - message.propertyNames.push(reader.string()); - break; - } - case 3: { - message.yAxis = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a HistogramQueryPropertyNameFilter message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter} HistogramQueryPropertyNameFilter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HistogramQueryPropertyNameFilter.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a HistogramQueryPropertyNameFilter message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - HistogramQueryPropertyNameFilter.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.documentSchemas != null && message.hasOwnProperty("documentSchemas")) { - if (!Array.isArray(message.documentSchemas)) - return "documentSchemas: array expected"; - for (var i = 0; i < message.documentSchemas.length; ++i) - if (!$util.isString(message.documentSchemas[i])) - return "documentSchemas: string[] expected"; - } - if (message.propertyNames != null && message.hasOwnProperty("propertyNames")) { - if (!Array.isArray(message.propertyNames)) - return "propertyNames: array expected"; - for (var i = 0; i < message.propertyNames.length; ++i) - if (!$util.isString(message.propertyNames[i])) - return "propertyNames: string[] expected"; - } - if (message.yAxis != null && message.hasOwnProperty("yAxis")) - switch (message.yAxis) { - default: - return "yAxis: enum value expected"; - case 0: - case 1: - break; - } - return null; - }; - - /** - * Creates a HistogramQueryPropertyNameFilter message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter} HistogramQueryPropertyNameFilter - */ - HistogramQueryPropertyNameFilter.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter(); - if (object.documentSchemas) { - if (!Array.isArray(object.documentSchemas)) - throw TypeError(".google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.documentSchemas: array expected"); - message.documentSchemas = []; - for (var i = 0; i < object.documentSchemas.length; ++i) - message.documentSchemas[i] = String(object.documentSchemas[i]); - } - if (object.propertyNames) { - if (!Array.isArray(object.propertyNames)) - throw TypeError(".google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.propertyNames: array expected"); - message.propertyNames = []; - for (var i = 0; i < object.propertyNames.length; ++i) - message.propertyNames[i] = String(object.propertyNames[i]); - } - switch (object.yAxis) { - default: - if (typeof object.yAxis === "number") { - message.yAxis = object.yAxis; - break; - } - break; - case "HISTOGRAM_YAXIS_DOCUMENT": - case 0: - message.yAxis = 0; - break; - case "HISTOGRAM_YAXIS_PROPERTY": - case 1: - message.yAxis = 1; - break; - } - return message; - }; - - /** - * Creates a plain object from a HistogramQueryPropertyNameFilter message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter - * @static - * @param {google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter} message HistogramQueryPropertyNameFilter - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HistogramQueryPropertyNameFilter.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.documentSchemas = []; - object.propertyNames = []; - } - if (options.defaults) - object.yAxis = options.enums === String ? "HISTOGRAM_YAXIS_DOCUMENT" : 0; - if (message.documentSchemas && message.documentSchemas.length) { - object.documentSchemas = []; - for (var j = 0; j < message.documentSchemas.length; ++j) - object.documentSchemas[j] = message.documentSchemas[j]; - } - if (message.propertyNames && message.propertyNames.length) { - object.propertyNames = []; - for (var j = 0; j < message.propertyNames.length; ++j) - object.propertyNames[j] = message.propertyNames[j]; - } - if (message.yAxis != null && message.hasOwnProperty("yAxis")) - object.yAxis = options.enums === String ? $root.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.HistogramYAxis[message.yAxis] === undefined ? message.yAxis : $root.google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.HistogramYAxis[message.yAxis] : message.yAxis; - return object; - }; - - /** - * Converts this HistogramQueryPropertyNameFilter to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter - * @instance - * @returns {Object.} JSON object - */ - HistogramQueryPropertyNameFilter.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for HistogramQueryPropertyNameFilter - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - HistogramQueryPropertyNameFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter"; - }; - - /** - * HistogramYAxis enum. - * @name google.cloud.contentwarehouse.v1.HistogramQueryPropertyNameFilter.HistogramYAxis - * @enum {number} - * @property {number} HISTOGRAM_YAXIS_DOCUMENT=0 HISTOGRAM_YAXIS_DOCUMENT value - * @property {number} HISTOGRAM_YAXIS_PROPERTY=1 HISTOGRAM_YAXIS_PROPERTY value - */ - HistogramQueryPropertyNameFilter.HistogramYAxis = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "HISTOGRAM_YAXIS_DOCUMENT"] = 0; - values[valuesById[1] = "HISTOGRAM_YAXIS_PROPERTY"] = 1; - return values; - })(); - - return HistogramQueryPropertyNameFilter; - })(); - - v1.HistogramQueryResult = (function() { - - /** - * Properties of a HistogramQueryResult. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IHistogramQueryResult - * @property {string|null} [histogramQuery] HistogramQueryResult histogramQuery - * @property {Object.|null} [histogram] HistogramQueryResult histogram - */ - - /** - * Constructs a new HistogramQueryResult. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a HistogramQueryResult. - * @implements IHistogramQueryResult - * @constructor - * @param {google.cloud.contentwarehouse.v1.IHistogramQueryResult=} [properties] Properties to set - */ - function HistogramQueryResult(properties) { - this.histogram = {}; - 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]]; - } - - /** - * HistogramQueryResult histogramQuery. - * @member {string} histogramQuery - * @memberof google.cloud.contentwarehouse.v1.HistogramQueryResult - * @instance - */ - HistogramQueryResult.prototype.histogramQuery = ""; - - /** - * HistogramQueryResult histogram. - * @member {Object.} histogram - * @memberof google.cloud.contentwarehouse.v1.HistogramQueryResult - * @instance - */ - HistogramQueryResult.prototype.histogram = $util.emptyObject; - - /** - * Creates a new HistogramQueryResult instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.HistogramQueryResult - * @static - * @param {google.cloud.contentwarehouse.v1.IHistogramQueryResult=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.HistogramQueryResult} HistogramQueryResult instance - */ - HistogramQueryResult.create = function create(properties) { - return new HistogramQueryResult(properties); - }; - - /** - * Encodes the specified HistogramQueryResult message. Does not implicitly {@link google.cloud.contentwarehouse.v1.HistogramQueryResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.HistogramQueryResult - * @static - * @param {google.cloud.contentwarehouse.v1.IHistogramQueryResult} message HistogramQueryResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HistogramQueryResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.histogramQuery != null && Object.hasOwnProperty.call(message, "histogramQuery")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.histogramQuery); - if (message.histogram != null && Object.hasOwnProperty.call(message, "histogram")) - for (var keys = Object.keys(message.histogram), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).int64(message.histogram[keys[i]]).ldelim(); - return writer; - }; - - /** - * Encodes the specified HistogramQueryResult message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.HistogramQueryResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.HistogramQueryResult - * @static - * @param {google.cloud.contentwarehouse.v1.IHistogramQueryResult} message HistogramQueryResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HistogramQueryResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a HistogramQueryResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.HistogramQueryResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.HistogramQueryResult} HistogramQueryResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HistogramQueryResult.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.HistogramQueryResult(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.histogramQuery = reader.string(); - break; - } - case 2: { - if (message.histogram === $util.emptyObject) - message.histogram = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = 0; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.int64(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.histogram[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a HistogramQueryResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.HistogramQueryResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.HistogramQueryResult} HistogramQueryResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HistogramQueryResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a HistogramQueryResult message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.HistogramQueryResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - HistogramQueryResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.histogramQuery != null && message.hasOwnProperty("histogramQuery")) - if (!$util.isString(message.histogramQuery)) - return "histogramQuery: string expected"; - if (message.histogram != null && message.hasOwnProperty("histogram")) { - if (!$util.isObject(message.histogram)) - return "histogram: object expected"; - var key = Object.keys(message.histogram); - for (var i = 0; i < key.length; ++i) - if (!$util.isInteger(message.histogram[key[i]]) && !(message.histogram[key[i]] && $util.isInteger(message.histogram[key[i]].low) && $util.isInteger(message.histogram[key[i]].high))) - return "histogram: integer|Long{k:string} expected"; - } - return null; - }; - - /** - * Creates a HistogramQueryResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.HistogramQueryResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.HistogramQueryResult} HistogramQueryResult - */ - HistogramQueryResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.HistogramQueryResult) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.HistogramQueryResult(); - if (object.histogramQuery != null) - message.histogramQuery = String(object.histogramQuery); - if (object.histogram) { - if (typeof object.histogram !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.HistogramQueryResult.histogram: object expected"); - message.histogram = {}; - for (var keys = Object.keys(object.histogram), i = 0; i < keys.length; ++i) - if ($util.Long) - (message.histogram[keys[i]] = $util.Long.fromValue(object.histogram[keys[i]])).unsigned = false; - else if (typeof object.histogram[keys[i]] === "string") - message.histogram[keys[i]] = parseInt(object.histogram[keys[i]], 10); - else if (typeof object.histogram[keys[i]] === "number") - message.histogram[keys[i]] = object.histogram[keys[i]]; - else if (typeof object.histogram[keys[i]] === "object") - message.histogram[keys[i]] = new $util.LongBits(object.histogram[keys[i]].low >>> 0, object.histogram[keys[i]].high >>> 0).toNumber(); - } - return message; - }; - - /** - * Creates a plain object from a HistogramQueryResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.HistogramQueryResult - * @static - * @param {google.cloud.contentwarehouse.v1.HistogramQueryResult} message HistogramQueryResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HistogramQueryResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.histogram = {}; - if (options.defaults) - object.histogramQuery = ""; - if (message.histogramQuery != null && message.hasOwnProperty("histogramQuery")) - object.histogramQuery = message.histogramQuery; - var keys2; - if (message.histogram && (keys2 = Object.keys(message.histogram)).length) { - object.histogram = {}; - for (var j = 0; j < keys2.length; ++j) - if (typeof message.histogram[keys2[j]] === "number") - object.histogram[keys2[j]] = options.longs === String ? String(message.histogram[keys2[j]]) : message.histogram[keys2[j]]; - else - object.histogram[keys2[j]] = options.longs === String ? $util.Long.prototype.toString.call(message.histogram[keys2[j]]) : options.longs === Number ? new $util.LongBits(message.histogram[keys2[j]].low >>> 0, message.histogram[keys2[j]].high >>> 0).toNumber() : message.histogram[keys2[j]]; - } - return object; - }; - - /** - * Converts this HistogramQueryResult to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.HistogramQueryResult - * @instance - * @returns {Object.} JSON object - */ - HistogramQueryResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for HistogramQueryResult - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.HistogramQueryResult - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - HistogramQueryResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.HistogramQueryResult"; - }; - - return HistogramQueryResult; - })(); - - v1.RuleSet = (function() { - - /** - * Properties of a RuleSet. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IRuleSet - * @property {string|null} [name] RuleSet name - * @property {string|null} [description] RuleSet description - * @property {string|null} [source] RuleSet source - * @property {Array.|null} [rules] RuleSet rules - */ - - /** - * Constructs a new RuleSet. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a RuleSet. - * @implements IRuleSet - * @constructor - * @param {google.cloud.contentwarehouse.v1.IRuleSet=} [properties] Properties to set - */ - function RuleSet(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]]; - } - - /** - * RuleSet name. - * @member {string} name - * @memberof google.cloud.contentwarehouse.v1.RuleSet - * @instance - */ - RuleSet.prototype.name = ""; - - /** - * RuleSet description. - * @member {string} description - * @memberof google.cloud.contentwarehouse.v1.RuleSet - * @instance - */ - RuleSet.prototype.description = ""; - - /** - * RuleSet source. - * @member {string} source - * @memberof google.cloud.contentwarehouse.v1.RuleSet - * @instance - */ - RuleSet.prototype.source = ""; - - /** - * RuleSet rules. - * @member {Array.} rules - * @memberof google.cloud.contentwarehouse.v1.RuleSet - * @instance - */ - RuleSet.prototype.rules = $util.emptyArray; - - /** - * Creates a new RuleSet instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.RuleSet - * @static - * @param {google.cloud.contentwarehouse.v1.IRuleSet=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.RuleSet} RuleSet instance - */ - RuleSet.create = function create(properties) { - return new RuleSet(properties); - }; - - /** - * Encodes the specified RuleSet message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RuleSet.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.RuleSet - * @static - * @param {google.cloud.contentwarehouse.v1.IRuleSet} message RuleSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RuleSet.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.source != null && Object.hasOwnProperty.call(message, "source")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.source); - if (message.rules != null && message.rules.length) - for (var i = 0; i < message.rules.length; ++i) - $root.google.cloud.contentwarehouse.v1.Rule.encode(message.rules[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.name); - return writer; - }; - - /** - * Encodes the specified RuleSet message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RuleSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.RuleSet - * @static - * @param {google.cloud.contentwarehouse.v1.IRuleSet} message RuleSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RuleSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RuleSet message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.RuleSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.RuleSet} RuleSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RuleSet.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.RuleSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 6: { - message.name = reader.string(); - break; - } - case 1: { - message.description = reader.string(); - break; - } - case 2: { - message.source = reader.string(); - break; - } - case 3: { - if (!(message.rules && message.rules.length)) - message.rules = []; - message.rules.push($root.google.cloud.contentwarehouse.v1.Rule.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RuleSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.RuleSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.RuleSet} RuleSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RuleSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RuleSet message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.RuleSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RuleSet.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.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.source != null && message.hasOwnProperty("source")) - if (!$util.isString(message.source)) - return "source: string 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.cloud.contentwarehouse.v1.Rule.verify(message.rules[i]); - if (error) - return "rules." + error; - } - } - return null; - }; - - /** - * Creates a RuleSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.RuleSet - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.RuleSet} RuleSet - */ - RuleSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.RuleSet) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.RuleSet(); - if (object.name != null) - message.name = String(object.name); - if (object.description != null) - message.description = String(object.description); - if (object.source != null) - message.source = String(object.source); - if (object.rules) { - if (!Array.isArray(object.rules)) - throw TypeError(".google.cloud.contentwarehouse.v1.RuleSet.rules: array expected"); - message.rules = []; - for (var i = 0; i < object.rules.length; ++i) { - if (typeof object.rules[i] !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.RuleSet.rules: object expected"); - message.rules[i] = $root.google.cloud.contentwarehouse.v1.Rule.fromObject(object.rules[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a RuleSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.RuleSet - * @static - * @param {google.cloud.contentwarehouse.v1.RuleSet} message RuleSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RuleSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.rules = []; - if (options.defaults) { - object.description = ""; - object.source = ""; - object.name = ""; - } - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.source != null && message.hasOwnProperty("source")) - object.source = message.source; - if (message.rules && message.rules.length) { - object.rules = []; - for (var j = 0; j < message.rules.length; ++j) - object.rules[j] = $root.google.cloud.contentwarehouse.v1.Rule.toObject(message.rules[j], options); - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this RuleSet to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.RuleSet - * @instance - * @returns {Object.} JSON object - */ - RuleSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RuleSet - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.RuleSet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RuleSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.RuleSet"; - }; - - return RuleSet; - })(); - - v1.Rule = (function() { - - /** - * Properties of a Rule. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IRule - * @property {string|null} [description] Rule description - * @property {string|null} [ruleId] Rule ruleId - * @property {google.cloud.contentwarehouse.v1.Rule.TriggerType|null} [triggerType] Rule triggerType - * @property {string|null} [condition] Rule condition - * @property {Array.|null} [actions] Rule actions - */ - - /** - * Constructs a new Rule. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a Rule. - * @implements IRule - * @constructor - * @param {google.cloud.contentwarehouse.v1.IRule=} [properties] Properties to set - */ - function Rule(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]]; - } - - /** - * Rule description. - * @member {string} description - * @memberof google.cloud.contentwarehouse.v1.Rule - * @instance - */ - Rule.prototype.description = ""; - - /** - * Rule ruleId. - * @member {string} ruleId - * @memberof google.cloud.contentwarehouse.v1.Rule - * @instance - */ - Rule.prototype.ruleId = ""; - - /** - * Rule triggerType. - * @member {google.cloud.contentwarehouse.v1.Rule.TriggerType} triggerType - * @memberof google.cloud.contentwarehouse.v1.Rule - * @instance - */ - Rule.prototype.triggerType = 0; - - /** - * Rule condition. - * @member {string} condition - * @memberof google.cloud.contentwarehouse.v1.Rule - * @instance - */ - Rule.prototype.condition = ""; - - /** - * Rule actions. - * @member {Array.} actions - * @memberof google.cloud.contentwarehouse.v1.Rule - * @instance - */ - Rule.prototype.actions = $util.emptyArray; - - /** - * Creates a new Rule instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.Rule - * @static - * @param {google.cloud.contentwarehouse.v1.IRule=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.Rule} Rule instance - */ - Rule.create = function create(properties) { - return new Rule(properties); - }; - - /** - * Encodes the specified Rule message. Does not implicitly {@link google.cloud.contentwarehouse.v1.Rule.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.Rule - * @static - * @param {google.cloud.contentwarehouse.v1.IRule} message Rule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Rule.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.ruleId != null && Object.hasOwnProperty.call(message, "ruleId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.ruleId); - if (message.triggerType != null && Object.hasOwnProperty.call(message, "triggerType")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.triggerType); - if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.condition); - if (message.actions != null && message.actions.length) - for (var i = 0; i < message.actions.length; ++i) - $root.google.cloud.contentwarehouse.v1.Action.encode(message.actions[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Rule message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.Rule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.Rule - * @static - * @param {google.cloud.contentwarehouse.v1.IRule} message Rule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Rule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Rule message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.Rule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.Rule} Rule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Rule.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.Rule(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.description = reader.string(); - break; - } - case 2: { - message.ruleId = reader.string(); - break; - } - case 3: { - message.triggerType = reader.int32(); - break; - } - case 4: { - message.condition = reader.string(); - break; - } - case 5: { - if (!(message.actions && message.actions.length)) - message.actions = []; - message.actions.push($root.google.cloud.contentwarehouse.v1.Action.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Rule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.Rule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.Rule} Rule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Rule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Rule message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.Rule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Rule.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.ruleId != null && message.hasOwnProperty("ruleId")) - if (!$util.isString(message.ruleId)) - return "ruleId: string expected"; - if (message.triggerType != null && message.hasOwnProperty("triggerType")) - switch (message.triggerType) { - default: - return "triggerType: enum value expected"; - case 0: - case 1: - case 4: - case 7: - case 8: - break; - } - if (message.condition != null && message.hasOwnProperty("condition")) - if (!$util.isString(message.condition)) - return "condition: 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.cloud.contentwarehouse.v1.Action.verify(message.actions[i]); - if (error) - return "actions." + error; - } - } - return null; - }; - - /** - * Creates a Rule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.Rule - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.Rule} Rule - */ - Rule.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.Rule) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.Rule(); - if (object.description != null) - message.description = String(object.description); - if (object.ruleId != null) - message.ruleId = String(object.ruleId); - switch (object.triggerType) { - default: - if (typeof object.triggerType === "number") { - message.triggerType = object.triggerType; - break; - } - break; - case "UNKNOWN": - case 0: - message.triggerType = 0; - break; - case "ON_CREATE": - case 1: - message.triggerType = 1; - break; - case "ON_UPDATE": - case 4: - message.triggerType = 4; - break; - case "ON_CREATE_LINK": - case 7: - message.triggerType = 7; - break; - case "ON_DELETE_LINK": - case 8: - message.triggerType = 8; - break; - } - if (object.condition != null) - message.condition = String(object.condition); - if (object.actions) { - if (!Array.isArray(object.actions)) - throw TypeError(".google.cloud.contentwarehouse.v1.Rule.actions: array expected"); - message.actions = []; - for (var i = 0; i < object.actions.length; ++i) { - if (typeof object.actions[i] !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.Rule.actions: object expected"); - message.actions[i] = $root.google.cloud.contentwarehouse.v1.Action.fromObject(object.actions[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Rule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.Rule - * @static - * @param {google.cloud.contentwarehouse.v1.Rule} message Rule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Rule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.actions = []; - if (options.defaults) { - object.description = ""; - object.ruleId = ""; - object.triggerType = options.enums === String ? "UNKNOWN" : 0; - object.condition = ""; - } - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.ruleId != null && message.hasOwnProperty("ruleId")) - object.ruleId = message.ruleId; - if (message.triggerType != null && message.hasOwnProperty("triggerType")) - object.triggerType = options.enums === String ? $root.google.cloud.contentwarehouse.v1.Rule.TriggerType[message.triggerType] === undefined ? message.triggerType : $root.google.cloud.contentwarehouse.v1.Rule.TriggerType[message.triggerType] : message.triggerType; - if (message.condition != null && message.hasOwnProperty("condition")) - object.condition = message.condition; - if (message.actions && message.actions.length) { - object.actions = []; - for (var j = 0; j < message.actions.length; ++j) - object.actions[j] = $root.google.cloud.contentwarehouse.v1.Action.toObject(message.actions[j], options); - } - return object; - }; - - /** - * Converts this Rule to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.Rule - * @instance - * @returns {Object.} JSON object - */ - Rule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Rule - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.Rule - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Rule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.Rule"; - }; - - /** - * TriggerType enum. - * @name google.cloud.contentwarehouse.v1.Rule.TriggerType - * @enum {number} - * @property {number} UNKNOWN=0 UNKNOWN value - * @property {number} ON_CREATE=1 ON_CREATE value - * @property {number} ON_UPDATE=4 ON_UPDATE value - * @property {number} ON_CREATE_LINK=7 ON_CREATE_LINK value - * @property {number} ON_DELETE_LINK=8 ON_DELETE_LINK value - */ - Rule.TriggerType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UNKNOWN"] = 0; - values[valuesById[1] = "ON_CREATE"] = 1; - values[valuesById[4] = "ON_UPDATE"] = 4; - values[valuesById[7] = "ON_CREATE_LINK"] = 7; - values[valuesById[8] = "ON_DELETE_LINK"] = 8; - return values; - })(); - - return Rule; - })(); - - v1.Action = (function() { - - /** - * Properties of an Action. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IAction - * @property {string|null} [actionId] Action actionId - * @property {google.cloud.contentwarehouse.v1.IAccessControlAction|null} [accessControl] Action accessControl - * @property {google.cloud.contentwarehouse.v1.IDataValidationAction|null} [dataValidation] Action dataValidation - * @property {google.cloud.contentwarehouse.v1.IDataUpdateAction|null} [dataUpdate] Action dataUpdate - * @property {google.cloud.contentwarehouse.v1.IAddToFolderAction|null} [addToFolder] Action addToFolder - * @property {google.cloud.contentwarehouse.v1.IPublishAction|null} [publishToPubSub] Action publishToPubSub - * @property {google.cloud.contentwarehouse.v1.IRemoveFromFolderAction|null} [removeFromFolderAction] Action removeFromFolderAction - * @property {google.cloud.contentwarehouse.v1.IDeleteDocumentAction|null} [deleteDocumentAction] Action deleteDocumentAction - */ - - /** - * Constructs a new Action. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents an Action. - * @implements IAction - * @constructor - * @param {google.cloud.contentwarehouse.v1.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 actionId. - * @member {string} actionId - * @memberof google.cloud.contentwarehouse.v1.Action - * @instance - */ - Action.prototype.actionId = ""; - - /** - * Action accessControl. - * @member {google.cloud.contentwarehouse.v1.IAccessControlAction|null|undefined} accessControl - * @memberof google.cloud.contentwarehouse.v1.Action - * @instance - */ - Action.prototype.accessControl = null; - - /** - * Action dataValidation. - * @member {google.cloud.contentwarehouse.v1.IDataValidationAction|null|undefined} dataValidation - * @memberof google.cloud.contentwarehouse.v1.Action - * @instance - */ - Action.prototype.dataValidation = null; - - /** - * Action dataUpdate. - * @member {google.cloud.contentwarehouse.v1.IDataUpdateAction|null|undefined} dataUpdate - * @memberof google.cloud.contentwarehouse.v1.Action - * @instance - */ - Action.prototype.dataUpdate = null; - - /** - * Action addToFolder. - * @member {google.cloud.contentwarehouse.v1.IAddToFolderAction|null|undefined} addToFolder - * @memberof google.cloud.contentwarehouse.v1.Action - * @instance - */ - Action.prototype.addToFolder = null; - - /** - * Action publishToPubSub. - * @member {google.cloud.contentwarehouse.v1.IPublishAction|null|undefined} publishToPubSub - * @memberof google.cloud.contentwarehouse.v1.Action - * @instance - */ - Action.prototype.publishToPubSub = null; - - /** - * Action removeFromFolderAction. - * @member {google.cloud.contentwarehouse.v1.IRemoveFromFolderAction|null|undefined} removeFromFolderAction - * @memberof google.cloud.contentwarehouse.v1.Action - * @instance - */ - Action.prototype.removeFromFolderAction = null; - - /** - * Action deleteDocumentAction. - * @member {google.cloud.contentwarehouse.v1.IDeleteDocumentAction|null|undefined} deleteDocumentAction - * @memberof google.cloud.contentwarehouse.v1.Action - * @instance - */ - Action.prototype.deleteDocumentAction = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Action action. - * @member {"accessControl"|"dataValidation"|"dataUpdate"|"addToFolder"|"publishToPubSub"|"removeFromFolderAction"|"deleteDocumentAction"|undefined} action - * @memberof google.cloud.contentwarehouse.v1.Action - * @instance - */ - Object.defineProperty(Action.prototype, "action", { - get: $util.oneOfGetter($oneOfFields = ["accessControl", "dataValidation", "dataUpdate", "addToFolder", "publishToPubSub", "removeFromFolderAction", "deleteDocumentAction"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Action instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.Action - * @static - * @param {google.cloud.contentwarehouse.v1.IAction=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.Action} Action instance - */ - Action.create = function create(properties) { - return new Action(properties); - }; - - /** - * Encodes the specified Action message. Does not implicitly {@link google.cloud.contentwarehouse.v1.Action.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.Action - * @static - * @param {google.cloud.contentwarehouse.v1.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.actionId != null && Object.hasOwnProperty.call(message, "actionId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.actionId); - if (message.accessControl != null && Object.hasOwnProperty.call(message, "accessControl")) - $root.google.cloud.contentwarehouse.v1.AccessControlAction.encode(message.accessControl, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.dataValidation != null && Object.hasOwnProperty.call(message, "dataValidation")) - $root.google.cloud.contentwarehouse.v1.DataValidationAction.encode(message.dataValidation, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.dataUpdate != null && Object.hasOwnProperty.call(message, "dataUpdate")) - $root.google.cloud.contentwarehouse.v1.DataUpdateAction.encode(message.dataUpdate, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.addToFolder != null && Object.hasOwnProperty.call(message, "addToFolder")) - $root.google.cloud.contentwarehouse.v1.AddToFolderAction.encode(message.addToFolder, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.publishToPubSub != null && Object.hasOwnProperty.call(message, "publishToPubSub")) - $root.google.cloud.contentwarehouse.v1.PublishAction.encode(message.publishToPubSub, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.removeFromFolderAction != null && Object.hasOwnProperty.call(message, "removeFromFolderAction")) - $root.google.cloud.contentwarehouse.v1.RemoveFromFolderAction.encode(message.removeFromFolderAction, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.deleteDocumentAction != null && Object.hasOwnProperty.call(message, "deleteDocumentAction")) - $root.google.cloud.contentwarehouse.v1.DeleteDocumentAction.encode(message.deleteDocumentAction, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Action message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.Action.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.Action - * @static - * @param {google.cloud.contentwarehouse.v1.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.cloud.contentwarehouse.v1.Action - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.Action(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.actionId = reader.string(); - break; - } - case 2: { - message.accessControl = $root.google.cloud.contentwarehouse.v1.AccessControlAction.decode(reader, reader.uint32()); - break; - } - case 3: { - message.dataValidation = $root.google.cloud.contentwarehouse.v1.DataValidationAction.decode(reader, reader.uint32()); - break; - } - case 4: { - message.dataUpdate = $root.google.cloud.contentwarehouse.v1.DataUpdateAction.decode(reader, reader.uint32()); - break; - } - case 5: { - message.addToFolder = $root.google.cloud.contentwarehouse.v1.AddToFolderAction.decode(reader, reader.uint32()); - break; - } - case 6: { - message.publishToPubSub = $root.google.cloud.contentwarehouse.v1.PublishAction.decode(reader, reader.uint32()); - break; - } - case 9: { - message.removeFromFolderAction = $root.google.cloud.contentwarehouse.v1.RemoveFromFolderAction.decode(reader, reader.uint32()); - break; - } - case 10: { - message.deleteDocumentAction = $root.google.cloud.contentwarehouse.v1.DeleteDocumentAction.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.cloud.contentwarehouse.v1.Action - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.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.cloud.contentwarehouse.v1.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.actionId != null && message.hasOwnProperty("actionId")) - if (!$util.isString(message.actionId)) - return "actionId: string expected"; - if (message.accessControl != null && message.hasOwnProperty("accessControl")) { - properties.action = 1; - { - var error = $root.google.cloud.contentwarehouse.v1.AccessControlAction.verify(message.accessControl); - if (error) - return "accessControl." + error; - } - } - if (message.dataValidation != null && message.hasOwnProperty("dataValidation")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.cloud.contentwarehouse.v1.DataValidationAction.verify(message.dataValidation); - if (error) - return "dataValidation." + error; - } - } - if (message.dataUpdate != null && message.hasOwnProperty("dataUpdate")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.cloud.contentwarehouse.v1.DataUpdateAction.verify(message.dataUpdate); - if (error) - return "dataUpdate." + error; - } - } - if (message.addToFolder != null && message.hasOwnProperty("addToFolder")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.cloud.contentwarehouse.v1.AddToFolderAction.verify(message.addToFolder); - if (error) - return "addToFolder." + error; - } - } - if (message.publishToPubSub != null && message.hasOwnProperty("publishToPubSub")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.cloud.contentwarehouse.v1.PublishAction.verify(message.publishToPubSub); - if (error) - return "publishToPubSub." + error; - } - } - if (message.removeFromFolderAction != null && message.hasOwnProperty("removeFromFolderAction")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.cloud.contentwarehouse.v1.RemoveFromFolderAction.verify(message.removeFromFolderAction); - if (error) - return "removeFromFolderAction." + error; - } - } - if (message.deleteDocumentAction != null && message.hasOwnProperty("deleteDocumentAction")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.cloud.contentwarehouse.v1.DeleteDocumentAction.verify(message.deleteDocumentAction); - if (error) - return "deleteDocumentAction." + error; - } - } - return null; - }; - - /** - * Creates an Action message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.Action - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.Action} Action - */ - Action.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.Action) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.Action(); - if (object.actionId != null) - message.actionId = String(object.actionId); - if (object.accessControl != null) { - if (typeof object.accessControl !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.Action.accessControl: object expected"); - message.accessControl = $root.google.cloud.contentwarehouse.v1.AccessControlAction.fromObject(object.accessControl); - } - if (object.dataValidation != null) { - if (typeof object.dataValidation !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.Action.dataValidation: object expected"); - message.dataValidation = $root.google.cloud.contentwarehouse.v1.DataValidationAction.fromObject(object.dataValidation); - } - if (object.dataUpdate != null) { - if (typeof object.dataUpdate !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.Action.dataUpdate: object expected"); - message.dataUpdate = $root.google.cloud.contentwarehouse.v1.DataUpdateAction.fromObject(object.dataUpdate); - } - if (object.addToFolder != null) { - if (typeof object.addToFolder !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.Action.addToFolder: object expected"); - message.addToFolder = $root.google.cloud.contentwarehouse.v1.AddToFolderAction.fromObject(object.addToFolder); - } - if (object.publishToPubSub != null) { - if (typeof object.publishToPubSub !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.Action.publishToPubSub: object expected"); - message.publishToPubSub = $root.google.cloud.contentwarehouse.v1.PublishAction.fromObject(object.publishToPubSub); - } - if (object.removeFromFolderAction != null) { - if (typeof object.removeFromFolderAction !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.Action.removeFromFolderAction: object expected"); - message.removeFromFolderAction = $root.google.cloud.contentwarehouse.v1.RemoveFromFolderAction.fromObject(object.removeFromFolderAction); - } - if (object.deleteDocumentAction != null) { - if (typeof object.deleteDocumentAction !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.Action.deleteDocumentAction: object expected"); - message.deleteDocumentAction = $root.google.cloud.contentwarehouse.v1.DeleteDocumentAction.fromObject(object.deleteDocumentAction); - } - return message; - }; - - /** - * Creates a plain object from an Action message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.Action - * @static - * @param {google.cloud.contentwarehouse.v1.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 (options.defaults) - object.actionId = ""; - if (message.actionId != null && message.hasOwnProperty("actionId")) - object.actionId = message.actionId; - if (message.accessControl != null && message.hasOwnProperty("accessControl")) { - object.accessControl = $root.google.cloud.contentwarehouse.v1.AccessControlAction.toObject(message.accessControl, options); - if (options.oneofs) - object.action = "accessControl"; - } - if (message.dataValidation != null && message.hasOwnProperty("dataValidation")) { - object.dataValidation = $root.google.cloud.contentwarehouse.v1.DataValidationAction.toObject(message.dataValidation, options); - if (options.oneofs) - object.action = "dataValidation"; - } - if (message.dataUpdate != null && message.hasOwnProperty("dataUpdate")) { - object.dataUpdate = $root.google.cloud.contentwarehouse.v1.DataUpdateAction.toObject(message.dataUpdate, options); - if (options.oneofs) - object.action = "dataUpdate"; - } - if (message.addToFolder != null && message.hasOwnProperty("addToFolder")) { - object.addToFolder = $root.google.cloud.contentwarehouse.v1.AddToFolderAction.toObject(message.addToFolder, options); - if (options.oneofs) - object.action = "addToFolder"; - } - if (message.publishToPubSub != null && message.hasOwnProperty("publishToPubSub")) { - object.publishToPubSub = $root.google.cloud.contentwarehouse.v1.PublishAction.toObject(message.publishToPubSub, options); - if (options.oneofs) - object.action = "publishToPubSub"; - } - if (message.removeFromFolderAction != null && message.hasOwnProperty("removeFromFolderAction")) { - object.removeFromFolderAction = $root.google.cloud.contentwarehouse.v1.RemoveFromFolderAction.toObject(message.removeFromFolderAction, options); - if (options.oneofs) - object.action = "removeFromFolderAction"; - } - if (message.deleteDocumentAction != null && message.hasOwnProperty("deleteDocumentAction")) { - object.deleteDocumentAction = $root.google.cloud.contentwarehouse.v1.DeleteDocumentAction.toObject(message.deleteDocumentAction, options); - if (options.oneofs) - object.action = "deleteDocumentAction"; - } - return object; - }; - - /** - * Converts this Action to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.Action - * @instance - * @returns {Object.} JSON object - */ - Action.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Action - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.Action - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Action.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.Action"; - }; - - return Action; - })(); - - v1.AccessControlAction = (function() { - - /** - * Properties of an AccessControlAction. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IAccessControlAction - * @property {google.cloud.contentwarehouse.v1.AccessControlAction.OperationType|null} [operationType] AccessControlAction operationType - * @property {google.iam.v1.IPolicy|null} [policy] AccessControlAction policy - */ - - /** - * Constructs a new AccessControlAction. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents an AccessControlAction. - * @implements IAccessControlAction - * @constructor - * @param {google.cloud.contentwarehouse.v1.IAccessControlAction=} [properties] Properties to set - */ - function AccessControlAction(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]]; - } - - /** - * AccessControlAction operationType. - * @member {google.cloud.contentwarehouse.v1.AccessControlAction.OperationType} operationType - * @memberof google.cloud.contentwarehouse.v1.AccessControlAction - * @instance - */ - AccessControlAction.prototype.operationType = 0; - - /** - * AccessControlAction policy. - * @member {google.iam.v1.IPolicy|null|undefined} policy - * @memberof google.cloud.contentwarehouse.v1.AccessControlAction - * @instance - */ - AccessControlAction.prototype.policy = null; - - /** - * Creates a new AccessControlAction instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.AccessControlAction - * @static - * @param {google.cloud.contentwarehouse.v1.IAccessControlAction=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.AccessControlAction} AccessControlAction instance - */ - AccessControlAction.create = function create(properties) { - return new AccessControlAction(properties); - }; - - /** - * Encodes the specified AccessControlAction message. Does not implicitly {@link google.cloud.contentwarehouse.v1.AccessControlAction.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.AccessControlAction - * @static - * @param {google.cloud.contentwarehouse.v1.IAccessControlAction} message AccessControlAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AccessControlAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.operationType != null && Object.hasOwnProperty.call(message, "operationType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.operationType); - if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) - $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified AccessControlAction message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.AccessControlAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.AccessControlAction - * @static - * @param {google.cloud.contentwarehouse.v1.IAccessControlAction} message AccessControlAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AccessControlAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AccessControlAction message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.AccessControlAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.AccessControlAction} AccessControlAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AccessControlAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.AccessControlAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.operationType = reader.int32(); - break; - } - case 2: { - message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AccessControlAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.AccessControlAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.AccessControlAction} AccessControlAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AccessControlAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AccessControlAction message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.AccessControlAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AccessControlAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.operationType != null && message.hasOwnProperty("operationType")) - switch (message.operationType) { - default: - return "operationType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.policy != null && message.hasOwnProperty("policy")) { - var error = $root.google.iam.v1.Policy.verify(message.policy); - if (error) - return "policy." + error; - } - return null; - }; - - /** - * Creates an AccessControlAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.AccessControlAction - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.AccessControlAction} AccessControlAction - */ - AccessControlAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.AccessControlAction) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.AccessControlAction(); - switch (object.operationType) { - default: - if (typeof object.operationType === "number") { - message.operationType = object.operationType; - break; - } - break; - case "UNKNOWN": - case 0: - message.operationType = 0; - break; - case "ADD_POLICY_BINDING": - case 1: - message.operationType = 1; - break; - case "REMOVE_POLICY_BINDING": - case 2: - message.operationType = 2; - break; - case "REPLACE_POLICY_BINDING": - case 3: - message.operationType = 3; - break; - } - if (object.policy != null) { - if (typeof object.policy !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.AccessControlAction.policy: object expected"); - message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); - } - return message; - }; - - /** - * Creates a plain object from an AccessControlAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.AccessControlAction - * @static - * @param {google.cloud.contentwarehouse.v1.AccessControlAction} message AccessControlAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AccessControlAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.operationType = options.enums === String ? "UNKNOWN" : 0; - object.policy = null; - } - if (message.operationType != null && message.hasOwnProperty("operationType")) - object.operationType = options.enums === String ? $root.google.cloud.contentwarehouse.v1.AccessControlAction.OperationType[message.operationType] === undefined ? message.operationType : $root.google.cloud.contentwarehouse.v1.AccessControlAction.OperationType[message.operationType] : message.operationType; - if (message.policy != null && message.hasOwnProperty("policy")) - object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); - return object; - }; - - /** - * Converts this AccessControlAction to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.AccessControlAction - * @instance - * @returns {Object.} JSON object - */ - AccessControlAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AccessControlAction - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.AccessControlAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AccessControlAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.AccessControlAction"; - }; - - /** - * OperationType enum. - * @name google.cloud.contentwarehouse.v1.AccessControlAction.OperationType - * @enum {number} - * @property {number} UNKNOWN=0 UNKNOWN value - * @property {number} ADD_POLICY_BINDING=1 ADD_POLICY_BINDING value - * @property {number} REMOVE_POLICY_BINDING=2 REMOVE_POLICY_BINDING value - * @property {number} REPLACE_POLICY_BINDING=3 REPLACE_POLICY_BINDING value - */ - AccessControlAction.OperationType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UNKNOWN"] = 0; - values[valuesById[1] = "ADD_POLICY_BINDING"] = 1; - values[valuesById[2] = "REMOVE_POLICY_BINDING"] = 2; - values[valuesById[3] = "REPLACE_POLICY_BINDING"] = 3; - return values; - })(); - - return AccessControlAction; - })(); - - v1.DataValidationAction = (function() { - - /** - * Properties of a DataValidationAction. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IDataValidationAction - * @property {Object.|null} [conditions] DataValidationAction conditions - */ - - /** - * Constructs a new DataValidationAction. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a DataValidationAction. - * @implements IDataValidationAction - * @constructor - * @param {google.cloud.contentwarehouse.v1.IDataValidationAction=} [properties] Properties to set - */ - function DataValidationAction(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]]; - } - - /** - * DataValidationAction conditions. - * @member {Object.} conditions - * @memberof google.cloud.contentwarehouse.v1.DataValidationAction - * @instance - */ - DataValidationAction.prototype.conditions = $util.emptyObject; - - /** - * Creates a new DataValidationAction instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.DataValidationAction - * @static - * @param {google.cloud.contentwarehouse.v1.IDataValidationAction=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.DataValidationAction} DataValidationAction instance - */ - DataValidationAction.create = function create(properties) { - return new DataValidationAction(properties); - }; - - /** - * Encodes the specified DataValidationAction message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DataValidationAction.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.DataValidationAction - * @static - * @param {google.cloud.contentwarehouse.v1.IDataValidationAction} message DataValidationAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataValidationAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.conditions != null && Object.hasOwnProperty.call(message, "conditions")) - for (var keys = Object.keys(message.conditions), i = 0; i < keys.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.conditions[keys[i]]).ldelim(); - return writer; - }; - - /** - * Encodes the specified DataValidationAction message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DataValidationAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.DataValidationAction - * @static - * @param {google.cloud.contentwarehouse.v1.IDataValidationAction} message DataValidationAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataValidationAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DataValidationAction message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.DataValidationAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.DataValidationAction} DataValidationAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataValidationAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.DataValidationAction(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (message.conditions === $util.emptyObject) - message.conditions = {}; - 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.conditions[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DataValidationAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.DataValidationAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.DataValidationAction} DataValidationAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataValidationAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DataValidationAction message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.DataValidationAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DataValidationAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.conditions != null && message.hasOwnProperty("conditions")) { - if (!$util.isObject(message.conditions)) - return "conditions: object expected"; - var key = Object.keys(message.conditions); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.conditions[key[i]])) - return "conditions: string{k:string} expected"; - } - return null; - }; - - /** - * Creates a DataValidationAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.DataValidationAction - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.DataValidationAction} DataValidationAction - */ - DataValidationAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.DataValidationAction) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.DataValidationAction(); - if (object.conditions) { - if (typeof object.conditions !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.DataValidationAction.conditions: object expected"); - message.conditions = {}; - for (var keys = Object.keys(object.conditions), i = 0; i < keys.length; ++i) - message.conditions[keys[i]] = String(object.conditions[keys[i]]); - } - return message; - }; - - /** - * Creates a plain object from a DataValidationAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.DataValidationAction - * @static - * @param {google.cloud.contentwarehouse.v1.DataValidationAction} message DataValidationAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DataValidationAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.conditions = {}; - var keys2; - if (message.conditions && (keys2 = Object.keys(message.conditions)).length) { - object.conditions = {}; - for (var j = 0; j < keys2.length; ++j) - object.conditions[keys2[j]] = message.conditions[keys2[j]]; - } - return object; - }; - - /** - * Converts this DataValidationAction to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.DataValidationAction - * @instance - * @returns {Object.} JSON object - */ - DataValidationAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DataValidationAction - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.DataValidationAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DataValidationAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.DataValidationAction"; - }; - - return DataValidationAction; - })(); - - v1.DataUpdateAction = (function() { - - /** - * Properties of a DataUpdateAction. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IDataUpdateAction - * @property {Object.|null} [entries] DataUpdateAction entries - */ - - /** - * Constructs a new DataUpdateAction. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a DataUpdateAction. - * @implements IDataUpdateAction - * @constructor - * @param {google.cloud.contentwarehouse.v1.IDataUpdateAction=} [properties] Properties to set - */ - function DataUpdateAction(properties) { - this.entries = {}; - 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]]; - } - - /** - * DataUpdateAction entries. - * @member {Object.} entries - * @memberof google.cloud.contentwarehouse.v1.DataUpdateAction - * @instance - */ - DataUpdateAction.prototype.entries = $util.emptyObject; - - /** - * Creates a new DataUpdateAction instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.DataUpdateAction - * @static - * @param {google.cloud.contentwarehouse.v1.IDataUpdateAction=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.DataUpdateAction} DataUpdateAction instance - */ - DataUpdateAction.create = function create(properties) { - return new DataUpdateAction(properties); - }; - - /** - * Encodes the specified DataUpdateAction message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DataUpdateAction.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.DataUpdateAction - * @static - * @param {google.cloud.contentwarehouse.v1.IDataUpdateAction} message DataUpdateAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataUpdateAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.entries != null && Object.hasOwnProperty.call(message, "entries")) - for (var keys = Object.keys(message.entries), i = 0; i < keys.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.entries[keys[i]]).ldelim(); - return writer; - }; - - /** - * Encodes the specified DataUpdateAction message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DataUpdateAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.DataUpdateAction - * @static - * @param {google.cloud.contentwarehouse.v1.IDataUpdateAction} message DataUpdateAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataUpdateAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DataUpdateAction message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.DataUpdateAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.DataUpdateAction} DataUpdateAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataUpdateAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.DataUpdateAction(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (message.entries === $util.emptyObject) - message.entries = {}; - 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.entries[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DataUpdateAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.DataUpdateAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.DataUpdateAction} DataUpdateAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataUpdateAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DataUpdateAction message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.DataUpdateAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DataUpdateAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.entries != null && message.hasOwnProperty("entries")) { - if (!$util.isObject(message.entries)) - return "entries: object expected"; - var key = Object.keys(message.entries); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.entries[key[i]])) - return "entries: string{k:string} expected"; - } - return null; - }; - - /** - * Creates a DataUpdateAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.DataUpdateAction - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.DataUpdateAction} DataUpdateAction - */ - DataUpdateAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.DataUpdateAction) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.DataUpdateAction(); - if (object.entries) { - if (typeof object.entries !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.DataUpdateAction.entries: object expected"); - message.entries = {}; - for (var keys = Object.keys(object.entries), i = 0; i < keys.length; ++i) - message.entries[keys[i]] = String(object.entries[keys[i]]); - } - return message; - }; - - /** - * Creates a plain object from a DataUpdateAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.DataUpdateAction - * @static - * @param {google.cloud.contentwarehouse.v1.DataUpdateAction} message DataUpdateAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DataUpdateAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.entries = {}; - var keys2; - if (message.entries && (keys2 = Object.keys(message.entries)).length) { - object.entries = {}; - for (var j = 0; j < keys2.length; ++j) - object.entries[keys2[j]] = message.entries[keys2[j]]; - } - return object; - }; - - /** - * Converts this DataUpdateAction to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.DataUpdateAction - * @instance - * @returns {Object.} JSON object - */ - DataUpdateAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DataUpdateAction - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.DataUpdateAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DataUpdateAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.DataUpdateAction"; - }; - - return DataUpdateAction; - })(); - - v1.AddToFolderAction = (function() { - - /** - * Properties of an AddToFolderAction. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IAddToFolderAction - * @property {Array.|null} [folders] AddToFolderAction folders - */ - - /** - * Constructs a new AddToFolderAction. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents an AddToFolderAction. - * @implements IAddToFolderAction - * @constructor - * @param {google.cloud.contentwarehouse.v1.IAddToFolderAction=} [properties] Properties to set - */ - function AddToFolderAction(properties) { - this.folders = []; - 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]]; - } - - /** - * AddToFolderAction folders. - * @member {Array.} folders - * @memberof google.cloud.contentwarehouse.v1.AddToFolderAction - * @instance - */ - AddToFolderAction.prototype.folders = $util.emptyArray; - - /** - * Creates a new AddToFolderAction instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.AddToFolderAction - * @static - * @param {google.cloud.contentwarehouse.v1.IAddToFolderAction=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.AddToFolderAction} AddToFolderAction instance - */ - AddToFolderAction.create = function create(properties) { - return new AddToFolderAction(properties); - }; - - /** - * Encodes the specified AddToFolderAction message. Does not implicitly {@link google.cloud.contentwarehouse.v1.AddToFolderAction.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.AddToFolderAction - * @static - * @param {google.cloud.contentwarehouse.v1.IAddToFolderAction} message AddToFolderAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AddToFolderAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.folders != null && message.folders.length) - for (var i = 0; i < message.folders.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.folders[i]); - return writer; - }; - - /** - * Encodes the specified AddToFolderAction message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.AddToFolderAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.AddToFolderAction - * @static - * @param {google.cloud.contentwarehouse.v1.IAddToFolderAction} message AddToFolderAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AddToFolderAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AddToFolderAction message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.AddToFolderAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.AddToFolderAction} AddToFolderAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AddToFolderAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.AddToFolderAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.folders && message.folders.length)) - message.folders = []; - message.folders.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AddToFolderAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.AddToFolderAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.AddToFolderAction} AddToFolderAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AddToFolderAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AddToFolderAction message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.AddToFolderAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AddToFolderAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.folders != null && message.hasOwnProperty("folders")) { - if (!Array.isArray(message.folders)) - return "folders: array expected"; - for (var i = 0; i < message.folders.length; ++i) - if (!$util.isString(message.folders[i])) - return "folders: string[] expected"; - } - return null; - }; - - /** - * Creates an AddToFolderAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.AddToFolderAction - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.AddToFolderAction} AddToFolderAction - */ - AddToFolderAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.AddToFolderAction) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.AddToFolderAction(); - if (object.folders) { - if (!Array.isArray(object.folders)) - throw TypeError(".google.cloud.contentwarehouse.v1.AddToFolderAction.folders: array expected"); - message.folders = []; - for (var i = 0; i < object.folders.length; ++i) - message.folders[i] = String(object.folders[i]); - } - return message; - }; - - /** - * Creates a plain object from an AddToFolderAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.AddToFolderAction - * @static - * @param {google.cloud.contentwarehouse.v1.AddToFolderAction} message AddToFolderAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AddToFolderAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.folders = []; - if (message.folders && message.folders.length) { - object.folders = []; - for (var j = 0; j < message.folders.length; ++j) - object.folders[j] = message.folders[j]; - } - return object; - }; - - /** - * Converts this AddToFolderAction to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.AddToFolderAction - * @instance - * @returns {Object.} JSON object - */ - AddToFolderAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AddToFolderAction - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.AddToFolderAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AddToFolderAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.AddToFolderAction"; - }; - - return AddToFolderAction; - })(); - - v1.RemoveFromFolderAction = (function() { - - /** - * Properties of a RemoveFromFolderAction. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IRemoveFromFolderAction - * @property {string|null} [condition] RemoveFromFolderAction condition - * @property {string|null} [folder] RemoveFromFolderAction folder - */ - - /** - * Constructs a new RemoveFromFolderAction. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a RemoveFromFolderAction. - * @implements IRemoveFromFolderAction - * @constructor - * @param {google.cloud.contentwarehouse.v1.IRemoveFromFolderAction=} [properties] Properties to set - */ - function RemoveFromFolderAction(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]]; - } - - /** - * RemoveFromFolderAction condition. - * @member {string} condition - * @memberof google.cloud.contentwarehouse.v1.RemoveFromFolderAction - * @instance - */ - RemoveFromFolderAction.prototype.condition = ""; - - /** - * RemoveFromFolderAction folder. - * @member {string} folder - * @memberof google.cloud.contentwarehouse.v1.RemoveFromFolderAction - * @instance - */ - RemoveFromFolderAction.prototype.folder = ""; - - /** - * Creates a new RemoveFromFolderAction instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.RemoveFromFolderAction - * @static - * @param {google.cloud.contentwarehouse.v1.IRemoveFromFolderAction=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.RemoveFromFolderAction} RemoveFromFolderAction instance - */ - RemoveFromFolderAction.create = function create(properties) { - return new RemoveFromFolderAction(properties); - }; - - /** - * Encodes the specified RemoveFromFolderAction message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RemoveFromFolderAction.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.RemoveFromFolderAction - * @static - * @param {google.cloud.contentwarehouse.v1.IRemoveFromFolderAction} message RemoveFromFolderAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RemoveFromFolderAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.condition); - if (message.folder != null && Object.hasOwnProperty.call(message, "folder")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.folder); - return writer; - }; - - /** - * Encodes the specified RemoveFromFolderAction message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RemoveFromFolderAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.RemoveFromFolderAction - * @static - * @param {google.cloud.contentwarehouse.v1.IRemoveFromFolderAction} message RemoveFromFolderAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RemoveFromFolderAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RemoveFromFolderAction message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.RemoveFromFolderAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.RemoveFromFolderAction} RemoveFromFolderAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RemoveFromFolderAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.RemoveFromFolderAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.condition = reader.string(); - break; - } - case 2: { - message.folder = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RemoveFromFolderAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.RemoveFromFolderAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.RemoveFromFolderAction} RemoveFromFolderAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RemoveFromFolderAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RemoveFromFolderAction message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.RemoveFromFolderAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RemoveFromFolderAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.condition != null && message.hasOwnProperty("condition")) - if (!$util.isString(message.condition)) - return "condition: string expected"; - if (message.folder != null && message.hasOwnProperty("folder")) - if (!$util.isString(message.folder)) - return "folder: string expected"; - return null; - }; - - /** - * Creates a RemoveFromFolderAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.RemoveFromFolderAction - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.RemoveFromFolderAction} RemoveFromFolderAction - */ - RemoveFromFolderAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.RemoveFromFolderAction) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.RemoveFromFolderAction(); - if (object.condition != null) - message.condition = String(object.condition); - if (object.folder != null) - message.folder = String(object.folder); - return message; - }; - - /** - * Creates a plain object from a RemoveFromFolderAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.RemoveFromFolderAction - * @static - * @param {google.cloud.contentwarehouse.v1.RemoveFromFolderAction} message RemoveFromFolderAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RemoveFromFolderAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.condition = ""; - object.folder = ""; - } - if (message.condition != null && message.hasOwnProperty("condition")) - object.condition = message.condition; - if (message.folder != null && message.hasOwnProperty("folder")) - object.folder = message.folder; - return object; - }; - - /** - * Converts this RemoveFromFolderAction to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.RemoveFromFolderAction - * @instance - * @returns {Object.} JSON object - */ - RemoveFromFolderAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RemoveFromFolderAction - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.RemoveFromFolderAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RemoveFromFolderAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.RemoveFromFolderAction"; - }; - - return RemoveFromFolderAction; - })(); - - v1.PublishAction = (function() { - - /** - * Properties of a PublishAction. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IPublishAction - * @property {string|null} [topicId] PublishAction topicId - * @property {Array.|null} [messages] PublishAction messages - */ - - /** - * Constructs a new PublishAction. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a PublishAction. - * @implements IPublishAction - * @constructor - * @param {google.cloud.contentwarehouse.v1.IPublishAction=} [properties] Properties to set - */ - function PublishAction(properties) { - this.messages = []; - 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]]; - } - - /** - * PublishAction topicId. - * @member {string} topicId - * @memberof google.cloud.contentwarehouse.v1.PublishAction - * @instance - */ - PublishAction.prototype.topicId = ""; - - /** - * PublishAction messages. - * @member {Array.} messages - * @memberof google.cloud.contentwarehouse.v1.PublishAction - * @instance - */ - PublishAction.prototype.messages = $util.emptyArray; - - /** - * Creates a new PublishAction instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.PublishAction - * @static - * @param {google.cloud.contentwarehouse.v1.IPublishAction=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.PublishAction} PublishAction instance - */ - PublishAction.create = function create(properties) { - return new PublishAction(properties); - }; - - /** - * Encodes the specified PublishAction message. Does not implicitly {@link google.cloud.contentwarehouse.v1.PublishAction.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.PublishAction - * @static - * @param {google.cloud.contentwarehouse.v1.IPublishAction} message PublishAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PublishAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.topicId != null && Object.hasOwnProperty.call(message, "topicId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.topicId); - if (message.messages != null && message.messages.length) - for (var i = 0; i < message.messages.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.messages[i]); - return writer; - }; - - /** - * Encodes the specified PublishAction message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.PublishAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.PublishAction - * @static - * @param {google.cloud.contentwarehouse.v1.IPublishAction} message PublishAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PublishAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PublishAction message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.PublishAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.PublishAction} PublishAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PublishAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.PublishAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.topicId = reader.string(); - break; - } - case 2: { - if (!(message.messages && message.messages.length)) - message.messages = []; - message.messages.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PublishAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.PublishAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.PublishAction} PublishAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PublishAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PublishAction message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.PublishAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PublishAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.topicId != null && message.hasOwnProperty("topicId")) - if (!$util.isString(message.topicId)) - return "topicId: string expected"; - if (message.messages != null && message.hasOwnProperty("messages")) { - if (!Array.isArray(message.messages)) - return "messages: array expected"; - for (var i = 0; i < message.messages.length; ++i) - if (!$util.isString(message.messages[i])) - return "messages: string[] expected"; - } - return null; - }; - - /** - * Creates a PublishAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.PublishAction - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.PublishAction} PublishAction - */ - PublishAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.PublishAction) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.PublishAction(); - if (object.topicId != null) - message.topicId = String(object.topicId); - if (object.messages) { - if (!Array.isArray(object.messages)) - throw TypeError(".google.cloud.contentwarehouse.v1.PublishAction.messages: array expected"); - message.messages = []; - for (var i = 0; i < object.messages.length; ++i) - message.messages[i] = String(object.messages[i]); - } - return message; - }; - - /** - * Creates a plain object from a PublishAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.PublishAction - * @static - * @param {google.cloud.contentwarehouse.v1.PublishAction} message PublishAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PublishAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.messages = []; - if (options.defaults) - object.topicId = ""; - if (message.topicId != null && message.hasOwnProperty("topicId")) - object.topicId = message.topicId; - if (message.messages && message.messages.length) { - object.messages = []; - for (var j = 0; j < message.messages.length; ++j) - object.messages[j] = message.messages[j]; - } - return object; - }; - - /** - * Converts this PublishAction to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.PublishAction - * @instance - * @returns {Object.} JSON object - */ - PublishAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PublishAction - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.PublishAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PublishAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.PublishAction"; - }; - - return PublishAction; - })(); - - v1.DeleteDocumentAction = (function() { - - /** - * Properties of a DeleteDocumentAction. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IDeleteDocumentAction - * @property {boolean|null} [enableHardDelete] DeleteDocumentAction enableHardDelete - */ - - /** - * Constructs a new DeleteDocumentAction. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a DeleteDocumentAction. - * @implements IDeleteDocumentAction - * @constructor - * @param {google.cloud.contentwarehouse.v1.IDeleteDocumentAction=} [properties] Properties to set - */ - function DeleteDocumentAction(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]]; - } - - /** - * DeleteDocumentAction enableHardDelete. - * @member {boolean} enableHardDelete - * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentAction - * @instance - */ - DeleteDocumentAction.prototype.enableHardDelete = false; - - /** - * Creates a new DeleteDocumentAction instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentAction - * @static - * @param {google.cloud.contentwarehouse.v1.IDeleteDocumentAction=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.DeleteDocumentAction} DeleteDocumentAction instance - */ - DeleteDocumentAction.create = function create(properties) { - return new DeleteDocumentAction(properties); - }; - - /** - * Encodes the specified DeleteDocumentAction message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DeleteDocumentAction.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentAction - * @static - * @param {google.cloud.contentwarehouse.v1.IDeleteDocumentAction} message DeleteDocumentAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteDocumentAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.enableHardDelete != null && Object.hasOwnProperty.call(message, "enableHardDelete")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableHardDelete); - return writer; - }; - - /** - * Encodes the specified DeleteDocumentAction message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DeleteDocumentAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentAction - * @static - * @param {google.cloud.contentwarehouse.v1.IDeleteDocumentAction} message DeleteDocumentAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteDocumentAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteDocumentAction message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.DeleteDocumentAction} DeleteDocumentAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteDocumentAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.DeleteDocumentAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.enableHardDelete = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteDocumentAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.DeleteDocumentAction} DeleteDocumentAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteDocumentAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteDocumentAction message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteDocumentAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.enableHardDelete != null && message.hasOwnProperty("enableHardDelete")) - if (typeof message.enableHardDelete !== "boolean") - return "enableHardDelete: boolean expected"; - return null; - }; - - /** - * Creates a DeleteDocumentAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentAction - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.DeleteDocumentAction} DeleteDocumentAction - */ - DeleteDocumentAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.DeleteDocumentAction) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.DeleteDocumentAction(); - if (object.enableHardDelete != null) - message.enableHardDelete = Boolean(object.enableHardDelete); - return message; - }; - - /** - * Creates a plain object from a DeleteDocumentAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentAction - * @static - * @param {google.cloud.contentwarehouse.v1.DeleteDocumentAction} message DeleteDocumentAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteDocumentAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.enableHardDelete = false; - if (message.enableHardDelete != null && message.hasOwnProperty("enableHardDelete")) - object.enableHardDelete = message.enableHardDelete; - return object; - }; - - /** - * Converts this DeleteDocumentAction to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentAction - * @instance - * @returns {Object.} JSON object - */ - DeleteDocumentAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteDocumentAction - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.DeleteDocumentAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteDocumentAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.DeleteDocumentAction"; - }; - - return DeleteDocumentAction; - })(); - - v1.RuleEngineOutput = (function() { - - /** - * Properties of a RuleEngineOutput. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IRuleEngineOutput - * @property {string|null} [documentName] RuleEngineOutput documentName - * @property {google.cloud.contentwarehouse.v1.IRuleEvaluatorOutput|null} [ruleEvaluatorOutput] RuleEngineOutput ruleEvaluatorOutput - * @property {google.cloud.contentwarehouse.v1.IActionExecutorOutput|null} [actionExecutorOutput] RuleEngineOutput actionExecutorOutput - */ - - /** - * Constructs a new RuleEngineOutput. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a RuleEngineOutput. - * @implements IRuleEngineOutput - * @constructor - * @param {google.cloud.contentwarehouse.v1.IRuleEngineOutput=} [properties] Properties to set - */ - function RuleEngineOutput(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]]; - } - - /** - * RuleEngineOutput documentName. - * @member {string} documentName - * @memberof google.cloud.contentwarehouse.v1.RuleEngineOutput - * @instance - */ - RuleEngineOutput.prototype.documentName = ""; - - /** - * RuleEngineOutput ruleEvaluatorOutput. - * @member {google.cloud.contentwarehouse.v1.IRuleEvaluatorOutput|null|undefined} ruleEvaluatorOutput - * @memberof google.cloud.contentwarehouse.v1.RuleEngineOutput - * @instance - */ - RuleEngineOutput.prototype.ruleEvaluatorOutput = null; - - /** - * RuleEngineOutput actionExecutorOutput. - * @member {google.cloud.contentwarehouse.v1.IActionExecutorOutput|null|undefined} actionExecutorOutput - * @memberof google.cloud.contentwarehouse.v1.RuleEngineOutput - * @instance - */ - RuleEngineOutput.prototype.actionExecutorOutput = null; - - /** - * Creates a new RuleEngineOutput instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.RuleEngineOutput - * @static - * @param {google.cloud.contentwarehouse.v1.IRuleEngineOutput=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.RuleEngineOutput} RuleEngineOutput instance - */ - RuleEngineOutput.create = function create(properties) { - return new RuleEngineOutput(properties); - }; - - /** - * Encodes the specified RuleEngineOutput message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RuleEngineOutput.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.RuleEngineOutput - * @static - * @param {google.cloud.contentwarehouse.v1.IRuleEngineOutput} message RuleEngineOutput message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RuleEngineOutput.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ruleEvaluatorOutput != null && Object.hasOwnProperty.call(message, "ruleEvaluatorOutput")) - $root.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput.encode(message.ruleEvaluatorOutput, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.actionExecutorOutput != null && Object.hasOwnProperty.call(message, "actionExecutorOutput")) - $root.google.cloud.contentwarehouse.v1.ActionExecutorOutput.encode(message.actionExecutorOutput, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.documentName != null && Object.hasOwnProperty.call(message, "documentName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.documentName); - return writer; - }; - - /** - * Encodes the specified RuleEngineOutput message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RuleEngineOutput.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.RuleEngineOutput - * @static - * @param {google.cloud.contentwarehouse.v1.IRuleEngineOutput} message RuleEngineOutput message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RuleEngineOutput.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RuleEngineOutput message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.RuleEngineOutput - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.RuleEngineOutput} RuleEngineOutput - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RuleEngineOutput.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.RuleEngineOutput(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.documentName = reader.string(); - break; - } - case 1: { - message.ruleEvaluatorOutput = $root.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput.decode(reader, reader.uint32()); - break; - } - case 2: { - message.actionExecutorOutput = $root.google.cloud.contentwarehouse.v1.ActionExecutorOutput.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RuleEngineOutput message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.RuleEngineOutput - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.RuleEngineOutput} RuleEngineOutput - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RuleEngineOutput.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RuleEngineOutput message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.RuleEngineOutput - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RuleEngineOutput.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.documentName != null && message.hasOwnProperty("documentName")) - if (!$util.isString(message.documentName)) - return "documentName: string expected"; - if (message.ruleEvaluatorOutput != null && message.hasOwnProperty("ruleEvaluatorOutput")) { - var error = $root.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput.verify(message.ruleEvaluatorOutput); - if (error) - return "ruleEvaluatorOutput." + error; - } - if (message.actionExecutorOutput != null && message.hasOwnProperty("actionExecutorOutput")) { - var error = $root.google.cloud.contentwarehouse.v1.ActionExecutorOutput.verify(message.actionExecutorOutput); - if (error) - return "actionExecutorOutput." + error; - } - return null; - }; - - /** - * Creates a RuleEngineOutput message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.RuleEngineOutput - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.RuleEngineOutput} RuleEngineOutput - */ - RuleEngineOutput.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.RuleEngineOutput) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.RuleEngineOutput(); - if (object.documentName != null) - message.documentName = String(object.documentName); - if (object.ruleEvaluatorOutput != null) { - if (typeof object.ruleEvaluatorOutput !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.RuleEngineOutput.ruleEvaluatorOutput: object expected"); - message.ruleEvaluatorOutput = $root.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput.fromObject(object.ruleEvaluatorOutput); - } - if (object.actionExecutorOutput != null) { - if (typeof object.actionExecutorOutput !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.RuleEngineOutput.actionExecutorOutput: object expected"); - message.actionExecutorOutput = $root.google.cloud.contentwarehouse.v1.ActionExecutorOutput.fromObject(object.actionExecutorOutput); - } - return message; - }; - - /** - * Creates a plain object from a RuleEngineOutput message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.RuleEngineOutput - * @static - * @param {google.cloud.contentwarehouse.v1.RuleEngineOutput} message RuleEngineOutput - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RuleEngineOutput.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.ruleEvaluatorOutput = null; - object.actionExecutorOutput = null; - object.documentName = ""; - } - if (message.ruleEvaluatorOutput != null && message.hasOwnProperty("ruleEvaluatorOutput")) - object.ruleEvaluatorOutput = $root.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput.toObject(message.ruleEvaluatorOutput, options); - if (message.actionExecutorOutput != null && message.hasOwnProperty("actionExecutorOutput")) - object.actionExecutorOutput = $root.google.cloud.contentwarehouse.v1.ActionExecutorOutput.toObject(message.actionExecutorOutput, options); - if (message.documentName != null && message.hasOwnProperty("documentName")) - object.documentName = message.documentName; - return object; - }; - - /** - * Converts this RuleEngineOutput to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.RuleEngineOutput - * @instance - * @returns {Object.} JSON object - */ - RuleEngineOutput.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RuleEngineOutput - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.RuleEngineOutput - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RuleEngineOutput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.RuleEngineOutput"; - }; - - return RuleEngineOutput; - })(); - - v1.RuleEvaluatorOutput = (function() { - - /** - * Properties of a RuleEvaluatorOutput. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IRuleEvaluatorOutput - * @property {Array.|null} [triggeredRules] RuleEvaluatorOutput triggeredRules - * @property {Array.|null} [matchedRules] RuleEvaluatorOutput matchedRules - * @property {Array.|null} [invalidRules] RuleEvaluatorOutput invalidRules - */ - - /** - * Constructs a new RuleEvaluatorOutput. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a RuleEvaluatorOutput. - * @implements IRuleEvaluatorOutput - * @constructor - * @param {google.cloud.contentwarehouse.v1.IRuleEvaluatorOutput=} [properties] Properties to set - */ - function RuleEvaluatorOutput(properties) { - this.triggeredRules = []; - this.matchedRules = []; - this.invalidRules = []; - 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]]; - } - - /** - * RuleEvaluatorOutput triggeredRules. - * @member {Array.} triggeredRules - * @memberof google.cloud.contentwarehouse.v1.RuleEvaluatorOutput - * @instance - */ - RuleEvaluatorOutput.prototype.triggeredRules = $util.emptyArray; - - /** - * RuleEvaluatorOutput matchedRules. - * @member {Array.} matchedRules - * @memberof google.cloud.contentwarehouse.v1.RuleEvaluatorOutput - * @instance - */ - RuleEvaluatorOutput.prototype.matchedRules = $util.emptyArray; - - /** - * RuleEvaluatorOutput invalidRules. - * @member {Array.} invalidRules - * @memberof google.cloud.contentwarehouse.v1.RuleEvaluatorOutput - * @instance - */ - RuleEvaluatorOutput.prototype.invalidRules = $util.emptyArray; - - /** - * Creates a new RuleEvaluatorOutput instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.RuleEvaluatorOutput - * @static - * @param {google.cloud.contentwarehouse.v1.IRuleEvaluatorOutput=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.RuleEvaluatorOutput} RuleEvaluatorOutput instance - */ - RuleEvaluatorOutput.create = function create(properties) { - return new RuleEvaluatorOutput(properties); - }; - - /** - * Encodes the specified RuleEvaluatorOutput message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RuleEvaluatorOutput.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.RuleEvaluatorOutput - * @static - * @param {google.cloud.contentwarehouse.v1.IRuleEvaluatorOutput} message RuleEvaluatorOutput message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RuleEvaluatorOutput.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.triggeredRules != null && message.triggeredRules.length) - for (var i = 0; i < message.triggeredRules.length; ++i) - $root.google.cloud.contentwarehouse.v1.Rule.encode(message.triggeredRules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.matchedRules != null && message.matchedRules.length) - for (var i = 0; i < message.matchedRules.length; ++i) - $root.google.cloud.contentwarehouse.v1.Rule.encode(message.matchedRules[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.invalidRules != null && message.invalidRules.length) - for (var i = 0; i < message.invalidRules.length; ++i) - $root.google.cloud.contentwarehouse.v1.InvalidRule.encode(message.invalidRules[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RuleEvaluatorOutput message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RuleEvaluatorOutput.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.RuleEvaluatorOutput - * @static - * @param {google.cloud.contentwarehouse.v1.IRuleEvaluatorOutput} message RuleEvaluatorOutput message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RuleEvaluatorOutput.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RuleEvaluatorOutput message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.RuleEvaluatorOutput - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.RuleEvaluatorOutput} RuleEvaluatorOutput - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RuleEvaluatorOutput.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.triggeredRules && message.triggeredRules.length)) - message.triggeredRules = []; - message.triggeredRules.push($root.google.cloud.contentwarehouse.v1.Rule.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.matchedRules && message.matchedRules.length)) - message.matchedRules = []; - message.matchedRules.push($root.google.cloud.contentwarehouse.v1.Rule.decode(reader, reader.uint32())); - break; - } - case 3: { - if (!(message.invalidRules && message.invalidRules.length)) - message.invalidRules = []; - message.invalidRules.push($root.google.cloud.contentwarehouse.v1.InvalidRule.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RuleEvaluatorOutput message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.RuleEvaluatorOutput - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.RuleEvaluatorOutput} RuleEvaluatorOutput - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RuleEvaluatorOutput.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RuleEvaluatorOutput message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.RuleEvaluatorOutput - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RuleEvaluatorOutput.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.triggeredRules != null && message.hasOwnProperty("triggeredRules")) { - if (!Array.isArray(message.triggeredRules)) - return "triggeredRules: array expected"; - for (var i = 0; i < message.triggeredRules.length; ++i) { - var error = $root.google.cloud.contentwarehouse.v1.Rule.verify(message.triggeredRules[i]); - if (error) - return "triggeredRules." + error; - } - } - if (message.matchedRules != null && message.hasOwnProperty("matchedRules")) { - if (!Array.isArray(message.matchedRules)) - return "matchedRules: array expected"; - for (var i = 0; i < message.matchedRules.length; ++i) { - var error = $root.google.cloud.contentwarehouse.v1.Rule.verify(message.matchedRules[i]); - if (error) - return "matchedRules." + error; - } - } - if (message.invalidRules != null && message.hasOwnProperty("invalidRules")) { - if (!Array.isArray(message.invalidRules)) - return "invalidRules: array expected"; - for (var i = 0; i < message.invalidRules.length; ++i) { - var error = $root.google.cloud.contentwarehouse.v1.InvalidRule.verify(message.invalidRules[i]); - if (error) - return "invalidRules." + error; - } - } - return null; - }; - - /** - * Creates a RuleEvaluatorOutput message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.RuleEvaluatorOutput - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.RuleEvaluatorOutput} RuleEvaluatorOutput - */ - RuleEvaluatorOutput.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.RuleEvaluatorOutput(); - if (object.triggeredRules) { - if (!Array.isArray(object.triggeredRules)) - throw TypeError(".google.cloud.contentwarehouse.v1.RuleEvaluatorOutput.triggeredRules: array expected"); - message.triggeredRules = []; - for (var i = 0; i < object.triggeredRules.length; ++i) { - if (typeof object.triggeredRules[i] !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.RuleEvaluatorOutput.triggeredRules: object expected"); - message.triggeredRules[i] = $root.google.cloud.contentwarehouse.v1.Rule.fromObject(object.triggeredRules[i]); - } - } - if (object.matchedRules) { - if (!Array.isArray(object.matchedRules)) - throw TypeError(".google.cloud.contentwarehouse.v1.RuleEvaluatorOutput.matchedRules: array expected"); - message.matchedRules = []; - for (var i = 0; i < object.matchedRules.length; ++i) { - if (typeof object.matchedRules[i] !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.RuleEvaluatorOutput.matchedRules: object expected"); - message.matchedRules[i] = $root.google.cloud.contentwarehouse.v1.Rule.fromObject(object.matchedRules[i]); - } - } - if (object.invalidRules) { - if (!Array.isArray(object.invalidRules)) - throw TypeError(".google.cloud.contentwarehouse.v1.RuleEvaluatorOutput.invalidRules: array expected"); - message.invalidRules = []; - for (var i = 0; i < object.invalidRules.length; ++i) { - if (typeof object.invalidRules[i] !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.RuleEvaluatorOutput.invalidRules: object expected"); - message.invalidRules[i] = $root.google.cloud.contentwarehouse.v1.InvalidRule.fromObject(object.invalidRules[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a RuleEvaluatorOutput message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.RuleEvaluatorOutput - * @static - * @param {google.cloud.contentwarehouse.v1.RuleEvaluatorOutput} message RuleEvaluatorOutput - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RuleEvaluatorOutput.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.triggeredRules = []; - object.matchedRules = []; - object.invalidRules = []; - } - if (message.triggeredRules && message.triggeredRules.length) { - object.triggeredRules = []; - for (var j = 0; j < message.triggeredRules.length; ++j) - object.triggeredRules[j] = $root.google.cloud.contentwarehouse.v1.Rule.toObject(message.triggeredRules[j], options); - } - if (message.matchedRules && message.matchedRules.length) { - object.matchedRules = []; - for (var j = 0; j < message.matchedRules.length; ++j) - object.matchedRules[j] = $root.google.cloud.contentwarehouse.v1.Rule.toObject(message.matchedRules[j], options); - } - if (message.invalidRules && message.invalidRules.length) { - object.invalidRules = []; - for (var j = 0; j < message.invalidRules.length; ++j) - object.invalidRules[j] = $root.google.cloud.contentwarehouse.v1.InvalidRule.toObject(message.invalidRules[j], options); - } - return object; - }; - - /** - * Converts this RuleEvaluatorOutput to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.RuleEvaluatorOutput - * @instance - * @returns {Object.} JSON object - */ - RuleEvaluatorOutput.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RuleEvaluatorOutput - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.RuleEvaluatorOutput - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RuleEvaluatorOutput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.RuleEvaluatorOutput"; - }; - - return RuleEvaluatorOutput; - })(); - - v1.InvalidRule = (function() { - - /** - * Properties of an InvalidRule. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IInvalidRule - * @property {google.cloud.contentwarehouse.v1.IRule|null} [rule] InvalidRule rule - * @property {string|null} [error] InvalidRule error - */ - - /** - * Constructs a new InvalidRule. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents an InvalidRule. - * @implements IInvalidRule - * @constructor - * @param {google.cloud.contentwarehouse.v1.IInvalidRule=} [properties] Properties to set - */ - function InvalidRule(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]]; - } - - /** - * InvalidRule rule. - * @member {google.cloud.contentwarehouse.v1.IRule|null|undefined} rule - * @memberof google.cloud.contentwarehouse.v1.InvalidRule - * @instance - */ - InvalidRule.prototype.rule = null; - - /** - * InvalidRule error. - * @member {string} error - * @memberof google.cloud.contentwarehouse.v1.InvalidRule - * @instance - */ - InvalidRule.prototype.error = ""; - - /** - * Creates a new InvalidRule instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.InvalidRule - * @static - * @param {google.cloud.contentwarehouse.v1.IInvalidRule=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.InvalidRule} InvalidRule instance - */ - InvalidRule.create = function create(properties) { - return new InvalidRule(properties); - }; - - /** - * Encodes the specified InvalidRule message. Does not implicitly {@link google.cloud.contentwarehouse.v1.InvalidRule.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.InvalidRule - * @static - * @param {google.cloud.contentwarehouse.v1.IInvalidRule} message InvalidRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InvalidRule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.rule != null && Object.hasOwnProperty.call(message, "rule")) - $root.google.cloud.contentwarehouse.v1.Rule.encode(message.rule, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.error != null && Object.hasOwnProperty.call(message, "error")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.error); - return writer; - }; - - /** - * Encodes the specified InvalidRule message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.InvalidRule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.InvalidRule - * @static - * @param {google.cloud.contentwarehouse.v1.IInvalidRule} message InvalidRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InvalidRule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InvalidRule message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.InvalidRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.InvalidRule} InvalidRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InvalidRule.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.InvalidRule(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.rule = $root.google.cloud.contentwarehouse.v1.Rule.decode(reader, reader.uint32()); - break; - } - case 2: { - message.error = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InvalidRule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.InvalidRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.InvalidRule} InvalidRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InvalidRule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InvalidRule message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.InvalidRule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InvalidRule.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.rule != null && message.hasOwnProperty("rule")) { - var error = $root.google.cloud.contentwarehouse.v1.Rule.verify(message.rule); - if (error) - return "rule." + error; - } - if (message.error != null && message.hasOwnProperty("error")) - if (!$util.isString(message.error)) - return "error: string expected"; - return null; - }; - - /** - * Creates an InvalidRule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.InvalidRule - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.InvalidRule} InvalidRule - */ - InvalidRule.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.InvalidRule) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.InvalidRule(); - if (object.rule != null) { - if (typeof object.rule !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.InvalidRule.rule: object expected"); - message.rule = $root.google.cloud.contentwarehouse.v1.Rule.fromObject(object.rule); - } - if (object.error != null) - message.error = String(object.error); - return message; - }; - - /** - * Creates a plain object from an InvalidRule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.InvalidRule - * @static - * @param {google.cloud.contentwarehouse.v1.InvalidRule} message InvalidRule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InvalidRule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.rule = null; - object.error = ""; - } - if (message.rule != null && message.hasOwnProperty("rule")) - object.rule = $root.google.cloud.contentwarehouse.v1.Rule.toObject(message.rule, options); - if (message.error != null && message.hasOwnProperty("error")) - object.error = message.error; - return object; - }; - - /** - * Converts this InvalidRule to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.InvalidRule - * @instance - * @returns {Object.} JSON object - */ - InvalidRule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InvalidRule - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.InvalidRule - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InvalidRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.InvalidRule"; - }; - - return InvalidRule; - })(); - - v1.ActionExecutorOutput = (function() { - - /** - * Properties of an ActionExecutorOutput. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IActionExecutorOutput - * @property {Array.|null} [ruleActionsPairs] ActionExecutorOutput ruleActionsPairs - */ - - /** - * Constructs a new ActionExecutorOutput. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents an ActionExecutorOutput. - * @implements IActionExecutorOutput - * @constructor - * @param {google.cloud.contentwarehouse.v1.IActionExecutorOutput=} [properties] Properties to set - */ - function ActionExecutorOutput(properties) { - this.ruleActionsPairs = []; - 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]]; - } - - /** - * ActionExecutorOutput ruleActionsPairs. - * @member {Array.} ruleActionsPairs - * @memberof google.cloud.contentwarehouse.v1.ActionExecutorOutput - * @instance - */ - ActionExecutorOutput.prototype.ruleActionsPairs = $util.emptyArray; - - /** - * Creates a new ActionExecutorOutput instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.ActionExecutorOutput - * @static - * @param {google.cloud.contentwarehouse.v1.IActionExecutorOutput=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.ActionExecutorOutput} ActionExecutorOutput instance - */ - ActionExecutorOutput.create = function create(properties) { - return new ActionExecutorOutput(properties); - }; - - /** - * Encodes the specified ActionExecutorOutput message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ActionExecutorOutput.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.ActionExecutorOutput - * @static - * @param {google.cloud.contentwarehouse.v1.IActionExecutorOutput} message ActionExecutorOutput message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ActionExecutorOutput.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ruleActionsPairs != null && message.ruleActionsPairs.length) - for (var i = 0; i < message.ruleActionsPairs.length; ++i) - $root.google.cloud.contentwarehouse.v1.RuleActionsPair.encode(message.ruleActionsPairs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ActionExecutorOutput message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ActionExecutorOutput.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.ActionExecutorOutput - * @static - * @param {google.cloud.contentwarehouse.v1.IActionExecutorOutput} message ActionExecutorOutput message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ActionExecutorOutput.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ActionExecutorOutput message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.ActionExecutorOutput - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.ActionExecutorOutput} ActionExecutorOutput - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ActionExecutorOutput.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.ActionExecutorOutput(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.ruleActionsPairs && message.ruleActionsPairs.length)) - message.ruleActionsPairs = []; - message.ruleActionsPairs.push($root.google.cloud.contentwarehouse.v1.RuleActionsPair.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ActionExecutorOutput message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.ActionExecutorOutput - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.ActionExecutorOutput} ActionExecutorOutput - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ActionExecutorOutput.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ActionExecutorOutput message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.ActionExecutorOutput - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ActionExecutorOutput.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ruleActionsPairs != null && message.hasOwnProperty("ruleActionsPairs")) { - if (!Array.isArray(message.ruleActionsPairs)) - return "ruleActionsPairs: array expected"; - for (var i = 0; i < message.ruleActionsPairs.length; ++i) { - var error = $root.google.cloud.contentwarehouse.v1.RuleActionsPair.verify(message.ruleActionsPairs[i]); - if (error) - return "ruleActionsPairs." + error; - } - } - return null; - }; - - /** - * Creates an ActionExecutorOutput message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.ActionExecutorOutput - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.ActionExecutorOutput} ActionExecutorOutput - */ - ActionExecutorOutput.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.ActionExecutorOutput) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.ActionExecutorOutput(); - if (object.ruleActionsPairs) { - if (!Array.isArray(object.ruleActionsPairs)) - throw TypeError(".google.cloud.contentwarehouse.v1.ActionExecutorOutput.ruleActionsPairs: array expected"); - message.ruleActionsPairs = []; - for (var i = 0; i < object.ruleActionsPairs.length; ++i) { - if (typeof object.ruleActionsPairs[i] !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.ActionExecutorOutput.ruleActionsPairs: object expected"); - message.ruleActionsPairs[i] = $root.google.cloud.contentwarehouse.v1.RuleActionsPair.fromObject(object.ruleActionsPairs[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an ActionExecutorOutput message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.ActionExecutorOutput - * @static - * @param {google.cloud.contentwarehouse.v1.ActionExecutorOutput} message ActionExecutorOutput - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ActionExecutorOutput.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.ruleActionsPairs = []; - if (message.ruleActionsPairs && message.ruleActionsPairs.length) { - object.ruleActionsPairs = []; - for (var j = 0; j < message.ruleActionsPairs.length; ++j) - object.ruleActionsPairs[j] = $root.google.cloud.contentwarehouse.v1.RuleActionsPair.toObject(message.ruleActionsPairs[j], options); - } - return object; - }; - - /** - * Converts this ActionExecutorOutput to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.ActionExecutorOutput - * @instance - * @returns {Object.} JSON object - */ - ActionExecutorOutput.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ActionExecutorOutput - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.ActionExecutorOutput - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ActionExecutorOutput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.ActionExecutorOutput"; - }; - - return ActionExecutorOutput; - })(); - - v1.RuleActionsPair = (function() { - - /** - * Properties of a RuleActionsPair. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IRuleActionsPair - * @property {google.cloud.contentwarehouse.v1.IRule|null} [rule] RuleActionsPair rule - * @property {Array.|null} [actionOutputs] RuleActionsPair actionOutputs - */ - - /** - * Constructs a new RuleActionsPair. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a RuleActionsPair. - * @implements IRuleActionsPair - * @constructor - * @param {google.cloud.contentwarehouse.v1.IRuleActionsPair=} [properties] Properties to set - */ - function RuleActionsPair(properties) { - this.actionOutputs = []; - 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]]; - } - - /** - * RuleActionsPair rule. - * @member {google.cloud.contentwarehouse.v1.IRule|null|undefined} rule - * @memberof google.cloud.contentwarehouse.v1.RuleActionsPair - * @instance - */ - RuleActionsPair.prototype.rule = null; - - /** - * RuleActionsPair actionOutputs. - * @member {Array.} actionOutputs - * @memberof google.cloud.contentwarehouse.v1.RuleActionsPair - * @instance - */ - RuleActionsPair.prototype.actionOutputs = $util.emptyArray; - - /** - * Creates a new RuleActionsPair instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.RuleActionsPair - * @static - * @param {google.cloud.contentwarehouse.v1.IRuleActionsPair=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.RuleActionsPair} RuleActionsPair instance - */ - RuleActionsPair.create = function create(properties) { - return new RuleActionsPair(properties); - }; - - /** - * Encodes the specified RuleActionsPair message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RuleActionsPair.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.RuleActionsPair - * @static - * @param {google.cloud.contentwarehouse.v1.IRuleActionsPair} message RuleActionsPair message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RuleActionsPair.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.rule != null && Object.hasOwnProperty.call(message, "rule")) - $root.google.cloud.contentwarehouse.v1.Rule.encode(message.rule, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.actionOutputs != null && message.actionOutputs.length) - for (var i = 0; i < message.actionOutputs.length; ++i) - $root.google.cloud.contentwarehouse.v1.ActionOutput.encode(message.actionOutputs[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RuleActionsPair message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RuleActionsPair.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.RuleActionsPair - * @static - * @param {google.cloud.contentwarehouse.v1.IRuleActionsPair} message RuleActionsPair message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RuleActionsPair.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RuleActionsPair message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.RuleActionsPair - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.RuleActionsPair} RuleActionsPair - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RuleActionsPair.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.RuleActionsPair(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.rule = $root.google.cloud.contentwarehouse.v1.Rule.decode(reader, reader.uint32()); - break; - } - case 2: { - if (!(message.actionOutputs && message.actionOutputs.length)) - message.actionOutputs = []; - message.actionOutputs.push($root.google.cloud.contentwarehouse.v1.ActionOutput.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RuleActionsPair message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.RuleActionsPair - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.RuleActionsPair} RuleActionsPair - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RuleActionsPair.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RuleActionsPair message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.RuleActionsPair - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RuleActionsPair.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.rule != null && message.hasOwnProperty("rule")) { - var error = $root.google.cloud.contentwarehouse.v1.Rule.verify(message.rule); - if (error) - return "rule." + error; - } - if (message.actionOutputs != null && message.hasOwnProperty("actionOutputs")) { - if (!Array.isArray(message.actionOutputs)) - return "actionOutputs: array expected"; - for (var i = 0; i < message.actionOutputs.length; ++i) { - var error = $root.google.cloud.contentwarehouse.v1.ActionOutput.verify(message.actionOutputs[i]); - if (error) - return "actionOutputs." + error; - } - } - return null; - }; - - /** - * Creates a RuleActionsPair message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.RuleActionsPair - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.RuleActionsPair} RuleActionsPair - */ - RuleActionsPair.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.RuleActionsPair) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.RuleActionsPair(); - if (object.rule != null) { - if (typeof object.rule !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.RuleActionsPair.rule: object expected"); - message.rule = $root.google.cloud.contentwarehouse.v1.Rule.fromObject(object.rule); - } - if (object.actionOutputs) { - if (!Array.isArray(object.actionOutputs)) - throw TypeError(".google.cloud.contentwarehouse.v1.RuleActionsPair.actionOutputs: array expected"); - message.actionOutputs = []; - for (var i = 0; i < object.actionOutputs.length; ++i) { - if (typeof object.actionOutputs[i] !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.RuleActionsPair.actionOutputs: object expected"); - message.actionOutputs[i] = $root.google.cloud.contentwarehouse.v1.ActionOutput.fromObject(object.actionOutputs[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a RuleActionsPair message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.RuleActionsPair - * @static - * @param {google.cloud.contentwarehouse.v1.RuleActionsPair} message RuleActionsPair - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RuleActionsPair.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.actionOutputs = []; - if (options.defaults) - object.rule = null; - if (message.rule != null && message.hasOwnProperty("rule")) - object.rule = $root.google.cloud.contentwarehouse.v1.Rule.toObject(message.rule, options); - if (message.actionOutputs && message.actionOutputs.length) { - object.actionOutputs = []; - for (var j = 0; j < message.actionOutputs.length; ++j) - object.actionOutputs[j] = $root.google.cloud.contentwarehouse.v1.ActionOutput.toObject(message.actionOutputs[j], options); - } - return object; - }; - - /** - * Converts this RuleActionsPair to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.RuleActionsPair - * @instance - * @returns {Object.} JSON object - */ - RuleActionsPair.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RuleActionsPair - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.RuleActionsPair - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RuleActionsPair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.RuleActionsPair"; - }; - - return RuleActionsPair; - })(); - - v1.ActionOutput = (function() { - - /** - * Properties of an ActionOutput. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IActionOutput - * @property {string|null} [actionId] ActionOutput actionId - * @property {google.cloud.contentwarehouse.v1.ActionOutput.State|null} [actionState] ActionOutput actionState - * @property {string|null} [outputMessage] ActionOutput outputMessage - */ - - /** - * Constructs a new ActionOutput. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents an ActionOutput. - * @implements IActionOutput - * @constructor - * @param {google.cloud.contentwarehouse.v1.IActionOutput=} [properties] Properties to set - */ - function ActionOutput(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]]; - } - - /** - * ActionOutput actionId. - * @member {string} actionId - * @memberof google.cloud.contentwarehouse.v1.ActionOutput - * @instance - */ - ActionOutput.prototype.actionId = ""; - - /** - * ActionOutput actionState. - * @member {google.cloud.contentwarehouse.v1.ActionOutput.State} actionState - * @memberof google.cloud.contentwarehouse.v1.ActionOutput - * @instance - */ - ActionOutput.prototype.actionState = 0; - - /** - * ActionOutput outputMessage. - * @member {string} outputMessage - * @memberof google.cloud.contentwarehouse.v1.ActionOutput - * @instance - */ - ActionOutput.prototype.outputMessage = ""; - - /** - * Creates a new ActionOutput instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.ActionOutput - * @static - * @param {google.cloud.contentwarehouse.v1.IActionOutput=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.ActionOutput} ActionOutput instance - */ - ActionOutput.create = function create(properties) { - return new ActionOutput(properties); - }; - - /** - * Encodes the specified ActionOutput message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ActionOutput.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.ActionOutput - * @static - * @param {google.cloud.contentwarehouse.v1.IActionOutput} message ActionOutput message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ActionOutput.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.actionId != null && Object.hasOwnProperty.call(message, "actionId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.actionId); - if (message.actionState != null && Object.hasOwnProperty.call(message, "actionState")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.actionState); - if (message.outputMessage != null && Object.hasOwnProperty.call(message, "outputMessage")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputMessage); - return writer; - }; - - /** - * Encodes the specified ActionOutput message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ActionOutput.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.ActionOutput - * @static - * @param {google.cloud.contentwarehouse.v1.IActionOutput} message ActionOutput message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ActionOutput.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ActionOutput message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.ActionOutput - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.ActionOutput} ActionOutput - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ActionOutput.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.ActionOutput(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.actionId = reader.string(); - break; - } - case 2: { - message.actionState = reader.int32(); - break; - } - case 3: { - message.outputMessage = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ActionOutput message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.ActionOutput - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.ActionOutput} ActionOutput - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ActionOutput.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ActionOutput message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.ActionOutput - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ActionOutput.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.actionId != null && message.hasOwnProperty("actionId")) - if (!$util.isString(message.actionId)) - return "actionId: string expected"; - if (message.actionState != null && message.hasOwnProperty("actionState")) - switch (message.actionState) { - default: - return "actionState: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.outputMessage != null && message.hasOwnProperty("outputMessage")) - if (!$util.isString(message.outputMessage)) - return "outputMessage: string expected"; - return null; - }; - - /** - * Creates an ActionOutput message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.ActionOutput - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.ActionOutput} ActionOutput - */ - ActionOutput.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.ActionOutput) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.ActionOutput(); - if (object.actionId != null) - message.actionId = String(object.actionId); - switch (object.actionState) { - default: - if (typeof object.actionState === "number") { - message.actionState = object.actionState; - break; - } - break; - case "UNKNOWN": - case 0: - message.actionState = 0; - break; - case "ACTION_SUCCEEDED": - case 1: - message.actionState = 1; - break; - case "ACTION_FAILED": - case 2: - message.actionState = 2; - break; - case "ACTION_TIMED_OUT": - case 3: - message.actionState = 3; - break; - case "ACTION_PENDING": - case 4: - message.actionState = 4; - break; - } - if (object.outputMessage != null) - message.outputMessage = String(object.outputMessage); - return message; - }; - - /** - * Creates a plain object from an ActionOutput message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.ActionOutput - * @static - * @param {google.cloud.contentwarehouse.v1.ActionOutput} message ActionOutput - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ActionOutput.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.actionId = ""; - object.actionState = options.enums === String ? "UNKNOWN" : 0; - object.outputMessage = ""; - } - if (message.actionId != null && message.hasOwnProperty("actionId")) - object.actionId = message.actionId; - if (message.actionState != null && message.hasOwnProperty("actionState")) - object.actionState = options.enums === String ? $root.google.cloud.contentwarehouse.v1.ActionOutput.State[message.actionState] === undefined ? message.actionState : $root.google.cloud.contentwarehouse.v1.ActionOutput.State[message.actionState] : message.actionState; - if (message.outputMessage != null && message.hasOwnProperty("outputMessage")) - object.outputMessage = message.outputMessage; - return object; - }; - - /** - * Converts this ActionOutput to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.ActionOutput - * @instance - * @returns {Object.} JSON object - */ - ActionOutput.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ActionOutput - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.ActionOutput - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ActionOutput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.ActionOutput"; - }; - - /** - * State enum. - * @name google.cloud.contentwarehouse.v1.ActionOutput.State - * @enum {number} - * @property {number} UNKNOWN=0 UNKNOWN value - * @property {number} ACTION_SUCCEEDED=1 ACTION_SUCCEEDED value - * @property {number} ACTION_FAILED=2 ACTION_FAILED value - * @property {number} ACTION_TIMED_OUT=3 ACTION_TIMED_OUT value - * @property {number} ACTION_PENDING=4 ACTION_PENDING value - */ - ActionOutput.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UNKNOWN"] = 0; - values[valuesById[1] = "ACTION_SUCCEEDED"] = 1; - values[valuesById[2] = "ACTION_FAILED"] = 2; - values[valuesById[3] = "ACTION_TIMED_OUT"] = 3; - values[valuesById[4] = "ACTION_PENDING"] = 4; - return values; - })(); - - return ActionOutput; - })(); - - v1.PipelineService = (function() { - - /** - * Constructs a new PipelineService service. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a PipelineService - * @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 PipelineService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (PipelineService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = PipelineService; - - /** - * Creates new PipelineService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.contentwarehouse.v1.PipelineService - * @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 {PipelineService} RPC service. Useful where requests and/or responses are streamed. - */ - PipelineService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.PipelineService|runPipeline}. - * @memberof google.cloud.contentwarehouse.v1.PipelineService - * @typedef RunPipelineCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls RunPipeline. - * @function runPipeline - * @memberof google.cloud.contentwarehouse.v1.PipelineService - * @instance - * @param {google.cloud.contentwarehouse.v1.IRunPipelineRequest} request RunPipelineRequest message or plain object - * @param {google.cloud.contentwarehouse.v1.PipelineService.RunPipelineCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(PipelineService.prototype.runPipeline = function runPipeline(request, callback) { - return this.rpcCall(runPipeline, $root.google.cloud.contentwarehouse.v1.RunPipelineRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "RunPipeline" }); - - /** - * Calls RunPipeline. - * @function runPipeline - * @memberof google.cloud.contentwarehouse.v1.PipelineService - * @instance - * @param {google.cloud.contentwarehouse.v1.IRunPipelineRequest} request RunPipelineRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return PipelineService; - })(); - - v1.RunPipelineRequest = (function() { - - /** - * Properties of a RunPipelineRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IRunPipelineRequest - * @property {string|null} [name] RunPipelineRequest name - * @property {google.cloud.contentwarehouse.v1.IGcsIngestPipeline|null} [gcsIngestPipeline] RunPipelineRequest gcsIngestPipeline - * @property {google.cloud.contentwarehouse.v1.IGcsIngestWithDocAiProcessorsPipeline|null} [gcsIngestWithDocAiProcessorsPipeline] RunPipelineRequest gcsIngestWithDocAiProcessorsPipeline - * @property {google.cloud.contentwarehouse.v1.IExportToCdwPipeline|null} [exportCdwPipeline] RunPipelineRequest exportCdwPipeline - * @property {google.cloud.contentwarehouse.v1.IProcessWithDocAiPipeline|null} [processWithDocAiPipeline] RunPipelineRequest processWithDocAiPipeline - * @property {google.cloud.contentwarehouse.v1.IRequestMetadata|null} [requestMetadata] RunPipelineRequest requestMetadata - */ - - /** - * Constructs a new RunPipelineRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a RunPipelineRequest. - * @implements IRunPipelineRequest - * @constructor - * @param {google.cloud.contentwarehouse.v1.IRunPipelineRequest=} [properties] Properties to set - */ - function RunPipelineRequest(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]]; - } - - /** - * RunPipelineRequest name. - * @member {string} name - * @memberof google.cloud.contentwarehouse.v1.RunPipelineRequest - * @instance - */ - RunPipelineRequest.prototype.name = ""; - - /** - * RunPipelineRequest gcsIngestPipeline. - * @member {google.cloud.contentwarehouse.v1.IGcsIngestPipeline|null|undefined} gcsIngestPipeline - * @memberof google.cloud.contentwarehouse.v1.RunPipelineRequest - * @instance - */ - RunPipelineRequest.prototype.gcsIngestPipeline = null; - - /** - * RunPipelineRequest gcsIngestWithDocAiProcessorsPipeline. - * @member {google.cloud.contentwarehouse.v1.IGcsIngestWithDocAiProcessorsPipeline|null|undefined} gcsIngestWithDocAiProcessorsPipeline - * @memberof google.cloud.contentwarehouse.v1.RunPipelineRequest - * @instance - */ - RunPipelineRequest.prototype.gcsIngestWithDocAiProcessorsPipeline = null; - - /** - * RunPipelineRequest exportCdwPipeline. - * @member {google.cloud.contentwarehouse.v1.IExportToCdwPipeline|null|undefined} exportCdwPipeline - * @memberof google.cloud.contentwarehouse.v1.RunPipelineRequest - * @instance - */ - RunPipelineRequest.prototype.exportCdwPipeline = null; - - /** - * RunPipelineRequest processWithDocAiPipeline. - * @member {google.cloud.contentwarehouse.v1.IProcessWithDocAiPipeline|null|undefined} processWithDocAiPipeline - * @memberof google.cloud.contentwarehouse.v1.RunPipelineRequest - * @instance - */ - RunPipelineRequest.prototype.processWithDocAiPipeline = null; - - /** - * RunPipelineRequest requestMetadata. - * @member {google.cloud.contentwarehouse.v1.IRequestMetadata|null|undefined} requestMetadata - * @memberof google.cloud.contentwarehouse.v1.RunPipelineRequest - * @instance - */ - RunPipelineRequest.prototype.requestMetadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * RunPipelineRequest pipeline. - * @member {"gcsIngestPipeline"|"gcsIngestWithDocAiProcessorsPipeline"|"exportCdwPipeline"|"processWithDocAiPipeline"|undefined} pipeline - * @memberof google.cloud.contentwarehouse.v1.RunPipelineRequest - * @instance - */ - Object.defineProperty(RunPipelineRequest.prototype, "pipeline", { - get: $util.oneOfGetter($oneOfFields = ["gcsIngestPipeline", "gcsIngestWithDocAiProcessorsPipeline", "exportCdwPipeline", "processWithDocAiPipeline"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new RunPipelineRequest instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.RunPipelineRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IRunPipelineRequest=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.RunPipelineRequest} RunPipelineRequest instance - */ - RunPipelineRequest.create = function create(properties) { - return new RunPipelineRequest(properties); - }; - - /** - * Encodes the specified RunPipelineRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.RunPipelineRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IRunPipelineRequest} message RunPipelineRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RunPipelineRequest.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.gcsIngestPipeline != null && Object.hasOwnProperty.call(message, "gcsIngestPipeline")) - $root.google.cloud.contentwarehouse.v1.GcsIngestPipeline.encode(message.gcsIngestPipeline, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.gcsIngestWithDocAiProcessorsPipeline != null && Object.hasOwnProperty.call(message, "gcsIngestWithDocAiProcessorsPipeline")) - $root.google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline.encode(message.gcsIngestWithDocAiProcessorsPipeline, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.exportCdwPipeline != null && Object.hasOwnProperty.call(message, "exportCdwPipeline")) - $root.google.cloud.contentwarehouse.v1.ExportToCdwPipeline.encode(message.exportCdwPipeline, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.processWithDocAiPipeline != null && Object.hasOwnProperty.call(message, "processWithDocAiPipeline")) - $root.google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline.encode(message.processWithDocAiPipeline, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.requestMetadata != null && Object.hasOwnProperty.call(message, "requestMetadata")) - $root.google.cloud.contentwarehouse.v1.RequestMetadata.encode(message.requestMetadata, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RunPipelineRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.RunPipelineRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IRunPipelineRequest} message RunPipelineRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RunPipelineRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RunPipelineRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.RunPipelineRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.RunPipelineRequest} RunPipelineRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RunPipelineRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.RunPipelineRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.gcsIngestPipeline = $root.google.cloud.contentwarehouse.v1.GcsIngestPipeline.decode(reader, reader.uint32()); - break; - } - case 3: { - message.gcsIngestWithDocAiProcessorsPipeline = $root.google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline.decode(reader, reader.uint32()); - break; - } - case 4: { - message.exportCdwPipeline = $root.google.cloud.contentwarehouse.v1.ExportToCdwPipeline.decode(reader, reader.uint32()); - break; - } - case 5: { - message.processWithDocAiPipeline = $root.google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline.decode(reader, reader.uint32()); - break; - } - case 6: { - message.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RunPipelineRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.RunPipelineRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.RunPipelineRequest} RunPipelineRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RunPipelineRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RunPipelineRequest message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.RunPipelineRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RunPipelineRequest.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.gcsIngestPipeline != null && message.hasOwnProperty("gcsIngestPipeline")) { - properties.pipeline = 1; - { - var error = $root.google.cloud.contentwarehouse.v1.GcsIngestPipeline.verify(message.gcsIngestPipeline); - if (error) - return "gcsIngestPipeline." + error; - } - } - if (message.gcsIngestWithDocAiProcessorsPipeline != null && message.hasOwnProperty("gcsIngestWithDocAiProcessorsPipeline")) { - if (properties.pipeline === 1) - return "pipeline: multiple values"; - properties.pipeline = 1; - { - var error = $root.google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline.verify(message.gcsIngestWithDocAiProcessorsPipeline); - if (error) - return "gcsIngestWithDocAiProcessorsPipeline." + error; - } - } - if (message.exportCdwPipeline != null && message.hasOwnProperty("exportCdwPipeline")) { - if (properties.pipeline === 1) - return "pipeline: multiple values"; - properties.pipeline = 1; - { - var error = $root.google.cloud.contentwarehouse.v1.ExportToCdwPipeline.verify(message.exportCdwPipeline); - if (error) - return "exportCdwPipeline." + error; - } - } - if (message.processWithDocAiPipeline != null && message.hasOwnProperty("processWithDocAiPipeline")) { - if (properties.pipeline === 1) - return "pipeline: multiple values"; - properties.pipeline = 1; - { - var error = $root.google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline.verify(message.processWithDocAiPipeline); - if (error) - return "processWithDocAiPipeline." + error; - } - } - if (message.requestMetadata != null && message.hasOwnProperty("requestMetadata")) { - var error = $root.google.cloud.contentwarehouse.v1.RequestMetadata.verify(message.requestMetadata); - if (error) - return "requestMetadata." + error; - } - return null; - }; - - /** - * Creates a RunPipelineRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.RunPipelineRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.RunPipelineRequest} RunPipelineRequest - */ - RunPipelineRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.RunPipelineRequest) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.RunPipelineRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.gcsIngestPipeline != null) { - if (typeof object.gcsIngestPipeline !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.RunPipelineRequest.gcsIngestPipeline: object expected"); - message.gcsIngestPipeline = $root.google.cloud.contentwarehouse.v1.GcsIngestPipeline.fromObject(object.gcsIngestPipeline); - } - if (object.gcsIngestWithDocAiProcessorsPipeline != null) { - if (typeof object.gcsIngestWithDocAiProcessorsPipeline !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.RunPipelineRequest.gcsIngestWithDocAiProcessorsPipeline: object expected"); - message.gcsIngestWithDocAiProcessorsPipeline = $root.google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline.fromObject(object.gcsIngestWithDocAiProcessorsPipeline); - } - if (object.exportCdwPipeline != null) { - if (typeof object.exportCdwPipeline !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.RunPipelineRequest.exportCdwPipeline: object expected"); - message.exportCdwPipeline = $root.google.cloud.contentwarehouse.v1.ExportToCdwPipeline.fromObject(object.exportCdwPipeline); - } - if (object.processWithDocAiPipeline != null) { - if (typeof object.processWithDocAiPipeline !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.RunPipelineRequest.processWithDocAiPipeline: object expected"); - message.processWithDocAiPipeline = $root.google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline.fromObject(object.processWithDocAiPipeline); - } - if (object.requestMetadata != null) { - if (typeof object.requestMetadata !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.RunPipelineRequest.requestMetadata: object expected"); - message.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.fromObject(object.requestMetadata); - } - return message; - }; - - /** - * Creates a plain object from a RunPipelineRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.RunPipelineRequest - * @static - * @param {google.cloud.contentwarehouse.v1.RunPipelineRequest} message RunPipelineRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RunPipelineRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.requestMetadata = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.gcsIngestPipeline != null && message.hasOwnProperty("gcsIngestPipeline")) { - object.gcsIngestPipeline = $root.google.cloud.contentwarehouse.v1.GcsIngestPipeline.toObject(message.gcsIngestPipeline, options); - if (options.oneofs) - object.pipeline = "gcsIngestPipeline"; - } - if (message.gcsIngestWithDocAiProcessorsPipeline != null && message.hasOwnProperty("gcsIngestWithDocAiProcessorsPipeline")) { - object.gcsIngestWithDocAiProcessorsPipeline = $root.google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline.toObject(message.gcsIngestWithDocAiProcessorsPipeline, options); - if (options.oneofs) - object.pipeline = "gcsIngestWithDocAiProcessorsPipeline"; - } - if (message.exportCdwPipeline != null && message.hasOwnProperty("exportCdwPipeline")) { - object.exportCdwPipeline = $root.google.cloud.contentwarehouse.v1.ExportToCdwPipeline.toObject(message.exportCdwPipeline, options); - if (options.oneofs) - object.pipeline = "exportCdwPipeline"; - } - if (message.processWithDocAiPipeline != null && message.hasOwnProperty("processWithDocAiPipeline")) { - object.processWithDocAiPipeline = $root.google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline.toObject(message.processWithDocAiPipeline, options); - if (options.oneofs) - object.pipeline = "processWithDocAiPipeline"; - } - if (message.requestMetadata != null && message.hasOwnProperty("requestMetadata")) - object.requestMetadata = $root.google.cloud.contentwarehouse.v1.RequestMetadata.toObject(message.requestMetadata, options); - return object; - }; - - /** - * Converts this RunPipelineRequest to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.RunPipelineRequest - * @instance - * @returns {Object.} JSON object - */ - RunPipelineRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RunPipelineRequest - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.RunPipelineRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RunPipelineRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.RunPipelineRequest"; - }; - - return RunPipelineRequest; - })(); - - v1.RunPipelineResponse = (function() { - - /** - * Properties of a RunPipelineResponse. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IRunPipelineResponse - */ - - /** - * Constructs a new RunPipelineResponse. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a RunPipelineResponse. - * @implements IRunPipelineResponse - * @constructor - * @param {google.cloud.contentwarehouse.v1.IRunPipelineResponse=} [properties] Properties to set - */ - function RunPipelineResponse(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 RunPipelineResponse instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.RunPipelineResponse - * @static - * @param {google.cloud.contentwarehouse.v1.IRunPipelineResponse=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.RunPipelineResponse} RunPipelineResponse instance - */ - RunPipelineResponse.create = function create(properties) { - return new RunPipelineResponse(properties); - }; - - /** - * Encodes the specified RunPipelineResponse message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.RunPipelineResponse - * @static - * @param {google.cloud.contentwarehouse.v1.IRunPipelineResponse} message RunPipelineResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RunPipelineResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified RunPipelineResponse message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.RunPipelineResponse - * @static - * @param {google.cloud.contentwarehouse.v1.IRunPipelineResponse} message RunPipelineResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RunPipelineResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RunPipelineResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.RunPipelineResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.RunPipelineResponse} RunPipelineResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RunPipelineResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.RunPipelineResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RunPipelineResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.RunPipelineResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.RunPipelineResponse} RunPipelineResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RunPipelineResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RunPipelineResponse message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.RunPipelineResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RunPipelineResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a RunPipelineResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.RunPipelineResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.RunPipelineResponse} RunPipelineResponse - */ - RunPipelineResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.RunPipelineResponse) - return object; - return new $root.google.cloud.contentwarehouse.v1.RunPipelineResponse(); - }; - - /** - * Creates a plain object from a RunPipelineResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.RunPipelineResponse - * @static - * @param {google.cloud.contentwarehouse.v1.RunPipelineResponse} message RunPipelineResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RunPipelineResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this RunPipelineResponse to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.RunPipelineResponse - * @instance - * @returns {Object.} JSON object - */ - RunPipelineResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RunPipelineResponse - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.RunPipelineResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RunPipelineResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.RunPipelineResponse"; - }; - - return RunPipelineResponse; - })(); - - v1.RunPipelineMetadata = (function() { - - /** - * Properties of a RunPipelineMetadata. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IRunPipelineMetadata - * @property {number|null} [totalFileCount] RunPipelineMetadata totalFileCount - * @property {number|null} [failedFileCount] RunPipelineMetadata failedFileCount - * @property {google.cloud.contentwarehouse.v1.IUserInfo|null} [userInfo] RunPipelineMetadata userInfo - * @property {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IGcsIngestPipelineMetadata|null} [gcsIngestPipelineMetadata] RunPipelineMetadata gcsIngestPipelineMetadata - * @property {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IExportToCdwPipelineMetadata|null} [exportToCdwPipelineMetadata] RunPipelineMetadata exportToCdwPipelineMetadata - * @property {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IProcessWithDocAiPipelineMetadata|null} [processWithDocAiPipelineMetadata] RunPipelineMetadata processWithDocAiPipelineMetadata - * @property {Array.|null} [individualDocumentStatuses] RunPipelineMetadata individualDocumentStatuses - */ - - /** - * Constructs a new RunPipelineMetadata. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a RunPipelineMetadata. - * @implements IRunPipelineMetadata - * @constructor - * @param {google.cloud.contentwarehouse.v1.IRunPipelineMetadata=} [properties] Properties to set - */ - function RunPipelineMetadata(properties) { - this.individualDocumentStatuses = []; - 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]]; - } - - /** - * RunPipelineMetadata totalFileCount. - * @member {number} totalFileCount - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata - * @instance - */ - RunPipelineMetadata.prototype.totalFileCount = 0; - - /** - * RunPipelineMetadata failedFileCount. - * @member {number} failedFileCount - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata - * @instance - */ - RunPipelineMetadata.prototype.failedFileCount = 0; - - /** - * RunPipelineMetadata userInfo. - * @member {google.cloud.contentwarehouse.v1.IUserInfo|null|undefined} userInfo - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata - * @instance - */ - RunPipelineMetadata.prototype.userInfo = null; - - /** - * RunPipelineMetadata gcsIngestPipelineMetadata. - * @member {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IGcsIngestPipelineMetadata|null|undefined} gcsIngestPipelineMetadata - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata - * @instance - */ - RunPipelineMetadata.prototype.gcsIngestPipelineMetadata = null; - - /** - * RunPipelineMetadata exportToCdwPipelineMetadata. - * @member {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IExportToCdwPipelineMetadata|null|undefined} exportToCdwPipelineMetadata - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata - * @instance - */ - RunPipelineMetadata.prototype.exportToCdwPipelineMetadata = null; - - /** - * RunPipelineMetadata processWithDocAiPipelineMetadata. - * @member {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IProcessWithDocAiPipelineMetadata|null|undefined} processWithDocAiPipelineMetadata - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata - * @instance - */ - RunPipelineMetadata.prototype.processWithDocAiPipelineMetadata = null; - - /** - * RunPipelineMetadata individualDocumentStatuses. - * @member {Array.} individualDocumentStatuses - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata - * @instance - */ - RunPipelineMetadata.prototype.individualDocumentStatuses = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * RunPipelineMetadata pipelineMetadata. - * @member {"gcsIngestPipelineMetadata"|"exportToCdwPipelineMetadata"|"processWithDocAiPipelineMetadata"|undefined} pipelineMetadata - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata - * @instance - */ - Object.defineProperty(RunPipelineMetadata.prototype, "pipelineMetadata", { - get: $util.oneOfGetter($oneOfFields = ["gcsIngestPipelineMetadata", "exportToCdwPipelineMetadata", "processWithDocAiPipelineMetadata"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new RunPipelineMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata - * @static - * @param {google.cloud.contentwarehouse.v1.IRunPipelineMetadata=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.RunPipelineMetadata} RunPipelineMetadata instance - */ - RunPipelineMetadata.create = function create(properties) { - return new RunPipelineMetadata(properties); - }; - - /** - * Encodes the specified RunPipelineMetadata message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata - * @static - * @param {google.cloud.contentwarehouse.v1.IRunPipelineMetadata} message RunPipelineMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RunPipelineMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.totalFileCount != null && Object.hasOwnProperty.call(message, "totalFileCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.totalFileCount); - if (message.failedFileCount != null && Object.hasOwnProperty.call(message, "failedFileCount")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.failedFileCount); - if (message.userInfo != null && Object.hasOwnProperty.call(message, "userInfo")) - $root.google.cloud.contentwarehouse.v1.UserInfo.encode(message.userInfo, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.gcsIngestPipelineMetadata != null && Object.hasOwnProperty.call(message, "gcsIngestPipelineMetadata")) - $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata.encode(message.gcsIngestPipelineMetadata, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.individualDocumentStatuses != null && message.individualDocumentStatuses.length) - for (var i = 0; i < message.individualDocumentStatuses.length; ++i) - $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus.encode(message.individualDocumentStatuses[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.exportToCdwPipelineMetadata != null && Object.hasOwnProperty.call(message, "exportToCdwPipelineMetadata")) - $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata.encode(message.exportToCdwPipelineMetadata, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.processWithDocAiPipelineMetadata != null && Object.hasOwnProperty.call(message, "processWithDocAiPipelineMetadata")) - $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata.encode(message.processWithDocAiPipelineMetadata, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RunPipelineMetadata message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata - * @static - * @param {google.cloud.contentwarehouse.v1.IRunPipelineMetadata} message RunPipelineMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RunPipelineMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RunPipelineMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.RunPipelineMetadata} RunPipelineMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RunPipelineMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.totalFileCount = reader.int32(); - break; - } - case 2: { - message.failedFileCount = reader.int32(); - break; - } - case 3: { - message.userInfo = $root.google.cloud.contentwarehouse.v1.UserInfo.decode(reader, reader.uint32()); - break; - } - case 4: { - message.gcsIngestPipelineMetadata = $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata.decode(reader, reader.uint32()); - break; - } - case 6: { - message.exportToCdwPipelineMetadata = $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata.decode(reader, reader.uint32()); - break; - } - case 7: { - message.processWithDocAiPipelineMetadata = $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata.decode(reader, reader.uint32()); - break; - } - case 5: { - if (!(message.individualDocumentStatuses && message.individualDocumentStatuses.length)) - message.individualDocumentStatuses = []; - message.individualDocumentStatuses.push($root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RunPipelineMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.RunPipelineMetadata} RunPipelineMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RunPipelineMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RunPipelineMetadata message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RunPipelineMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.totalFileCount != null && message.hasOwnProperty("totalFileCount")) - if (!$util.isInteger(message.totalFileCount)) - return "totalFileCount: integer expected"; - if (message.failedFileCount != null && message.hasOwnProperty("failedFileCount")) - if (!$util.isInteger(message.failedFileCount)) - return "failedFileCount: integer expected"; - if (message.userInfo != null && message.hasOwnProperty("userInfo")) { - var error = $root.google.cloud.contentwarehouse.v1.UserInfo.verify(message.userInfo); - if (error) - return "userInfo." + error; - } - if (message.gcsIngestPipelineMetadata != null && message.hasOwnProperty("gcsIngestPipelineMetadata")) { - properties.pipelineMetadata = 1; - { - var error = $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata.verify(message.gcsIngestPipelineMetadata); - if (error) - return "gcsIngestPipelineMetadata." + error; - } - } - if (message.exportToCdwPipelineMetadata != null && message.hasOwnProperty("exportToCdwPipelineMetadata")) { - if (properties.pipelineMetadata === 1) - return "pipelineMetadata: multiple values"; - properties.pipelineMetadata = 1; - { - var error = $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata.verify(message.exportToCdwPipelineMetadata); - if (error) - return "exportToCdwPipelineMetadata." + error; - } - } - if (message.processWithDocAiPipelineMetadata != null && message.hasOwnProperty("processWithDocAiPipelineMetadata")) { - if (properties.pipelineMetadata === 1) - return "pipelineMetadata: multiple values"; - properties.pipelineMetadata = 1; - { - var error = $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata.verify(message.processWithDocAiPipelineMetadata); - if (error) - return "processWithDocAiPipelineMetadata." + error; - } - } - if (message.individualDocumentStatuses != null && message.hasOwnProperty("individualDocumentStatuses")) { - if (!Array.isArray(message.individualDocumentStatuses)) - return "individualDocumentStatuses: array expected"; - for (var i = 0; i < message.individualDocumentStatuses.length; ++i) { - var error = $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus.verify(message.individualDocumentStatuses[i]); - if (error) - return "individualDocumentStatuses." + error; - } - } - return null; - }; - - /** - * Creates a RunPipelineMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.RunPipelineMetadata} RunPipelineMetadata - */ - RunPipelineMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata(); - if (object.totalFileCount != null) - message.totalFileCount = object.totalFileCount | 0; - if (object.failedFileCount != null) - message.failedFileCount = object.failedFileCount | 0; - if (object.userInfo != null) { - if (typeof object.userInfo !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.RunPipelineMetadata.userInfo: object expected"); - message.userInfo = $root.google.cloud.contentwarehouse.v1.UserInfo.fromObject(object.userInfo); - } - if (object.gcsIngestPipelineMetadata != null) { - if (typeof object.gcsIngestPipelineMetadata !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.RunPipelineMetadata.gcsIngestPipelineMetadata: object expected"); - message.gcsIngestPipelineMetadata = $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata.fromObject(object.gcsIngestPipelineMetadata); - } - if (object.exportToCdwPipelineMetadata != null) { - if (typeof object.exportToCdwPipelineMetadata !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.RunPipelineMetadata.exportToCdwPipelineMetadata: object expected"); - message.exportToCdwPipelineMetadata = $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata.fromObject(object.exportToCdwPipelineMetadata); - } - if (object.processWithDocAiPipelineMetadata != null) { - if (typeof object.processWithDocAiPipelineMetadata !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.RunPipelineMetadata.processWithDocAiPipelineMetadata: object expected"); - message.processWithDocAiPipelineMetadata = $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata.fromObject(object.processWithDocAiPipelineMetadata); - } - if (object.individualDocumentStatuses) { - if (!Array.isArray(object.individualDocumentStatuses)) - throw TypeError(".google.cloud.contentwarehouse.v1.RunPipelineMetadata.individualDocumentStatuses: array expected"); - message.individualDocumentStatuses = []; - for (var i = 0; i < object.individualDocumentStatuses.length; ++i) { - if (typeof object.individualDocumentStatuses[i] !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.RunPipelineMetadata.individualDocumentStatuses: object expected"); - message.individualDocumentStatuses[i] = $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus.fromObject(object.individualDocumentStatuses[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a RunPipelineMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata - * @static - * @param {google.cloud.contentwarehouse.v1.RunPipelineMetadata} message RunPipelineMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RunPipelineMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.individualDocumentStatuses = []; - if (options.defaults) { - object.totalFileCount = 0; - object.failedFileCount = 0; - object.userInfo = null; - } - if (message.totalFileCount != null && message.hasOwnProperty("totalFileCount")) - object.totalFileCount = message.totalFileCount; - if (message.failedFileCount != null && message.hasOwnProperty("failedFileCount")) - object.failedFileCount = message.failedFileCount; - if (message.userInfo != null && message.hasOwnProperty("userInfo")) - object.userInfo = $root.google.cloud.contentwarehouse.v1.UserInfo.toObject(message.userInfo, options); - if (message.gcsIngestPipelineMetadata != null && message.hasOwnProperty("gcsIngestPipelineMetadata")) { - object.gcsIngestPipelineMetadata = $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata.toObject(message.gcsIngestPipelineMetadata, options); - if (options.oneofs) - object.pipelineMetadata = "gcsIngestPipelineMetadata"; - } - if (message.individualDocumentStatuses && message.individualDocumentStatuses.length) { - object.individualDocumentStatuses = []; - for (var j = 0; j < message.individualDocumentStatuses.length; ++j) - object.individualDocumentStatuses[j] = $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus.toObject(message.individualDocumentStatuses[j], options); - } - if (message.exportToCdwPipelineMetadata != null && message.hasOwnProperty("exportToCdwPipelineMetadata")) { - object.exportToCdwPipelineMetadata = $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata.toObject(message.exportToCdwPipelineMetadata, options); - if (options.oneofs) - object.pipelineMetadata = "exportToCdwPipelineMetadata"; - } - if (message.processWithDocAiPipelineMetadata != null && message.hasOwnProperty("processWithDocAiPipelineMetadata")) { - object.processWithDocAiPipelineMetadata = $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata.toObject(message.processWithDocAiPipelineMetadata, options); - if (options.oneofs) - object.pipelineMetadata = "processWithDocAiPipelineMetadata"; - } - return object; - }; - - /** - * Converts this RunPipelineMetadata to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata - * @instance - * @returns {Object.} JSON object - */ - RunPipelineMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RunPipelineMetadata - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RunPipelineMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.RunPipelineMetadata"; - }; - - RunPipelineMetadata.GcsIngestPipelineMetadata = (function() { - - /** - * Properties of a GcsIngestPipelineMetadata. - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata - * @interface IGcsIngestPipelineMetadata - * @property {string|null} [inputPath] GcsIngestPipelineMetadata inputPath - */ - - /** - * Constructs a new GcsIngestPipelineMetadata. - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata - * @classdesc Represents a GcsIngestPipelineMetadata. - * @implements IGcsIngestPipelineMetadata - * @constructor - * @param {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IGcsIngestPipelineMetadata=} [properties] Properties to set - */ - function GcsIngestPipelineMetadata(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]]; - } - - /** - * GcsIngestPipelineMetadata inputPath. - * @member {string} inputPath - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata - * @instance - */ - GcsIngestPipelineMetadata.prototype.inputPath = ""; - - /** - * Creates a new GcsIngestPipelineMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata - * @static - * @param {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IGcsIngestPipelineMetadata=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata} GcsIngestPipelineMetadata instance - */ - GcsIngestPipelineMetadata.create = function create(properties) { - return new GcsIngestPipelineMetadata(properties); - }; - - /** - * Encodes the specified GcsIngestPipelineMetadata message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata - * @static - * @param {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IGcsIngestPipelineMetadata} message GcsIngestPipelineMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GcsIngestPipelineMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.inputPath != null && Object.hasOwnProperty.call(message, "inputPath")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputPath); - return writer; - }; - - /** - * Encodes the specified GcsIngestPipelineMetadata message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata - * @static - * @param {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IGcsIngestPipelineMetadata} message GcsIngestPipelineMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GcsIngestPipelineMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GcsIngestPipelineMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata} GcsIngestPipelineMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GcsIngestPipelineMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.inputPath = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GcsIngestPipelineMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata} GcsIngestPipelineMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GcsIngestPipelineMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GcsIngestPipelineMetadata message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GcsIngestPipelineMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.inputPath != null && message.hasOwnProperty("inputPath")) - if (!$util.isString(message.inputPath)) - return "inputPath: string expected"; - return null; - }; - - /** - * Creates a GcsIngestPipelineMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata} GcsIngestPipelineMetadata - */ - GcsIngestPipelineMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata(); - if (object.inputPath != null) - message.inputPath = String(object.inputPath); - return message; - }; - - /** - * Creates a plain object from a GcsIngestPipelineMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata - * @static - * @param {google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata} message GcsIngestPipelineMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GcsIngestPipelineMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.inputPath = ""; - if (message.inputPath != null && message.hasOwnProperty("inputPath")) - object.inputPath = message.inputPath; - return object; - }; - - /** - * Converts this GcsIngestPipelineMetadata to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata - * @instance - * @returns {Object.} JSON object - */ - GcsIngestPipelineMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GcsIngestPipelineMetadata - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GcsIngestPipelineMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.RunPipelineMetadata.GcsIngestPipelineMetadata"; - }; - - return GcsIngestPipelineMetadata; - })(); - - RunPipelineMetadata.ExportToCdwPipelineMetadata = (function() { - - /** - * Properties of an ExportToCdwPipelineMetadata. - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata - * @interface IExportToCdwPipelineMetadata - * @property {Array.|null} [documents] ExportToCdwPipelineMetadata documents - * @property {string|null} [docAiDataset] ExportToCdwPipelineMetadata docAiDataset - * @property {string|null} [outputPath] ExportToCdwPipelineMetadata outputPath - */ - - /** - * Constructs a new ExportToCdwPipelineMetadata. - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata - * @classdesc Represents an ExportToCdwPipelineMetadata. - * @implements IExportToCdwPipelineMetadata - * @constructor - * @param {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IExportToCdwPipelineMetadata=} [properties] Properties to set - */ - function ExportToCdwPipelineMetadata(properties) { - this.documents = []; - 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]]; - } - - /** - * ExportToCdwPipelineMetadata documents. - * @member {Array.} documents - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata - * @instance - */ - ExportToCdwPipelineMetadata.prototype.documents = $util.emptyArray; - - /** - * ExportToCdwPipelineMetadata docAiDataset. - * @member {string} docAiDataset - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata - * @instance - */ - ExportToCdwPipelineMetadata.prototype.docAiDataset = ""; - - /** - * ExportToCdwPipelineMetadata outputPath. - * @member {string} outputPath - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata - * @instance - */ - ExportToCdwPipelineMetadata.prototype.outputPath = ""; - - /** - * Creates a new ExportToCdwPipelineMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata - * @static - * @param {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IExportToCdwPipelineMetadata=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata} ExportToCdwPipelineMetadata instance - */ - ExportToCdwPipelineMetadata.create = function create(properties) { - return new ExportToCdwPipelineMetadata(properties); - }; - - /** - * Encodes the specified ExportToCdwPipelineMetadata message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata - * @static - * @param {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IExportToCdwPipelineMetadata} message ExportToCdwPipelineMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportToCdwPipelineMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.documents != null && message.documents.length) - for (var i = 0; i < message.documents.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.documents[i]); - if (message.docAiDataset != null && Object.hasOwnProperty.call(message, "docAiDataset")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.docAiDataset); - if (message.outputPath != null && Object.hasOwnProperty.call(message, "outputPath")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputPath); - return writer; - }; - - /** - * Encodes the specified ExportToCdwPipelineMetadata message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata - * @static - * @param {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IExportToCdwPipelineMetadata} message ExportToCdwPipelineMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportToCdwPipelineMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExportToCdwPipelineMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata} ExportToCdwPipelineMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportToCdwPipelineMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.documents && message.documents.length)) - message.documents = []; - message.documents.push(reader.string()); - break; - } - case 2: { - message.docAiDataset = reader.string(); - break; - } - case 3: { - message.outputPath = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExportToCdwPipelineMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata} ExportToCdwPipelineMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportToCdwPipelineMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExportToCdwPipelineMetadata message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExportToCdwPipelineMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.documents != null && message.hasOwnProperty("documents")) { - if (!Array.isArray(message.documents)) - return "documents: array expected"; - for (var i = 0; i < message.documents.length; ++i) - if (!$util.isString(message.documents[i])) - return "documents: string[] expected"; - } - if (message.docAiDataset != null && message.hasOwnProperty("docAiDataset")) - if (!$util.isString(message.docAiDataset)) - return "docAiDataset: string expected"; - if (message.outputPath != null && message.hasOwnProperty("outputPath")) - if (!$util.isString(message.outputPath)) - return "outputPath: string expected"; - return null; - }; - - /** - * Creates an ExportToCdwPipelineMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata} ExportToCdwPipelineMetadata - */ - ExportToCdwPipelineMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata(); - if (object.documents) { - if (!Array.isArray(object.documents)) - throw TypeError(".google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata.documents: array expected"); - message.documents = []; - for (var i = 0; i < object.documents.length; ++i) - message.documents[i] = String(object.documents[i]); - } - if (object.docAiDataset != null) - message.docAiDataset = String(object.docAiDataset); - if (object.outputPath != null) - message.outputPath = String(object.outputPath); - return message; - }; - - /** - * Creates a plain object from an ExportToCdwPipelineMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata - * @static - * @param {google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata} message ExportToCdwPipelineMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExportToCdwPipelineMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.documents = []; - if (options.defaults) { - object.docAiDataset = ""; - object.outputPath = ""; - } - if (message.documents && message.documents.length) { - object.documents = []; - for (var j = 0; j < message.documents.length; ++j) - object.documents[j] = message.documents[j]; - } - if (message.docAiDataset != null && message.hasOwnProperty("docAiDataset")) - object.docAiDataset = message.docAiDataset; - if (message.outputPath != null && message.hasOwnProperty("outputPath")) - object.outputPath = message.outputPath; - return object; - }; - - /** - * Converts this ExportToCdwPipelineMetadata to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata - * @instance - * @returns {Object.} JSON object - */ - ExportToCdwPipelineMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExportToCdwPipelineMetadata - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExportToCdwPipelineMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.RunPipelineMetadata.ExportToCdwPipelineMetadata"; - }; - - return ExportToCdwPipelineMetadata; - })(); - - RunPipelineMetadata.ProcessWithDocAiPipelineMetadata = (function() { - - /** - * Properties of a ProcessWithDocAiPipelineMetadata. - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata - * @interface IProcessWithDocAiPipelineMetadata - * @property {Array.|null} [documents] ProcessWithDocAiPipelineMetadata documents - * @property {google.cloud.contentwarehouse.v1.IProcessorInfo|null} [processorInfo] ProcessWithDocAiPipelineMetadata processorInfo - */ - - /** - * Constructs a new ProcessWithDocAiPipelineMetadata. - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata - * @classdesc Represents a ProcessWithDocAiPipelineMetadata. - * @implements IProcessWithDocAiPipelineMetadata - * @constructor - * @param {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IProcessWithDocAiPipelineMetadata=} [properties] Properties to set - */ - function ProcessWithDocAiPipelineMetadata(properties) { - this.documents = []; - 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]]; - } - - /** - * ProcessWithDocAiPipelineMetadata documents. - * @member {Array.} documents - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata - * @instance - */ - ProcessWithDocAiPipelineMetadata.prototype.documents = $util.emptyArray; - - /** - * ProcessWithDocAiPipelineMetadata processorInfo. - * @member {google.cloud.contentwarehouse.v1.IProcessorInfo|null|undefined} processorInfo - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata - * @instance - */ - ProcessWithDocAiPipelineMetadata.prototype.processorInfo = null; - - /** - * Creates a new ProcessWithDocAiPipelineMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata - * @static - * @param {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IProcessWithDocAiPipelineMetadata=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata} ProcessWithDocAiPipelineMetadata instance - */ - ProcessWithDocAiPipelineMetadata.create = function create(properties) { - return new ProcessWithDocAiPipelineMetadata(properties); - }; - - /** - * Encodes the specified ProcessWithDocAiPipelineMetadata message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata - * @static - * @param {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IProcessWithDocAiPipelineMetadata} message ProcessWithDocAiPipelineMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProcessWithDocAiPipelineMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.documents != null && message.documents.length) - for (var i = 0; i < message.documents.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.documents[i]); - if (message.processorInfo != null && Object.hasOwnProperty.call(message, "processorInfo")) - $root.google.cloud.contentwarehouse.v1.ProcessorInfo.encode(message.processorInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ProcessWithDocAiPipelineMetadata message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata - * @static - * @param {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IProcessWithDocAiPipelineMetadata} message ProcessWithDocAiPipelineMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProcessWithDocAiPipelineMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ProcessWithDocAiPipelineMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata} ProcessWithDocAiPipelineMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProcessWithDocAiPipelineMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.documents && message.documents.length)) - message.documents = []; - message.documents.push(reader.string()); - break; - } - case 2: { - message.processorInfo = $root.google.cloud.contentwarehouse.v1.ProcessorInfo.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ProcessWithDocAiPipelineMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata} ProcessWithDocAiPipelineMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProcessWithDocAiPipelineMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ProcessWithDocAiPipelineMetadata message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ProcessWithDocAiPipelineMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.documents != null && message.hasOwnProperty("documents")) { - if (!Array.isArray(message.documents)) - return "documents: array expected"; - for (var i = 0; i < message.documents.length; ++i) - if (!$util.isString(message.documents[i])) - return "documents: string[] expected"; - } - if (message.processorInfo != null && message.hasOwnProperty("processorInfo")) { - var error = $root.google.cloud.contentwarehouse.v1.ProcessorInfo.verify(message.processorInfo); - if (error) - return "processorInfo." + error; - } - return null; - }; - - /** - * Creates a ProcessWithDocAiPipelineMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata} ProcessWithDocAiPipelineMetadata - */ - ProcessWithDocAiPipelineMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata(); - if (object.documents) { - if (!Array.isArray(object.documents)) - throw TypeError(".google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata.documents: array expected"); - message.documents = []; - for (var i = 0; i < object.documents.length; ++i) - message.documents[i] = String(object.documents[i]); - } - if (object.processorInfo != null) { - if (typeof object.processorInfo !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata.processorInfo: object expected"); - message.processorInfo = $root.google.cloud.contentwarehouse.v1.ProcessorInfo.fromObject(object.processorInfo); - } - return message; - }; - - /** - * Creates a plain object from a ProcessWithDocAiPipelineMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata - * @static - * @param {google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata} message ProcessWithDocAiPipelineMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ProcessWithDocAiPipelineMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.documents = []; - if (options.defaults) - object.processorInfo = null; - if (message.documents && message.documents.length) { - object.documents = []; - for (var j = 0; j < message.documents.length; ++j) - object.documents[j] = message.documents[j]; - } - if (message.processorInfo != null && message.hasOwnProperty("processorInfo")) - object.processorInfo = $root.google.cloud.contentwarehouse.v1.ProcessorInfo.toObject(message.processorInfo, options); - return object; - }; - - /** - * Converts this ProcessWithDocAiPipelineMetadata to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata - * @instance - * @returns {Object.} JSON object - */ - ProcessWithDocAiPipelineMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ProcessWithDocAiPipelineMetadata - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ProcessWithDocAiPipelineMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.RunPipelineMetadata.ProcessWithDocAiPipelineMetadata"; - }; - - return ProcessWithDocAiPipelineMetadata; - })(); - - RunPipelineMetadata.IndividualDocumentStatus = (function() { - - /** - * Properties of an IndividualDocumentStatus. - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata - * @interface IIndividualDocumentStatus - * @property {string|null} [documentId] IndividualDocumentStatus documentId - * @property {google.rpc.IStatus|null} [status] IndividualDocumentStatus status - */ - - /** - * Constructs a new IndividualDocumentStatus. - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata - * @classdesc Represents an IndividualDocumentStatus. - * @implements IIndividualDocumentStatus - * @constructor - * @param {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IIndividualDocumentStatus=} [properties] Properties to set - */ - function IndividualDocumentStatus(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]]; - } - - /** - * IndividualDocumentStatus documentId. - * @member {string} documentId - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus - * @instance - */ - IndividualDocumentStatus.prototype.documentId = ""; - - /** - * IndividualDocumentStatus status. - * @member {google.rpc.IStatus|null|undefined} status - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus - * @instance - */ - IndividualDocumentStatus.prototype.status = null; - - /** - * Creates a new IndividualDocumentStatus instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus - * @static - * @param {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IIndividualDocumentStatus=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus} IndividualDocumentStatus instance - */ - IndividualDocumentStatus.create = function create(properties) { - return new IndividualDocumentStatus(properties); - }; - - /** - * Encodes the specified IndividualDocumentStatus message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus - * @static - * @param {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IIndividualDocumentStatus} message IndividualDocumentStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IndividualDocumentStatus.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.documentId != null && Object.hasOwnProperty.call(message, "documentId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.documentId); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified IndividualDocumentStatus message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus - * @static - * @param {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IIndividualDocumentStatus} message IndividualDocumentStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IndividualDocumentStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IndividualDocumentStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus} IndividualDocumentStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IndividualDocumentStatus.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.documentId = reader.string(); - break; - } - case 2: { - message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IndividualDocumentStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus} IndividualDocumentStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IndividualDocumentStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IndividualDocumentStatus message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IndividualDocumentStatus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.documentId != null && message.hasOwnProperty("documentId")) - if (!$util.isString(message.documentId)) - return "documentId: string expected"; - if (message.status != null && message.hasOwnProperty("status")) { - var error = $root.google.rpc.Status.verify(message.status); - if (error) - return "status." + error; - } - return null; - }; - - /** - * Creates an IndividualDocumentStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus} IndividualDocumentStatus - */ - IndividualDocumentStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus(); - if (object.documentId != null) - message.documentId = String(object.documentId); - if (object.status != null) { - if (typeof object.status !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus.status: object expected"); - message.status = $root.google.rpc.Status.fromObject(object.status); - } - return message; - }; - - /** - * Creates a plain object from an IndividualDocumentStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus - * @static - * @param {google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus} message IndividualDocumentStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IndividualDocumentStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.documentId = ""; - object.status = null; - } - if (message.documentId != null && message.hasOwnProperty("documentId")) - object.documentId = message.documentId; - if (message.status != null && message.hasOwnProperty("status")) - object.status = $root.google.rpc.Status.toObject(message.status, options); - return object; - }; - - /** - * Converts this IndividualDocumentStatus to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus - * @instance - * @returns {Object.} JSON object - */ - IndividualDocumentStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for IndividualDocumentStatus - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - IndividualDocumentStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.RunPipelineMetadata.IndividualDocumentStatus"; - }; - - return IndividualDocumentStatus; - })(); - - return RunPipelineMetadata; - })(); - - v1.ProcessorInfo = (function() { - - /** - * Properties of a ProcessorInfo. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IProcessorInfo - * @property {string|null} [processorName] ProcessorInfo processorName - * @property {string|null} [documentType] ProcessorInfo documentType - * @property {string|null} [schemaName] ProcessorInfo schemaName - */ - - /** - * Constructs a new ProcessorInfo. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a ProcessorInfo. - * @implements IProcessorInfo - * @constructor - * @param {google.cloud.contentwarehouse.v1.IProcessorInfo=} [properties] Properties to set - */ - function ProcessorInfo(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]]; - } - - /** - * ProcessorInfo processorName. - * @member {string} processorName - * @memberof google.cloud.contentwarehouse.v1.ProcessorInfo - * @instance - */ - ProcessorInfo.prototype.processorName = ""; - - /** - * ProcessorInfo documentType. - * @member {string} documentType - * @memberof google.cloud.contentwarehouse.v1.ProcessorInfo - * @instance - */ - ProcessorInfo.prototype.documentType = ""; - - /** - * ProcessorInfo schemaName. - * @member {string} schemaName - * @memberof google.cloud.contentwarehouse.v1.ProcessorInfo - * @instance - */ - ProcessorInfo.prototype.schemaName = ""; - - /** - * Creates a new ProcessorInfo instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.ProcessorInfo - * @static - * @param {google.cloud.contentwarehouse.v1.IProcessorInfo=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.ProcessorInfo} ProcessorInfo instance - */ - ProcessorInfo.create = function create(properties) { - return new ProcessorInfo(properties); - }; - - /** - * Encodes the specified ProcessorInfo message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ProcessorInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.ProcessorInfo - * @static - * @param {google.cloud.contentwarehouse.v1.IProcessorInfo} message ProcessorInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProcessorInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.processorName != null && Object.hasOwnProperty.call(message, "processorName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.processorName); - if (message.documentType != null && Object.hasOwnProperty.call(message, "documentType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.documentType); - if (message.schemaName != null && Object.hasOwnProperty.call(message, "schemaName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.schemaName); - return writer; - }; - - /** - * Encodes the specified ProcessorInfo message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ProcessorInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.ProcessorInfo - * @static - * @param {google.cloud.contentwarehouse.v1.IProcessorInfo} message ProcessorInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProcessorInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ProcessorInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.ProcessorInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.ProcessorInfo} ProcessorInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProcessorInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.ProcessorInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.processorName = reader.string(); - break; - } - case 2: { - message.documentType = reader.string(); - break; - } - case 3: { - message.schemaName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ProcessorInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.ProcessorInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.ProcessorInfo} ProcessorInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProcessorInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ProcessorInfo message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.ProcessorInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ProcessorInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.processorName != null && message.hasOwnProperty("processorName")) - if (!$util.isString(message.processorName)) - return "processorName: string expected"; - if (message.documentType != null && message.hasOwnProperty("documentType")) - if (!$util.isString(message.documentType)) - return "documentType: string expected"; - if (message.schemaName != null && message.hasOwnProperty("schemaName")) - if (!$util.isString(message.schemaName)) - return "schemaName: string expected"; - return null; - }; - - /** - * Creates a ProcessorInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.ProcessorInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.ProcessorInfo} ProcessorInfo - */ - ProcessorInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.ProcessorInfo) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.ProcessorInfo(); - if (object.processorName != null) - message.processorName = String(object.processorName); - if (object.documentType != null) - message.documentType = String(object.documentType); - if (object.schemaName != null) - message.schemaName = String(object.schemaName); - return message; - }; - - /** - * Creates a plain object from a ProcessorInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.ProcessorInfo - * @static - * @param {google.cloud.contentwarehouse.v1.ProcessorInfo} message ProcessorInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ProcessorInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.processorName = ""; - object.documentType = ""; - object.schemaName = ""; - } - if (message.processorName != null && message.hasOwnProperty("processorName")) - object.processorName = message.processorName; - if (message.documentType != null && message.hasOwnProperty("documentType")) - object.documentType = message.documentType; - if (message.schemaName != null && message.hasOwnProperty("schemaName")) - object.schemaName = message.schemaName; - return object; - }; - - /** - * Converts this ProcessorInfo to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.ProcessorInfo - * @instance - * @returns {Object.} JSON object - */ - ProcessorInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ProcessorInfo - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.ProcessorInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ProcessorInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.ProcessorInfo"; - }; - - return ProcessorInfo; - })(); - - v1.IngestPipelineConfig = (function() { - - /** - * Properties of an IngestPipelineConfig. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IIngestPipelineConfig - * @property {google.iam.v1.IPolicy|null} [documentAclPolicy] IngestPipelineConfig documentAclPolicy - * @property {boolean|null} [enableDocumentTextExtraction] IngestPipelineConfig enableDocumentTextExtraction - * @property {string|null} [folder] IngestPipelineConfig folder - * @property {string|null} [cloudFunction] IngestPipelineConfig cloudFunction - */ - - /** - * Constructs a new IngestPipelineConfig. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents an IngestPipelineConfig. - * @implements IIngestPipelineConfig - * @constructor - * @param {google.cloud.contentwarehouse.v1.IIngestPipelineConfig=} [properties] Properties to set - */ - function IngestPipelineConfig(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]]; - } - - /** - * IngestPipelineConfig documentAclPolicy. - * @member {google.iam.v1.IPolicy|null|undefined} documentAclPolicy - * @memberof google.cloud.contentwarehouse.v1.IngestPipelineConfig - * @instance - */ - IngestPipelineConfig.prototype.documentAclPolicy = null; - - /** - * IngestPipelineConfig enableDocumentTextExtraction. - * @member {boolean} enableDocumentTextExtraction - * @memberof google.cloud.contentwarehouse.v1.IngestPipelineConfig - * @instance - */ - IngestPipelineConfig.prototype.enableDocumentTextExtraction = false; - - /** - * IngestPipelineConfig folder. - * @member {string} folder - * @memberof google.cloud.contentwarehouse.v1.IngestPipelineConfig - * @instance - */ - IngestPipelineConfig.prototype.folder = ""; - - /** - * IngestPipelineConfig cloudFunction. - * @member {string} cloudFunction - * @memberof google.cloud.contentwarehouse.v1.IngestPipelineConfig - * @instance - */ - IngestPipelineConfig.prototype.cloudFunction = ""; - - /** - * Creates a new IngestPipelineConfig instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.IngestPipelineConfig - * @static - * @param {google.cloud.contentwarehouse.v1.IIngestPipelineConfig=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.IngestPipelineConfig} IngestPipelineConfig instance - */ - IngestPipelineConfig.create = function create(properties) { - return new IngestPipelineConfig(properties); - }; - - /** - * Encodes the specified IngestPipelineConfig message. Does not implicitly {@link google.cloud.contentwarehouse.v1.IngestPipelineConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.IngestPipelineConfig - * @static - * @param {google.cloud.contentwarehouse.v1.IIngestPipelineConfig} message IngestPipelineConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IngestPipelineConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.documentAclPolicy != null && Object.hasOwnProperty.call(message, "documentAclPolicy")) - $root.google.iam.v1.Policy.encode(message.documentAclPolicy, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.enableDocumentTextExtraction != null && Object.hasOwnProperty.call(message, "enableDocumentTextExtraction")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enableDocumentTextExtraction); - if (message.folder != null && Object.hasOwnProperty.call(message, "folder")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.folder); - if (message.cloudFunction != null && Object.hasOwnProperty.call(message, "cloudFunction")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.cloudFunction); - return writer; - }; - - /** - * Encodes the specified IngestPipelineConfig message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.IngestPipelineConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.IngestPipelineConfig - * @static - * @param {google.cloud.contentwarehouse.v1.IIngestPipelineConfig} message IngestPipelineConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IngestPipelineConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IngestPipelineConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.IngestPipelineConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.IngestPipelineConfig} IngestPipelineConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IngestPipelineConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.IngestPipelineConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.documentAclPolicy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); - break; - } - case 2: { - message.enableDocumentTextExtraction = reader.bool(); - break; - } - case 3: { - message.folder = reader.string(); - break; - } - case 4: { - message.cloudFunction = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IngestPipelineConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.IngestPipelineConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.IngestPipelineConfig} IngestPipelineConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IngestPipelineConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IngestPipelineConfig message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.IngestPipelineConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IngestPipelineConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.documentAclPolicy != null && message.hasOwnProperty("documentAclPolicy")) { - var error = $root.google.iam.v1.Policy.verify(message.documentAclPolicy); - if (error) - return "documentAclPolicy." + error; - } - if (message.enableDocumentTextExtraction != null && message.hasOwnProperty("enableDocumentTextExtraction")) - if (typeof message.enableDocumentTextExtraction !== "boolean") - return "enableDocumentTextExtraction: boolean expected"; - if (message.folder != null && message.hasOwnProperty("folder")) - if (!$util.isString(message.folder)) - return "folder: string expected"; - if (message.cloudFunction != null && message.hasOwnProperty("cloudFunction")) - if (!$util.isString(message.cloudFunction)) - return "cloudFunction: string expected"; - return null; - }; - - /** - * Creates an IngestPipelineConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.IngestPipelineConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.IngestPipelineConfig} IngestPipelineConfig - */ - IngestPipelineConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.IngestPipelineConfig) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.IngestPipelineConfig(); - if (object.documentAclPolicy != null) { - if (typeof object.documentAclPolicy !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.IngestPipelineConfig.documentAclPolicy: object expected"); - message.documentAclPolicy = $root.google.iam.v1.Policy.fromObject(object.documentAclPolicy); - } - if (object.enableDocumentTextExtraction != null) - message.enableDocumentTextExtraction = Boolean(object.enableDocumentTextExtraction); - if (object.folder != null) - message.folder = String(object.folder); - if (object.cloudFunction != null) - message.cloudFunction = String(object.cloudFunction); - return message; - }; - - /** - * Creates a plain object from an IngestPipelineConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.IngestPipelineConfig - * @static - * @param {google.cloud.contentwarehouse.v1.IngestPipelineConfig} message IngestPipelineConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IngestPipelineConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.documentAclPolicy = null; - object.enableDocumentTextExtraction = false; - object.folder = ""; - object.cloudFunction = ""; - } - if (message.documentAclPolicy != null && message.hasOwnProperty("documentAclPolicy")) - object.documentAclPolicy = $root.google.iam.v1.Policy.toObject(message.documentAclPolicy, options); - if (message.enableDocumentTextExtraction != null && message.hasOwnProperty("enableDocumentTextExtraction")) - object.enableDocumentTextExtraction = message.enableDocumentTextExtraction; - if (message.folder != null && message.hasOwnProperty("folder")) - object.folder = message.folder; - if (message.cloudFunction != null && message.hasOwnProperty("cloudFunction")) - object.cloudFunction = message.cloudFunction; - return object; - }; - - /** - * Converts this IngestPipelineConfig to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.IngestPipelineConfig - * @instance - * @returns {Object.} JSON object - */ - IngestPipelineConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for IngestPipelineConfig - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.IngestPipelineConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - IngestPipelineConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.IngestPipelineConfig"; - }; - - return IngestPipelineConfig; - })(); - - v1.GcsIngestPipeline = (function() { - - /** - * Properties of a GcsIngestPipeline. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IGcsIngestPipeline - * @property {string|null} [inputPath] GcsIngestPipeline inputPath - * @property {string|null} [schemaName] GcsIngestPipeline schemaName - * @property {string|null} [processorType] GcsIngestPipeline processorType - * @property {boolean|null} [skipIngestedDocuments] GcsIngestPipeline skipIngestedDocuments - * @property {google.cloud.contentwarehouse.v1.IIngestPipelineConfig|null} [pipelineConfig] GcsIngestPipeline pipelineConfig - */ - - /** - * Constructs a new GcsIngestPipeline. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a GcsIngestPipeline. - * @implements IGcsIngestPipeline - * @constructor - * @param {google.cloud.contentwarehouse.v1.IGcsIngestPipeline=} [properties] Properties to set - */ - function GcsIngestPipeline(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]]; - } - - /** - * GcsIngestPipeline inputPath. - * @member {string} inputPath - * @memberof google.cloud.contentwarehouse.v1.GcsIngestPipeline - * @instance - */ - GcsIngestPipeline.prototype.inputPath = ""; - - /** - * GcsIngestPipeline schemaName. - * @member {string} schemaName - * @memberof google.cloud.contentwarehouse.v1.GcsIngestPipeline - * @instance - */ - GcsIngestPipeline.prototype.schemaName = ""; - - /** - * GcsIngestPipeline processorType. - * @member {string} processorType - * @memberof google.cloud.contentwarehouse.v1.GcsIngestPipeline - * @instance - */ - GcsIngestPipeline.prototype.processorType = ""; - - /** - * GcsIngestPipeline skipIngestedDocuments. - * @member {boolean} skipIngestedDocuments - * @memberof google.cloud.contentwarehouse.v1.GcsIngestPipeline - * @instance - */ - GcsIngestPipeline.prototype.skipIngestedDocuments = false; - - /** - * GcsIngestPipeline pipelineConfig. - * @member {google.cloud.contentwarehouse.v1.IIngestPipelineConfig|null|undefined} pipelineConfig - * @memberof google.cloud.contentwarehouse.v1.GcsIngestPipeline - * @instance - */ - GcsIngestPipeline.prototype.pipelineConfig = null; - - /** - * Creates a new GcsIngestPipeline instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.GcsIngestPipeline - * @static - * @param {google.cloud.contentwarehouse.v1.IGcsIngestPipeline=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.GcsIngestPipeline} GcsIngestPipeline instance - */ - GcsIngestPipeline.create = function create(properties) { - return new GcsIngestPipeline(properties); - }; - - /** - * Encodes the specified GcsIngestPipeline message. Does not implicitly {@link google.cloud.contentwarehouse.v1.GcsIngestPipeline.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.GcsIngestPipeline - * @static - * @param {google.cloud.contentwarehouse.v1.IGcsIngestPipeline} message GcsIngestPipeline message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GcsIngestPipeline.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.inputPath != null && Object.hasOwnProperty.call(message, "inputPath")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputPath); - if (message.schemaName != null && Object.hasOwnProperty.call(message, "schemaName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.schemaName); - if (message.processorType != null && Object.hasOwnProperty.call(message, "processorType")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.processorType); - if (message.skipIngestedDocuments != null && Object.hasOwnProperty.call(message, "skipIngestedDocuments")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.skipIngestedDocuments); - if (message.pipelineConfig != null && Object.hasOwnProperty.call(message, "pipelineConfig")) - $root.google.cloud.contentwarehouse.v1.IngestPipelineConfig.encode(message.pipelineConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GcsIngestPipeline message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.GcsIngestPipeline.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.GcsIngestPipeline - * @static - * @param {google.cloud.contentwarehouse.v1.IGcsIngestPipeline} message GcsIngestPipeline message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GcsIngestPipeline.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GcsIngestPipeline message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.GcsIngestPipeline - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.GcsIngestPipeline} GcsIngestPipeline - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GcsIngestPipeline.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.GcsIngestPipeline(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.inputPath = reader.string(); - break; - } - case 2: { - message.schemaName = reader.string(); - break; - } - case 3: { - message.processorType = reader.string(); - break; - } - case 4: { - message.skipIngestedDocuments = reader.bool(); - break; - } - case 5: { - message.pipelineConfig = $root.google.cloud.contentwarehouse.v1.IngestPipelineConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GcsIngestPipeline message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.GcsIngestPipeline - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.GcsIngestPipeline} GcsIngestPipeline - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GcsIngestPipeline.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GcsIngestPipeline message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.GcsIngestPipeline - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GcsIngestPipeline.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.inputPath != null && message.hasOwnProperty("inputPath")) - if (!$util.isString(message.inputPath)) - return "inputPath: string expected"; - if (message.schemaName != null && message.hasOwnProperty("schemaName")) - if (!$util.isString(message.schemaName)) - return "schemaName: string expected"; - if (message.processorType != null && message.hasOwnProperty("processorType")) - if (!$util.isString(message.processorType)) - return "processorType: string expected"; - if (message.skipIngestedDocuments != null && message.hasOwnProperty("skipIngestedDocuments")) - if (typeof message.skipIngestedDocuments !== "boolean") - return "skipIngestedDocuments: boolean expected"; - if (message.pipelineConfig != null && message.hasOwnProperty("pipelineConfig")) { - var error = $root.google.cloud.contentwarehouse.v1.IngestPipelineConfig.verify(message.pipelineConfig); - if (error) - return "pipelineConfig." + error; - } - return null; - }; - - /** - * Creates a GcsIngestPipeline message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.GcsIngestPipeline - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.GcsIngestPipeline} GcsIngestPipeline - */ - GcsIngestPipeline.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.GcsIngestPipeline) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.GcsIngestPipeline(); - if (object.inputPath != null) - message.inputPath = String(object.inputPath); - if (object.schemaName != null) - message.schemaName = String(object.schemaName); - if (object.processorType != null) - message.processorType = String(object.processorType); - if (object.skipIngestedDocuments != null) - message.skipIngestedDocuments = Boolean(object.skipIngestedDocuments); - if (object.pipelineConfig != null) { - if (typeof object.pipelineConfig !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.GcsIngestPipeline.pipelineConfig: object expected"); - message.pipelineConfig = $root.google.cloud.contentwarehouse.v1.IngestPipelineConfig.fromObject(object.pipelineConfig); - } - return message; - }; - - /** - * Creates a plain object from a GcsIngestPipeline message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.GcsIngestPipeline - * @static - * @param {google.cloud.contentwarehouse.v1.GcsIngestPipeline} message GcsIngestPipeline - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GcsIngestPipeline.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.inputPath = ""; - object.schemaName = ""; - object.processorType = ""; - object.skipIngestedDocuments = false; - object.pipelineConfig = null; - } - if (message.inputPath != null && message.hasOwnProperty("inputPath")) - object.inputPath = message.inputPath; - if (message.schemaName != null && message.hasOwnProperty("schemaName")) - object.schemaName = message.schemaName; - if (message.processorType != null && message.hasOwnProperty("processorType")) - object.processorType = message.processorType; - if (message.skipIngestedDocuments != null && message.hasOwnProperty("skipIngestedDocuments")) - object.skipIngestedDocuments = message.skipIngestedDocuments; - if (message.pipelineConfig != null && message.hasOwnProperty("pipelineConfig")) - object.pipelineConfig = $root.google.cloud.contentwarehouse.v1.IngestPipelineConfig.toObject(message.pipelineConfig, options); - return object; - }; - - /** - * Converts this GcsIngestPipeline to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.GcsIngestPipeline - * @instance - * @returns {Object.} JSON object - */ - GcsIngestPipeline.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GcsIngestPipeline - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.GcsIngestPipeline - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GcsIngestPipeline.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.GcsIngestPipeline"; - }; - - return GcsIngestPipeline; - })(); - - v1.GcsIngestWithDocAiProcessorsPipeline = (function() { - - /** - * Properties of a GcsIngestWithDocAiProcessorsPipeline. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IGcsIngestWithDocAiProcessorsPipeline - * @property {string|null} [inputPath] GcsIngestWithDocAiProcessorsPipeline inputPath - * @property {google.cloud.contentwarehouse.v1.IProcessorInfo|null} [splitClassifyProcessorInfo] GcsIngestWithDocAiProcessorsPipeline splitClassifyProcessorInfo - * @property {Array.|null} [extractProcessorInfos] GcsIngestWithDocAiProcessorsPipeline extractProcessorInfos - * @property {string|null} [processorResultsFolderPath] GcsIngestWithDocAiProcessorsPipeline processorResultsFolderPath - * @property {boolean|null} [skipIngestedDocuments] GcsIngestWithDocAiProcessorsPipeline skipIngestedDocuments - * @property {google.cloud.contentwarehouse.v1.IIngestPipelineConfig|null} [pipelineConfig] GcsIngestWithDocAiProcessorsPipeline pipelineConfig - */ - - /** - * Constructs a new GcsIngestWithDocAiProcessorsPipeline. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a GcsIngestWithDocAiProcessorsPipeline. - * @implements IGcsIngestWithDocAiProcessorsPipeline - * @constructor - * @param {google.cloud.contentwarehouse.v1.IGcsIngestWithDocAiProcessorsPipeline=} [properties] Properties to set - */ - function GcsIngestWithDocAiProcessorsPipeline(properties) { - this.extractProcessorInfos = []; - 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]]; - } - - /** - * GcsIngestWithDocAiProcessorsPipeline inputPath. - * @member {string} inputPath - * @memberof google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline - * @instance - */ - GcsIngestWithDocAiProcessorsPipeline.prototype.inputPath = ""; - - /** - * GcsIngestWithDocAiProcessorsPipeline splitClassifyProcessorInfo. - * @member {google.cloud.contentwarehouse.v1.IProcessorInfo|null|undefined} splitClassifyProcessorInfo - * @memberof google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline - * @instance - */ - GcsIngestWithDocAiProcessorsPipeline.prototype.splitClassifyProcessorInfo = null; - - /** - * GcsIngestWithDocAiProcessorsPipeline extractProcessorInfos. - * @member {Array.} extractProcessorInfos - * @memberof google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline - * @instance - */ - GcsIngestWithDocAiProcessorsPipeline.prototype.extractProcessorInfos = $util.emptyArray; - - /** - * GcsIngestWithDocAiProcessorsPipeline processorResultsFolderPath. - * @member {string} processorResultsFolderPath - * @memberof google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline - * @instance - */ - GcsIngestWithDocAiProcessorsPipeline.prototype.processorResultsFolderPath = ""; - - /** - * GcsIngestWithDocAiProcessorsPipeline skipIngestedDocuments. - * @member {boolean} skipIngestedDocuments - * @memberof google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline - * @instance - */ - GcsIngestWithDocAiProcessorsPipeline.prototype.skipIngestedDocuments = false; - - /** - * GcsIngestWithDocAiProcessorsPipeline pipelineConfig. - * @member {google.cloud.contentwarehouse.v1.IIngestPipelineConfig|null|undefined} pipelineConfig - * @memberof google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline - * @instance - */ - GcsIngestWithDocAiProcessorsPipeline.prototype.pipelineConfig = null; - - /** - * Creates a new GcsIngestWithDocAiProcessorsPipeline instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline - * @static - * @param {google.cloud.contentwarehouse.v1.IGcsIngestWithDocAiProcessorsPipeline=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline} GcsIngestWithDocAiProcessorsPipeline instance - */ - GcsIngestWithDocAiProcessorsPipeline.create = function create(properties) { - return new GcsIngestWithDocAiProcessorsPipeline(properties); - }; - - /** - * Encodes the specified GcsIngestWithDocAiProcessorsPipeline message. Does not implicitly {@link google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline - * @static - * @param {google.cloud.contentwarehouse.v1.IGcsIngestWithDocAiProcessorsPipeline} message GcsIngestWithDocAiProcessorsPipeline message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GcsIngestWithDocAiProcessorsPipeline.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.inputPath != null && Object.hasOwnProperty.call(message, "inputPath")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputPath); - if (message.splitClassifyProcessorInfo != null && Object.hasOwnProperty.call(message, "splitClassifyProcessorInfo")) - $root.google.cloud.contentwarehouse.v1.ProcessorInfo.encode(message.splitClassifyProcessorInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.extractProcessorInfos != null && message.extractProcessorInfos.length) - for (var i = 0; i < message.extractProcessorInfos.length; ++i) - $root.google.cloud.contentwarehouse.v1.ProcessorInfo.encode(message.extractProcessorInfos[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.processorResultsFolderPath != null && Object.hasOwnProperty.call(message, "processorResultsFolderPath")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.processorResultsFolderPath); - if (message.skipIngestedDocuments != null && Object.hasOwnProperty.call(message, "skipIngestedDocuments")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.skipIngestedDocuments); - if (message.pipelineConfig != null && Object.hasOwnProperty.call(message, "pipelineConfig")) - $root.google.cloud.contentwarehouse.v1.IngestPipelineConfig.encode(message.pipelineConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GcsIngestWithDocAiProcessorsPipeline message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline - * @static - * @param {google.cloud.contentwarehouse.v1.IGcsIngestWithDocAiProcessorsPipeline} message GcsIngestWithDocAiProcessorsPipeline message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GcsIngestWithDocAiProcessorsPipeline.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GcsIngestWithDocAiProcessorsPipeline message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline} GcsIngestWithDocAiProcessorsPipeline - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GcsIngestWithDocAiProcessorsPipeline.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.inputPath = reader.string(); - break; - } - case 2: { - message.splitClassifyProcessorInfo = $root.google.cloud.contentwarehouse.v1.ProcessorInfo.decode(reader, reader.uint32()); - break; - } - case 3: { - if (!(message.extractProcessorInfos && message.extractProcessorInfos.length)) - message.extractProcessorInfos = []; - message.extractProcessorInfos.push($root.google.cloud.contentwarehouse.v1.ProcessorInfo.decode(reader, reader.uint32())); - break; - } - case 4: { - message.processorResultsFolderPath = reader.string(); - break; - } - case 5: { - message.skipIngestedDocuments = reader.bool(); - break; - } - case 6: { - message.pipelineConfig = $root.google.cloud.contentwarehouse.v1.IngestPipelineConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GcsIngestWithDocAiProcessorsPipeline message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline} GcsIngestWithDocAiProcessorsPipeline - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GcsIngestWithDocAiProcessorsPipeline.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GcsIngestWithDocAiProcessorsPipeline message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GcsIngestWithDocAiProcessorsPipeline.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.inputPath != null && message.hasOwnProperty("inputPath")) - if (!$util.isString(message.inputPath)) - return "inputPath: string expected"; - if (message.splitClassifyProcessorInfo != null && message.hasOwnProperty("splitClassifyProcessorInfo")) { - var error = $root.google.cloud.contentwarehouse.v1.ProcessorInfo.verify(message.splitClassifyProcessorInfo); - if (error) - return "splitClassifyProcessorInfo." + error; - } - if (message.extractProcessorInfos != null && message.hasOwnProperty("extractProcessorInfos")) { - if (!Array.isArray(message.extractProcessorInfos)) - return "extractProcessorInfos: array expected"; - for (var i = 0; i < message.extractProcessorInfos.length; ++i) { - var error = $root.google.cloud.contentwarehouse.v1.ProcessorInfo.verify(message.extractProcessorInfos[i]); - if (error) - return "extractProcessorInfos." + error; - } - } - if (message.processorResultsFolderPath != null && message.hasOwnProperty("processorResultsFolderPath")) - if (!$util.isString(message.processorResultsFolderPath)) - return "processorResultsFolderPath: string expected"; - if (message.skipIngestedDocuments != null && message.hasOwnProperty("skipIngestedDocuments")) - if (typeof message.skipIngestedDocuments !== "boolean") - return "skipIngestedDocuments: boolean expected"; - if (message.pipelineConfig != null && message.hasOwnProperty("pipelineConfig")) { - var error = $root.google.cloud.contentwarehouse.v1.IngestPipelineConfig.verify(message.pipelineConfig); - if (error) - return "pipelineConfig." + error; - } - return null; - }; - - /** - * Creates a GcsIngestWithDocAiProcessorsPipeline message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline} GcsIngestWithDocAiProcessorsPipeline - */ - GcsIngestWithDocAiProcessorsPipeline.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline(); - if (object.inputPath != null) - message.inputPath = String(object.inputPath); - if (object.splitClassifyProcessorInfo != null) { - if (typeof object.splitClassifyProcessorInfo !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline.splitClassifyProcessorInfo: object expected"); - message.splitClassifyProcessorInfo = $root.google.cloud.contentwarehouse.v1.ProcessorInfo.fromObject(object.splitClassifyProcessorInfo); - } - if (object.extractProcessorInfos) { - if (!Array.isArray(object.extractProcessorInfos)) - throw TypeError(".google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline.extractProcessorInfos: array expected"); - message.extractProcessorInfos = []; - for (var i = 0; i < object.extractProcessorInfos.length; ++i) { - if (typeof object.extractProcessorInfos[i] !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline.extractProcessorInfos: object expected"); - message.extractProcessorInfos[i] = $root.google.cloud.contentwarehouse.v1.ProcessorInfo.fromObject(object.extractProcessorInfos[i]); - } - } - if (object.processorResultsFolderPath != null) - message.processorResultsFolderPath = String(object.processorResultsFolderPath); - if (object.skipIngestedDocuments != null) - message.skipIngestedDocuments = Boolean(object.skipIngestedDocuments); - if (object.pipelineConfig != null) { - if (typeof object.pipelineConfig !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline.pipelineConfig: object expected"); - message.pipelineConfig = $root.google.cloud.contentwarehouse.v1.IngestPipelineConfig.fromObject(object.pipelineConfig); - } - return message; - }; - - /** - * Creates a plain object from a GcsIngestWithDocAiProcessorsPipeline message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline - * @static - * @param {google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline} message GcsIngestWithDocAiProcessorsPipeline - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GcsIngestWithDocAiProcessorsPipeline.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.extractProcessorInfos = []; - if (options.defaults) { - object.inputPath = ""; - object.splitClassifyProcessorInfo = null; - object.processorResultsFolderPath = ""; - object.skipIngestedDocuments = false; - object.pipelineConfig = null; - } - if (message.inputPath != null && message.hasOwnProperty("inputPath")) - object.inputPath = message.inputPath; - if (message.splitClassifyProcessorInfo != null && message.hasOwnProperty("splitClassifyProcessorInfo")) - object.splitClassifyProcessorInfo = $root.google.cloud.contentwarehouse.v1.ProcessorInfo.toObject(message.splitClassifyProcessorInfo, options); - if (message.extractProcessorInfos && message.extractProcessorInfos.length) { - object.extractProcessorInfos = []; - for (var j = 0; j < message.extractProcessorInfos.length; ++j) - object.extractProcessorInfos[j] = $root.google.cloud.contentwarehouse.v1.ProcessorInfo.toObject(message.extractProcessorInfos[j], options); - } - if (message.processorResultsFolderPath != null && message.hasOwnProperty("processorResultsFolderPath")) - object.processorResultsFolderPath = message.processorResultsFolderPath; - if (message.skipIngestedDocuments != null && message.hasOwnProperty("skipIngestedDocuments")) - object.skipIngestedDocuments = message.skipIngestedDocuments; - if (message.pipelineConfig != null && message.hasOwnProperty("pipelineConfig")) - object.pipelineConfig = $root.google.cloud.contentwarehouse.v1.IngestPipelineConfig.toObject(message.pipelineConfig, options); - return object; - }; - - /** - * Converts this GcsIngestWithDocAiProcessorsPipeline to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline - * @instance - * @returns {Object.} JSON object - */ - GcsIngestWithDocAiProcessorsPipeline.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GcsIngestWithDocAiProcessorsPipeline - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GcsIngestWithDocAiProcessorsPipeline.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline"; - }; - - return GcsIngestWithDocAiProcessorsPipeline; - })(); - - v1.ExportToCdwPipeline = (function() { - - /** - * Properties of an ExportToCdwPipeline. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IExportToCdwPipeline - * @property {Array.|null} [documents] ExportToCdwPipeline documents - * @property {string|null} [exportFolderPath] ExportToCdwPipeline exportFolderPath - * @property {string|null} [docAiDataset] ExportToCdwPipeline docAiDataset - * @property {number|null} [trainingSplitRatio] ExportToCdwPipeline trainingSplitRatio - */ - - /** - * Constructs a new ExportToCdwPipeline. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents an ExportToCdwPipeline. - * @implements IExportToCdwPipeline - * @constructor - * @param {google.cloud.contentwarehouse.v1.IExportToCdwPipeline=} [properties] Properties to set - */ - function ExportToCdwPipeline(properties) { - this.documents = []; - 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]]; - } - - /** - * ExportToCdwPipeline documents. - * @member {Array.} documents - * @memberof google.cloud.contentwarehouse.v1.ExportToCdwPipeline - * @instance - */ - ExportToCdwPipeline.prototype.documents = $util.emptyArray; - - /** - * ExportToCdwPipeline exportFolderPath. - * @member {string} exportFolderPath - * @memberof google.cloud.contentwarehouse.v1.ExportToCdwPipeline - * @instance - */ - ExportToCdwPipeline.prototype.exportFolderPath = ""; - - /** - * ExportToCdwPipeline docAiDataset. - * @member {string} docAiDataset - * @memberof google.cloud.contentwarehouse.v1.ExportToCdwPipeline - * @instance - */ - ExportToCdwPipeline.prototype.docAiDataset = ""; - - /** - * ExportToCdwPipeline trainingSplitRatio. - * @member {number} trainingSplitRatio - * @memberof google.cloud.contentwarehouse.v1.ExportToCdwPipeline - * @instance - */ - ExportToCdwPipeline.prototype.trainingSplitRatio = 0; - - /** - * Creates a new ExportToCdwPipeline instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.ExportToCdwPipeline - * @static - * @param {google.cloud.contentwarehouse.v1.IExportToCdwPipeline=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.ExportToCdwPipeline} ExportToCdwPipeline instance - */ - ExportToCdwPipeline.create = function create(properties) { - return new ExportToCdwPipeline(properties); - }; - - /** - * Encodes the specified ExportToCdwPipeline message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ExportToCdwPipeline.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.ExportToCdwPipeline - * @static - * @param {google.cloud.contentwarehouse.v1.IExportToCdwPipeline} message ExportToCdwPipeline message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportToCdwPipeline.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.documents != null && message.documents.length) - for (var i = 0; i < message.documents.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.documents[i]); - if (message.exportFolderPath != null && Object.hasOwnProperty.call(message, "exportFolderPath")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.exportFolderPath); - if (message.docAiDataset != null && Object.hasOwnProperty.call(message, "docAiDataset")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.docAiDataset); - if (message.trainingSplitRatio != null && Object.hasOwnProperty.call(message, "trainingSplitRatio")) - writer.uint32(/* id 4, wireType 5 =*/37).float(message.trainingSplitRatio); - return writer; - }; - - /** - * Encodes the specified ExportToCdwPipeline message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ExportToCdwPipeline.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.ExportToCdwPipeline - * @static - * @param {google.cloud.contentwarehouse.v1.IExportToCdwPipeline} message ExportToCdwPipeline message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportToCdwPipeline.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExportToCdwPipeline message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.ExportToCdwPipeline - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.ExportToCdwPipeline} ExportToCdwPipeline - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportToCdwPipeline.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.ExportToCdwPipeline(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.documents && message.documents.length)) - message.documents = []; - message.documents.push(reader.string()); - break; - } - case 2: { - message.exportFolderPath = reader.string(); - break; - } - case 3: { - message.docAiDataset = reader.string(); - break; - } - case 4: { - message.trainingSplitRatio = reader.float(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExportToCdwPipeline message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.ExportToCdwPipeline - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.ExportToCdwPipeline} ExportToCdwPipeline - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportToCdwPipeline.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExportToCdwPipeline message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.ExportToCdwPipeline - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExportToCdwPipeline.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.documents != null && message.hasOwnProperty("documents")) { - if (!Array.isArray(message.documents)) - return "documents: array expected"; - for (var i = 0; i < message.documents.length; ++i) - if (!$util.isString(message.documents[i])) - return "documents: string[] expected"; - } - if (message.exportFolderPath != null && message.hasOwnProperty("exportFolderPath")) - if (!$util.isString(message.exportFolderPath)) - return "exportFolderPath: string expected"; - if (message.docAiDataset != null && message.hasOwnProperty("docAiDataset")) - if (!$util.isString(message.docAiDataset)) - return "docAiDataset: string expected"; - if (message.trainingSplitRatio != null && message.hasOwnProperty("trainingSplitRatio")) - if (typeof message.trainingSplitRatio !== "number") - return "trainingSplitRatio: number expected"; - return null; - }; - - /** - * Creates an ExportToCdwPipeline message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.ExportToCdwPipeline - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.ExportToCdwPipeline} ExportToCdwPipeline - */ - ExportToCdwPipeline.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.ExportToCdwPipeline) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.ExportToCdwPipeline(); - if (object.documents) { - if (!Array.isArray(object.documents)) - throw TypeError(".google.cloud.contentwarehouse.v1.ExportToCdwPipeline.documents: array expected"); - message.documents = []; - for (var i = 0; i < object.documents.length; ++i) - message.documents[i] = String(object.documents[i]); - } - if (object.exportFolderPath != null) - message.exportFolderPath = String(object.exportFolderPath); - if (object.docAiDataset != null) - message.docAiDataset = String(object.docAiDataset); - if (object.trainingSplitRatio != null) - message.trainingSplitRatio = Number(object.trainingSplitRatio); - return message; - }; - - /** - * Creates a plain object from an ExportToCdwPipeline message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.ExportToCdwPipeline - * @static - * @param {google.cloud.contentwarehouse.v1.ExportToCdwPipeline} message ExportToCdwPipeline - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExportToCdwPipeline.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.documents = []; - if (options.defaults) { - object.exportFolderPath = ""; - object.docAiDataset = ""; - object.trainingSplitRatio = 0; - } - if (message.documents && message.documents.length) { - object.documents = []; - for (var j = 0; j < message.documents.length; ++j) - object.documents[j] = message.documents[j]; - } - if (message.exportFolderPath != null && message.hasOwnProperty("exportFolderPath")) - object.exportFolderPath = message.exportFolderPath; - if (message.docAiDataset != null && message.hasOwnProperty("docAiDataset")) - object.docAiDataset = message.docAiDataset; - if (message.trainingSplitRatio != null && message.hasOwnProperty("trainingSplitRatio")) - object.trainingSplitRatio = options.json && !isFinite(message.trainingSplitRatio) ? String(message.trainingSplitRatio) : message.trainingSplitRatio; - return object; - }; - - /** - * Converts this ExportToCdwPipeline to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.ExportToCdwPipeline - * @instance - * @returns {Object.} JSON object - */ - ExportToCdwPipeline.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExportToCdwPipeline - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.ExportToCdwPipeline - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExportToCdwPipeline.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.ExportToCdwPipeline"; - }; - - return ExportToCdwPipeline; - })(); - - v1.ProcessWithDocAiPipeline = (function() { - - /** - * Properties of a ProcessWithDocAiPipeline. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IProcessWithDocAiPipeline - * @property {Array.|null} [documents] ProcessWithDocAiPipeline documents - * @property {string|null} [exportFolderPath] ProcessWithDocAiPipeline exportFolderPath - * @property {google.cloud.contentwarehouse.v1.IProcessorInfo|null} [processorInfo] ProcessWithDocAiPipeline processorInfo - * @property {string|null} [processorResultsFolderPath] ProcessWithDocAiPipeline processorResultsFolderPath - */ - - /** - * Constructs a new ProcessWithDocAiPipeline. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a ProcessWithDocAiPipeline. - * @implements IProcessWithDocAiPipeline - * @constructor - * @param {google.cloud.contentwarehouse.v1.IProcessWithDocAiPipeline=} [properties] Properties to set - */ - function ProcessWithDocAiPipeline(properties) { - this.documents = []; - 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]]; - } - - /** - * ProcessWithDocAiPipeline documents. - * @member {Array.} documents - * @memberof google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline - * @instance - */ - ProcessWithDocAiPipeline.prototype.documents = $util.emptyArray; - - /** - * ProcessWithDocAiPipeline exportFolderPath. - * @member {string} exportFolderPath - * @memberof google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline - * @instance - */ - ProcessWithDocAiPipeline.prototype.exportFolderPath = ""; - - /** - * ProcessWithDocAiPipeline processorInfo. - * @member {google.cloud.contentwarehouse.v1.IProcessorInfo|null|undefined} processorInfo - * @memberof google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline - * @instance - */ - ProcessWithDocAiPipeline.prototype.processorInfo = null; - - /** - * ProcessWithDocAiPipeline processorResultsFolderPath. - * @member {string} processorResultsFolderPath - * @memberof google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline - * @instance - */ - ProcessWithDocAiPipeline.prototype.processorResultsFolderPath = ""; - - /** - * Creates a new ProcessWithDocAiPipeline instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline - * @static - * @param {google.cloud.contentwarehouse.v1.IProcessWithDocAiPipeline=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline} ProcessWithDocAiPipeline instance - */ - ProcessWithDocAiPipeline.create = function create(properties) { - return new ProcessWithDocAiPipeline(properties); - }; - - /** - * Encodes the specified ProcessWithDocAiPipeline message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline - * @static - * @param {google.cloud.contentwarehouse.v1.IProcessWithDocAiPipeline} message ProcessWithDocAiPipeline message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProcessWithDocAiPipeline.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.documents != null && message.documents.length) - for (var i = 0; i < message.documents.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.documents[i]); - if (message.exportFolderPath != null && Object.hasOwnProperty.call(message, "exportFolderPath")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.exportFolderPath); - if (message.processorInfo != null && Object.hasOwnProperty.call(message, "processorInfo")) - $root.google.cloud.contentwarehouse.v1.ProcessorInfo.encode(message.processorInfo, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.processorResultsFolderPath != null && Object.hasOwnProperty.call(message, "processorResultsFolderPath")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.processorResultsFolderPath); - return writer; - }; - - /** - * Encodes the specified ProcessWithDocAiPipeline message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline - * @static - * @param {google.cloud.contentwarehouse.v1.IProcessWithDocAiPipeline} message ProcessWithDocAiPipeline message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProcessWithDocAiPipeline.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ProcessWithDocAiPipeline message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline} ProcessWithDocAiPipeline - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProcessWithDocAiPipeline.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.documents && message.documents.length)) - message.documents = []; - message.documents.push(reader.string()); - break; - } - case 2: { - message.exportFolderPath = reader.string(); - break; - } - case 3: { - message.processorInfo = $root.google.cloud.contentwarehouse.v1.ProcessorInfo.decode(reader, reader.uint32()); - break; - } - case 4: { - message.processorResultsFolderPath = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ProcessWithDocAiPipeline message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline} ProcessWithDocAiPipeline - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProcessWithDocAiPipeline.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ProcessWithDocAiPipeline message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ProcessWithDocAiPipeline.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.documents != null && message.hasOwnProperty("documents")) { - if (!Array.isArray(message.documents)) - return "documents: array expected"; - for (var i = 0; i < message.documents.length; ++i) - if (!$util.isString(message.documents[i])) - return "documents: string[] expected"; - } - if (message.exportFolderPath != null && message.hasOwnProperty("exportFolderPath")) - if (!$util.isString(message.exportFolderPath)) - return "exportFolderPath: string expected"; - if (message.processorInfo != null && message.hasOwnProperty("processorInfo")) { - var error = $root.google.cloud.contentwarehouse.v1.ProcessorInfo.verify(message.processorInfo); - if (error) - return "processorInfo." + error; - } - if (message.processorResultsFolderPath != null && message.hasOwnProperty("processorResultsFolderPath")) - if (!$util.isString(message.processorResultsFolderPath)) - return "processorResultsFolderPath: string expected"; - return null; - }; - - /** - * Creates a ProcessWithDocAiPipeline message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline} ProcessWithDocAiPipeline - */ - ProcessWithDocAiPipeline.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline(); - if (object.documents) { - if (!Array.isArray(object.documents)) - throw TypeError(".google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline.documents: array expected"); - message.documents = []; - for (var i = 0; i < object.documents.length; ++i) - message.documents[i] = String(object.documents[i]); - } - if (object.exportFolderPath != null) - message.exportFolderPath = String(object.exportFolderPath); - if (object.processorInfo != null) { - if (typeof object.processorInfo !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline.processorInfo: object expected"); - message.processorInfo = $root.google.cloud.contentwarehouse.v1.ProcessorInfo.fromObject(object.processorInfo); - } - if (object.processorResultsFolderPath != null) - message.processorResultsFolderPath = String(object.processorResultsFolderPath); - return message; - }; - - /** - * Creates a plain object from a ProcessWithDocAiPipeline message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline - * @static - * @param {google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline} message ProcessWithDocAiPipeline - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ProcessWithDocAiPipeline.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.documents = []; - if (options.defaults) { - object.exportFolderPath = ""; - object.processorInfo = null; - object.processorResultsFolderPath = ""; - } - if (message.documents && message.documents.length) { - object.documents = []; - for (var j = 0; j < message.documents.length; ++j) - object.documents[j] = message.documents[j]; - } - if (message.exportFolderPath != null && message.hasOwnProperty("exportFolderPath")) - object.exportFolderPath = message.exportFolderPath; - if (message.processorInfo != null && message.hasOwnProperty("processorInfo")) - object.processorInfo = $root.google.cloud.contentwarehouse.v1.ProcessorInfo.toObject(message.processorInfo, options); - if (message.processorResultsFolderPath != null && message.hasOwnProperty("processorResultsFolderPath")) - object.processorResultsFolderPath = message.processorResultsFolderPath; - return object; - }; - - /** - * Converts this ProcessWithDocAiPipeline to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline - * @instance - * @returns {Object.} JSON object - */ - ProcessWithDocAiPipeline.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ProcessWithDocAiPipeline - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ProcessWithDocAiPipeline.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline"; - }; - - return ProcessWithDocAiPipeline; - })(); - - v1.RuleSetService = (function() { - - /** - * Constructs a new RuleSetService service. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a RuleSetService - * @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 RuleSetService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (RuleSetService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = RuleSetService; - - /** - * Creates new RuleSetService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.contentwarehouse.v1.RuleSetService - * @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 {RuleSetService} RPC service. Useful where requests and/or responses are streamed. - */ - RuleSetService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.RuleSetService|createRuleSet}. - * @memberof google.cloud.contentwarehouse.v1.RuleSetService - * @typedef CreateRuleSetCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.contentwarehouse.v1.RuleSet} [response] RuleSet - */ - - /** - * Calls CreateRuleSet. - * @function createRuleSet - * @memberof google.cloud.contentwarehouse.v1.RuleSetService - * @instance - * @param {google.cloud.contentwarehouse.v1.ICreateRuleSetRequest} request CreateRuleSetRequest message or plain object - * @param {google.cloud.contentwarehouse.v1.RuleSetService.CreateRuleSetCallback} callback Node-style callback called with the error, if any, and RuleSet - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(RuleSetService.prototype.createRuleSet = function createRuleSet(request, callback) { - return this.rpcCall(createRuleSet, $root.google.cloud.contentwarehouse.v1.CreateRuleSetRequest, $root.google.cloud.contentwarehouse.v1.RuleSet, request, callback); - }, "name", { value: "CreateRuleSet" }); - - /** - * Calls CreateRuleSet. - * @function createRuleSet - * @memberof google.cloud.contentwarehouse.v1.RuleSetService - * @instance - * @param {google.cloud.contentwarehouse.v1.ICreateRuleSetRequest} request CreateRuleSetRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.RuleSetService|getRuleSet}. - * @memberof google.cloud.contentwarehouse.v1.RuleSetService - * @typedef GetRuleSetCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.contentwarehouse.v1.RuleSet} [response] RuleSet - */ - - /** - * Calls GetRuleSet. - * @function getRuleSet - * @memberof google.cloud.contentwarehouse.v1.RuleSetService - * @instance - * @param {google.cloud.contentwarehouse.v1.IGetRuleSetRequest} request GetRuleSetRequest message or plain object - * @param {google.cloud.contentwarehouse.v1.RuleSetService.GetRuleSetCallback} callback Node-style callback called with the error, if any, and RuleSet - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(RuleSetService.prototype.getRuleSet = function getRuleSet(request, callback) { - return this.rpcCall(getRuleSet, $root.google.cloud.contentwarehouse.v1.GetRuleSetRequest, $root.google.cloud.contentwarehouse.v1.RuleSet, request, callback); - }, "name", { value: "GetRuleSet" }); - - /** - * Calls GetRuleSet. - * @function getRuleSet - * @memberof google.cloud.contentwarehouse.v1.RuleSetService - * @instance - * @param {google.cloud.contentwarehouse.v1.IGetRuleSetRequest} request GetRuleSetRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.RuleSetService|updateRuleSet}. - * @memberof google.cloud.contentwarehouse.v1.RuleSetService - * @typedef UpdateRuleSetCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.contentwarehouse.v1.RuleSet} [response] RuleSet - */ - - /** - * Calls UpdateRuleSet. - * @function updateRuleSet - * @memberof google.cloud.contentwarehouse.v1.RuleSetService - * @instance - * @param {google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest} request UpdateRuleSetRequest message or plain object - * @param {google.cloud.contentwarehouse.v1.RuleSetService.UpdateRuleSetCallback} callback Node-style callback called with the error, if any, and RuleSet - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(RuleSetService.prototype.updateRuleSet = function updateRuleSet(request, callback) { - return this.rpcCall(updateRuleSet, $root.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest, $root.google.cloud.contentwarehouse.v1.RuleSet, request, callback); - }, "name", { value: "UpdateRuleSet" }); - - /** - * Calls UpdateRuleSet. - * @function updateRuleSet - * @memberof google.cloud.contentwarehouse.v1.RuleSetService - * @instance - * @param {google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest} request UpdateRuleSetRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.RuleSetService|deleteRuleSet}. - * @memberof google.cloud.contentwarehouse.v1.RuleSetService - * @typedef DeleteRuleSetCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteRuleSet. - * @function deleteRuleSet - * @memberof google.cloud.contentwarehouse.v1.RuleSetService - * @instance - * @param {google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest} request DeleteRuleSetRequest message or plain object - * @param {google.cloud.contentwarehouse.v1.RuleSetService.DeleteRuleSetCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(RuleSetService.prototype.deleteRuleSet = function deleteRuleSet(request, callback) { - return this.rpcCall(deleteRuleSet, $root.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteRuleSet" }); - - /** - * Calls DeleteRuleSet. - * @function deleteRuleSet - * @memberof google.cloud.contentwarehouse.v1.RuleSetService - * @instance - * @param {google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest} request DeleteRuleSetRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.RuleSetService|listRuleSets}. - * @memberof google.cloud.contentwarehouse.v1.RuleSetService - * @typedef ListRuleSetsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.contentwarehouse.v1.ListRuleSetsResponse} [response] ListRuleSetsResponse - */ - - /** - * Calls ListRuleSets. - * @function listRuleSets - * @memberof google.cloud.contentwarehouse.v1.RuleSetService - * @instance - * @param {google.cloud.contentwarehouse.v1.IListRuleSetsRequest} request ListRuleSetsRequest message or plain object - * @param {google.cloud.contentwarehouse.v1.RuleSetService.ListRuleSetsCallback} callback Node-style callback called with the error, if any, and ListRuleSetsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(RuleSetService.prototype.listRuleSets = function listRuleSets(request, callback) { - return this.rpcCall(listRuleSets, $root.google.cloud.contentwarehouse.v1.ListRuleSetsRequest, $root.google.cloud.contentwarehouse.v1.ListRuleSetsResponse, request, callback); - }, "name", { value: "ListRuleSets" }); - - /** - * Calls ListRuleSets. - * @function listRuleSets - * @memberof google.cloud.contentwarehouse.v1.RuleSetService - * @instance - * @param {google.cloud.contentwarehouse.v1.IListRuleSetsRequest} request ListRuleSetsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return RuleSetService; - })(); - - v1.CreateRuleSetRequest = (function() { - - /** - * Properties of a CreateRuleSetRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @interface ICreateRuleSetRequest - * @property {string|null} [parent] CreateRuleSetRequest parent - * @property {google.cloud.contentwarehouse.v1.IRuleSet|null} [ruleSet] CreateRuleSetRequest ruleSet - */ - - /** - * Constructs a new CreateRuleSetRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a CreateRuleSetRequest. - * @implements ICreateRuleSetRequest - * @constructor - * @param {google.cloud.contentwarehouse.v1.ICreateRuleSetRequest=} [properties] Properties to set - */ - function CreateRuleSetRequest(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]]; - } - - /** - * CreateRuleSetRequest parent. - * @member {string} parent - * @memberof google.cloud.contentwarehouse.v1.CreateRuleSetRequest - * @instance - */ - CreateRuleSetRequest.prototype.parent = ""; - - /** - * CreateRuleSetRequest ruleSet. - * @member {google.cloud.contentwarehouse.v1.IRuleSet|null|undefined} ruleSet - * @memberof google.cloud.contentwarehouse.v1.CreateRuleSetRequest - * @instance - */ - CreateRuleSetRequest.prototype.ruleSet = null; - - /** - * Creates a new CreateRuleSetRequest instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.CreateRuleSetRequest - * @static - * @param {google.cloud.contentwarehouse.v1.ICreateRuleSetRequest=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.CreateRuleSetRequest} CreateRuleSetRequest instance - */ - CreateRuleSetRequest.create = function create(properties) { - return new CreateRuleSetRequest(properties); - }; - - /** - * Encodes the specified CreateRuleSetRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateRuleSetRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.CreateRuleSetRequest - * @static - * @param {google.cloud.contentwarehouse.v1.ICreateRuleSetRequest} message CreateRuleSetRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateRuleSetRequest.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.ruleSet != null && Object.hasOwnProperty.call(message, "ruleSet")) - $root.google.cloud.contentwarehouse.v1.RuleSet.encode(message.ruleSet, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateRuleSetRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateRuleSetRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.CreateRuleSetRequest - * @static - * @param {google.cloud.contentwarehouse.v1.ICreateRuleSetRequest} message CreateRuleSetRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateRuleSetRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateRuleSetRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.CreateRuleSetRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.CreateRuleSetRequest} CreateRuleSetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateRuleSetRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.CreateRuleSetRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.ruleSet = $root.google.cloud.contentwarehouse.v1.RuleSet.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateRuleSetRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.CreateRuleSetRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.CreateRuleSetRequest} CreateRuleSetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateRuleSetRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateRuleSetRequest message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.CreateRuleSetRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateRuleSetRequest.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.ruleSet != null && message.hasOwnProperty("ruleSet")) { - var error = $root.google.cloud.contentwarehouse.v1.RuleSet.verify(message.ruleSet); - if (error) - return "ruleSet." + error; - } - return null; - }; - - /** - * Creates a CreateRuleSetRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.CreateRuleSetRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.CreateRuleSetRequest} CreateRuleSetRequest - */ - CreateRuleSetRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.CreateRuleSetRequest) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.CreateRuleSetRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.ruleSet != null) { - if (typeof object.ruleSet !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.CreateRuleSetRequest.ruleSet: object expected"); - message.ruleSet = $root.google.cloud.contentwarehouse.v1.RuleSet.fromObject(object.ruleSet); - } - return message; - }; - - /** - * Creates a plain object from a CreateRuleSetRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.CreateRuleSetRequest - * @static - * @param {google.cloud.contentwarehouse.v1.CreateRuleSetRequest} message CreateRuleSetRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateRuleSetRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.ruleSet = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.ruleSet != null && message.hasOwnProperty("ruleSet")) - object.ruleSet = $root.google.cloud.contentwarehouse.v1.RuleSet.toObject(message.ruleSet, options); - return object; - }; - - /** - * Converts this CreateRuleSetRequest to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.CreateRuleSetRequest - * @instance - * @returns {Object.} JSON object - */ - CreateRuleSetRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateRuleSetRequest - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.CreateRuleSetRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateRuleSetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.CreateRuleSetRequest"; - }; - - return CreateRuleSetRequest; - })(); - - v1.GetRuleSetRequest = (function() { - - /** - * Properties of a GetRuleSetRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IGetRuleSetRequest - * @property {string|null} [name] GetRuleSetRequest name - */ - - /** - * Constructs a new GetRuleSetRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a GetRuleSetRequest. - * @implements IGetRuleSetRequest - * @constructor - * @param {google.cloud.contentwarehouse.v1.IGetRuleSetRequest=} [properties] Properties to set - */ - function GetRuleSetRequest(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]]; - } - - /** - * GetRuleSetRequest name. - * @member {string} name - * @memberof google.cloud.contentwarehouse.v1.GetRuleSetRequest - * @instance - */ - GetRuleSetRequest.prototype.name = ""; - - /** - * Creates a new GetRuleSetRequest instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.GetRuleSetRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IGetRuleSetRequest=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.GetRuleSetRequest} GetRuleSetRequest instance - */ - GetRuleSetRequest.create = function create(properties) { - return new GetRuleSetRequest(properties); - }; - - /** - * Encodes the specified GetRuleSetRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.GetRuleSetRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.GetRuleSetRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IGetRuleSetRequest} message GetRuleSetRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetRuleSetRequest.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 GetRuleSetRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.GetRuleSetRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.GetRuleSetRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IGetRuleSetRequest} message GetRuleSetRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetRuleSetRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetRuleSetRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.GetRuleSetRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.GetRuleSetRequest} GetRuleSetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetRuleSetRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.GetRuleSetRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetRuleSetRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.GetRuleSetRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.GetRuleSetRequest} GetRuleSetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetRuleSetRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetRuleSetRequest message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.GetRuleSetRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetRuleSetRequest.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 GetRuleSetRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.GetRuleSetRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.GetRuleSetRequest} GetRuleSetRequest - */ - GetRuleSetRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.GetRuleSetRequest) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.GetRuleSetRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetRuleSetRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.GetRuleSetRequest - * @static - * @param {google.cloud.contentwarehouse.v1.GetRuleSetRequest} message GetRuleSetRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetRuleSetRequest.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 GetRuleSetRequest to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.GetRuleSetRequest - * @instance - * @returns {Object.} JSON object - */ - GetRuleSetRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetRuleSetRequest - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.GetRuleSetRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetRuleSetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.GetRuleSetRequest"; - }; - - return GetRuleSetRequest; - })(); - - v1.UpdateRuleSetRequest = (function() { - - /** - * Properties of an UpdateRuleSetRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IUpdateRuleSetRequest - * @property {string|null} [name] UpdateRuleSetRequest name - * @property {google.cloud.contentwarehouse.v1.IRuleSet|null} [ruleSet] UpdateRuleSetRequest ruleSet - */ - - /** - * Constructs a new UpdateRuleSetRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents an UpdateRuleSetRequest. - * @implements IUpdateRuleSetRequest - * @constructor - * @param {google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest=} [properties] Properties to set - */ - function UpdateRuleSetRequest(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]]; - } - - /** - * UpdateRuleSetRequest name. - * @member {string} name - * @memberof google.cloud.contentwarehouse.v1.UpdateRuleSetRequest - * @instance - */ - UpdateRuleSetRequest.prototype.name = ""; - - /** - * UpdateRuleSetRequest ruleSet. - * @member {google.cloud.contentwarehouse.v1.IRuleSet|null|undefined} ruleSet - * @memberof google.cloud.contentwarehouse.v1.UpdateRuleSetRequest - * @instance - */ - UpdateRuleSetRequest.prototype.ruleSet = null; - - /** - * Creates a new UpdateRuleSetRequest instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.UpdateRuleSetRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.UpdateRuleSetRequest} UpdateRuleSetRequest instance - */ - UpdateRuleSetRequest.create = function create(properties) { - return new UpdateRuleSetRequest(properties); - }; - - /** - * Encodes the specified UpdateRuleSetRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateRuleSetRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.UpdateRuleSetRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest} message UpdateRuleSetRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateRuleSetRequest.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.ruleSet != null && Object.hasOwnProperty.call(message, "ruleSet")) - $root.google.cloud.contentwarehouse.v1.RuleSet.encode(message.ruleSet, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateRuleSetRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateRuleSetRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.UpdateRuleSetRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest} message UpdateRuleSetRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateRuleSetRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateRuleSetRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.UpdateRuleSetRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.UpdateRuleSetRequest} UpdateRuleSetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateRuleSetRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.ruleSet = $root.google.cloud.contentwarehouse.v1.RuleSet.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateRuleSetRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.UpdateRuleSetRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.UpdateRuleSetRequest} UpdateRuleSetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateRuleSetRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateRuleSetRequest message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.UpdateRuleSetRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateRuleSetRequest.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.ruleSet != null && message.hasOwnProperty("ruleSet")) { - var error = $root.google.cloud.contentwarehouse.v1.RuleSet.verify(message.ruleSet); - if (error) - return "ruleSet." + error; - } - return null; - }; - - /** - * Creates an UpdateRuleSetRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.UpdateRuleSetRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.UpdateRuleSetRequest} UpdateRuleSetRequest - */ - UpdateRuleSetRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.ruleSet != null) { - if (typeof object.ruleSet !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.UpdateRuleSetRequest.ruleSet: object expected"); - message.ruleSet = $root.google.cloud.contentwarehouse.v1.RuleSet.fromObject(object.ruleSet); - } - return message; - }; - - /** - * Creates a plain object from an UpdateRuleSetRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.UpdateRuleSetRequest - * @static - * @param {google.cloud.contentwarehouse.v1.UpdateRuleSetRequest} message UpdateRuleSetRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateRuleSetRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.ruleSet = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.ruleSet != null && message.hasOwnProperty("ruleSet")) - object.ruleSet = $root.google.cloud.contentwarehouse.v1.RuleSet.toObject(message.ruleSet, options); - return object; - }; - - /** - * Converts this UpdateRuleSetRequest to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.UpdateRuleSetRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateRuleSetRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateRuleSetRequest - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.UpdateRuleSetRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateRuleSetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.UpdateRuleSetRequest"; - }; - - return UpdateRuleSetRequest; - })(); - - v1.DeleteRuleSetRequest = (function() { - - /** - * Properties of a DeleteRuleSetRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IDeleteRuleSetRequest - * @property {string|null} [name] DeleteRuleSetRequest name - */ - - /** - * Constructs a new DeleteRuleSetRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a DeleteRuleSetRequest. - * @implements IDeleteRuleSetRequest - * @constructor - * @param {google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest=} [properties] Properties to set - */ - function DeleteRuleSetRequest(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]]; - } - - /** - * DeleteRuleSetRequest name. - * @member {string} name - * @memberof google.cloud.contentwarehouse.v1.DeleteRuleSetRequest - * @instance - */ - DeleteRuleSetRequest.prototype.name = ""; - - /** - * Creates a new DeleteRuleSetRequest instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.DeleteRuleSetRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.DeleteRuleSetRequest} DeleteRuleSetRequest instance - */ - DeleteRuleSetRequest.create = function create(properties) { - return new DeleteRuleSetRequest(properties); - }; - - /** - * Encodes the specified DeleteRuleSetRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DeleteRuleSetRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.DeleteRuleSetRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest} message DeleteRuleSetRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteRuleSetRequest.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 DeleteRuleSetRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DeleteRuleSetRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.DeleteRuleSetRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest} message DeleteRuleSetRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteRuleSetRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteRuleSetRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.DeleteRuleSetRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.DeleteRuleSetRequest} DeleteRuleSetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteRuleSetRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteRuleSetRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.DeleteRuleSetRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.DeleteRuleSetRequest} DeleteRuleSetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteRuleSetRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteRuleSetRequest message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.DeleteRuleSetRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteRuleSetRequest.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 DeleteRuleSetRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.DeleteRuleSetRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.DeleteRuleSetRequest} DeleteRuleSetRequest - */ - DeleteRuleSetRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteRuleSetRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.DeleteRuleSetRequest - * @static - * @param {google.cloud.contentwarehouse.v1.DeleteRuleSetRequest} message DeleteRuleSetRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteRuleSetRequest.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 DeleteRuleSetRequest to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.DeleteRuleSetRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteRuleSetRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteRuleSetRequest - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.DeleteRuleSetRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteRuleSetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.DeleteRuleSetRequest"; - }; - - return DeleteRuleSetRequest; - })(); - - v1.ListRuleSetsRequest = (function() { - - /** - * Properties of a ListRuleSetsRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IListRuleSetsRequest - * @property {string|null} [parent] ListRuleSetsRequest parent - * @property {number|null} [pageSize] ListRuleSetsRequest pageSize - * @property {string|null} [pageToken] ListRuleSetsRequest pageToken - */ - - /** - * Constructs a new ListRuleSetsRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a ListRuleSetsRequest. - * @implements IListRuleSetsRequest - * @constructor - * @param {google.cloud.contentwarehouse.v1.IListRuleSetsRequest=} [properties] Properties to set - */ - function ListRuleSetsRequest(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]]; - } - - /** - * ListRuleSetsRequest parent. - * @member {string} parent - * @memberof google.cloud.contentwarehouse.v1.ListRuleSetsRequest - * @instance - */ - ListRuleSetsRequest.prototype.parent = ""; - - /** - * ListRuleSetsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.contentwarehouse.v1.ListRuleSetsRequest - * @instance - */ - ListRuleSetsRequest.prototype.pageSize = 0; - - /** - * ListRuleSetsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.contentwarehouse.v1.ListRuleSetsRequest - * @instance - */ - ListRuleSetsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListRuleSetsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.ListRuleSetsRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IListRuleSetsRequest=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.ListRuleSetsRequest} ListRuleSetsRequest instance - */ - ListRuleSetsRequest.create = function create(properties) { - return new ListRuleSetsRequest(properties); - }; - - /** - * Encodes the specified ListRuleSetsRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListRuleSetsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.ListRuleSetsRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IListRuleSetsRequest} message ListRuleSetsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListRuleSetsRequest.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.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); - return writer; - }; - - /** - * Encodes the specified ListRuleSetsRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListRuleSetsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.ListRuleSetsRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IListRuleSetsRequest} message ListRuleSetsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListRuleSetsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListRuleSetsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.ListRuleSetsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.ListRuleSetsRequest} ListRuleSetsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListRuleSetsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.ListRuleSetsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListRuleSetsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.ListRuleSetsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.ListRuleSetsRequest} ListRuleSetsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListRuleSetsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListRuleSetsRequest message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.ListRuleSetsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListRuleSetsRequest.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.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"; - return null; - }; - - /** - * Creates a ListRuleSetsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.ListRuleSetsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.ListRuleSetsRequest} ListRuleSetsRequest - */ - ListRuleSetsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.ListRuleSetsRequest) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.ListRuleSetsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListRuleSetsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.ListRuleSetsRequest - * @static - * @param {google.cloud.contentwarehouse.v1.ListRuleSetsRequest} message ListRuleSetsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListRuleSetsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListRuleSetsRequest to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.ListRuleSetsRequest - * @instance - * @returns {Object.} JSON object - */ - ListRuleSetsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListRuleSetsRequest - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.ListRuleSetsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListRuleSetsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.ListRuleSetsRequest"; - }; - - return ListRuleSetsRequest; - })(); - - v1.ListRuleSetsResponse = (function() { - - /** - * Properties of a ListRuleSetsResponse. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IListRuleSetsResponse - * @property {Array.|null} [ruleSets] ListRuleSetsResponse ruleSets - * @property {string|null} [nextPageToken] ListRuleSetsResponse nextPageToken - */ - - /** - * Constructs a new ListRuleSetsResponse. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a ListRuleSetsResponse. - * @implements IListRuleSetsResponse - * @constructor - * @param {google.cloud.contentwarehouse.v1.IListRuleSetsResponse=} [properties] Properties to set - */ - function ListRuleSetsResponse(properties) { - this.ruleSets = []; - 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]]; - } - - /** - * ListRuleSetsResponse ruleSets. - * @member {Array.} ruleSets - * @memberof google.cloud.contentwarehouse.v1.ListRuleSetsResponse - * @instance - */ - ListRuleSetsResponse.prototype.ruleSets = $util.emptyArray; - - /** - * ListRuleSetsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.contentwarehouse.v1.ListRuleSetsResponse - * @instance - */ - ListRuleSetsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListRuleSetsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.ListRuleSetsResponse - * @static - * @param {google.cloud.contentwarehouse.v1.IListRuleSetsResponse=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.ListRuleSetsResponse} ListRuleSetsResponse instance - */ - ListRuleSetsResponse.create = function create(properties) { - return new ListRuleSetsResponse(properties); - }; - - /** - * Encodes the specified ListRuleSetsResponse message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListRuleSetsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.ListRuleSetsResponse - * @static - * @param {google.cloud.contentwarehouse.v1.IListRuleSetsResponse} message ListRuleSetsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListRuleSetsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ruleSets != null && message.ruleSets.length) - for (var i = 0; i < message.ruleSets.length; ++i) - $root.google.cloud.contentwarehouse.v1.RuleSet.encode(message.ruleSets[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 ListRuleSetsResponse message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListRuleSetsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.ListRuleSetsResponse - * @static - * @param {google.cloud.contentwarehouse.v1.IListRuleSetsResponse} message ListRuleSetsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListRuleSetsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListRuleSetsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.ListRuleSetsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.ListRuleSetsResponse} ListRuleSetsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListRuleSetsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.ListRuleSetsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.ruleSets && message.ruleSets.length)) - message.ruleSets = []; - message.ruleSets.push($root.google.cloud.contentwarehouse.v1.RuleSet.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListRuleSetsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.ListRuleSetsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.ListRuleSetsResponse} ListRuleSetsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListRuleSetsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListRuleSetsResponse message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.ListRuleSetsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListRuleSetsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ruleSets != null && message.hasOwnProperty("ruleSets")) { - if (!Array.isArray(message.ruleSets)) - return "ruleSets: array expected"; - for (var i = 0; i < message.ruleSets.length; ++i) { - var error = $root.google.cloud.contentwarehouse.v1.RuleSet.verify(message.ruleSets[i]); - if (error) - return "ruleSets." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListRuleSetsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.ListRuleSetsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.ListRuleSetsResponse} ListRuleSetsResponse - */ - ListRuleSetsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.ListRuleSetsResponse) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.ListRuleSetsResponse(); - if (object.ruleSets) { - if (!Array.isArray(object.ruleSets)) - throw TypeError(".google.cloud.contentwarehouse.v1.ListRuleSetsResponse.ruleSets: array expected"); - message.ruleSets = []; - for (var i = 0; i < object.ruleSets.length; ++i) { - if (typeof object.ruleSets[i] !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.ListRuleSetsResponse.ruleSets: object expected"); - message.ruleSets[i] = $root.google.cloud.contentwarehouse.v1.RuleSet.fromObject(object.ruleSets[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListRuleSetsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.ListRuleSetsResponse - * @static - * @param {google.cloud.contentwarehouse.v1.ListRuleSetsResponse} message ListRuleSetsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListRuleSetsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.ruleSets = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.ruleSets && message.ruleSets.length) { - object.ruleSets = []; - for (var j = 0; j < message.ruleSets.length; ++j) - object.ruleSets[j] = $root.google.cloud.contentwarehouse.v1.RuleSet.toObject(message.ruleSets[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListRuleSetsResponse to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.ListRuleSetsResponse - * @instance - * @returns {Object.} JSON object - */ - ListRuleSetsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListRuleSetsResponse - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.ListRuleSetsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListRuleSetsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.ListRuleSetsResponse"; - }; - - return ListRuleSetsResponse; - })(); - - v1.SynonymSet = (function() { - - /** - * Properties of a SynonymSet. - * @memberof google.cloud.contentwarehouse.v1 - * @interface ISynonymSet - * @property {string|null} [name] SynonymSet name - * @property {string|null} [context] SynonymSet context - * @property {Array.|null} [synonyms] SynonymSet synonyms - */ - - /** - * Constructs a new SynonymSet. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a SynonymSet. - * @implements ISynonymSet - * @constructor - * @param {google.cloud.contentwarehouse.v1.ISynonymSet=} [properties] Properties to set - */ - function SynonymSet(properties) { - this.synonyms = []; - 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]]; - } - - /** - * SynonymSet name. - * @member {string} name - * @memberof google.cloud.contentwarehouse.v1.SynonymSet - * @instance - */ - SynonymSet.prototype.name = ""; - - /** - * SynonymSet context. - * @member {string} context - * @memberof google.cloud.contentwarehouse.v1.SynonymSet - * @instance - */ - SynonymSet.prototype.context = ""; - - /** - * SynonymSet synonyms. - * @member {Array.} synonyms - * @memberof google.cloud.contentwarehouse.v1.SynonymSet - * @instance - */ - SynonymSet.prototype.synonyms = $util.emptyArray; - - /** - * Creates a new SynonymSet instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.SynonymSet - * @static - * @param {google.cloud.contentwarehouse.v1.ISynonymSet=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.SynonymSet} SynonymSet instance - */ - SynonymSet.create = function create(properties) { - return new SynonymSet(properties); - }; - - /** - * Encodes the specified SynonymSet message. Does not implicitly {@link google.cloud.contentwarehouse.v1.SynonymSet.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.SynonymSet - * @static - * @param {google.cloud.contentwarehouse.v1.ISynonymSet} message SynonymSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SynonymSet.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.context != null && Object.hasOwnProperty.call(message, "context")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.context); - if (message.synonyms != null && message.synonyms.length) - for (var i = 0; i < message.synonyms.length; ++i) - $root.google.cloud.contentwarehouse.v1.SynonymSet.Synonym.encode(message.synonyms[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SynonymSet message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.SynonymSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.SynonymSet - * @static - * @param {google.cloud.contentwarehouse.v1.ISynonymSet} message SynonymSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SynonymSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SynonymSet message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.SynonymSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.SynonymSet} SynonymSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SynonymSet.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.SynonymSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.context = reader.string(); - break; - } - case 3: { - if (!(message.synonyms && message.synonyms.length)) - message.synonyms = []; - message.synonyms.push($root.google.cloud.contentwarehouse.v1.SynonymSet.Synonym.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SynonymSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.SynonymSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.SynonymSet} SynonymSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SynonymSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SynonymSet message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.SynonymSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SynonymSet.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.context != null && message.hasOwnProperty("context")) - if (!$util.isString(message.context)) - return "context: string expected"; - if (message.synonyms != null && message.hasOwnProperty("synonyms")) { - if (!Array.isArray(message.synonyms)) - return "synonyms: array expected"; - for (var i = 0; i < message.synonyms.length; ++i) { - var error = $root.google.cloud.contentwarehouse.v1.SynonymSet.Synonym.verify(message.synonyms[i]); - if (error) - return "synonyms." + error; - } - } - return null; - }; - - /** - * Creates a SynonymSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.SynonymSet - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.SynonymSet} SynonymSet - */ - SynonymSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.SynonymSet) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.SynonymSet(); - if (object.name != null) - message.name = String(object.name); - if (object.context != null) - message.context = String(object.context); - if (object.synonyms) { - if (!Array.isArray(object.synonyms)) - throw TypeError(".google.cloud.contentwarehouse.v1.SynonymSet.synonyms: array expected"); - message.synonyms = []; - for (var i = 0; i < object.synonyms.length; ++i) { - if (typeof object.synonyms[i] !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.SynonymSet.synonyms: object expected"); - message.synonyms[i] = $root.google.cloud.contentwarehouse.v1.SynonymSet.Synonym.fromObject(object.synonyms[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a SynonymSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.SynonymSet - * @static - * @param {google.cloud.contentwarehouse.v1.SynonymSet} message SynonymSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SynonymSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.synonyms = []; - if (options.defaults) { - object.name = ""; - object.context = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.context != null && message.hasOwnProperty("context")) - object.context = message.context; - if (message.synonyms && message.synonyms.length) { - object.synonyms = []; - for (var j = 0; j < message.synonyms.length; ++j) - object.synonyms[j] = $root.google.cloud.contentwarehouse.v1.SynonymSet.Synonym.toObject(message.synonyms[j], options); - } - return object; - }; - - /** - * Converts this SynonymSet to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.SynonymSet - * @instance - * @returns {Object.} JSON object - */ - SynonymSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SynonymSet - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.SynonymSet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SynonymSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.SynonymSet"; - }; - - SynonymSet.Synonym = (function() { - - /** - * Properties of a Synonym. - * @memberof google.cloud.contentwarehouse.v1.SynonymSet - * @interface ISynonym - * @property {Array.|null} [words] Synonym words - */ - - /** - * Constructs a new Synonym. - * @memberof google.cloud.contentwarehouse.v1.SynonymSet - * @classdesc Represents a Synonym. - * @implements ISynonym - * @constructor - * @param {google.cloud.contentwarehouse.v1.SynonymSet.ISynonym=} [properties] Properties to set - */ - function Synonym(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]]; - } - - /** - * Synonym words. - * @member {Array.} words - * @memberof google.cloud.contentwarehouse.v1.SynonymSet.Synonym - * @instance - */ - Synonym.prototype.words = $util.emptyArray; - - /** - * Creates a new Synonym instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.SynonymSet.Synonym - * @static - * @param {google.cloud.contentwarehouse.v1.SynonymSet.ISynonym=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.SynonymSet.Synonym} Synonym instance - */ - Synonym.create = function create(properties) { - return new Synonym(properties); - }; - - /** - * Encodes the specified Synonym message. Does not implicitly {@link google.cloud.contentwarehouse.v1.SynonymSet.Synonym.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.SynonymSet.Synonym - * @static - * @param {google.cloud.contentwarehouse.v1.SynonymSet.ISynonym} message Synonym message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Synonym.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 Synonym message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.SynonymSet.Synonym.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.SynonymSet.Synonym - * @static - * @param {google.cloud.contentwarehouse.v1.SynonymSet.ISynonym} message Synonym message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Synonym.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Synonym message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.SynonymSet.Synonym - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.SynonymSet.Synonym} Synonym - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Synonym.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.SynonymSet.Synonym(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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 Synonym message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.SynonymSet.Synonym - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.SynonymSet.Synonym} Synonym - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Synonym.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Synonym message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.SynonymSet.Synonym - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Synonym.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 Synonym message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.SynonymSet.Synonym - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.SynonymSet.Synonym} Synonym - */ - Synonym.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.SynonymSet.Synonym) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.SynonymSet.Synonym(); - if (object.words) { - if (!Array.isArray(object.words)) - throw TypeError(".google.cloud.contentwarehouse.v1.SynonymSet.Synonym.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 Synonym message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.SynonymSet.Synonym - * @static - * @param {google.cloud.contentwarehouse.v1.SynonymSet.Synonym} message Synonym - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Synonym.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 Synonym to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.SynonymSet.Synonym - * @instance - * @returns {Object.} JSON object - */ - Synonym.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Synonym - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.SynonymSet.Synonym - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Synonym.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.SynonymSet.Synonym"; - }; - - return Synonym; - })(); - - return SynonymSet; - })(); - - v1.SynonymSetService = (function() { - - /** - * Constructs a new SynonymSetService service. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a SynonymSetService - * @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 SynonymSetService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (SynonymSetService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SynonymSetService; - - /** - * Creates new SynonymSetService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.contentwarehouse.v1.SynonymSetService - * @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 {SynonymSetService} RPC service. Useful where requests and/or responses are streamed. - */ - SynonymSetService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.SynonymSetService|createSynonymSet}. - * @memberof google.cloud.contentwarehouse.v1.SynonymSetService - * @typedef CreateSynonymSetCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.contentwarehouse.v1.SynonymSet} [response] SynonymSet - */ - - /** - * Calls CreateSynonymSet. - * @function createSynonymSet - * @memberof google.cloud.contentwarehouse.v1.SynonymSetService - * @instance - * @param {google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest} request CreateSynonymSetRequest message or plain object - * @param {google.cloud.contentwarehouse.v1.SynonymSetService.CreateSynonymSetCallback} callback Node-style callback called with the error, if any, and SynonymSet - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SynonymSetService.prototype.createSynonymSet = function createSynonymSet(request, callback) { - return this.rpcCall(createSynonymSet, $root.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest, $root.google.cloud.contentwarehouse.v1.SynonymSet, request, callback); - }, "name", { value: "CreateSynonymSet" }); - - /** - * Calls CreateSynonymSet. - * @function createSynonymSet - * @memberof google.cloud.contentwarehouse.v1.SynonymSetService - * @instance - * @param {google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest} request CreateSynonymSetRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.SynonymSetService|getSynonymSet}. - * @memberof google.cloud.contentwarehouse.v1.SynonymSetService - * @typedef GetSynonymSetCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.contentwarehouse.v1.SynonymSet} [response] SynonymSet - */ - - /** - * Calls GetSynonymSet. - * @function getSynonymSet - * @memberof google.cloud.contentwarehouse.v1.SynonymSetService - * @instance - * @param {google.cloud.contentwarehouse.v1.IGetSynonymSetRequest} request GetSynonymSetRequest message or plain object - * @param {google.cloud.contentwarehouse.v1.SynonymSetService.GetSynonymSetCallback} callback Node-style callback called with the error, if any, and SynonymSet - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SynonymSetService.prototype.getSynonymSet = function getSynonymSet(request, callback) { - return this.rpcCall(getSynonymSet, $root.google.cloud.contentwarehouse.v1.GetSynonymSetRequest, $root.google.cloud.contentwarehouse.v1.SynonymSet, request, callback); - }, "name", { value: "GetSynonymSet" }); - - /** - * Calls GetSynonymSet. - * @function getSynonymSet - * @memberof google.cloud.contentwarehouse.v1.SynonymSetService - * @instance - * @param {google.cloud.contentwarehouse.v1.IGetSynonymSetRequest} request GetSynonymSetRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.SynonymSetService|updateSynonymSet}. - * @memberof google.cloud.contentwarehouse.v1.SynonymSetService - * @typedef UpdateSynonymSetCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.contentwarehouse.v1.SynonymSet} [response] SynonymSet - */ - - /** - * Calls UpdateSynonymSet. - * @function updateSynonymSet - * @memberof google.cloud.contentwarehouse.v1.SynonymSetService - * @instance - * @param {google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest} request UpdateSynonymSetRequest message or plain object - * @param {google.cloud.contentwarehouse.v1.SynonymSetService.UpdateSynonymSetCallback} callback Node-style callback called with the error, if any, and SynonymSet - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SynonymSetService.prototype.updateSynonymSet = function updateSynonymSet(request, callback) { - return this.rpcCall(updateSynonymSet, $root.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest, $root.google.cloud.contentwarehouse.v1.SynonymSet, request, callback); - }, "name", { value: "UpdateSynonymSet" }); - - /** - * Calls UpdateSynonymSet. - * @function updateSynonymSet - * @memberof google.cloud.contentwarehouse.v1.SynonymSetService - * @instance - * @param {google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest} request UpdateSynonymSetRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.SynonymSetService|deleteSynonymSet}. - * @memberof google.cloud.contentwarehouse.v1.SynonymSetService - * @typedef DeleteSynonymSetCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteSynonymSet. - * @function deleteSynonymSet - * @memberof google.cloud.contentwarehouse.v1.SynonymSetService - * @instance - * @param {google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest} request DeleteSynonymSetRequest message or plain object - * @param {google.cloud.contentwarehouse.v1.SynonymSetService.DeleteSynonymSetCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SynonymSetService.prototype.deleteSynonymSet = function deleteSynonymSet(request, callback) { - return this.rpcCall(deleteSynonymSet, $root.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteSynonymSet" }); - - /** - * Calls DeleteSynonymSet. - * @function deleteSynonymSet - * @memberof google.cloud.contentwarehouse.v1.SynonymSetService - * @instance - * @param {google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest} request DeleteSynonymSetRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.contentwarehouse.v1.SynonymSetService|listSynonymSets}. - * @memberof google.cloud.contentwarehouse.v1.SynonymSetService - * @typedef ListSynonymSetsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.contentwarehouse.v1.ListSynonymSetsResponse} [response] ListSynonymSetsResponse - */ - - /** - * Calls ListSynonymSets. - * @function listSynonymSets - * @memberof google.cloud.contentwarehouse.v1.SynonymSetService - * @instance - * @param {google.cloud.contentwarehouse.v1.IListSynonymSetsRequest} request ListSynonymSetsRequest message or plain object - * @param {google.cloud.contentwarehouse.v1.SynonymSetService.ListSynonymSetsCallback} callback Node-style callback called with the error, if any, and ListSynonymSetsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SynonymSetService.prototype.listSynonymSets = function listSynonymSets(request, callback) { - return this.rpcCall(listSynonymSets, $root.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest, $root.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse, request, callback); - }, "name", { value: "ListSynonymSets" }); - - /** - * Calls ListSynonymSets. - * @function listSynonymSets - * @memberof google.cloud.contentwarehouse.v1.SynonymSetService - * @instance - * @param {google.cloud.contentwarehouse.v1.IListSynonymSetsRequest} request ListSynonymSetsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return SynonymSetService; - })(); - - v1.CreateSynonymSetRequest = (function() { - - /** - * Properties of a CreateSynonymSetRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @interface ICreateSynonymSetRequest - * @property {string|null} [parent] CreateSynonymSetRequest parent - * @property {google.cloud.contentwarehouse.v1.ISynonymSet|null} [synonymSet] CreateSynonymSetRequest synonymSet - */ - - /** - * Constructs a new CreateSynonymSetRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a CreateSynonymSetRequest. - * @implements ICreateSynonymSetRequest - * @constructor - * @param {google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest=} [properties] Properties to set - */ - function CreateSynonymSetRequest(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]]; - } - - /** - * CreateSynonymSetRequest parent. - * @member {string} parent - * @memberof google.cloud.contentwarehouse.v1.CreateSynonymSetRequest - * @instance - */ - CreateSynonymSetRequest.prototype.parent = ""; - - /** - * CreateSynonymSetRequest synonymSet. - * @member {google.cloud.contentwarehouse.v1.ISynonymSet|null|undefined} synonymSet - * @memberof google.cloud.contentwarehouse.v1.CreateSynonymSetRequest - * @instance - */ - CreateSynonymSetRequest.prototype.synonymSet = null; - - /** - * Creates a new CreateSynonymSetRequest instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.CreateSynonymSetRequest - * @static - * @param {google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.CreateSynonymSetRequest} CreateSynonymSetRequest instance - */ - CreateSynonymSetRequest.create = function create(properties) { - return new CreateSynonymSetRequest(properties); - }; - - /** - * Encodes the specified CreateSynonymSetRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateSynonymSetRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.CreateSynonymSetRequest - * @static - * @param {google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest} message CreateSynonymSetRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateSynonymSetRequest.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.synonymSet != null && Object.hasOwnProperty.call(message, "synonymSet")) - $root.google.cloud.contentwarehouse.v1.SynonymSet.encode(message.synonymSet, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateSynonymSetRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateSynonymSetRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.CreateSynonymSetRequest - * @static - * @param {google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest} message CreateSynonymSetRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateSynonymSetRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateSynonymSetRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.CreateSynonymSetRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.CreateSynonymSetRequest} CreateSynonymSetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateSynonymSetRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.synonymSet = $root.google.cloud.contentwarehouse.v1.SynonymSet.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateSynonymSetRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.CreateSynonymSetRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.CreateSynonymSetRequest} CreateSynonymSetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateSynonymSetRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateSynonymSetRequest message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.CreateSynonymSetRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateSynonymSetRequest.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.synonymSet != null && message.hasOwnProperty("synonymSet")) { - var error = $root.google.cloud.contentwarehouse.v1.SynonymSet.verify(message.synonymSet); - if (error) - return "synonymSet." + error; - } - return null; - }; - - /** - * Creates a CreateSynonymSetRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.CreateSynonymSetRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.CreateSynonymSetRequest} CreateSynonymSetRequest - */ - CreateSynonymSetRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.synonymSet != null) { - if (typeof object.synonymSet !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.CreateSynonymSetRequest.synonymSet: object expected"); - message.synonymSet = $root.google.cloud.contentwarehouse.v1.SynonymSet.fromObject(object.synonymSet); - } - return message; - }; - - /** - * Creates a plain object from a CreateSynonymSetRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.CreateSynonymSetRequest - * @static - * @param {google.cloud.contentwarehouse.v1.CreateSynonymSetRequest} message CreateSynonymSetRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateSynonymSetRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.synonymSet = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.synonymSet != null && message.hasOwnProperty("synonymSet")) - object.synonymSet = $root.google.cloud.contentwarehouse.v1.SynonymSet.toObject(message.synonymSet, options); - return object; - }; - - /** - * Converts this CreateSynonymSetRequest to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.CreateSynonymSetRequest - * @instance - * @returns {Object.} JSON object - */ - CreateSynonymSetRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateSynonymSetRequest - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.CreateSynonymSetRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateSynonymSetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.CreateSynonymSetRequest"; - }; - - return CreateSynonymSetRequest; - })(); - - v1.GetSynonymSetRequest = (function() { - - /** - * Properties of a GetSynonymSetRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IGetSynonymSetRequest - * @property {string|null} [name] GetSynonymSetRequest name - */ - - /** - * Constructs a new GetSynonymSetRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a GetSynonymSetRequest. - * @implements IGetSynonymSetRequest - * @constructor - * @param {google.cloud.contentwarehouse.v1.IGetSynonymSetRequest=} [properties] Properties to set - */ - function GetSynonymSetRequest(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]]; - } - - /** - * GetSynonymSetRequest name. - * @member {string} name - * @memberof google.cloud.contentwarehouse.v1.GetSynonymSetRequest - * @instance - */ - GetSynonymSetRequest.prototype.name = ""; - - /** - * Creates a new GetSynonymSetRequest instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.GetSynonymSetRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IGetSynonymSetRequest=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.GetSynonymSetRequest} GetSynonymSetRequest instance - */ - GetSynonymSetRequest.create = function create(properties) { - return new GetSynonymSetRequest(properties); - }; - - /** - * Encodes the specified GetSynonymSetRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.GetSynonymSetRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.GetSynonymSetRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IGetSynonymSetRequest} message GetSynonymSetRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetSynonymSetRequest.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 GetSynonymSetRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.GetSynonymSetRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.GetSynonymSetRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IGetSynonymSetRequest} message GetSynonymSetRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetSynonymSetRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetSynonymSetRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.GetSynonymSetRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.GetSynonymSetRequest} GetSynonymSetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetSynonymSetRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.GetSynonymSetRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetSynonymSetRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.GetSynonymSetRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.GetSynonymSetRequest} GetSynonymSetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetSynonymSetRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetSynonymSetRequest message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.GetSynonymSetRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetSynonymSetRequest.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 GetSynonymSetRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.GetSynonymSetRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.GetSynonymSetRequest} GetSynonymSetRequest - */ - GetSynonymSetRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.GetSynonymSetRequest) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.GetSynonymSetRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetSynonymSetRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.GetSynonymSetRequest - * @static - * @param {google.cloud.contentwarehouse.v1.GetSynonymSetRequest} message GetSynonymSetRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetSynonymSetRequest.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 GetSynonymSetRequest to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.GetSynonymSetRequest - * @instance - * @returns {Object.} JSON object - */ - GetSynonymSetRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetSynonymSetRequest - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.GetSynonymSetRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetSynonymSetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.GetSynonymSetRequest"; - }; - - return GetSynonymSetRequest; - })(); - - v1.ListSynonymSetsRequest = (function() { - - /** - * Properties of a ListSynonymSetsRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IListSynonymSetsRequest - * @property {string|null} [parent] ListSynonymSetsRequest parent - * @property {number|null} [pageSize] ListSynonymSetsRequest pageSize - * @property {string|null} [pageToken] ListSynonymSetsRequest pageToken - */ - - /** - * Constructs a new ListSynonymSetsRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a ListSynonymSetsRequest. - * @implements IListSynonymSetsRequest - * @constructor - * @param {google.cloud.contentwarehouse.v1.IListSynonymSetsRequest=} [properties] Properties to set - */ - function ListSynonymSetsRequest(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]]; - } - - /** - * ListSynonymSetsRequest parent. - * @member {string} parent - * @memberof google.cloud.contentwarehouse.v1.ListSynonymSetsRequest - * @instance - */ - ListSynonymSetsRequest.prototype.parent = ""; - - /** - * ListSynonymSetsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.contentwarehouse.v1.ListSynonymSetsRequest - * @instance - */ - ListSynonymSetsRequest.prototype.pageSize = 0; - - /** - * ListSynonymSetsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.contentwarehouse.v1.ListSynonymSetsRequest - * @instance - */ - ListSynonymSetsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListSynonymSetsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.ListSynonymSetsRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IListSynonymSetsRequest=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.ListSynonymSetsRequest} ListSynonymSetsRequest instance - */ - ListSynonymSetsRequest.create = function create(properties) { - return new ListSynonymSetsRequest(properties); - }; - - /** - * Encodes the specified ListSynonymSetsRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListSynonymSetsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.ListSynonymSetsRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IListSynonymSetsRequest} message ListSynonymSetsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSynonymSetsRequest.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.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); - return writer; - }; - - /** - * Encodes the specified ListSynonymSetsRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListSynonymSetsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.ListSynonymSetsRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IListSynonymSetsRequest} message ListSynonymSetsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSynonymSetsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListSynonymSetsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.ListSynonymSetsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.ListSynonymSetsRequest} ListSynonymSetsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSynonymSetsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListSynonymSetsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.ListSynonymSetsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.ListSynonymSetsRequest} ListSynonymSetsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSynonymSetsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListSynonymSetsRequest message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.ListSynonymSetsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListSynonymSetsRequest.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.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"; - return null; - }; - - /** - * Creates a ListSynonymSetsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.ListSynonymSetsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.ListSynonymSetsRequest} ListSynonymSetsRequest - */ - ListSynonymSetsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListSynonymSetsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.ListSynonymSetsRequest - * @static - * @param {google.cloud.contentwarehouse.v1.ListSynonymSetsRequest} message ListSynonymSetsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListSynonymSetsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListSynonymSetsRequest to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.ListSynonymSetsRequest - * @instance - * @returns {Object.} JSON object - */ - ListSynonymSetsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListSynonymSetsRequest - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.ListSynonymSetsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListSynonymSetsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.ListSynonymSetsRequest"; - }; - - return ListSynonymSetsRequest; - })(); - - v1.ListSynonymSetsResponse = (function() { - - /** - * Properties of a ListSynonymSetsResponse. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IListSynonymSetsResponse - * @property {Array.|null} [synonymSets] ListSynonymSetsResponse synonymSets - * @property {string|null} [nextPageToken] ListSynonymSetsResponse nextPageToken - */ - - /** - * Constructs a new ListSynonymSetsResponse. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a ListSynonymSetsResponse. - * @implements IListSynonymSetsResponse - * @constructor - * @param {google.cloud.contentwarehouse.v1.IListSynonymSetsResponse=} [properties] Properties to set - */ - function ListSynonymSetsResponse(properties) { - this.synonymSets = []; - 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]]; - } - - /** - * ListSynonymSetsResponse synonymSets. - * @member {Array.} synonymSets - * @memberof google.cloud.contentwarehouse.v1.ListSynonymSetsResponse - * @instance - */ - ListSynonymSetsResponse.prototype.synonymSets = $util.emptyArray; - - /** - * ListSynonymSetsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.contentwarehouse.v1.ListSynonymSetsResponse - * @instance - */ - ListSynonymSetsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListSynonymSetsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.ListSynonymSetsResponse - * @static - * @param {google.cloud.contentwarehouse.v1.IListSynonymSetsResponse=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.ListSynonymSetsResponse} ListSynonymSetsResponse instance - */ - ListSynonymSetsResponse.create = function create(properties) { - return new ListSynonymSetsResponse(properties); - }; - - /** - * Encodes the specified ListSynonymSetsResponse message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListSynonymSetsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.ListSynonymSetsResponse - * @static - * @param {google.cloud.contentwarehouse.v1.IListSynonymSetsResponse} message ListSynonymSetsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSynonymSetsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.synonymSets != null && message.synonymSets.length) - for (var i = 0; i < message.synonymSets.length; ++i) - $root.google.cloud.contentwarehouse.v1.SynonymSet.encode(message.synonymSets[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 ListSynonymSetsResponse message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ListSynonymSetsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.ListSynonymSetsResponse - * @static - * @param {google.cloud.contentwarehouse.v1.IListSynonymSetsResponse} message ListSynonymSetsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSynonymSetsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListSynonymSetsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.ListSynonymSetsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.ListSynonymSetsResponse} ListSynonymSetsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSynonymSetsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.synonymSets && message.synonymSets.length)) - message.synonymSets = []; - message.synonymSets.push($root.google.cloud.contentwarehouse.v1.SynonymSet.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListSynonymSetsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.ListSynonymSetsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.ListSynonymSetsResponse} ListSynonymSetsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSynonymSetsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListSynonymSetsResponse message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.ListSynonymSetsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListSynonymSetsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.synonymSets != null && message.hasOwnProperty("synonymSets")) { - if (!Array.isArray(message.synonymSets)) - return "synonymSets: array expected"; - for (var i = 0; i < message.synonymSets.length; ++i) { - var error = $root.google.cloud.contentwarehouse.v1.SynonymSet.verify(message.synonymSets[i]); - if (error) - return "synonymSets." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListSynonymSetsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.ListSynonymSetsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.ListSynonymSetsResponse} ListSynonymSetsResponse - */ - ListSynonymSetsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.ListSynonymSetsResponse(); - if (object.synonymSets) { - if (!Array.isArray(object.synonymSets)) - throw TypeError(".google.cloud.contentwarehouse.v1.ListSynonymSetsResponse.synonymSets: array expected"); - message.synonymSets = []; - for (var i = 0; i < object.synonymSets.length; ++i) { - if (typeof object.synonymSets[i] !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.ListSynonymSetsResponse.synonymSets: object expected"); - message.synonymSets[i] = $root.google.cloud.contentwarehouse.v1.SynonymSet.fromObject(object.synonymSets[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListSynonymSetsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.ListSynonymSetsResponse - * @static - * @param {google.cloud.contentwarehouse.v1.ListSynonymSetsResponse} message ListSynonymSetsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListSynonymSetsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.synonymSets = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.synonymSets && message.synonymSets.length) { - object.synonymSets = []; - for (var j = 0; j < message.synonymSets.length; ++j) - object.synonymSets[j] = $root.google.cloud.contentwarehouse.v1.SynonymSet.toObject(message.synonymSets[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListSynonymSetsResponse to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.ListSynonymSetsResponse - * @instance - * @returns {Object.} JSON object - */ - ListSynonymSetsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListSynonymSetsResponse - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.ListSynonymSetsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListSynonymSetsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.ListSynonymSetsResponse"; - }; - - return ListSynonymSetsResponse; - })(); - - v1.UpdateSynonymSetRequest = (function() { - - /** - * Properties of an UpdateSynonymSetRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IUpdateSynonymSetRequest - * @property {string|null} [name] UpdateSynonymSetRequest name - * @property {google.cloud.contentwarehouse.v1.ISynonymSet|null} [synonymSet] UpdateSynonymSetRequest synonymSet - */ - - /** - * Constructs a new UpdateSynonymSetRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents an UpdateSynonymSetRequest. - * @implements IUpdateSynonymSetRequest - * @constructor - * @param {google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest=} [properties] Properties to set - */ - function UpdateSynonymSetRequest(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]]; - } - - /** - * UpdateSynonymSetRequest name. - * @member {string} name - * @memberof google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest - * @instance - */ - UpdateSynonymSetRequest.prototype.name = ""; - - /** - * UpdateSynonymSetRequest synonymSet. - * @member {google.cloud.contentwarehouse.v1.ISynonymSet|null|undefined} synonymSet - * @memberof google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest - * @instance - */ - UpdateSynonymSetRequest.prototype.synonymSet = null; - - /** - * Creates a new UpdateSynonymSetRequest instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest} UpdateSynonymSetRequest instance - */ - UpdateSynonymSetRequest.create = function create(properties) { - return new UpdateSynonymSetRequest(properties); - }; - - /** - * Encodes the specified UpdateSynonymSetRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest} message UpdateSynonymSetRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateSynonymSetRequest.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.synonymSet != null && Object.hasOwnProperty.call(message, "synonymSet")) - $root.google.cloud.contentwarehouse.v1.SynonymSet.encode(message.synonymSet, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateSynonymSetRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest} message UpdateSynonymSetRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateSynonymSetRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateSynonymSetRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest} UpdateSynonymSetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateSynonymSetRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.synonymSet = $root.google.cloud.contentwarehouse.v1.SynonymSet.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateSynonymSetRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest} UpdateSynonymSetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateSynonymSetRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateSynonymSetRequest message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateSynonymSetRequest.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.synonymSet != null && message.hasOwnProperty("synonymSet")) { - var error = $root.google.cloud.contentwarehouse.v1.SynonymSet.verify(message.synonymSet); - if (error) - return "synonymSet." + error; - } - return null; - }; - - /** - * Creates an UpdateSynonymSetRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest} UpdateSynonymSetRequest - */ - UpdateSynonymSetRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.synonymSet != null) { - if (typeof object.synonymSet !== "object") - throw TypeError(".google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest.synonymSet: object expected"); - message.synonymSet = $root.google.cloud.contentwarehouse.v1.SynonymSet.fromObject(object.synonymSet); - } - return message; - }; - - /** - * Creates a plain object from an UpdateSynonymSetRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest - * @static - * @param {google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest} message UpdateSynonymSetRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateSynonymSetRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.synonymSet = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.synonymSet != null && message.hasOwnProperty("synonymSet")) - object.synonymSet = $root.google.cloud.contentwarehouse.v1.SynonymSet.toObject(message.synonymSet, options); - return object; - }; - - /** - * Converts this UpdateSynonymSetRequest to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateSynonymSetRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateSynonymSetRequest - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateSynonymSetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest"; - }; - - return UpdateSynonymSetRequest; - })(); - - v1.DeleteSynonymSetRequest = (function() { - - /** - * Properties of a DeleteSynonymSetRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @interface IDeleteSynonymSetRequest - * @property {string|null} [name] DeleteSynonymSetRequest name - */ - - /** - * Constructs a new DeleteSynonymSetRequest. - * @memberof google.cloud.contentwarehouse.v1 - * @classdesc Represents a DeleteSynonymSetRequest. - * @implements IDeleteSynonymSetRequest - * @constructor - * @param {google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest=} [properties] Properties to set - */ - function DeleteSynonymSetRequest(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]]; - } - - /** - * DeleteSynonymSetRequest name. - * @member {string} name - * @memberof google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest - * @instance - */ - DeleteSynonymSetRequest.prototype.name = ""; - - /** - * Creates a new DeleteSynonymSetRequest instance using the specified properties. - * @function create - * @memberof google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest=} [properties] Properties to set - * @returns {google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest} DeleteSynonymSetRequest instance - */ - DeleteSynonymSetRequest.create = function create(properties) { - return new DeleteSynonymSetRequest(properties); - }; - - /** - * Encodes the specified DeleteSynonymSetRequest message. Does not implicitly {@link google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest} message DeleteSynonymSetRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteSynonymSetRequest.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 DeleteSynonymSetRequest message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest - * @static - * @param {google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest} message DeleteSynonymSetRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteSynonymSetRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteSynonymSetRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest} DeleteSynonymSetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteSynonymSetRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteSynonymSetRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest} DeleteSynonymSetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteSynonymSetRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteSynonymSetRequest message. - * @function verify - * @memberof google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteSynonymSetRequest.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 DeleteSynonymSetRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest} DeleteSynonymSetRequest - */ - DeleteSynonymSetRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest) - return object; - var message = new $root.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteSynonymSetRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest - * @static - * @param {google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest} message DeleteSynonymSetRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteSynonymSetRequest.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 DeleteSynonymSetRequest to JSON. - * @function toJSON - * @memberof google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteSynonymSetRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteSynonymSetRequest - * @function getTypeUrl - * @memberof google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteSynonymSetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest"; - }; - - return DeleteSynonymSetRequest; - })(); - - return v1; - })(); - - return contentwarehouse; - })(); - - cloud.documentai = (function() { - - /** - * Namespace documentai. - * @memberof google.cloud - * @namespace - */ - var documentai = {}; - - documentai.v1 = (function() { - - /** - * Namespace v1. - * @memberof google.cloud.documentai - * @namespace - */ - var v1 = {}; - - v1.Document = (function() { - - /** - * Properties of a Document. - * @memberof google.cloud.documentai.v1 - * @interface IDocument - * @property {string|null} [uri] Document uri - * @property {Uint8Array|null} [content] Document content - * @property {string|null} [docid] Document docid - * @property {string|null} [mimeType] Document mimeType - * @property {string|null} [text] Document text - * @property {Array.|null} [textStyles] Document textStyles - * @property {Array.|null} [pages] Document pages - * @property {Array.|null} [entities] Document entities - * @property {Array.|null} [entityRelations] Document entityRelations - * @property {Array.|null} [textChanges] Document textChanges - * @property {google.cloud.documentai.v1.Document.IShardInfo|null} [shardInfo] Document shardInfo - * @property {google.rpc.IStatus|null} [error] Document error - * @property {Array.|null} [revisions] Document revisions - * @property {google.cloud.documentai.v1.Document.IDocumentLayout|null} [documentLayout] Document documentLayout - * @property {google.cloud.documentai.v1.Document.IChunkedDocument|null} [chunkedDocument] Document chunkedDocument - * @property {google.cloud.documentai.v1.Document.IEntityValidationOutput|null} [entityValidationOutput] Document entityValidationOutput - * @property {Array.|null} [entitiesRevisions] Document entitiesRevisions - * @property {string|null} [entitiesRevisionId] Document entitiesRevisionId - */ - - /** - * Constructs a new Document. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a Document. - * @implements IDocument - * @constructor - * @param {google.cloud.documentai.v1.IDocument=} [properties] Properties to set - */ - function Document(properties) { - this.textStyles = []; - this.pages = []; - this.entities = []; - this.entityRelations = []; - this.textChanges = []; - this.revisions = []; - this.entitiesRevisions = []; - 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]]; - } - - /** - * Document uri. - * @member {string|null|undefined} uri - * @memberof google.cloud.documentai.v1.Document - * @instance - */ - Document.prototype.uri = null; - - /** - * Document content. - * @member {Uint8Array|null|undefined} content - * @memberof google.cloud.documentai.v1.Document - * @instance - */ - Document.prototype.content = null; - - /** - * Document docid. - * @member {string} docid - * @memberof google.cloud.documentai.v1.Document - * @instance - */ - Document.prototype.docid = ""; - - /** - * Document mimeType. - * @member {string} mimeType - * @memberof google.cloud.documentai.v1.Document - * @instance - */ - Document.prototype.mimeType = ""; - - /** - * Document text. - * @member {string} text - * @memberof google.cloud.documentai.v1.Document - * @instance - */ - Document.prototype.text = ""; - - /** - * Document textStyles. - * @member {Array.} textStyles - * @memberof google.cloud.documentai.v1.Document - * @instance - */ - Document.prototype.textStyles = $util.emptyArray; - - /** - * Document pages. - * @member {Array.} pages - * @memberof google.cloud.documentai.v1.Document - * @instance - */ - Document.prototype.pages = $util.emptyArray; - - /** - * Document entities. - * @member {Array.} entities - * @memberof google.cloud.documentai.v1.Document - * @instance - */ - Document.prototype.entities = $util.emptyArray; - - /** - * Document entityRelations. - * @member {Array.} entityRelations - * @memberof google.cloud.documentai.v1.Document - * @instance - */ - Document.prototype.entityRelations = $util.emptyArray; - - /** - * Document textChanges. - * @member {Array.} textChanges - * @memberof google.cloud.documentai.v1.Document - * @instance - */ - Document.prototype.textChanges = $util.emptyArray; - - /** - * Document shardInfo. - * @member {google.cloud.documentai.v1.Document.IShardInfo|null|undefined} shardInfo - * @memberof google.cloud.documentai.v1.Document - * @instance - */ - Document.prototype.shardInfo = null; - - /** - * Document error. - * @member {google.rpc.IStatus|null|undefined} error - * @memberof google.cloud.documentai.v1.Document - * @instance - */ - Document.prototype.error = null; - - /** - * Document revisions. - * @member {Array.} revisions - * @memberof google.cloud.documentai.v1.Document - * @instance - */ - Document.prototype.revisions = $util.emptyArray; - - /** - * Document documentLayout. - * @member {google.cloud.documentai.v1.Document.IDocumentLayout|null|undefined} documentLayout - * @memberof google.cloud.documentai.v1.Document - * @instance - */ - Document.prototype.documentLayout = null; - - /** - * Document chunkedDocument. - * @member {google.cloud.documentai.v1.Document.IChunkedDocument|null|undefined} chunkedDocument - * @memberof google.cloud.documentai.v1.Document - * @instance - */ - Document.prototype.chunkedDocument = null; - - /** - * Document entityValidationOutput. - * @member {google.cloud.documentai.v1.Document.IEntityValidationOutput|null|undefined} entityValidationOutput - * @memberof google.cloud.documentai.v1.Document - * @instance - */ - Document.prototype.entityValidationOutput = null; - - /** - * Document entitiesRevisions. - * @member {Array.} entitiesRevisions - * @memberof google.cloud.documentai.v1.Document - * @instance - */ - Document.prototype.entitiesRevisions = $util.emptyArray; - - /** - * Document entitiesRevisionId. - * @member {string} entitiesRevisionId - * @memberof google.cloud.documentai.v1.Document - * @instance - */ - Document.prototype.entitiesRevisionId = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Document source. - * @member {"uri"|"content"|undefined} source - * @memberof google.cloud.documentai.v1.Document - * @instance - */ - Object.defineProperty(Document.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["uri", "content"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Document instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document - * @static - * @param {google.cloud.documentai.v1.IDocument=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document} Document instance - */ - Document.create = function create(properties) { - return new Document(properties); - }; - - /** - * Encodes the specified Document message. Does not implicitly {@link google.cloud.documentai.v1.Document.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document - * @static - * @param {google.cloud.documentai.v1.IDocument} message Document message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Document.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); - if (message.content != null && Object.hasOwnProperty.call(message, "content")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.content); - if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.mimeType); - if (message.text != null && Object.hasOwnProperty.call(message, "text")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.text); - if (message.textStyles != null && message.textStyles.length) - for (var i = 0; i < message.textStyles.length; ++i) - $root.google.cloud.documentai.v1.Document.Style.encode(message.textStyles[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.pages != null && message.pages.length) - for (var i = 0; i < message.pages.length; ++i) - $root.google.cloud.documentai.v1.Document.Page.encode(message.pages[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.entities != null && message.entities.length) - for (var i = 0; i < message.entities.length; ++i) - $root.google.cloud.documentai.v1.Document.Entity.encode(message.entities[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.entityRelations != null && message.entityRelations.length) - for (var i = 0; i < message.entityRelations.length; ++i) - $root.google.cloud.documentai.v1.Document.EntityRelation.encode(message.entityRelations[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.shardInfo != null && Object.hasOwnProperty.call(message, "shardInfo")) - $root.google.cloud.documentai.v1.Document.ShardInfo.encode(message.shardInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.error != null && Object.hasOwnProperty.call(message, "error")) - $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.revisions != null && message.revisions.length) - for (var i = 0; i < message.revisions.length; ++i) - $root.google.cloud.documentai.v1.Document.Revision.encode(message.revisions[i], writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.textChanges != null && message.textChanges.length) - for (var i = 0; i < message.textChanges.length; ++i) - $root.google.cloud.documentai.v1.Document.TextChange.encode(message.textChanges[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.docid != null && Object.hasOwnProperty.call(message, "docid")) - writer.uint32(/* id 15, wireType 2 =*/122).string(message.docid); - if (message.documentLayout != null && Object.hasOwnProperty.call(message, "documentLayout")) - $root.google.cloud.documentai.v1.Document.DocumentLayout.encode(message.documentLayout, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.chunkedDocument != null && Object.hasOwnProperty.call(message, "chunkedDocument")) - $root.google.cloud.documentai.v1.Document.ChunkedDocument.encode(message.chunkedDocument, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.entityValidationOutput != null && Object.hasOwnProperty.call(message, "entityValidationOutput")) - $root.google.cloud.documentai.v1.Document.EntityValidationOutput.encode(message.entityValidationOutput, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.entitiesRevisions != null && message.entitiesRevisions.length) - for (var i = 0; i < message.entitiesRevisions.length; ++i) - $root.google.cloud.documentai.v1.Document.EntitiesRevision.encode(message.entitiesRevisions[i], writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.entitiesRevisionId != null && Object.hasOwnProperty.call(message, "entitiesRevisionId")) - writer.uint32(/* id 23, wireType 2 =*/186).string(message.entitiesRevisionId); - return writer; - }; - - /** - * Encodes the specified Document message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document - * @static - * @param {google.cloud.documentai.v1.IDocument} message Document message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Document.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Document message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document} Document - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Document.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.uri = reader.string(); - break; - } - case 2: { - message.content = reader.bytes(); - break; - } - case 15: { - message.docid = reader.string(); - break; - } - case 3: { - message.mimeType = reader.string(); - break; - } - case 4: { - message.text = reader.string(); - break; - } - case 5: { - if (!(message.textStyles && message.textStyles.length)) - message.textStyles = []; - message.textStyles.push($root.google.cloud.documentai.v1.Document.Style.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.pages && message.pages.length)) - message.pages = []; - message.pages.push($root.google.cloud.documentai.v1.Document.Page.decode(reader, reader.uint32())); - break; - } - case 7: { - if (!(message.entities && message.entities.length)) - message.entities = []; - message.entities.push($root.google.cloud.documentai.v1.Document.Entity.decode(reader, reader.uint32())); - break; - } - case 8: { - if (!(message.entityRelations && message.entityRelations.length)) - message.entityRelations = []; - message.entityRelations.push($root.google.cloud.documentai.v1.Document.EntityRelation.decode(reader, reader.uint32())); - break; - } - case 14: { - if (!(message.textChanges && message.textChanges.length)) - message.textChanges = []; - message.textChanges.push($root.google.cloud.documentai.v1.Document.TextChange.decode(reader, reader.uint32())); - break; - } - case 9: { - message.shardInfo = $root.google.cloud.documentai.v1.Document.ShardInfo.decode(reader, reader.uint32()); - break; - } - case 10: { - message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - } - case 13: { - if (!(message.revisions && message.revisions.length)) - message.revisions = []; - message.revisions.push($root.google.cloud.documentai.v1.Document.Revision.decode(reader, reader.uint32())); - break; - } - case 17: { - message.documentLayout = $root.google.cloud.documentai.v1.Document.DocumentLayout.decode(reader, reader.uint32()); - break; - } - case 18: { - message.chunkedDocument = $root.google.cloud.documentai.v1.Document.ChunkedDocument.decode(reader, reader.uint32()); - break; - } - case 21: { - message.entityValidationOutput = $root.google.cloud.documentai.v1.Document.EntityValidationOutput.decode(reader, reader.uint32()); - break; - } - case 22: { - if (!(message.entitiesRevisions && message.entitiesRevisions.length)) - message.entitiesRevisions = []; - message.entitiesRevisions.push($root.google.cloud.documentai.v1.Document.EntitiesRevision.decode(reader, reader.uint32())); - break; - } - case 23: { - message.entitiesRevisionId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Document message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document} Document - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Document.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Document message. - * @function verify - * @memberof google.cloud.documentai.v1.Document - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Document.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.uri != null && message.hasOwnProperty("uri")) { - properties.source = 1; - if (!$util.isString(message.uri)) - return "uri: string expected"; - } - if (message.content != null && message.hasOwnProperty("content")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - if (!(message.content && typeof message.content.length === "number" || $util.isString(message.content))) - return "content: buffer expected"; - } - if (message.docid != null && message.hasOwnProperty("docid")) - if (!$util.isString(message.docid)) - return "docid: string expected"; - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - if (!$util.isString(message.mimeType)) - return "mimeType: string expected"; - if (message.text != null && message.hasOwnProperty("text")) - if (!$util.isString(message.text)) - return "text: string expected"; - if (message.textStyles != null && message.hasOwnProperty("textStyles")) { - if (!Array.isArray(message.textStyles)) - return "textStyles: array expected"; - for (var i = 0; i < message.textStyles.length; ++i) { - var error = $root.google.cloud.documentai.v1.Document.Style.verify(message.textStyles[i]); - if (error) - return "textStyles." + error; - } - } - if (message.pages != null && message.hasOwnProperty("pages")) { - if (!Array.isArray(message.pages)) - return "pages: array expected"; - for (var i = 0; i < message.pages.length; ++i) { - var error = $root.google.cloud.documentai.v1.Document.Page.verify(message.pages[i]); - if (error) - return "pages." + error; - } - } - if (message.entities != null && message.hasOwnProperty("entities")) { - if (!Array.isArray(message.entities)) - return "entities: array expected"; - for (var i = 0; i < message.entities.length; ++i) { - var error = $root.google.cloud.documentai.v1.Document.Entity.verify(message.entities[i]); - if (error) - return "entities." + error; - } - } - if (message.entityRelations != null && message.hasOwnProperty("entityRelations")) { - if (!Array.isArray(message.entityRelations)) - return "entityRelations: array expected"; - for (var i = 0; i < message.entityRelations.length; ++i) { - var error = $root.google.cloud.documentai.v1.Document.EntityRelation.verify(message.entityRelations[i]); - if (error) - return "entityRelations." + error; - } - } - if (message.textChanges != null && message.hasOwnProperty("textChanges")) { - if (!Array.isArray(message.textChanges)) - return "textChanges: array expected"; - for (var i = 0; i < message.textChanges.length; ++i) { - var error = $root.google.cloud.documentai.v1.Document.TextChange.verify(message.textChanges[i]); - if (error) - return "textChanges." + error; - } - } - if (message.shardInfo != null && message.hasOwnProperty("shardInfo")) { - var error = $root.google.cloud.documentai.v1.Document.ShardInfo.verify(message.shardInfo); - if (error) - return "shardInfo." + error; - } - if (message.error != null && message.hasOwnProperty("error")) { - var error = $root.google.rpc.Status.verify(message.error); - if (error) - return "error." + error; - } - if (message.revisions != null && message.hasOwnProperty("revisions")) { - if (!Array.isArray(message.revisions)) - return "revisions: array expected"; - for (var i = 0; i < message.revisions.length; ++i) { - var error = $root.google.cloud.documentai.v1.Document.Revision.verify(message.revisions[i]); - if (error) - return "revisions." + error; - } - } - if (message.documentLayout != null && message.hasOwnProperty("documentLayout")) { - var error = $root.google.cloud.documentai.v1.Document.DocumentLayout.verify(message.documentLayout); - if (error) - return "documentLayout." + error; - } - if (message.chunkedDocument != null && message.hasOwnProperty("chunkedDocument")) { - var error = $root.google.cloud.documentai.v1.Document.ChunkedDocument.verify(message.chunkedDocument); - if (error) - return "chunkedDocument." + error; - } - if (message.entityValidationOutput != null && message.hasOwnProperty("entityValidationOutput")) { - var error = $root.google.cloud.documentai.v1.Document.EntityValidationOutput.verify(message.entityValidationOutput); - if (error) - return "entityValidationOutput." + error; - } - if (message.entitiesRevisions != null && message.hasOwnProperty("entitiesRevisions")) { - if (!Array.isArray(message.entitiesRevisions)) - return "entitiesRevisions: array expected"; - for (var i = 0; i < message.entitiesRevisions.length; ++i) { - var error = $root.google.cloud.documentai.v1.Document.EntitiesRevision.verify(message.entitiesRevisions[i]); - if (error) - return "entitiesRevisions." + error; - } - } - if (message.entitiesRevisionId != null && message.hasOwnProperty("entitiesRevisionId")) - if (!$util.isString(message.entitiesRevisionId)) - return "entitiesRevisionId: string expected"; - return null; - }; - - /** - * Creates a Document message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document} Document - */ - Document.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document) - return object; - var message = new $root.google.cloud.documentai.v1.Document(); - if (object.uri != null) - message.uri = String(object.uri); - if (object.content != null) - if (typeof object.content === "string") - $util.base64.decode(object.content, message.content = $util.newBuffer($util.base64.length(object.content)), 0); - else if (object.content.length >= 0) - message.content = object.content; - if (object.docid != null) - message.docid = String(object.docid); - if (object.mimeType != null) - message.mimeType = String(object.mimeType); - if (object.text != null) - message.text = String(object.text); - if (object.textStyles) { - if (!Array.isArray(object.textStyles)) - throw TypeError(".google.cloud.documentai.v1.Document.textStyles: array expected"); - message.textStyles = []; - for (var i = 0; i < object.textStyles.length; ++i) { - if (typeof object.textStyles[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.textStyles: object expected"); - message.textStyles[i] = $root.google.cloud.documentai.v1.Document.Style.fromObject(object.textStyles[i]); - } - } - if (object.pages) { - if (!Array.isArray(object.pages)) - throw TypeError(".google.cloud.documentai.v1.Document.pages: array expected"); - message.pages = []; - for (var i = 0; i < object.pages.length; ++i) { - if (typeof object.pages[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.pages: object expected"); - message.pages[i] = $root.google.cloud.documentai.v1.Document.Page.fromObject(object.pages[i]); - } - } - if (object.entities) { - if (!Array.isArray(object.entities)) - throw TypeError(".google.cloud.documentai.v1.Document.entities: array expected"); - message.entities = []; - for (var i = 0; i < object.entities.length; ++i) { - if (typeof object.entities[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.entities: object expected"); - message.entities[i] = $root.google.cloud.documentai.v1.Document.Entity.fromObject(object.entities[i]); - } - } - if (object.entityRelations) { - if (!Array.isArray(object.entityRelations)) - throw TypeError(".google.cloud.documentai.v1.Document.entityRelations: array expected"); - message.entityRelations = []; - for (var i = 0; i < object.entityRelations.length; ++i) { - if (typeof object.entityRelations[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.entityRelations: object expected"); - message.entityRelations[i] = $root.google.cloud.documentai.v1.Document.EntityRelation.fromObject(object.entityRelations[i]); - } - } - if (object.textChanges) { - if (!Array.isArray(object.textChanges)) - throw TypeError(".google.cloud.documentai.v1.Document.textChanges: array expected"); - message.textChanges = []; - for (var i = 0; i < object.textChanges.length; ++i) { - if (typeof object.textChanges[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.textChanges: object expected"); - message.textChanges[i] = $root.google.cloud.documentai.v1.Document.TextChange.fromObject(object.textChanges[i]); - } - } - if (object.shardInfo != null) { - if (typeof object.shardInfo !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.shardInfo: object expected"); - message.shardInfo = $root.google.cloud.documentai.v1.Document.ShardInfo.fromObject(object.shardInfo); - } - if (object.error != null) { - if (typeof object.error !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.error: object expected"); - message.error = $root.google.rpc.Status.fromObject(object.error); - } - if (object.revisions) { - if (!Array.isArray(object.revisions)) - throw TypeError(".google.cloud.documentai.v1.Document.revisions: array expected"); - message.revisions = []; - for (var i = 0; i < object.revisions.length; ++i) { - if (typeof object.revisions[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.revisions: object expected"); - message.revisions[i] = $root.google.cloud.documentai.v1.Document.Revision.fromObject(object.revisions[i]); - } - } - if (object.documentLayout != null) { - if (typeof object.documentLayout !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.documentLayout: object expected"); - message.documentLayout = $root.google.cloud.documentai.v1.Document.DocumentLayout.fromObject(object.documentLayout); - } - if (object.chunkedDocument != null) { - if (typeof object.chunkedDocument !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.chunkedDocument: object expected"); - message.chunkedDocument = $root.google.cloud.documentai.v1.Document.ChunkedDocument.fromObject(object.chunkedDocument); - } - if (object.entityValidationOutput != null) { - if (typeof object.entityValidationOutput !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.entityValidationOutput: object expected"); - message.entityValidationOutput = $root.google.cloud.documentai.v1.Document.EntityValidationOutput.fromObject(object.entityValidationOutput); - } - if (object.entitiesRevisions) { - if (!Array.isArray(object.entitiesRevisions)) - throw TypeError(".google.cloud.documentai.v1.Document.entitiesRevisions: array expected"); - message.entitiesRevisions = []; - for (var i = 0; i < object.entitiesRevisions.length; ++i) { - if (typeof object.entitiesRevisions[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.entitiesRevisions: object expected"); - message.entitiesRevisions[i] = $root.google.cloud.documentai.v1.Document.EntitiesRevision.fromObject(object.entitiesRevisions[i]); - } - } - if (object.entitiesRevisionId != null) - message.entitiesRevisionId = String(object.entitiesRevisionId); - return message; - }; - - /** - * Creates a plain object from a Document message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document - * @static - * @param {google.cloud.documentai.v1.Document} message Document - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Document.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.textStyles = []; - object.pages = []; - object.entities = []; - object.entityRelations = []; - object.revisions = []; - object.textChanges = []; - object.entitiesRevisions = []; - } - if (options.defaults) { - object.mimeType = ""; - object.text = ""; - object.shardInfo = null; - object.error = null; - object.docid = ""; - object.documentLayout = null; - object.chunkedDocument = null; - object.entityValidationOutput = null; - object.entitiesRevisionId = ""; - } - if (message.uri != null && message.hasOwnProperty("uri")) { - object.uri = message.uri; - if (options.oneofs) - object.source = "uri"; - } - if (message.content != null && message.hasOwnProperty("content")) { - object.content = options.bytes === String ? $util.base64.encode(message.content, 0, message.content.length) : options.bytes === Array ? Array.prototype.slice.call(message.content) : message.content; - if (options.oneofs) - object.source = "content"; - } - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - object.mimeType = message.mimeType; - if (message.text != null && message.hasOwnProperty("text")) - object.text = message.text; - if (message.textStyles && message.textStyles.length) { - object.textStyles = []; - for (var j = 0; j < message.textStyles.length; ++j) - object.textStyles[j] = $root.google.cloud.documentai.v1.Document.Style.toObject(message.textStyles[j], options); - } - if (message.pages && message.pages.length) { - object.pages = []; - for (var j = 0; j < message.pages.length; ++j) - object.pages[j] = $root.google.cloud.documentai.v1.Document.Page.toObject(message.pages[j], options); - } - if (message.entities && message.entities.length) { - object.entities = []; - for (var j = 0; j < message.entities.length; ++j) - object.entities[j] = $root.google.cloud.documentai.v1.Document.Entity.toObject(message.entities[j], options); - } - if (message.entityRelations && message.entityRelations.length) { - object.entityRelations = []; - for (var j = 0; j < message.entityRelations.length; ++j) - object.entityRelations[j] = $root.google.cloud.documentai.v1.Document.EntityRelation.toObject(message.entityRelations[j], options); - } - if (message.shardInfo != null && message.hasOwnProperty("shardInfo")) - object.shardInfo = $root.google.cloud.documentai.v1.Document.ShardInfo.toObject(message.shardInfo, options); - if (message.error != null && message.hasOwnProperty("error")) - object.error = $root.google.rpc.Status.toObject(message.error, options); - if (message.revisions && message.revisions.length) { - object.revisions = []; - for (var j = 0; j < message.revisions.length; ++j) - object.revisions[j] = $root.google.cloud.documentai.v1.Document.Revision.toObject(message.revisions[j], options); - } - if (message.textChanges && message.textChanges.length) { - object.textChanges = []; - for (var j = 0; j < message.textChanges.length; ++j) - object.textChanges[j] = $root.google.cloud.documentai.v1.Document.TextChange.toObject(message.textChanges[j], options); - } - if (message.docid != null && message.hasOwnProperty("docid")) - object.docid = message.docid; - if (message.documentLayout != null && message.hasOwnProperty("documentLayout")) - object.documentLayout = $root.google.cloud.documentai.v1.Document.DocumentLayout.toObject(message.documentLayout, options); - if (message.chunkedDocument != null && message.hasOwnProperty("chunkedDocument")) - object.chunkedDocument = $root.google.cloud.documentai.v1.Document.ChunkedDocument.toObject(message.chunkedDocument, options); - if (message.entityValidationOutput != null && message.hasOwnProperty("entityValidationOutput")) - object.entityValidationOutput = $root.google.cloud.documentai.v1.Document.EntityValidationOutput.toObject(message.entityValidationOutput, options); - if (message.entitiesRevisions && message.entitiesRevisions.length) { - object.entitiesRevisions = []; - for (var j = 0; j < message.entitiesRevisions.length; ++j) - object.entitiesRevisions[j] = $root.google.cloud.documentai.v1.Document.EntitiesRevision.toObject(message.entitiesRevisions[j], options); - } - if (message.entitiesRevisionId != null && message.hasOwnProperty("entitiesRevisionId")) - object.entitiesRevisionId = message.entitiesRevisionId; - return object; - }; - - /** - * Converts this Document to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document - * @instance - * @returns {Object.} JSON object - */ - Document.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Document - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Document.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document"; - }; - - Document.ShardInfo = (function() { - - /** - * Properties of a ShardInfo. - * @memberof google.cloud.documentai.v1.Document - * @interface IShardInfo - * @property {number|Long|null} [shardIndex] ShardInfo shardIndex - * @property {number|Long|null} [shardCount] ShardInfo shardCount - * @property {number|Long|null} [textOffset] ShardInfo textOffset - */ - - /** - * Constructs a new ShardInfo. - * @memberof google.cloud.documentai.v1.Document - * @classdesc Represents a ShardInfo. - * @implements IShardInfo - * @constructor - * @param {google.cloud.documentai.v1.Document.IShardInfo=} [properties] Properties to set - */ - function ShardInfo(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]]; - } - - /** - * ShardInfo shardIndex. - * @member {number|Long} shardIndex - * @memberof google.cloud.documentai.v1.Document.ShardInfo - * @instance - */ - ShardInfo.prototype.shardIndex = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * ShardInfo shardCount. - * @member {number|Long} shardCount - * @memberof google.cloud.documentai.v1.Document.ShardInfo - * @instance - */ - ShardInfo.prototype.shardCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * ShardInfo textOffset. - * @member {number|Long} textOffset - * @memberof google.cloud.documentai.v1.Document.ShardInfo - * @instance - */ - ShardInfo.prototype.textOffset = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new ShardInfo instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.ShardInfo - * @static - * @param {google.cloud.documentai.v1.Document.IShardInfo=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.ShardInfo} ShardInfo instance - */ - ShardInfo.create = function create(properties) { - return new ShardInfo(properties); - }; - - /** - * Encodes the specified ShardInfo message. Does not implicitly {@link google.cloud.documentai.v1.Document.ShardInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.ShardInfo - * @static - * @param {google.cloud.documentai.v1.Document.IShardInfo} message ShardInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ShardInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.shardIndex != null && Object.hasOwnProperty.call(message, "shardIndex")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.shardIndex); - if (message.shardCount != null && Object.hasOwnProperty.call(message, "shardCount")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.shardCount); - if (message.textOffset != null && Object.hasOwnProperty.call(message, "textOffset")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.textOffset); - return writer; - }; - - /** - * Encodes the specified ShardInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.ShardInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.ShardInfo - * @static - * @param {google.cloud.documentai.v1.Document.IShardInfo} message ShardInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ShardInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ShardInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document.ShardInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.ShardInfo} ShardInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ShardInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.ShardInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.shardIndex = reader.int64(); - break; - } - case 2: { - message.shardCount = reader.int64(); - break; - } - case 3: { - message.textOffset = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ShardInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document.ShardInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.ShardInfo} ShardInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ShardInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ShardInfo message. - * @function verify - * @memberof google.cloud.documentai.v1.Document.ShardInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ShardInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.shardIndex != null && message.hasOwnProperty("shardIndex")) - if (!$util.isInteger(message.shardIndex) && !(message.shardIndex && $util.isInteger(message.shardIndex.low) && $util.isInteger(message.shardIndex.high))) - return "shardIndex: integer|Long expected"; - if (message.shardCount != null && message.hasOwnProperty("shardCount")) - if (!$util.isInteger(message.shardCount) && !(message.shardCount && $util.isInteger(message.shardCount.low) && $util.isInteger(message.shardCount.high))) - return "shardCount: integer|Long expected"; - if (message.textOffset != null && message.hasOwnProperty("textOffset")) - if (!$util.isInteger(message.textOffset) && !(message.textOffset && $util.isInteger(message.textOffset.low) && $util.isInteger(message.textOffset.high))) - return "textOffset: integer|Long expected"; - return null; - }; - - /** - * Creates a ShardInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.ShardInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.ShardInfo} ShardInfo - */ - ShardInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.ShardInfo) - return object; - var message = new $root.google.cloud.documentai.v1.Document.ShardInfo(); - if (object.shardIndex != null) - if ($util.Long) - (message.shardIndex = $util.Long.fromValue(object.shardIndex)).unsigned = false; - else if (typeof object.shardIndex === "string") - message.shardIndex = parseInt(object.shardIndex, 10); - else if (typeof object.shardIndex === "number") - message.shardIndex = object.shardIndex; - else if (typeof object.shardIndex === "object") - message.shardIndex = new $util.LongBits(object.shardIndex.low >>> 0, object.shardIndex.high >>> 0).toNumber(); - if (object.shardCount != null) - if ($util.Long) - (message.shardCount = $util.Long.fromValue(object.shardCount)).unsigned = false; - else if (typeof object.shardCount === "string") - message.shardCount = parseInt(object.shardCount, 10); - else if (typeof object.shardCount === "number") - message.shardCount = object.shardCount; - else if (typeof object.shardCount === "object") - message.shardCount = new $util.LongBits(object.shardCount.low >>> 0, object.shardCount.high >>> 0).toNumber(); - if (object.textOffset != null) - if ($util.Long) - (message.textOffset = $util.Long.fromValue(object.textOffset)).unsigned = false; - else if (typeof object.textOffset === "string") - message.textOffset = parseInt(object.textOffset, 10); - else if (typeof object.textOffset === "number") - message.textOffset = object.textOffset; - else if (typeof object.textOffset === "object") - message.textOffset = new $util.LongBits(object.textOffset.low >>> 0, object.textOffset.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a ShardInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.ShardInfo - * @static - * @param {google.cloud.documentai.v1.Document.ShardInfo} message ShardInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ShardInfo.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.shardIndex = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.shardIndex = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.shardCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.shardCount = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.textOffset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.textOffset = options.longs === String ? "0" : 0; - } - if (message.shardIndex != null && message.hasOwnProperty("shardIndex")) - if (typeof message.shardIndex === "number") - object.shardIndex = options.longs === String ? String(message.shardIndex) : message.shardIndex; - else - object.shardIndex = options.longs === String ? $util.Long.prototype.toString.call(message.shardIndex) : options.longs === Number ? new $util.LongBits(message.shardIndex.low >>> 0, message.shardIndex.high >>> 0).toNumber() : message.shardIndex; - if (message.shardCount != null && message.hasOwnProperty("shardCount")) - if (typeof message.shardCount === "number") - object.shardCount = options.longs === String ? String(message.shardCount) : message.shardCount; - else - object.shardCount = options.longs === String ? $util.Long.prototype.toString.call(message.shardCount) : options.longs === Number ? new $util.LongBits(message.shardCount.low >>> 0, message.shardCount.high >>> 0).toNumber() : message.shardCount; - if (message.textOffset != null && message.hasOwnProperty("textOffset")) - if (typeof message.textOffset === "number") - object.textOffset = options.longs === String ? String(message.textOffset) : message.textOffset; - else - object.textOffset = options.longs === String ? $util.Long.prototype.toString.call(message.textOffset) : options.longs === Number ? new $util.LongBits(message.textOffset.low >>> 0, message.textOffset.high >>> 0).toNumber() : message.textOffset; - return object; - }; - - /** - * Converts this ShardInfo to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.ShardInfo - * @instance - * @returns {Object.} JSON object - */ - ShardInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ShardInfo - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.ShardInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ShardInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.ShardInfo"; - }; - - return ShardInfo; - })(); - - Document.Style = (function() { - - /** - * Properties of a Style. - * @memberof google.cloud.documentai.v1.Document - * @interface IStyle - * @property {google.cloud.documentai.v1.Document.ITextAnchor|null} [textAnchor] Style textAnchor - * @property {google.type.IColor|null} [color] Style color - * @property {google.type.IColor|null} [backgroundColor] Style backgroundColor - * @property {string|null} [fontWeight] Style fontWeight - * @property {string|null} [textStyle] Style textStyle - * @property {string|null} [textDecoration] Style textDecoration - * @property {google.cloud.documentai.v1.Document.Style.IFontSize|null} [fontSize] Style fontSize - * @property {string|null} [fontFamily] Style fontFamily - */ - - /** - * Constructs a new Style. - * @memberof google.cloud.documentai.v1.Document - * @classdesc Represents a Style. - * @implements IStyle - * @constructor - * @param {google.cloud.documentai.v1.Document.IStyle=} [properties] Properties to set - */ - function Style(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]]; - } - - /** - * Style textAnchor. - * @member {google.cloud.documentai.v1.Document.ITextAnchor|null|undefined} textAnchor - * @memberof google.cloud.documentai.v1.Document.Style - * @instance - */ - Style.prototype.textAnchor = null; - - /** - * Style color. - * @member {google.type.IColor|null|undefined} color - * @memberof google.cloud.documentai.v1.Document.Style - * @instance - */ - Style.prototype.color = null; - - /** - * Style backgroundColor. - * @member {google.type.IColor|null|undefined} backgroundColor - * @memberof google.cloud.documentai.v1.Document.Style - * @instance - */ - Style.prototype.backgroundColor = null; - - /** - * Style fontWeight. - * @member {string} fontWeight - * @memberof google.cloud.documentai.v1.Document.Style - * @instance - */ - Style.prototype.fontWeight = ""; - - /** - * Style textStyle. - * @member {string} textStyle - * @memberof google.cloud.documentai.v1.Document.Style - * @instance - */ - Style.prototype.textStyle = ""; - - /** - * Style textDecoration. - * @member {string} textDecoration - * @memberof google.cloud.documentai.v1.Document.Style - * @instance - */ - Style.prototype.textDecoration = ""; - - /** - * Style fontSize. - * @member {google.cloud.documentai.v1.Document.Style.IFontSize|null|undefined} fontSize - * @memberof google.cloud.documentai.v1.Document.Style - * @instance - */ - Style.prototype.fontSize = null; - - /** - * Style fontFamily. - * @member {string} fontFamily - * @memberof google.cloud.documentai.v1.Document.Style - * @instance - */ - Style.prototype.fontFamily = ""; - - /** - * Creates a new Style instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.Style - * @static - * @param {google.cloud.documentai.v1.Document.IStyle=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.Style} Style instance - */ - Style.create = function create(properties) { - return new Style(properties); - }; - - /** - * Encodes the specified Style message. Does not implicitly {@link google.cloud.documentai.v1.Document.Style.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.Style - * @static - * @param {google.cloud.documentai.v1.Document.IStyle} message Style message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Style.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.textAnchor != null && Object.hasOwnProperty.call(message, "textAnchor")) - $root.google.cloud.documentai.v1.Document.TextAnchor.encode(message.textAnchor, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.color != null && Object.hasOwnProperty.call(message, "color")) - $root.google.type.Color.encode(message.color, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.backgroundColor != null && Object.hasOwnProperty.call(message, "backgroundColor")) - $root.google.type.Color.encode(message.backgroundColor, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.fontWeight != null && Object.hasOwnProperty.call(message, "fontWeight")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.fontWeight); - if (message.textStyle != null && Object.hasOwnProperty.call(message, "textStyle")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.textStyle); - if (message.textDecoration != null && Object.hasOwnProperty.call(message, "textDecoration")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.textDecoration); - if (message.fontSize != null && Object.hasOwnProperty.call(message, "fontSize")) - $root.google.cloud.documentai.v1.Document.Style.FontSize.encode(message.fontSize, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.fontFamily != null && Object.hasOwnProperty.call(message, "fontFamily")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.fontFamily); - return writer; - }; - - /** - * Encodes the specified Style message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Style.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.Style - * @static - * @param {google.cloud.documentai.v1.Document.IStyle} message Style message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Style.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Style message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document.Style - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.Style} Style - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Style.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Style(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.textAnchor = $root.google.cloud.documentai.v1.Document.TextAnchor.decode(reader, reader.uint32()); - break; - } - case 2: { - message.color = $root.google.type.Color.decode(reader, reader.uint32()); - break; - } - case 3: { - message.backgroundColor = $root.google.type.Color.decode(reader, reader.uint32()); - break; - } - case 4: { - message.fontWeight = reader.string(); - break; - } - case 5: { - message.textStyle = reader.string(); - break; - } - case 6: { - message.textDecoration = reader.string(); - break; - } - case 7: { - message.fontSize = $root.google.cloud.documentai.v1.Document.Style.FontSize.decode(reader, reader.uint32()); - break; - } - case 8: { - message.fontFamily = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Style message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document.Style - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.Style} Style - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Style.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Style message. - * @function verify - * @memberof google.cloud.documentai.v1.Document.Style - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Style.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.textAnchor != null && message.hasOwnProperty("textAnchor")) { - var error = $root.google.cloud.documentai.v1.Document.TextAnchor.verify(message.textAnchor); - if (error) - return "textAnchor." + error; - } - if (message.color != null && message.hasOwnProperty("color")) { - var error = $root.google.type.Color.verify(message.color); - if (error) - return "color." + error; - } - if (message.backgroundColor != null && message.hasOwnProperty("backgroundColor")) { - var error = $root.google.type.Color.verify(message.backgroundColor); - if (error) - return "backgroundColor." + error; - } - if (message.fontWeight != null && message.hasOwnProperty("fontWeight")) - if (!$util.isString(message.fontWeight)) - return "fontWeight: string expected"; - if (message.textStyle != null && message.hasOwnProperty("textStyle")) - if (!$util.isString(message.textStyle)) - return "textStyle: string expected"; - if (message.textDecoration != null && message.hasOwnProperty("textDecoration")) - if (!$util.isString(message.textDecoration)) - return "textDecoration: string expected"; - if (message.fontSize != null && message.hasOwnProperty("fontSize")) { - var error = $root.google.cloud.documentai.v1.Document.Style.FontSize.verify(message.fontSize); - if (error) - return "fontSize." + error; - } - if (message.fontFamily != null && message.hasOwnProperty("fontFamily")) - if (!$util.isString(message.fontFamily)) - return "fontFamily: string expected"; - return null; - }; - - /** - * Creates a Style message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.Style - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.Style} Style - */ - Style.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.Style) - return object; - var message = new $root.google.cloud.documentai.v1.Document.Style(); - if (object.textAnchor != null) { - if (typeof object.textAnchor !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Style.textAnchor: object expected"); - message.textAnchor = $root.google.cloud.documentai.v1.Document.TextAnchor.fromObject(object.textAnchor); - } - if (object.color != null) { - if (typeof object.color !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Style.color: object expected"); - message.color = $root.google.type.Color.fromObject(object.color); - } - if (object.backgroundColor != null) { - if (typeof object.backgroundColor !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Style.backgroundColor: object expected"); - message.backgroundColor = $root.google.type.Color.fromObject(object.backgroundColor); - } - if (object.fontWeight != null) - message.fontWeight = String(object.fontWeight); - if (object.textStyle != null) - message.textStyle = String(object.textStyle); - if (object.textDecoration != null) - message.textDecoration = String(object.textDecoration); - if (object.fontSize != null) { - if (typeof object.fontSize !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Style.fontSize: object expected"); - message.fontSize = $root.google.cloud.documentai.v1.Document.Style.FontSize.fromObject(object.fontSize); - } - if (object.fontFamily != null) - message.fontFamily = String(object.fontFamily); - return message; - }; - - /** - * Creates a plain object from a Style message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.Style - * @static - * @param {google.cloud.documentai.v1.Document.Style} message Style - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Style.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.textAnchor = null; - object.color = null; - object.backgroundColor = null; - object.fontWeight = ""; - object.textStyle = ""; - object.textDecoration = ""; - object.fontSize = null; - object.fontFamily = ""; - } - if (message.textAnchor != null && message.hasOwnProperty("textAnchor")) - object.textAnchor = $root.google.cloud.documentai.v1.Document.TextAnchor.toObject(message.textAnchor, options); - if (message.color != null && message.hasOwnProperty("color")) - object.color = $root.google.type.Color.toObject(message.color, options); - if (message.backgroundColor != null && message.hasOwnProperty("backgroundColor")) - object.backgroundColor = $root.google.type.Color.toObject(message.backgroundColor, options); - if (message.fontWeight != null && message.hasOwnProperty("fontWeight")) - object.fontWeight = message.fontWeight; - if (message.textStyle != null && message.hasOwnProperty("textStyle")) - object.textStyle = message.textStyle; - if (message.textDecoration != null && message.hasOwnProperty("textDecoration")) - object.textDecoration = message.textDecoration; - if (message.fontSize != null && message.hasOwnProperty("fontSize")) - object.fontSize = $root.google.cloud.documentai.v1.Document.Style.FontSize.toObject(message.fontSize, options); - if (message.fontFamily != null && message.hasOwnProperty("fontFamily")) - object.fontFamily = message.fontFamily; - return object; - }; - - /** - * Converts this Style to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.Style - * @instance - * @returns {Object.} JSON object - */ - Style.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Style - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.Style - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Style.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Style"; - }; - - Style.FontSize = (function() { - - /** - * Properties of a FontSize. - * @memberof google.cloud.documentai.v1.Document.Style - * @interface IFontSize - * @property {number|null} [size] FontSize size - * @property {string|null} [unit] FontSize unit - */ - - /** - * Constructs a new FontSize. - * @memberof google.cloud.documentai.v1.Document.Style - * @classdesc Represents a FontSize. - * @implements IFontSize - * @constructor - * @param {google.cloud.documentai.v1.Document.Style.IFontSize=} [properties] Properties to set - */ - function FontSize(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]]; - } - - /** - * FontSize size. - * @member {number} size - * @memberof google.cloud.documentai.v1.Document.Style.FontSize - * @instance - */ - FontSize.prototype.size = 0; - - /** - * FontSize unit. - * @member {string} unit - * @memberof google.cloud.documentai.v1.Document.Style.FontSize - * @instance - */ - FontSize.prototype.unit = ""; - - /** - * Creates a new FontSize instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.Style.FontSize - * @static - * @param {google.cloud.documentai.v1.Document.Style.IFontSize=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.Style.FontSize} FontSize instance - */ - FontSize.create = function create(properties) { - return new FontSize(properties); - }; - - /** - * Encodes the specified FontSize message. Does not implicitly {@link google.cloud.documentai.v1.Document.Style.FontSize.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.Style.FontSize - * @static - * @param {google.cloud.documentai.v1.Document.Style.IFontSize} message FontSize message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FontSize.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.size != null && Object.hasOwnProperty.call(message, "size")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.size); - if (message.unit != null && Object.hasOwnProperty.call(message, "unit")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.unit); - return writer; - }; - - /** - * Encodes the specified FontSize message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Style.FontSize.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.Style.FontSize - * @static - * @param {google.cloud.documentai.v1.Document.Style.IFontSize} message FontSize message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FontSize.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FontSize message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document.Style.FontSize - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.Style.FontSize} FontSize - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FontSize.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Style.FontSize(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.size = reader.float(); - break; - } - case 2: { - message.unit = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FontSize message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document.Style.FontSize - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.Style.FontSize} FontSize - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FontSize.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FontSize message. - * @function verify - * @memberof google.cloud.documentai.v1.Document.Style.FontSize - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FontSize.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.size != null && message.hasOwnProperty("size")) - if (typeof message.size !== "number") - return "size: number expected"; - if (message.unit != null && message.hasOwnProperty("unit")) - if (!$util.isString(message.unit)) - return "unit: string expected"; - return null; - }; - - /** - * Creates a FontSize message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.Style.FontSize - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.Style.FontSize} FontSize - */ - FontSize.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.Style.FontSize) - return object; - var message = new $root.google.cloud.documentai.v1.Document.Style.FontSize(); - if (object.size != null) - message.size = Number(object.size); - if (object.unit != null) - message.unit = String(object.unit); - return message; - }; - - /** - * Creates a plain object from a FontSize message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.Style.FontSize - * @static - * @param {google.cloud.documentai.v1.Document.Style.FontSize} message FontSize - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FontSize.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.size = 0; - object.unit = ""; - } - if (message.size != null && message.hasOwnProperty("size")) - object.size = options.json && !isFinite(message.size) ? String(message.size) : message.size; - if (message.unit != null && message.hasOwnProperty("unit")) - object.unit = message.unit; - return object; - }; - - /** - * Converts this FontSize to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.Style.FontSize - * @instance - * @returns {Object.} JSON object - */ - FontSize.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FontSize - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.Style.FontSize - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FontSize.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Style.FontSize"; - }; - - return FontSize; - })(); - - return Style; - })(); - - Document.Page = (function() { - - /** - * Properties of a Page. - * @memberof google.cloud.documentai.v1.Document - * @interface IPage - * @property {number|null} [pageNumber] Page pageNumber - * @property {google.cloud.documentai.v1.Document.Page.IImage|null} [image] Page image - * @property {Array.|null} [transforms] Page transforms - * @property {google.cloud.documentai.v1.Document.Page.IDimension|null} [dimension] Page dimension - * @property {google.cloud.documentai.v1.Document.Page.ILayout|null} [layout] Page layout - * @property {Array.|null} [detectedLanguages] Page detectedLanguages - * @property {Array.|null} [blocks] Page blocks - * @property {Array.|null} [paragraphs] Page paragraphs - * @property {Array.|null} [lines] Page lines - * @property {Array.|null} [tokens] Page tokens - * @property {Array.|null} [visualElements] Page visualElements - * @property {Array.|null} [tables] Page tables - * @property {Array.|null} [formFields] Page formFields - * @property {Array.|null} [symbols] Page symbols - * @property {Array.|null} [detectedBarcodes] Page detectedBarcodes - * @property {google.cloud.documentai.v1.Document.Page.IImageQualityScores|null} [imageQualityScores] Page imageQualityScores - * @property {google.cloud.documentai.v1.Document.IProvenance|null} [provenance] Page provenance - */ - - /** - * Constructs a new Page. - * @memberof google.cloud.documentai.v1.Document - * @classdesc Represents a Page. - * @implements IPage - * @constructor - * @param {google.cloud.documentai.v1.Document.IPage=} [properties] Properties to set - */ - function Page(properties) { - this.transforms = []; - this.detectedLanguages = []; - this.blocks = []; - this.paragraphs = []; - this.lines = []; - this.tokens = []; - this.visualElements = []; - this.tables = []; - this.formFields = []; - this.symbols = []; - this.detectedBarcodes = []; - 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]]; - } - - /** - * Page pageNumber. - * @member {number} pageNumber - * @memberof google.cloud.documentai.v1.Document.Page - * @instance - */ - Page.prototype.pageNumber = 0; - - /** - * Page image. - * @member {google.cloud.documentai.v1.Document.Page.IImage|null|undefined} image - * @memberof google.cloud.documentai.v1.Document.Page - * @instance - */ - Page.prototype.image = null; - - /** - * Page transforms. - * @member {Array.} transforms - * @memberof google.cloud.documentai.v1.Document.Page - * @instance - */ - Page.prototype.transforms = $util.emptyArray; - - /** - * Page dimension. - * @member {google.cloud.documentai.v1.Document.Page.IDimension|null|undefined} dimension - * @memberof google.cloud.documentai.v1.Document.Page - * @instance - */ - Page.prototype.dimension = null; - - /** - * Page layout. - * @member {google.cloud.documentai.v1.Document.Page.ILayout|null|undefined} layout - * @memberof google.cloud.documentai.v1.Document.Page - * @instance - */ - Page.prototype.layout = null; - - /** - * Page detectedLanguages. - * @member {Array.} detectedLanguages - * @memberof google.cloud.documentai.v1.Document.Page - * @instance - */ - Page.prototype.detectedLanguages = $util.emptyArray; - - /** - * Page blocks. - * @member {Array.} blocks - * @memberof google.cloud.documentai.v1.Document.Page - * @instance - */ - Page.prototype.blocks = $util.emptyArray; - - /** - * Page paragraphs. - * @member {Array.} paragraphs - * @memberof google.cloud.documentai.v1.Document.Page - * @instance - */ - Page.prototype.paragraphs = $util.emptyArray; - - /** - * Page lines. - * @member {Array.} lines - * @memberof google.cloud.documentai.v1.Document.Page - * @instance - */ - Page.prototype.lines = $util.emptyArray; - - /** - * Page tokens. - * @member {Array.} tokens - * @memberof google.cloud.documentai.v1.Document.Page - * @instance - */ - Page.prototype.tokens = $util.emptyArray; - - /** - * Page visualElements. - * @member {Array.} visualElements - * @memberof google.cloud.documentai.v1.Document.Page - * @instance - */ - Page.prototype.visualElements = $util.emptyArray; - - /** - * Page tables. - * @member {Array.} tables - * @memberof google.cloud.documentai.v1.Document.Page - * @instance - */ - Page.prototype.tables = $util.emptyArray; - - /** - * Page formFields. - * @member {Array.} formFields - * @memberof google.cloud.documentai.v1.Document.Page - * @instance - */ - Page.prototype.formFields = $util.emptyArray; - - /** - * Page symbols. - * @member {Array.} symbols - * @memberof google.cloud.documentai.v1.Document.Page - * @instance - */ - Page.prototype.symbols = $util.emptyArray; - - /** - * Page detectedBarcodes. - * @member {Array.} detectedBarcodes - * @memberof google.cloud.documentai.v1.Document.Page - * @instance - */ - Page.prototype.detectedBarcodes = $util.emptyArray; - - /** - * Page imageQualityScores. - * @member {google.cloud.documentai.v1.Document.Page.IImageQualityScores|null|undefined} imageQualityScores - * @memberof google.cloud.documentai.v1.Document.Page - * @instance - */ - Page.prototype.imageQualityScores = null; - - /** - * Page provenance. - * @member {google.cloud.documentai.v1.Document.IProvenance|null|undefined} provenance - * @memberof google.cloud.documentai.v1.Document.Page - * @instance - */ - Page.prototype.provenance = null; - - /** - * Creates a new Page instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.Page - * @static - * @param {google.cloud.documentai.v1.Document.IPage=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.Page} Page instance - */ - Page.create = function create(properties) { - return new Page(properties); - }; - - /** - * Encodes the specified Page message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.Page - * @static - * @param {google.cloud.documentai.v1.Document.IPage} message Page message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Page.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pageNumber != null && Object.hasOwnProperty.call(message, "pageNumber")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.pageNumber); - if (message.dimension != null && Object.hasOwnProperty.call(message, "dimension")) - $root.google.cloud.documentai.v1.Document.Page.Dimension.encode(message.dimension, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.layout != null && Object.hasOwnProperty.call(message, "layout")) - $root.google.cloud.documentai.v1.Document.Page.Layout.encode(message.layout, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.detectedLanguages != null && message.detectedLanguages.length) - for (var i = 0; i < message.detectedLanguages.length; ++i) - $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.encode(message.detectedLanguages[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.blocks != null && message.blocks.length) - for (var i = 0; i < message.blocks.length; ++i) - $root.google.cloud.documentai.v1.Document.Page.Block.encode(message.blocks[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.paragraphs != null && message.paragraphs.length) - for (var i = 0; i < message.paragraphs.length; ++i) - $root.google.cloud.documentai.v1.Document.Page.Paragraph.encode(message.paragraphs[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.lines != null && message.lines.length) - for (var i = 0; i < message.lines.length; ++i) - $root.google.cloud.documentai.v1.Document.Page.Line.encode(message.lines[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.tokens != null && message.tokens.length) - for (var i = 0; i < message.tokens.length; ++i) - $root.google.cloud.documentai.v1.Document.Page.Token.encode(message.tokens[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.visualElements != null && message.visualElements.length) - for (var i = 0; i < message.visualElements.length; ++i) - $root.google.cloud.documentai.v1.Document.Page.VisualElement.encode(message.visualElements[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.tables != null && message.tables.length) - for (var i = 0; i < message.tables.length; ++i) - $root.google.cloud.documentai.v1.Document.Page.Table.encode(message.tables[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.formFields != null && message.formFields.length) - for (var i = 0; i < message.formFields.length; ++i) - $root.google.cloud.documentai.v1.Document.Page.FormField.encode(message.formFields[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.symbols != null && message.symbols.length) - for (var i = 0; i < message.symbols.length; ++i) - $root.google.cloud.documentai.v1.Document.Page.Symbol.encode(message.symbols[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.image != null && Object.hasOwnProperty.call(message, "image")) - $root.google.cloud.documentai.v1.Document.Page.Image.encode(message.image, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.transforms != null && message.transforms.length) - for (var i = 0; i < message.transforms.length; ++i) - $root.google.cloud.documentai.v1.Document.Page.Matrix.encode(message.transforms[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.detectedBarcodes != null && message.detectedBarcodes.length) - for (var i = 0; i < message.detectedBarcodes.length; ++i) - $root.google.cloud.documentai.v1.Document.Page.DetectedBarcode.encode(message.detectedBarcodes[i], writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.provenance != null && Object.hasOwnProperty.call(message, "provenance")) - $root.google.cloud.documentai.v1.Document.Provenance.encode(message.provenance, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); - if (message.imageQualityScores != null && Object.hasOwnProperty.call(message, "imageQualityScores")) - $root.google.cloud.documentai.v1.Document.Page.ImageQualityScores.encode(message.imageQualityScores, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Page message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.Page - * @static - * @param {google.cloud.documentai.v1.Document.IPage} message Page message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Page.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Page message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document.Page - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.Page} Page - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Page.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Page(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.pageNumber = reader.int32(); - break; - } - case 13: { - message.image = $root.google.cloud.documentai.v1.Document.Page.Image.decode(reader, reader.uint32()); - break; - } - case 14: { - if (!(message.transforms && message.transforms.length)) - message.transforms = []; - message.transforms.push($root.google.cloud.documentai.v1.Document.Page.Matrix.decode(reader, reader.uint32())); - break; - } - case 2: { - message.dimension = $root.google.cloud.documentai.v1.Document.Page.Dimension.decode(reader, reader.uint32()); - break; - } - case 3: { - message.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.decode(reader, reader.uint32()); - break; - } - case 4: { - if (!(message.detectedLanguages && message.detectedLanguages.length)) - message.detectedLanguages = []; - message.detectedLanguages.push($root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.blocks && message.blocks.length)) - message.blocks = []; - message.blocks.push($root.google.cloud.documentai.v1.Document.Page.Block.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.paragraphs && message.paragraphs.length)) - message.paragraphs = []; - message.paragraphs.push($root.google.cloud.documentai.v1.Document.Page.Paragraph.decode(reader, reader.uint32())); - break; - } - case 7: { - if (!(message.lines && message.lines.length)) - message.lines = []; - message.lines.push($root.google.cloud.documentai.v1.Document.Page.Line.decode(reader, reader.uint32())); - break; - } - case 8: { - if (!(message.tokens && message.tokens.length)) - message.tokens = []; - message.tokens.push($root.google.cloud.documentai.v1.Document.Page.Token.decode(reader, reader.uint32())); - break; - } - case 9: { - if (!(message.visualElements && message.visualElements.length)) - message.visualElements = []; - message.visualElements.push($root.google.cloud.documentai.v1.Document.Page.VisualElement.decode(reader, reader.uint32())); - break; - } - case 10: { - if (!(message.tables && message.tables.length)) - message.tables = []; - message.tables.push($root.google.cloud.documentai.v1.Document.Page.Table.decode(reader, reader.uint32())); - break; - } - case 11: { - if (!(message.formFields && message.formFields.length)) - message.formFields = []; - message.formFields.push($root.google.cloud.documentai.v1.Document.Page.FormField.decode(reader, reader.uint32())); - break; - } - case 12: { - if (!(message.symbols && message.symbols.length)) - message.symbols = []; - message.symbols.push($root.google.cloud.documentai.v1.Document.Page.Symbol.decode(reader, reader.uint32())); - break; - } - case 15: { - if (!(message.detectedBarcodes && message.detectedBarcodes.length)) - message.detectedBarcodes = []; - message.detectedBarcodes.push($root.google.cloud.documentai.v1.Document.Page.DetectedBarcode.decode(reader, reader.uint32())); - break; - } - case 17: { - message.imageQualityScores = $root.google.cloud.documentai.v1.Document.Page.ImageQualityScores.decode(reader, reader.uint32()); - break; - } - case 16: { - message.provenance = $root.google.cloud.documentai.v1.Document.Provenance.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Page message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document.Page - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.Page} Page - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Page.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Page message. - * @function verify - * @memberof google.cloud.documentai.v1.Document.Page - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Page.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pageNumber != null && message.hasOwnProperty("pageNumber")) - if (!$util.isInteger(message.pageNumber)) - return "pageNumber: integer expected"; - if (message.image != null && message.hasOwnProperty("image")) { - var error = $root.google.cloud.documentai.v1.Document.Page.Image.verify(message.image); - if (error) - return "image." + error; - } - if (message.transforms != null && message.hasOwnProperty("transforms")) { - if (!Array.isArray(message.transforms)) - return "transforms: array expected"; - for (var i = 0; i < message.transforms.length; ++i) { - var error = $root.google.cloud.documentai.v1.Document.Page.Matrix.verify(message.transforms[i]); - if (error) - return "transforms." + error; - } - } - if (message.dimension != null && message.hasOwnProperty("dimension")) { - var error = $root.google.cloud.documentai.v1.Document.Page.Dimension.verify(message.dimension); - if (error) - return "dimension." + error; - } - if (message.layout != null && message.hasOwnProperty("layout")) { - var error = $root.google.cloud.documentai.v1.Document.Page.Layout.verify(message.layout); - if (error) - return "layout." + error; - } - if (message.detectedLanguages != null && message.hasOwnProperty("detectedLanguages")) { - if (!Array.isArray(message.detectedLanguages)) - return "detectedLanguages: array expected"; - for (var i = 0; i < message.detectedLanguages.length; ++i) { - var error = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.verify(message.detectedLanguages[i]); - if (error) - return "detectedLanguages." + error; - } - } - if (message.blocks != null && message.hasOwnProperty("blocks")) { - if (!Array.isArray(message.blocks)) - return "blocks: array expected"; - for (var i = 0; i < message.blocks.length; ++i) { - var error = $root.google.cloud.documentai.v1.Document.Page.Block.verify(message.blocks[i]); - if (error) - return "blocks." + error; - } - } - if (message.paragraphs != null && message.hasOwnProperty("paragraphs")) { - if (!Array.isArray(message.paragraphs)) - return "paragraphs: array expected"; - for (var i = 0; i < message.paragraphs.length; ++i) { - var error = $root.google.cloud.documentai.v1.Document.Page.Paragraph.verify(message.paragraphs[i]); - if (error) - return "paragraphs." + error; - } - } - if (message.lines != null && message.hasOwnProperty("lines")) { - if (!Array.isArray(message.lines)) - return "lines: array expected"; - for (var i = 0; i < message.lines.length; ++i) { - var error = $root.google.cloud.documentai.v1.Document.Page.Line.verify(message.lines[i]); - if (error) - return "lines." + error; - } - } - if (message.tokens != null && message.hasOwnProperty("tokens")) { - if (!Array.isArray(message.tokens)) - return "tokens: array expected"; - for (var i = 0; i < message.tokens.length; ++i) { - var error = $root.google.cloud.documentai.v1.Document.Page.Token.verify(message.tokens[i]); - if (error) - return "tokens." + error; - } - } - if (message.visualElements != null && message.hasOwnProperty("visualElements")) { - if (!Array.isArray(message.visualElements)) - return "visualElements: array expected"; - for (var i = 0; i < message.visualElements.length; ++i) { - var error = $root.google.cloud.documentai.v1.Document.Page.VisualElement.verify(message.visualElements[i]); - if (error) - return "visualElements." + error; - } - } - if (message.tables != null && message.hasOwnProperty("tables")) { - if (!Array.isArray(message.tables)) - return "tables: array expected"; - for (var i = 0; i < message.tables.length; ++i) { - var error = $root.google.cloud.documentai.v1.Document.Page.Table.verify(message.tables[i]); - if (error) - return "tables." + error; - } - } - if (message.formFields != null && message.hasOwnProperty("formFields")) { - if (!Array.isArray(message.formFields)) - return "formFields: array expected"; - for (var i = 0; i < message.formFields.length; ++i) { - var error = $root.google.cloud.documentai.v1.Document.Page.FormField.verify(message.formFields[i]); - if (error) - return "formFields." + error; - } - } - if (message.symbols != null && message.hasOwnProperty("symbols")) { - if (!Array.isArray(message.symbols)) - return "symbols: array expected"; - for (var i = 0; i < message.symbols.length; ++i) { - var error = $root.google.cloud.documentai.v1.Document.Page.Symbol.verify(message.symbols[i]); - if (error) - return "symbols." + error; - } - } - if (message.detectedBarcodes != null && message.hasOwnProperty("detectedBarcodes")) { - if (!Array.isArray(message.detectedBarcodes)) - return "detectedBarcodes: array expected"; - for (var i = 0; i < message.detectedBarcodes.length; ++i) { - var error = $root.google.cloud.documentai.v1.Document.Page.DetectedBarcode.verify(message.detectedBarcodes[i]); - if (error) - return "detectedBarcodes." + error; - } - } - if (message.imageQualityScores != null && message.hasOwnProperty("imageQualityScores")) { - var error = $root.google.cloud.documentai.v1.Document.Page.ImageQualityScores.verify(message.imageQualityScores); - if (error) - return "imageQualityScores." + error; - } - if (message.provenance != null && message.hasOwnProperty("provenance")) { - var error = $root.google.cloud.documentai.v1.Document.Provenance.verify(message.provenance); - if (error) - return "provenance." + error; - } - return null; - }; - - /** - * Creates a Page message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.Page - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.Page} Page - */ - Page.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.Page) - return object; - var message = new $root.google.cloud.documentai.v1.Document.Page(); - if (object.pageNumber != null) - message.pageNumber = object.pageNumber | 0; - if (object.image != null) { - if (typeof object.image !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.image: object expected"); - message.image = $root.google.cloud.documentai.v1.Document.Page.Image.fromObject(object.image); - } - if (object.transforms) { - if (!Array.isArray(object.transforms)) - throw TypeError(".google.cloud.documentai.v1.Document.Page.transforms: array expected"); - message.transforms = []; - for (var i = 0; i < object.transforms.length; ++i) { - if (typeof object.transforms[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.transforms: object expected"); - message.transforms[i] = $root.google.cloud.documentai.v1.Document.Page.Matrix.fromObject(object.transforms[i]); - } - } - if (object.dimension != null) { - if (typeof object.dimension !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.dimension: object expected"); - message.dimension = $root.google.cloud.documentai.v1.Document.Page.Dimension.fromObject(object.dimension); - } - if (object.layout != null) { - if (typeof object.layout !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.layout: object expected"); - message.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.fromObject(object.layout); - } - if (object.detectedLanguages) { - if (!Array.isArray(object.detectedLanguages)) - throw TypeError(".google.cloud.documentai.v1.Document.Page.detectedLanguages: array expected"); - message.detectedLanguages = []; - for (var i = 0; i < object.detectedLanguages.length; ++i) { - if (typeof object.detectedLanguages[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.detectedLanguages: object expected"); - message.detectedLanguages[i] = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.fromObject(object.detectedLanguages[i]); - } - } - if (object.blocks) { - if (!Array.isArray(object.blocks)) - throw TypeError(".google.cloud.documentai.v1.Document.Page.blocks: array expected"); - message.blocks = []; - for (var i = 0; i < object.blocks.length; ++i) { - if (typeof object.blocks[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.blocks: object expected"); - message.blocks[i] = $root.google.cloud.documentai.v1.Document.Page.Block.fromObject(object.blocks[i]); - } - } - if (object.paragraphs) { - if (!Array.isArray(object.paragraphs)) - throw TypeError(".google.cloud.documentai.v1.Document.Page.paragraphs: array expected"); - message.paragraphs = []; - for (var i = 0; i < object.paragraphs.length; ++i) { - if (typeof object.paragraphs[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.paragraphs: object expected"); - message.paragraphs[i] = $root.google.cloud.documentai.v1.Document.Page.Paragraph.fromObject(object.paragraphs[i]); - } - } - if (object.lines) { - if (!Array.isArray(object.lines)) - throw TypeError(".google.cloud.documentai.v1.Document.Page.lines: array expected"); - message.lines = []; - for (var i = 0; i < object.lines.length; ++i) { - if (typeof object.lines[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.lines: object expected"); - message.lines[i] = $root.google.cloud.documentai.v1.Document.Page.Line.fromObject(object.lines[i]); - } - } - if (object.tokens) { - if (!Array.isArray(object.tokens)) - throw TypeError(".google.cloud.documentai.v1.Document.Page.tokens: array expected"); - message.tokens = []; - for (var i = 0; i < object.tokens.length; ++i) { - if (typeof object.tokens[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.tokens: object expected"); - message.tokens[i] = $root.google.cloud.documentai.v1.Document.Page.Token.fromObject(object.tokens[i]); - } - } - if (object.visualElements) { - if (!Array.isArray(object.visualElements)) - throw TypeError(".google.cloud.documentai.v1.Document.Page.visualElements: array expected"); - message.visualElements = []; - for (var i = 0; i < object.visualElements.length; ++i) { - if (typeof object.visualElements[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.visualElements: object expected"); - message.visualElements[i] = $root.google.cloud.documentai.v1.Document.Page.VisualElement.fromObject(object.visualElements[i]); - } - } - if (object.tables) { - if (!Array.isArray(object.tables)) - throw TypeError(".google.cloud.documentai.v1.Document.Page.tables: array expected"); - message.tables = []; - for (var i = 0; i < object.tables.length; ++i) { - if (typeof object.tables[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.tables: object expected"); - message.tables[i] = $root.google.cloud.documentai.v1.Document.Page.Table.fromObject(object.tables[i]); - } - } - if (object.formFields) { - if (!Array.isArray(object.formFields)) - throw TypeError(".google.cloud.documentai.v1.Document.Page.formFields: array expected"); - message.formFields = []; - for (var i = 0; i < object.formFields.length; ++i) { - if (typeof object.formFields[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.formFields: object expected"); - message.formFields[i] = $root.google.cloud.documentai.v1.Document.Page.FormField.fromObject(object.formFields[i]); - } - } - if (object.symbols) { - if (!Array.isArray(object.symbols)) - throw TypeError(".google.cloud.documentai.v1.Document.Page.symbols: array expected"); - message.symbols = []; - for (var i = 0; i < object.symbols.length; ++i) { - if (typeof object.symbols[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.symbols: object expected"); - message.symbols[i] = $root.google.cloud.documentai.v1.Document.Page.Symbol.fromObject(object.symbols[i]); - } - } - if (object.detectedBarcodes) { - if (!Array.isArray(object.detectedBarcodes)) - throw TypeError(".google.cloud.documentai.v1.Document.Page.detectedBarcodes: array expected"); - message.detectedBarcodes = []; - for (var i = 0; i < object.detectedBarcodes.length; ++i) { - if (typeof object.detectedBarcodes[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.detectedBarcodes: object expected"); - message.detectedBarcodes[i] = $root.google.cloud.documentai.v1.Document.Page.DetectedBarcode.fromObject(object.detectedBarcodes[i]); - } - } - if (object.imageQualityScores != null) { - if (typeof object.imageQualityScores !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.imageQualityScores: object expected"); - message.imageQualityScores = $root.google.cloud.documentai.v1.Document.Page.ImageQualityScores.fromObject(object.imageQualityScores); - } - if (object.provenance != null) { - if (typeof object.provenance !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.provenance: object expected"); - message.provenance = $root.google.cloud.documentai.v1.Document.Provenance.fromObject(object.provenance); - } - return message; - }; - - /** - * Creates a plain object from a Page message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.Page - * @static - * @param {google.cloud.documentai.v1.Document.Page} message Page - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Page.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.detectedLanguages = []; - object.blocks = []; - object.paragraphs = []; - object.lines = []; - object.tokens = []; - object.visualElements = []; - object.tables = []; - object.formFields = []; - object.symbols = []; - object.transforms = []; - object.detectedBarcodes = []; - } - if (options.defaults) { - object.pageNumber = 0; - object.dimension = null; - object.layout = null; - object.image = null; - object.provenance = null; - object.imageQualityScores = null; - } - if (message.pageNumber != null && message.hasOwnProperty("pageNumber")) - object.pageNumber = message.pageNumber; - if (message.dimension != null && message.hasOwnProperty("dimension")) - object.dimension = $root.google.cloud.documentai.v1.Document.Page.Dimension.toObject(message.dimension, options); - if (message.layout != null && message.hasOwnProperty("layout")) - object.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.toObject(message.layout, options); - if (message.detectedLanguages && message.detectedLanguages.length) { - object.detectedLanguages = []; - for (var j = 0; j < message.detectedLanguages.length; ++j) - object.detectedLanguages[j] = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.toObject(message.detectedLanguages[j], options); - } - if (message.blocks && message.blocks.length) { - object.blocks = []; - for (var j = 0; j < message.blocks.length; ++j) - object.blocks[j] = $root.google.cloud.documentai.v1.Document.Page.Block.toObject(message.blocks[j], options); - } - if (message.paragraphs && message.paragraphs.length) { - object.paragraphs = []; - for (var j = 0; j < message.paragraphs.length; ++j) - object.paragraphs[j] = $root.google.cloud.documentai.v1.Document.Page.Paragraph.toObject(message.paragraphs[j], options); - } - if (message.lines && message.lines.length) { - object.lines = []; - for (var j = 0; j < message.lines.length; ++j) - object.lines[j] = $root.google.cloud.documentai.v1.Document.Page.Line.toObject(message.lines[j], options); - } - if (message.tokens && message.tokens.length) { - object.tokens = []; - for (var j = 0; j < message.tokens.length; ++j) - object.tokens[j] = $root.google.cloud.documentai.v1.Document.Page.Token.toObject(message.tokens[j], options); - } - if (message.visualElements && message.visualElements.length) { - object.visualElements = []; - for (var j = 0; j < message.visualElements.length; ++j) - object.visualElements[j] = $root.google.cloud.documentai.v1.Document.Page.VisualElement.toObject(message.visualElements[j], options); - } - if (message.tables && message.tables.length) { - object.tables = []; - for (var j = 0; j < message.tables.length; ++j) - object.tables[j] = $root.google.cloud.documentai.v1.Document.Page.Table.toObject(message.tables[j], options); - } - if (message.formFields && message.formFields.length) { - object.formFields = []; - for (var j = 0; j < message.formFields.length; ++j) - object.formFields[j] = $root.google.cloud.documentai.v1.Document.Page.FormField.toObject(message.formFields[j], options); - } - if (message.symbols && message.symbols.length) { - object.symbols = []; - for (var j = 0; j < message.symbols.length; ++j) - object.symbols[j] = $root.google.cloud.documentai.v1.Document.Page.Symbol.toObject(message.symbols[j], options); - } - if (message.image != null && message.hasOwnProperty("image")) - object.image = $root.google.cloud.documentai.v1.Document.Page.Image.toObject(message.image, options); - if (message.transforms && message.transforms.length) { - object.transforms = []; - for (var j = 0; j < message.transforms.length; ++j) - object.transforms[j] = $root.google.cloud.documentai.v1.Document.Page.Matrix.toObject(message.transforms[j], options); - } - if (message.detectedBarcodes && message.detectedBarcodes.length) { - object.detectedBarcodes = []; - for (var j = 0; j < message.detectedBarcodes.length; ++j) - object.detectedBarcodes[j] = $root.google.cloud.documentai.v1.Document.Page.DetectedBarcode.toObject(message.detectedBarcodes[j], options); - } - if (message.provenance != null && message.hasOwnProperty("provenance")) - object.provenance = $root.google.cloud.documentai.v1.Document.Provenance.toObject(message.provenance, options); - if (message.imageQualityScores != null && message.hasOwnProperty("imageQualityScores")) - object.imageQualityScores = $root.google.cloud.documentai.v1.Document.Page.ImageQualityScores.toObject(message.imageQualityScores, options); - return object; - }; - - /** - * Converts this Page to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.Page - * @instance - * @returns {Object.} JSON object - */ - Page.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Page - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.Page - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Page.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Page"; - }; - - Page.Dimension = (function() { - - /** - * Properties of a Dimension. - * @memberof google.cloud.documentai.v1.Document.Page - * @interface IDimension - * @property {number|null} [width] Dimension width - * @property {number|null} [height] Dimension height - * @property {string|null} [unit] Dimension unit - */ - - /** - * Constructs a new Dimension. - * @memberof google.cloud.documentai.v1.Document.Page - * @classdesc Represents a Dimension. - * @implements IDimension - * @constructor - * @param {google.cloud.documentai.v1.Document.Page.IDimension=} [properties] Properties to set - */ - function Dimension(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]]; - } - - /** - * Dimension width. - * @member {number} width - * @memberof google.cloud.documentai.v1.Document.Page.Dimension - * @instance - */ - Dimension.prototype.width = 0; - - /** - * Dimension height. - * @member {number} height - * @memberof google.cloud.documentai.v1.Document.Page.Dimension - * @instance - */ - Dimension.prototype.height = 0; - - /** - * Dimension unit. - * @member {string} unit - * @memberof google.cloud.documentai.v1.Document.Page.Dimension - * @instance - */ - Dimension.prototype.unit = ""; - - /** - * Creates a new Dimension instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.Page.Dimension - * @static - * @param {google.cloud.documentai.v1.Document.Page.IDimension=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.Page.Dimension} Dimension instance - */ - Dimension.create = function create(properties) { - return new Dimension(properties); - }; - - /** - * Encodes the specified Dimension message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Dimension.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.Page.Dimension - * @static - * @param {google.cloud.documentai.v1.Document.Page.IDimension} message Dimension message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Dimension.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.width != null && Object.hasOwnProperty.call(message, "width")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.width); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.height); - if (message.unit != null && Object.hasOwnProperty.call(message, "unit")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unit); - return writer; - }; - - /** - * Encodes the specified Dimension message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Dimension.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.Page.Dimension - * @static - * @param {google.cloud.documentai.v1.Document.Page.IDimension} message Dimension message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Dimension.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Dimension message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document.Page.Dimension - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.Page.Dimension} Dimension - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Dimension.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Page.Dimension(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.width = reader.float(); - break; - } - case 2: { - message.height = reader.float(); - break; - } - case 3: { - message.unit = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Dimension message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document.Page.Dimension - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.Page.Dimension} Dimension - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Dimension.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Dimension message. - * @function verify - * @memberof google.cloud.documentai.v1.Document.Page.Dimension - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Dimension.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.width != null && message.hasOwnProperty("width")) - if (typeof message.width !== "number") - return "width: number expected"; - if (message.height != null && message.hasOwnProperty("height")) - if (typeof message.height !== "number") - return "height: number expected"; - if (message.unit != null && message.hasOwnProperty("unit")) - if (!$util.isString(message.unit)) - return "unit: string expected"; - return null; - }; - - /** - * Creates a Dimension message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.Page.Dimension - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.Page.Dimension} Dimension - */ - Dimension.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.Page.Dimension) - return object; - var message = new $root.google.cloud.documentai.v1.Document.Page.Dimension(); - if (object.width != null) - message.width = Number(object.width); - if (object.height != null) - message.height = Number(object.height); - if (object.unit != null) - message.unit = String(object.unit); - return message; - }; - - /** - * Creates a plain object from a Dimension message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.Page.Dimension - * @static - * @param {google.cloud.documentai.v1.Document.Page.Dimension} message Dimension - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Dimension.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.width = 0; - object.height = 0; - object.unit = ""; - } - if (message.width != null && message.hasOwnProperty("width")) - object.width = options.json && !isFinite(message.width) ? String(message.width) : message.width; - if (message.height != null && message.hasOwnProperty("height")) - object.height = options.json && !isFinite(message.height) ? String(message.height) : message.height; - if (message.unit != null && message.hasOwnProperty("unit")) - object.unit = message.unit; - return object; - }; - - /** - * Converts this Dimension to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.Page.Dimension - * @instance - * @returns {Object.} JSON object - */ - Dimension.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Dimension - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.Page.Dimension - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Dimension.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Page.Dimension"; - }; - - return Dimension; - })(); - - Page.Image = (function() { - - /** - * Properties of an Image. - * @memberof google.cloud.documentai.v1.Document.Page - * @interface IImage - * @property {Uint8Array|null} [content] Image content - * @property {string|null} [mimeType] Image mimeType - * @property {number|null} [width] Image width - * @property {number|null} [height] Image height - */ - - /** - * Constructs a new Image. - * @memberof google.cloud.documentai.v1.Document.Page - * @classdesc Represents an Image. - * @implements IImage - * @constructor - * @param {google.cloud.documentai.v1.Document.Page.IImage=} [properties] Properties to set - */ - function Image(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]]; - } - - /** - * Image content. - * @member {Uint8Array} content - * @memberof google.cloud.documentai.v1.Document.Page.Image - * @instance - */ - Image.prototype.content = $util.newBuffer([]); - - /** - * Image mimeType. - * @member {string} mimeType - * @memberof google.cloud.documentai.v1.Document.Page.Image - * @instance - */ - Image.prototype.mimeType = ""; - - /** - * Image width. - * @member {number} width - * @memberof google.cloud.documentai.v1.Document.Page.Image - * @instance - */ - Image.prototype.width = 0; - - /** - * Image height. - * @member {number} height - * @memberof google.cloud.documentai.v1.Document.Page.Image - * @instance - */ - Image.prototype.height = 0; - - /** - * Creates a new Image instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.Page.Image - * @static - * @param {google.cloud.documentai.v1.Document.Page.IImage=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.Page.Image} Image instance - */ - Image.create = function create(properties) { - return new Image(properties); - }; - - /** - * Encodes the specified Image message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Image.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.Page.Image - * @static - * @param {google.cloud.documentai.v1.Document.Page.IImage} message Image message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Image.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.content != null && Object.hasOwnProperty.call(message, "content")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.content); - if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimeType); - 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 Image message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Image.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.Page.Image - * @static - * @param {google.cloud.documentai.v1.Document.Page.IImage} message Image message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Image.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Image message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document.Page.Image - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.Page.Image} Image - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Image.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Page.Image(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.content = reader.bytes(); - break; - } - case 2: { - message.mimeType = reader.string(); - break; - } - case 3: { - message.width = reader.int32(); - break; - } - case 4: { - message.height = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Image message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document.Page.Image - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.Page.Image} Image - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Image.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Image message. - * @function verify - * @memberof google.cloud.documentai.v1.Document.Page.Image - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Image.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.content != null && message.hasOwnProperty("content")) - if (!(message.content && typeof message.content.length === "number" || $util.isString(message.content))) - return "content: buffer expected"; - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - if (!$util.isString(message.mimeType)) - return "mimeType: string 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 an Image message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.Page.Image - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.Page.Image} Image - */ - Image.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.Page.Image) - return object; - var message = new $root.google.cloud.documentai.v1.Document.Page.Image(); - if (object.content != null) - if (typeof object.content === "string") - $util.base64.decode(object.content, message.content = $util.newBuffer($util.base64.length(object.content)), 0); - else if (object.content.length >= 0) - message.content = object.content; - if (object.mimeType != null) - message.mimeType = String(object.mimeType); - 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 an Image message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.Page.Image - * @static - * @param {google.cloud.documentai.v1.Document.Page.Image} message Image - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Image.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.content = ""; - else { - object.content = []; - if (options.bytes !== Array) - object.content = $util.newBuffer(object.content); - } - object.mimeType = ""; - object.width = 0; - object.height = 0; - } - if (message.content != null && message.hasOwnProperty("content")) - object.content = options.bytes === String ? $util.base64.encode(message.content, 0, message.content.length) : options.bytes === Array ? Array.prototype.slice.call(message.content) : message.content; - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - object.mimeType = message.mimeType; - 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 Image to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.Page.Image - * @instance - * @returns {Object.} JSON object - */ - Image.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Image - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.Page.Image - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Image.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Page.Image"; - }; - - return Image; - })(); - - Page.Matrix = (function() { - - /** - * Properties of a Matrix. - * @memberof google.cloud.documentai.v1.Document.Page - * @interface IMatrix - * @property {number|null} [rows] Matrix rows - * @property {number|null} [cols] Matrix cols - * @property {number|null} [type] Matrix type - * @property {Uint8Array|null} [data] Matrix data - */ - - /** - * Constructs a new Matrix. - * @memberof google.cloud.documentai.v1.Document.Page - * @classdesc Represents a Matrix. - * @implements IMatrix - * @constructor - * @param {google.cloud.documentai.v1.Document.Page.IMatrix=} [properties] Properties to set - */ - function Matrix(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]]; - } - - /** - * Matrix rows. - * @member {number} rows - * @memberof google.cloud.documentai.v1.Document.Page.Matrix - * @instance - */ - Matrix.prototype.rows = 0; - - /** - * Matrix cols. - * @member {number} cols - * @memberof google.cloud.documentai.v1.Document.Page.Matrix - * @instance - */ - Matrix.prototype.cols = 0; - - /** - * Matrix type. - * @member {number} type - * @memberof google.cloud.documentai.v1.Document.Page.Matrix - * @instance - */ - Matrix.prototype.type = 0; - - /** - * Matrix data. - * @member {Uint8Array} data - * @memberof google.cloud.documentai.v1.Document.Page.Matrix - * @instance - */ - Matrix.prototype.data = $util.newBuffer([]); - - /** - * Creates a new Matrix instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.Page.Matrix - * @static - * @param {google.cloud.documentai.v1.Document.Page.IMatrix=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.Page.Matrix} Matrix instance - */ - Matrix.create = function create(properties) { - return new Matrix(properties); - }; - - /** - * Encodes the specified Matrix message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Matrix.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.Page.Matrix - * @static - * @param {google.cloud.documentai.v1.Document.Page.IMatrix} message Matrix message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Matrix.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.rows != null && Object.hasOwnProperty.call(message, "rows")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.rows); - if (message.cols != null && Object.hasOwnProperty.call(message, "cols")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.cols); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); - if (message.data != null && Object.hasOwnProperty.call(message, "data")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.data); - return writer; - }; - - /** - * Encodes the specified Matrix message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Matrix.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.Page.Matrix - * @static - * @param {google.cloud.documentai.v1.Document.Page.IMatrix} message Matrix message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Matrix.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Matrix message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document.Page.Matrix - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.Page.Matrix} Matrix - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Matrix.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Page.Matrix(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.rows = reader.int32(); - break; - } - case 2: { - message.cols = reader.int32(); - break; - } - case 3: { - message.type = reader.int32(); - break; - } - case 4: { - message.data = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Matrix message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document.Page.Matrix - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.Page.Matrix} Matrix - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Matrix.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Matrix message. - * @function verify - * @memberof google.cloud.documentai.v1.Document.Page.Matrix - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Matrix.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.rows != null && message.hasOwnProperty("rows")) - if (!$util.isInteger(message.rows)) - return "rows: integer expected"; - if (message.cols != null && message.hasOwnProperty("cols")) - if (!$util.isInteger(message.cols)) - return "cols: integer expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isInteger(message.type)) - return "type: integer expected"; - 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 Matrix message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.Page.Matrix - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.Page.Matrix} Matrix - */ - Matrix.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.Page.Matrix) - return object; - var message = new $root.google.cloud.documentai.v1.Document.Page.Matrix(); - if (object.rows != null) - message.rows = object.rows | 0; - if (object.cols != null) - message.cols = object.cols | 0; - if (object.type != null) - message.type = object.type | 0; - 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 >= 0) - message.data = object.data; - return message; - }; - - /** - * Creates a plain object from a Matrix message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.Page.Matrix - * @static - * @param {google.cloud.documentai.v1.Document.Page.Matrix} message Matrix - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Matrix.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.rows = 0; - object.cols = 0; - object.type = 0; - if (options.bytes === String) - object.data = ""; - else { - object.data = []; - if (options.bytes !== Array) - object.data = $util.newBuffer(object.data); - } - } - if (message.rows != null && message.hasOwnProperty("rows")) - object.rows = message.rows; - if (message.cols != null && message.hasOwnProperty("cols")) - object.cols = message.cols; - if (message.type != null && message.hasOwnProperty("type")) - object.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 Matrix to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.Page.Matrix - * @instance - * @returns {Object.} JSON object - */ - Matrix.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Matrix - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.Page.Matrix - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Matrix.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Page.Matrix"; - }; - - return Matrix; - })(); - - Page.Layout = (function() { - - /** - * Properties of a Layout. - * @memberof google.cloud.documentai.v1.Document.Page - * @interface ILayout - * @property {google.cloud.documentai.v1.Document.ITextAnchor|null} [textAnchor] Layout textAnchor - * @property {number|null} [confidence] Layout confidence - * @property {google.cloud.documentai.v1.IBoundingPoly|null} [boundingPoly] Layout boundingPoly - * @property {google.cloud.documentai.v1.Document.Page.Layout.Orientation|null} [orientation] Layout orientation - */ - - /** - * Constructs a new Layout. - * @memberof google.cloud.documentai.v1.Document.Page - * @classdesc Represents a Layout. - * @implements ILayout - * @constructor - * @param {google.cloud.documentai.v1.Document.Page.ILayout=} [properties] Properties to set - */ - function Layout(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]]; - } - - /** - * Layout textAnchor. - * @member {google.cloud.documentai.v1.Document.ITextAnchor|null|undefined} textAnchor - * @memberof google.cloud.documentai.v1.Document.Page.Layout - * @instance - */ - Layout.prototype.textAnchor = null; - - /** - * Layout confidence. - * @member {number} confidence - * @memberof google.cloud.documentai.v1.Document.Page.Layout - * @instance - */ - Layout.prototype.confidence = 0; - - /** - * Layout boundingPoly. - * @member {google.cloud.documentai.v1.IBoundingPoly|null|undefined} boundingPoly - * @memberof google.cloud.documentai.v1.Document.Page.Layout - * @instance - */ - Layout.prototype.boundingPoly = null; - - /** - * Layout orientation. - * @member {google.cloud.documentai.v1.Document.Page.Layout.Orientation} orientation - * @memberof google.cloud.documentai.v1.Document.Page.Layout - * @instance - */ - Layout.prototype.orientation = 0; - - /** - * Creates a new Layout instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.Page.Layout - * @static - * @param {google.cloud.documentai.v1.Document.Page.ILayout=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.Page.Layout} Layout instance - */ - Layout.create = function create(properties) { - return new Layout(properties); - }; - - /** - * Encodes the specified Layout message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Layout.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.Page.Layout - * @static - * @param {google.cloud.documentai.v1.Document.Page.ILayout} message Layout message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Layout.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.textAnchor != null && Object.hasOwnProperty.call(message, "textAnchor")) - $root.google.cloud.documentai.v1.Document.TextAnchor.encode(message.textAnchor, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); - if (message.boundingPoly != null && Object.hasOwnProperty.call(message, "boundingPoly")) - $root.google.cloud.documentai.v1.BoundingPoly.encode(message.boundingPoly, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.orientation != null && Object.hasOwnProperty.call(message, "orientation")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.orientation); - return writer; - }; - - /** - * Encodes the specified Layout message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Layout.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.Page.Layout - * @static - * @param {google.cloud.documentai.v1.Document.Page.ILayout} message Layout message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Layout.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Layout message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document.Page.Layout - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.Page.Layout} Layout - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Layout.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Page.Layout(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.textAnchor = $root.google.cloud.documentai.v1.Document.TextAnchor.decode(reader, reader.uint32()); - break; - } - case 2: { - message.confidence = reader.float(); - break; - } - case 3: { - message.boundingPoly = $root.google.cloud.documentai.v1.BoundingPoly.decode(reader, reader.uint32()); - break; - } - case 4: { - message.orientation = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Layout message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document.Page.Layout - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.Page.Layout} Layout - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Layout.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Layout message. - * @function verify - * @memberof google.cloud.documentai.v1.Document.Page.Layout - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Layout.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.textAnchor != null && message.hasOwnProperty("textAnchor")) { - var error = $root.google.cloud.documentai.v1.Document.TextAnchor.verify(message.textAnchor); - if (error) - return "textAnchor." + error; - } - if (message.confidence != null && message.hasOwnProperty("confidence")) - if (typeof message.confidence !== "number") - return "confidence: number expected"; - if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) { - var error = $root.google.cloud.documentai.v1.BoundingPoly.verify(message.boundingPoly); - if (error) - return "boundingPoly." + error; - } - if (message.orientation != null && message.hasOwnProperty("orientation")) - switch (message.orientation) { - default: - return "orientation: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - return null; - }; - - /** - * Creates a Layout message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.Page.Layout - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.Page.Layout} Layout - */ - Layout.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.Page.Layout) - return object; - var message = new $root.google.cloud.documentai.v1.Document.Page.Layout(); - if (object.textAnchor != null) { - if (typeof object.textAnchor !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.Layout.textAnchor: object expected"); - message.textAnchor = $root.google.cloud.documentai.v1.Document.TextAnchor.fromObject(object.textAnchor); - } - if (object.confidence != null) - message.confidence = Number(object.confidence); - if (object.boundingPoly != null) { - if (typeof object.boundingPoly !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.Layout.boundingPoly: object expected"); - message.boundingPoly = $root.google.cloud.documentai.v1.BoundingPoly.fromObject(object.boundingPoly); - } - switch (object.orientation) { - default: - if (typeof object.orientation === "number") { - message.orientation = object.orientation; - break; - } - break; - case "ORIENTATION_UNSPECIFIED": - case 0: - message.orientation = 0; - break; - case "PAGE_UP": - case 1: - message.orientation = 1; - break; - case "PAGE_RIGHT": - case 2: - message.orientation = 2; - break; - case "PAGE_DOWN": - case 3: - message.orientation = 3; - break; - case "PAGE_LEFT": - case 4: - message.orientation = 4; - break; - } - return message; - }; - - /** - * Creates a plain object from a Layout message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.Page.Layout - * @static - * @param {google.cloud.documentai.v1.Document.Page.Layout} message Layout - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Layout.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.textAnchor = null; - object.confidence = 0; - object.boundingPoly = null; - object.orientation = options.enums === String ? "ORIENTATION_UNSPECIFIED" : 0; - } - if (message.textAnchor != null && message.hasOwnProperty("textAnchor")) - object.textAnchor = $root.google.cloud.documentai.v1.Document.TextAnchor.toObject(message.textAnchor, options); - if (message.confidence != null && message.hasOwnProperty("confidence")) - object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; - if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) - object.boundingPoly = $root.google.cloud.documentai.v1.BoundingPoly.toObject(message.boundingPoly, options); - if (message.orientation != null && message.hasOwnProperty("orientation")) - object.orientation = options.enums === String ? $root.google.cloud.documentai.v1.Document.Page.Layout.Orientation[message.orientation] === undefined ? message.orientation : $root.google.cloud.documentai.v1.Document.Page.Layout.Orientation[message.orientation] : message.orientation; - return object; - }; - - /** - * Converts this Layout to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.Page.Layout - * @instance - * @returns {Object.} JSON object - */ - Layout.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Layout - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.Page.Layout - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Layout.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Page.Layout"; - }; - - /** - * Orientation enum. - * @name google.cloud.documentai.v1.Document.Page.Layout.Orientation - * @enum {number} - * @property {number} ORIENTATION_UNSPECIFIED=0 ORIENTATION_UNSPECIFIED value - * @property {number} PAGE_UP=1 PAGE_UP value - * @property {number} PAGE_RIGHT=2 PAGE_RIGHT value - * @property {number} PAGE_DOWN=3 PAGE_DOWN value - * @property {number} PAGE_LEFT=4 PAGE_LEFT value - */ - Layout.Orientation = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ORIENTATION_UNSPECIFIED"] = 0; - values[valuesById[1] = "PAGE_UP"] = 1; - values[valuesById[2] = "PAGE_RIGHT"] = 2; - values[valuesById[3] = "PAGE_DOWN"] = 3; - values[valuesById[4] = "PAGE_LEFT"] = 4; - return values; - })(); - - return Layout; - })(); - - Page.Block = (function() { - - /** - * Properties of a Block. - * @memberof google.cloud.documentai.v1.Document.Page - * @interface IBlock - * @property {google.cloud.documentai.v1.Document.Page.ILayout|null} [layout] Block layout - * @property {Array.|null} [detectedLanguages] Block detectedLanguages - * @property {google.cloud.documentai.v1.Document.IProvenance|null} [provenance] Block provenance - */ - - /** - * Constructs a new Block. - * @memberof google.cloud.documentai.v1.Document.Page - * @classdesc Represents a Block. - * @implements IBlock - * @constructor - * @param {google.cloud.documentai.v1.Document.Page.IBlock=} [properties] Properties to set - */ - function Block(properties) { - this.detectedLanguages = []; - 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]]; - } - - /** - * Block layout. - * @member {google.cloud.documentai.v1.Document.Page.ILayout|null|undefined} layout - * @memberof google.cloud.documentai.v1.Document.Page.Block - * @instance - */ - Block.prototype.layout = null; - - /** - * Block detectedLanguages. - * @member {Array.} detectedLanguages - * @memberof google.cloud.documentai.v1.Document.Page.Block - * @instance - */ - Block.prototype.detectedLanguages = $util.emptyArray; - - /** - * Block provenance. - * @member {google.cloud.documentai.v1.Document.IProvenance|null|undefined} provenance - * @memberof google.cloud.documentai.v1.Document.Page.Block - * @instance - */ - Block.prototype.provenance = null; - - /** - * Creates a new Block instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.Page.Block - * @static - * @param {google.cloud.documentai.v1.Document.Page.IBlock=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.Page.Block} Block instance - */ - Block.create = function create(properties) { - return new Block(properties); - }; - - /** - * Encodes the specified Block message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Block.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.Page.Block - * @static - * @param {google.cloud.documentai.v1.Document.Page.IBlock} message Block message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Block.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.layout != null && Object.hasOwnProperty.call(message, "layout")) - $root.google.cloud.documentai.v1.Document.Page.Layout.encode(message.layout, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.detectedLanguages != null && message.detectedLanguages.length) - for (var i = 0; i < message.detectedLanguages.length; ++i) - $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.encode(message.detectedLanguages[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.provenance != null && Object.hasOwnProperty.call(message, "provenance")) - $root.google.cloud.documentai.v1.Document.Provenance.encode(message.provenance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Block message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Block.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.Page.Block - * @static - * @param {google.cloud.documentai.v1.Document.Page.IBlock} message Block message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Block.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Block message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document.Page.Block - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.Page.Block} Block - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Block.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Page.Block(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.decode(reader, reader.uint32()); - break; - } - case 2: { - if (!(message.detectedLanguages && message.detectedLanguages.length)) - message.detectedLanguages = []; - message.detectedLanguages.push($root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.decode(reader, reader.uint32())); - break; - } - case 3: { - message.provenance = $root.google.cloud.documentai.v1.Document.Provenance.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Block message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document.Page.Block - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.Page.Block} Block - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Block.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Block message. - * @function verify - * @memberof google.cloud.documentai.v1.Document.Page.Block - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Block.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.layout != null && message.hasOwnProperty("layout")) { - var error = $root.google.cloud.documentai.v1.Document.Page.Layout.verify(message.layout); - if (error) - return "layout." + error; - } - if (message.detectedLanguages != null && message.hasOwnProperty("detectedLanguages")) { - if (!Array.isArray(message.detectedLanguages)) - return "detectedLanguages: array expected"; - for (var i = 0; i < message.detectedLanguages.length; ++i) { - var error = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.verify(message.detectedLanguages[i]); - if (error) - return "detectedLanguages." + error; - } - } - if (message.provenance != null && message.hasOwnProperty("provenance")) { - var error = $root.google.cloud.documentai.v1.Document.Provenance.verify(message.provenance); - if (error) - return "provenance." + error; - } - return null; - }; - - /** - * Creates a Block message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.Page.Block - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.Page.Block} Block - */ - Block.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.Page.Block) - return object; - var message = new $root.google.cloud.documentai.v1.Document.Page.Block(); - if (object.layout != null) { - if (typeof object.layout !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.Block.layout: object expected"); - message.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.fromObject(object.layout); - } - if (object.detectedLanguages) { - if (!Array.isArray(object.detectedLanguages)) - throw TypeError(".google.cloud.documentai.v1.Document.Page.Block.detectedLanguages: array expected"); - message.detectedLanguages = []; - for (var i = 0; i < object.detectedLanguages.length; ++i) { - if (typeof object.detectedLanguages[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.Block.detectedLanguages: object expected"); - message.detectedLanguages[i] = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.fromObject(object.detectedLanguages[i]); - } - } - if (object.provenance != null) { - if (typeof object.provenance !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.Block.provenance: object expected"); - message.provenance = $root.google.cloud.documentai.v1.Document.Provenance.fromObject(object.provenance); - } - return message; - }; - - /** - * Creates a plain object from a Block message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.Page.Block - * @static - * @param {google.cloud.documentai.v1.Document.Page.Block} message Block - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Block.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.detectedLanguages = []; - if (options.defaults) { - object.layout = null; - object.provenance = null; - } - if (message.layout != null && message.hasOwnProperty("layout")) - object.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.toObject(message.layout, options); - if (message.detectedLanguages && message.detectedLanguages.length) { - object.detectedLanguages = []; - for (var j = 0; j < message.detectedLanguages.length; ++j) - object.detectedLanguages[j] = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.toObject(message.detectedLanguages[j], options); - } - if (message.provenance != null && message.hasOwnProperty("provenance")) - object.provenance = $root.google.cloud.documentai.v1.Document.Provenance.toObject(message.provenance, options); - return object; - }; - - /** - * Converts this Block to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.Page.Block - * @instance - * @returns {Object.} JSON object - */ - Block.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Block - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.Page.Block - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Block.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Page.Block"; - }; - - return Block; - })(); - - Page.Paragraph = (function() { - - /** - * Properties of a Paragraph. - * @memberof google.cloud.documentai.v1.Document.Page - * @interface IParagraph - * @property {google.cloud.documentai.v1.Document.Page.ILayout|null} [layout] Paragraph layout - * @property {Array.|null} [detectedLanguages] Paragraph detectedLanguages - * @property {google.cloud.documentai.v1.Document.IProvenance|null} [provenance] Paragraph provenance - */ - - /** - * Constructs a new Paragraph. - * @memberof google.cloud.documentai.v1.Document.Page - * @classdesc Represents a Paragraph. - * @implements IParagraph - * @constructor - * @param {google.cloud.documentai.v1.Document.Page.IParagraph=} [properties] Properties to set - */ - function Paragraph(properties) { - this.detectedLanguages = []; - 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]]; - } - - /** - * Paragraph layout. - * @member {google.cloud.documentai.v1.Document.Page.ILayout|null|undefined} layout - * @memberof google.cloud.documentai.v1.Document.Page.Paragraph - * @instance - */ - Paragraph.prototype.layout = null; - - /** - * Paragraph detectedLanguages. - * @member {Array.} detectedLanguages - * @memberof google.cloud.documentai.v1.Document.Page.Paragraph - * @instance - */ - Paragraph.prototype.detectedLanguages = $util.emptyArray; - - /** - * Paragraph provenance. - * @member {google.cloud.documentai.v1.Document.IProvenance|null|undefined} provenance - * @memberof google.cloud.documentai.v1.Document.Page.Paragraph - * @instance - */ - Paragraph.prototype.provenance = null; - - /** - * Creates a new Paragraph instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.Page.Paragraph - * @static - * @param {google.cloud.documentai.v1.Document.Page.IParagraph=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.Page.Paragraph} Paragraph instance - */ - Paragraph.create = function create(properties) { - return new Paragraph(properties); - }; - - /** - * Encodes the specified Paragraph message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Paragraph.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.Page.Paragraph - * @static - * @param {google.cloud.documentai.v1.Document.Page.IParagraph} message Paragraph message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Paragraph.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.layout != null && Object.hasOwnProperty.call(message, "layout")) - $root.google.cloud.documentai.v1.Document.Page.Layout.encode(message.layout, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.detectedLanguages != null && message.detectedLanguages.length) - for (var i = 0; i < message.detectedLanguages.length; ++i) - $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.encode(message.detectedLanguages[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.provenance != null && Object.hasOwnProperty.call(message, "provenance")) - $root.google.cloud.documentai.v1.Document.Provenance.encode(message.provenance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Paragraph message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Paragraph.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.Page.Paragraph - * @static - * @param {google.cloud.documentai.v1.Document.Page.IParagraph} message Paragraph message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Paragraph.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Paragraph message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document.Page.Paragraph - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.Page.Paragraph} Paragraph - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Paragraph.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Page.Paragraph(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.decode(reader, reader.uint32()); - break; - } - case 2: { - if (!(message.detectedLanguages && message.detectedLanguages.length)) - message.detectedLanguages = []; - message.detectedLanguages.push($root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.decode(reader, reader.uint32())); - break; - } - case 3: { - message.provenance = $root.google.cloud.documentai.v1.Document.Provenance.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Paragraph message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document.Page.Paragraph - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.Page.Paragraph} Paragraph - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Paragraph.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Paragraph message. - * @function verify - * @memberof google.cloud.documentai.v1.Document.Page.Paragraph - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Paragraph.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.layout != null && message.hasOwnProperty("layout")) { - var error = $root.google.cloud.documentai.v1.Document.Page.Layout.verify(message.layout); - if (error) - return "layout." + error; - } - if (message.detectedLanguages != null && message.hasOwnProperty("detectedLanguages")) { - if (!Array.isArray(message.detectedLanguages)) - return "detectedLanguages: array expected"; - for (var i = 0; i < message.detectedLanguages.length; ++i) { - var error = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.verify(message.detectedLanguages[i]); - if (error) - return "detectedLanguages." + error; - } - } - if (message.provenance != null && message.hasOwnProperty("provenance")) { - var error = $root.google.cloud.documentai.v1.Document.Provenance.verify(message.provenance); - if (error) - return "provenance." + error; - } - return null; - }; - - /** - * Creates a Paragraph message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.Page.Paragraph - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.Page.Paragraph} Paragraph - */ - Paragraph.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.Page.Paragraph) - return object; - var message = new $root.google.cloud.documentai.v1.Document.Page.Paragraph(); - if (object.layout != null) { - if (typeof object.layout !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.Paragraph.layout: object expected"); - message.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.fromObject(object.layout); - } - if (object.detectedLanguages) { - if (!Array.isArray(object.detectedLanguages)) - throw TypeError(".google.cloud.documentai.v1.Document.Page.Paragraph.detectedLanguages: array expected"); - message.detectedLanguages = []; - for (var i = 0; i < object.detectedLanguages.length; ++i) { - if (typeof object.detectedLanguages[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.Paragraph.detectedLanguages: object expected"); - message.detectedLanguages[i] = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.fromObject(object.detectedLanguages[i]); - } - } - if (object.provenance != null) { - if (typeof object.provenance !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.Paragraph.provenance: object expected"); - message.provenance = $root.google.cloud.documentai.v1.Document.Provenance.fromObject(object.provenance); - } - return message; - }; - - /** - * Creates a plain object from a Paragraph message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.Page.Paragraph - * @static - * @param {google.cloud.documentai.v1.Document.Page.Paragraph} message Paragraph - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Paragraph.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.detectedLanguages = []; - if (options.defaults) { - object.layout = null; - object.provenance = null; - } - if (message.layout != null && message.hasOwnProperty("layout")) - object.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.toObject(message.layout, options); - if (message.detectedLanguages && message.detectedLanguages.length) { - object.detectedLanguages = []; - for (var j = 0; j < message.detectedLanguages.length; ++j) - object.detectedLanguages[j] = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.toObject(message.detectedLanguages[j], options); - } - if (message.provenance != null && message.hasOwnProperty("provenance")) - object.provenance = $root.google.cloud.documentai.v1.Document.Provenance.toObject(message.provenance, options); - return object; - }; - - /** - * Converts this Paragraph to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.Page.Paragraph - * @instance - * @returns {Object.} JSON object - */ - Paragraph.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Paragraph - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.Page.Paragraph - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Paragraph.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Page.Paragraph"; - }; - - return Paragraph; - })(); - - Page.Line = (function() { - - /** - * Properties of a Line. - * @memberof google.cloud.documentai.v1.Document.Page - * @interface ILine - * @property {google.cloud.documentai.v1.Document.Page.ILayout|null} [layout] Line layout - * @property {Array.|null} [detectedLanguages] Line detectedLanguages - * @property {google.cloud.documentai.v1.Document.IProvenance|null} [provenance] Line provenance - */ - - /** - * Constructs a new Line. - * @memberof google.cloud.documentai.v1.Document.Page - * @classdesc Represents a Line. - * @implements ILine - * @constructor - * @param {google.cloud.documentai.v1.Document.Page.ILine=} [properties] Properties to set - */ - function Line(properties) { - this.detectedLanguages = []; - 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]]; - } - - /** - * Line layout. - * @member {google.cloud.documentai.v1.Document.Page.ILayout|null|undefined} layout - * @memberof google.cloud.documentai.v1.Document.Page.Line - * @instance - */ - Line.prototype.layout = null; - - /** - * Line detectedLanguages. - * @member {Array.} detectedLanguages - * @memberof google.cloud.documentai.v1.Document.Page.Line - * @instance - */ - Line.prototype.detectedLanguages = $util.emptyArray; - - /** - * Line provenance. - * @member {google.cloud.documentai.v1.Document.IProvenance|null|undefined} provenance - * @memberof google.cloud.documentai.v1.Document.Page.Line - * @instance - */ - Line.prototype.provenance = null; - - /** - * Creates a new Line instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.Page.Line - * @static - * @param {google.cloud.documentai.v1.Document.Page.ILine=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.Page.Line} Line instance - */ - Line.create = function create(properties) { - return new Line(properties); - }; - - /** - * Encodes the specified Line message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Line.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.Page.Line - * @static - * @param {google.cloud.documentai.v1.Document.Page.ILine} message Line message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Line.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.layout != null && Object.hasOwnProperty.call(message, "layout")) - $root.google.cloud.documentai.v1.Document.Page.Layout.encode(message.layout, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.detectedLanguages != null && message.detectedLanguages.length) - for (var i = 0; i < message.detectedLanguages.length; ++i) - $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.encode(message.detectedLanguages[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.provenance != null && Object.hasOwnProperty.call(message, "provenance")) - $root.google.cloud.documentai.v1.Document.Provenance.encode(message.provenance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Line message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Line.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.Page.Line - * @static - * @param {google.cloud.documentai.v1.Document.Page.ILine} message Line message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Line.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Line message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document.Page.Line - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.Page.Line} Line - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Line.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Page.Line(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.decode(reader, reader.uint32()); - break; - } - case 2: { - if (!(message.detectedLanguages && message.detectedLanguages.length)) - message.detectedLanguages = []; - message.detectedLanguages.push($root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.decode(reader, reader.uint32())); - break; - } - case 3: { - message.provenance = $root.google.cloud.documentai.v1.Document.Provenance.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Line message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document.Page.Line - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.Page.Line} Line - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Line.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Line message. - * @function verify - * @memberof google.cloud.documentai.v1.Document.Page.Line - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Line.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.layout != null && message.hasOwnProperty("layout")) { - var error = $root.google.cloud.documentai.v1.Document.Page.Layout.verify(message.layout); - if (error) - return "layout." + error; - } - if (message.detectedLanguages != null && message.hasOwnProperty("detectedLanguages")) { - if (!Array.isArray(message.detectedLanguages)) - return "detectedLanguages: array expected"; - for (var i = 0; i < message.detectedLanguages.length; ++i) { - var error = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.verify(message.detectedLanguages[i]); - if (error) - return "detectedLanguages." + error; - } - } - if (message.provenance != null && message.hasOwnProperty("provenance")) { - var error = $root.google.cloud.documentai.v1.Document.Provenance.verify(message.provenance); - if (error) - return "provenance." + error; - } - return null; - }; - - /** - * Creates a Line message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.Page.Line - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.Page.Line} Line - */ - Line.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.Page.Line) - return object; - var message = new $root.google.cloud.documentai.v1.Document.Page.Line(); - if (object.layout != null) { - if (typeof object.layout !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.Line.layout: object expected"); - message.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.fromObject(object.layout); - } - if (object.detectedLanguages) { - if (!Array.isArray(object.detectedLanguages)) - throw TypeError(".google.cloud.documentai.v1.Document.Page.Line.detectedLanguages: array expected"); - message.detectedLanguages = []; - for (var i = 0; i < object.detectedLanguages.length; ++i) { - if (typeof object.detectedLanguages[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.Line.detectedLanguages: object expected"); - message.detectedLanguages[i] = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.fromObject(object.detectedLanguages[i]); - } - } - if (object.provenance != null) { - if (typeof object.provenance !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.Line.provenance: object expected"); - message.provenance = $root.google.cloud.documentai.v1.Document.Provenance.fromObject(object.provenance); - } - return message; - }; - - /** - * Creates a plain object from a Line message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.Page.Line - * @static - * @param {google.cloud.documentai.v1.Document.Page.Line} message Line - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Line.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.detectedLanguages = []; - if (options.defaults) { - object.layout = null; - object.provenance = null; - } - if (message.layout != null && message.hasOwnProperty("layout")) - object.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.toObject(message.layout, options); - if (message.detectedLanguages && message.detectedLanguages.length) { - object.detectedLanguages = []; - for (var j = 0; j < message.detectedLanguages.length; ++j) - object.detectedLanguages[j] = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.toObject(message.detectedLanguages[j], options); - } - if (message.provenance != null && message.hasOwnProperty("provenance")) - object.provenance = $root.google.cloud.documentai.v1.Document.Provenance.toObject(message.provenance, options); - return object; - }; - - /** - * Converts this Line to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.Page.Line - * @instance - * @returns {Object.} JSON object - */ - Line.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Line - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.Page.Line - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Line.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Page.Line"; - }; - - return Line; - })(); - - Page.Token = (function() { - - /** - * Properties of a Token. - * @memberof google.cloud.documentai.v1.Document.Page - * @interface IToken - * @property {google.cloud.documentai.v1.Document.Page.ILayout|null} [layout] Token layout - * @property {google.cloud.documentai.v1.Document.Page.Token.IDetectedBreak|null} [detectedBreak] Token detectedBreak - * @property {Array.|null} [detectedLanguages] Token detectedLanguages - * @property {google.cloud.documentai.v1.Document.IProvenance|null} [provenance] Token provenance - * @property {google.cloud.documentai.v1.Document.Page.Token.IStyleInfo|null} [styleInfo] Token styleInfo - */ - - /** - * Constructs a new Token. - * @memberof google.cloud.documentai.v1.Document.Page - * @classdesc Represents a Token. - * @implements IToken - * @constructor - * @param {google.cloud.documentai.v1.Document.Page.IToken=} [properties] Properties to set - */ - function Token(properties) { - this.detectedLanguages = []; - 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]]; - } - - /** - * Token layout. - * @member {google.cloud.documentai.v1.Document.Page.ILayout|null|undefined} layout - * @memberof google.cloud.documentai.v1.Document.Page.Token - * @instance - */ - Token.prototype.layout = null; - - /** - * Token detectedBreak. - * @member {google.cloud.documentai.v1.Document.Page.Token.IDetectedBreak|null|undefined} detectedBreak - * @memberof google.cloud.documentai.v1.Document.Page.Token - * @instance - */ - Token.prototype.detectedBreak = null; - - /** - * Token detectedLanguages. - * @member {Array.} detectedLanguages - * @memberof google.cloud.documentai.v1.Document.Page.Token - * @instance - */ - Token.prototype.detectedLanguages = $util.emptyArray; - - /** - * Token provenance. - * @member {google.cloud.documentai.v1.Document.IProvenance|null|undefined} provenance - * @memberof google.cloud.documentai.v1.Document.Page.Token - * @instance - */ - Token.prototype.provenance = null; - - /** - * Token styleInfo. - * @member {google.cloud.documentai.v1.Document.Page.Token.IStyleInfo|null|undefined} styleInfo - * @memberof google.cloud.documentai.v1.Document.Page.Token - * @instance - */ - Token.prototype.styleInfo = null; - - /** - * Creates a new Token instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.Page.Token - * @static - * @param {google.cloud.documentai.v1.Document.Page.IToken=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.Page.Token} Token instance - */ - Token.create = function create(properties) { - return new Token(properties); - }; - - /** - * Encodes the specified Token message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Token.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.Page.Token - * @static - * @param {google.cloud.documentai.v1.Document.Page.IToken} message Token message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Token.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.layout != null && Object.hasOwnProperty.call(message, "layout")) - $root.google.cloud.documentai.v1.Document.Page.Layout.encode(message.layout, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.detectedBreak != null && Object.hasOwnProperty.call(message, "detectedBreak")) - $root.google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.encode(message.detectedBreak, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.detectedLanguages != null && message.detectedLanguages.length) - for (var i = 0; i < message.detectedLanguages.length; ++i) - $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.encode(message.detectedLanguages[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.provenance != null && Object.hasOwnProperty.call(message, "provenance")) - $root.google.cloud.documentai.v1.Document.Provenance.encode(message.provenance, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.styleInfo != null && Object.hasOwnProperty.call(message, "styleInfo")) - $root.google.cloud.documentai.v1.Document.Page.Token.StyleInfo.encode(message.styleInfo, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Token message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Token.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.Page.Token - * @static - * @param {google.cloud.documentai.v1.Document.Page.IToken} message Token message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Token.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Token message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document.Page.Token - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.Page.Token} Token - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Token.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Page.Token(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.decode(reader, reader.uint32()); - break; - } - case 2: { - message.detectedBreak = $root.google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.decode(reader, reader.uint32()); - break; - } - case 3: { - if (!(message.detectedLanguages && message.detectedLanguages.length)) - message.detectedLanguages = []; - message.detectedLanguages.push($root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.decode(reader, reader.uint32())); - break; - } - case 4: { - message.provenance = $root.google.cloud.documentai.v1.Document.Provenance.decode(reader, reader.uint32()); - break; - } - case 5: { - message.styleInfo = $root.google.cloud.documentai.v1.Document.Page.Token.StyleInfo.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Token message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document.Page.Token - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.Page.Token} Token - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Token.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Token message. - * @function verify - * @memberof google.cloud.documentai.v1.Document.Page.Token - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Token.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.layout != null && message.hasOwnProperty("layout")) { - var error = $root.google.cloud.documentai.v1.Document.Page.Layout.verify(message.layout); - if (error) - return "layout." + error; - } - if (message.detectedBreak != null && message.hasOwnProperty("detectedBreak")) { - var error = $root.google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.verify(message.detectedBreak); - if (error) - return "detectedBreak." + error; - } - if (message.detectedLanguages != null && message.hasOwnProperty("detectedLanguages")) { - if (!Array.isArray(message.detectedLanguages)) - return "detectedLanguages: array expected"; - for (var i = 0; i < message.detectedLanguages.length; ++i) { - var error = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.verify(message.detectedLanguages[i]); - if (error) - return "detectedLanguages." + error; - } - } - if (message.provenance != null && message.hasOwnProperty("provenance")) { - var error = $root.google.cloud.documentai.v1.Document.Provenance.verify(message.provenance); - if (error) - return "provenance." + error; - } - if (message.styleInfo != null && message.hasOwnProperty("styleInfo")) { - var error = $root.google.cloud.documentai.v1.Document.Page.Token.StyleInfo.verify(message.styleInfo); - if (error) - return "styleInfo." + error; - } - return null; - }; - - /** - * Creates a Token message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.Page.Token - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.Page.Token} Token - */ - Token.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.Page.Token) - return object; - var message = new $root.google.cloud.documentai.v1.Document.Page.Token(); - if (object.layout != null) { - if (typeof object.layout !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.Token.layout: object expected"); - message.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.fromObject(object.layout); - } - if (object.detectedBreak != null) { - if (typeof object.detectedBreak !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.Token.detectedBreak: object expected"); - message.detectedBreak = $root.google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.fromObject(object.detectedBreak); - } - if (object.detectedLanguages) { - if (!Array.isArray(object.detectedLanguages)) - throw TypeError(".google.cloud.documentai.v1.Document.Page.Token.detectedLanguages: array expected"); - message.detectedLanguages = []; - for (var i = 0; i < object.detectedLanguages.length; ++i) { - if (typeof object.detectedLanguages[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.Token.detectedLanguages: object expected"); - message.detectedLanguages[i] = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.fromObject(object.detectedLanguages[i]); - } - } - if (object.provenance != null) { - if (typeof object.provenance !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.Token.provenance: object expected"); - message.provenance = $root.google.cloud.documentai.v1.Document.Provenance.fromObject(object.provenance); - } - if (object.styleInfo != null) { - if (typeof object.styleInfo !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.Token.styleInfo: object expected"); - message.styleInfo = $root.google.cloud.documentai.v1.Document.Page.Token.StyleInfo.fromObject(object.styleInfo); - } - return message; - }; - - /** - * Creates a plain object from a Token message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.Page.Token - * @static - * @param {google.cloud.documentai.v1.Document.Page.Token} message Token - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Token.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.detectedLanguages = []; - if (options.defaults) { - object.layout = null; - object.detectedBreak = null; - object.provenance = null; - object.styleInfo = null; - } - if (message.layout != null && message.hasOwnProperty("layout")) - object.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.toObject(message.layout, options); - if (message.detectedBreak != null && message.hasOwnProperty("detectedBreak")) - object.detectedBreak = $root.google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.toObject(message.detectedBreak, options); - if (message.detectedLanguages && message.detectedLanguages.length) { - object.detectedLanguages = []; - for (var j = 0; j < message.detectedLanguages.length; ++j) - object.detectedLanguages[j] = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.toObject(message.detectedLanguages[j], options); - } - if (message.provenance != null && message.hasOwnProperty("provenance")) - object.provenance = $root.google.cloud.documentai.v1.Document.Provenance.toObject(message.provenance, options); - if (message.styleInfo != null && message.hasOwnProperty("styleInfo")) - object.styleInfo = $root.google.cloud.documentai.v1.Document.Page.Token.StyleInfo.toObject(message.styleInfo, options); - return object; - }; - - /** - * Converts this Token to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.Page.Token - * @instance - * @returns {Object.} JSON object - */ - Token.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Token - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.Page.Token - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Token.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Page.Token"; - }; - - Token.DetectedBreak = (function() { - - /** - * Properties of a DetectedBreak. - * @memberof google.cloud.documentai.v1.Document.Page.Token - * @interface IDetectedBreak - * @property {google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.Type|null} [type] DetectedBreak type - */ - - /** - * Constructs a new DetectedBreak. - * @memberof google.cloud.documentai.v1.Document.Page.Token - * @classdesc Represents a DetectedBreak. - * @implements IDetectedBreak - * @constructor - * @param {google.cloud.documentai.v1.Document.Page.Token.IDetectedBreak=} [properties] Properties to set - */ - function DetectedBreak(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]]; - } - - /** - * DetectedBreak type. - * @member {google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.Type} type - * @memberof google.cloud.documentai.v1.Document.Page.Token.DetectedBreak - * @instance - */ - DetectedBreak.prototype.type = 0; - - /** - * Creates a new DetectedBreak instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.Page.Token.DetectedBreak - * @static - * @param {google.cloud.documentai.v1.Document.Page.Token.IDetectedBreak=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.Page.Token.DetectedBreak} DetectedBreak instance - */ - DetectedBreak.create = function create(properties) { - return new DetectedBreak(properties); - }; - - /** - * Encodes the specified DetectedBreak message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.Page.Token.DetectedBreak - * @static - * @param {google.cloud.documentai.v1.Document.Page.Token.IDetectedBreak} message DetectedBreak message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DetectedBreak.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); - return writer; - }; - - /** - * Encodes the specified DetectedBreak message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.Page.Token.DetectedBreak - * @static - * @param {google.cloud.documentai.v1.Document.Page.Token.IDetectedBreak} message DetectedBreak message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DetectedBreak.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DetectedBreak message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document.Page.Token.DetectedBreak - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.Page.Token.DetectedBreak} DetectedBreak - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DetectedBreak.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Page.Token.DetectedBreak(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.type = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DetectedBreak message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document.Page.Token.DetectedBreak - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.Page.Token.DetectedBreak} DetectedBreak - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DetectedBreak.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DetectedBreak message. - * @function verify - * @memberof google.cloud.documentai.v1.Document.Page.Token.DetectedBreak - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DetectedBreak.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 1: - case 2: - case 3: - break; - } - return null; - }; - - /** - * Creates a DetectedBreak message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.Page.Token.DetectedBreak - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.Page.Token.DetectedBreak} DetectedBreak - */ - DetectedBreak.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.Page.Token.DetectedBreak) - return object; - var message = new $root.google.cloud.documentai.v1.Document.Page.Token.DetectedBreak(); - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "SPACE": - case 1: - message.type = 1; - break; - case "WIDE_SPACE": - case 2: - message.type = 2; - break; - case "HYPHEN": - case 3: - message.type = 3; - break; - } - return message; - }; - - /** - * Creates a plain object from a DetectedBreak message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.Page.Token.DetectedBreak - * @static - * @param {google.cloud.documentai.v1.Document.Page.Token.DetectedBreak} message DetectedBreak - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DetectedBreak.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.Type[message.type] === undefined ? message.type : $root.google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.Type[message.type] : message.type; - return object; - }; - - /** - * Converts this DetectedBreak to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.Page.Token.DetectedBreak - * @instance - * @returns {Object.} JSON object - */ - DetectedBreak.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DetectedBreak - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.Page.Token.DetectedBreak - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DetectedBreak.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Page.Token.DetectedBreak"; - }; - - /** - * Type enum. - * @name google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.Type - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} SPACE=1 SPACE value - * @property {number} WIDE_SPACE=2 WIDE_SPACE value - * @property {number} HYPHEN=3 HYPHEN value - */ - DetectedBreak.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "SPACE"] = 1; - values[valuesById[2] = "WIDE_SPACE"] = 2; - values[valuesById[3] = "HYPHEN"] = 3; - return values; - })(); - - return DetectedBreak; - })(); - - Token.StyleInfo = (function() { - - /** - * Properties of a StyleInfo. - * @memberof google.cloud.documentai.v1.Document.Page.Token - * @interface IStyleInfo - * @property {number|null} [fontSize] StyleInfo fontSize - * @property {number|null} [pixelFontSize] StyleInfo pixelFontSize - * @property {number|null} [letterSpacing] StyleInfo letterSpacing - * @property {string|null} [fontType] StyleInfo fontType - * @property {boolean|null} [bold] StyleInfo bold - * @property {boolean|null} [italic] StyleInfo italic - * @property {boolean|null} [underlined] StyleInfo underlined - * @property {boolean|null} [strikeout] StyleInfo strikeout - * @property {boolean|null} [subscript] StyleInfo subscript - * @property {boolean|null} [superscript] StyleInfo superscript - * @property {boolean|null} [smallcaps] StyleInfo smallcaps - * @property {number|null} [fontWeight] StyleInfo fontWeight - * @property {boolean|null} [handwritten] StyleInfo handwritten - * @property {google.type.IColor|null} [textColor] StyleInfo textColor - * @property {google.type.IColor|null} [backgroundColor] StyleInfo backgroundColor - */ - - /** - * Constructs a new StyleInfo. - * @memberof google.cloud.documentai.v1.Document.Page.Token - * @classdesc Represents a StyleInfo. - * @implements IStyleInfo - * @constructor - * @param {google.cloud.documentai.v1.Document.Page.Token.IStyleInfo=} [properties] Properties to set - */ - function StyleInfo(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]]; - } - - /** - * StyleInfo fontSize. - * @member {number} fontSize - * @memberof google.cloud.documentai.v1.Document.Page.Token.StyleInfo - * @instance - */ - StyleInfo.prototype.fontSize = 0; - - /** - * StyleInfo pixelFontSize. - * @member {number} pixelFontSize - * @memberof google.cloud.documentai.v1.Document.Page.Token.StyleInfo - * @instance - */ - StyleInfo.prototype.pixelFontSize = 0; - - /** - * StyleInfo letterSpacing. - * @member {number} letterSpacing - * @memberof google.cloud.documentai.v1.Document.Page.Token.StyleInfo - * @instance - */ - StyleInfo.prototype.letterSpacing = 0; - - /** - * StyleInfo fontType. - * @member {string} fontType - * @memberof google.cloud.documentai.v1.Document.Page.Token.StyleInfo - * @instance - */ - StyleInfo.prototype.fontType = ""; - - /** - * StyleInfo bold. - * @member {boolean} bold - * @memberof google.cloud.documentai.v1.Document.Page.Token.StyleInfo - * @instance - */ - StyleInfo.prototype.bold = false; - - /** - * StyleInfo italic. - * @member {boolean} italic - * @memberof google.cloud.documentai.v1.Document.Page.Token.StyleInfo - * @instance - */ - StyleInfo.prototype.italic = false; - - /** - * StyleInfo underlined. - * @member {boolean} underlined - * @memberof google.cloud.documentai.v1.Document.Page.Token.StyleInfo - * @instance - */ - StyleInfo.prototype.underlined = false; - - /** - * StyleInfo strikeout. - * @member {boolean} strikeout - * @memberof google.cloud.documentai.v1.Document.Page.Token.StyleInfo - * @instance - */ - StyleInfo.prototype.strikeout = false; - - /** - * StyleInfo subscript. - * @member {boolean} subscript - * @memberof google.cloud.documentai.v1.Document.Page.Token.StyleInfo - * @instance - */ - StyleInfo.prototype.subscript = false; - - /** - * StyleInfo superscript. - * @member {boolean} superscript - * @memberof google.cloud.documentai.v1.Document.Page.Token.StyleInfo - * @instance - */ - StyleInfo.prototype.superscript = false; - - /** - * StyleInfo smallcaps. - * @member {boolean} smallcaps - * @memberof google.cloud.documentai.v1.Document.Page.Token.StyleInfo - * @instance - */ - StyleInfo.prototype.smallcaps = false; - - /** - * StyleInfo fontWeight. - * @member {number} fontWeight - * @memberof google.cloud.documentai.v1.Document.Page.Token.StyleInfo - * @instance - */ - StyleInfo.prototype.fontWeight = 0; - - /** - * StyleInfo handwritten. - * @member {boolean} handwritten - * @memberof google.cloud.documentai.v1.Document.Page.Token.StyleInfo - * @instance - */ - StyleInfo.prototype.handwritten = false; - - /** - * StyleInfo textColor. - * @member {google.type.IColor|null|undefined} textColor - * @memberof google.cloud.documentai.v1.Document.Page.Token.StyleInfo - * @instance - */ - StyleInfo.prototype.textColor = null; - - /** - * StyleInfo backgroundColor. - * @member {google.type.IColor|null|undefined} backgroundColor - * @memberof google.cloud.documentai.v1.Document.Page.Token.StyleInfo - * @instance - */ - StyleInfo.prototype.backgroundColor = null; - - /** - * Creates a new StyleInfo instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.Page.Token.StyleInfo - * @static - * @param {google.cloud.documentai.v1.Document.Page.Token.IStyleInfo=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.Page.Token.StyleInfo} StyleInfo instance - */ - StyleInfo.create = function create(properties) { - return new StyleInfo(properties); - }; - - /** - * Encodes the specified StyleInfo message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Token.StyleInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.Page.Token.StyleInfo - * @static - * @param {google.cloud.documentai.v1.Document.Page.Token.IStyleInfo} message StyleInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StyleInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fontSize != null && Object.hasOwnProperty.call(message, "fontSize")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fontSize); - if (message.pixelFontSize != null && Object.hasOwnProperty.call(message, "pixelFontSize")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.pixelFontSize); - if (message.letterSpacing != null && Object.hasOwnProperty.call(message, "letterSpacing")) - writer.uint32(/* id 3, wireType 1 =*/25).double(message.letterSpacing); - if (message.fontType != null && Object.hasOwnProperty.call(message, "fontType")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.fontType); - if (message.bold != null && Object.hasOwnProperty.call(message, "bold")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.bold); - if (message.italic != null && Object.hasOwnProperty.call(message, "italic")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.italic); - if (message.underlined != null && Object.hasOwnProperty.call(message, "underlined")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.underlined); - if (message.strikeout != null && Object.hasOwnProperty.call(message, "strikeout")) - writer.uint32(/* id 8, wireType 0 =*/64).bool(message.strikeout); - if (message.subscript != null && Object.hasOwnProperty.call(message, "subscript")) - writer.uint32(/* id 9, wireType 0 =*/72).bool(message.subscript); - if (message.superscript != null && Object.hasOwnProperty.call(message, "superscript")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.superscript); - if (message.smallcaps != null && Object.hasOwnProperty.call(message, "smallcaps")) - writer.uint32(/* id 11, wireType 0 =*/88).bool(message.smallcaps); - if (message.fontWeight != null && Object.hasOwnProperty.call(message, "fontWeight")) - writer.uint32(/* id 12, wireType 0 =*/96).int32(message.fontWeight); - if (message.handwritten != null && Object.hasOwnProperty.call(message, "handwritten")) - writer.uint32(/* id 13, wireType 0 =*/104).bool(message.handwritten); - if (message.textColor != null && Object.hasOwnProperty.call(message, "textColor")) - $root.google.type.Color.encode(message.textColor, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.backgroundColor != null && Object.hasOwnProperty.call(message, "backgroundColor")) - $root.google.type.Color.encode(message.backgroundColor, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified StyleInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Token.StyleInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.Page.Token.StyleInfo - * @static - * @param {google.cloud.documentai.v1.Document.Page.Token.IStyleInfo} message StyleInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StyleInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StyleInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document.Page.Token.StyleInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.Page.Token.StyleInfo} StyleInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StyleInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Page.Token.StyleInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.fontSize = reader.int32(); - break; - } - case 2: { - message.pixelFontSize = reader.double(); - break; - } - case 3: { - message.letterSpacing = reader.double(); - break; - } - case 4: { - message.fontType = reader.string(); - break; - } - case 5: { - message.bold = reader.bool(); - break; - } - case 6: { - message.italic = reader.bool(); - break; - } - case 7: { - message.underlined = reader.bool(); - break; - } - case 8: { - message.strikeout = reader.bool(); - break; - } - case 9: { - message.subscript = reader.bool(); - break; - } - case 10: { - message.superscript = reader.bool(); - break; - } - case 11: { - message.smallcaps = reader.bool(); - break; - } - case 12: { - message.fontWeight = reader.int32(); - break; - } - case 13: { - message.handwritten = reader.bool(); - break; - } - case 14: { - message.textColor = $root.google.type.Color.decode(reader, reader.uint32()); - break; - } - case 15: { - message.backgroundColor = $root.google.type.Color.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StyleInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document.Page.Token.StyleInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.Page.Token.StyleInfo} StyleInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StyleInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StyleInfo message. - * @function verify - * @memberof google.cloud.documentai.v1.Document.Page.Token.StyleInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StyleInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fontSize != null && message.hasOwnProperty("fontSize")) - if (!$util.isInteger(message.fontSize)) - return "fontSize: integer expected"; - if (message.pixelFontSize != null && message.hasOwnProperty("pixelFontSize")) - if (typeof message.pixelFontSize !== "number") - return "pixelFontSize: number expected"; - if (message.letterSpacing != null && message.hasOwnProperty("letterSpacing")) - if (typeof message.letterSpacing !== "number") - return "letterSpacing: number expected"; - if (message.fontType != null && message.hasOwnProperty("fontType")) - if (!$util.isString(message.fontType)) - return "fontType: string expected"; - if (message.bold != null && message.hasOwnProperty("bold")) - if (typeof message.bold !== "boolean") - return "bold: boolean expected"; - if (message.italic != null && message.hasOwnProperty("italic")) - if (typeof message.italic !== "boolean") - return "italic: boolean expected"; - if (message.underlined != null && message.hasOwnProperty("underlined")) - if (typeof message.underlined !== "boolean") - return "underlined: boolean expected"; - if (message.strikeout != null && message.hasOwnProperty("strikeout")) - if (typeof message.strikeout !== "boolean") - return "strikeout: boolean expected"; - if (message.subscript != null && message.hasOwnProperty("subscript")) - if (typeof message.subscript !== "boolean") - return "subscript: boolean expected"; - if (message.superscript != null && message.hasOwnProperty("superscript")) - if (typeof message.superscript !== "boolean") - return "superscript: boolean expected"; - if (message.smallcaps != null && message.hasOwnProperty("smallcaps")) - if (typeof message.smallcaps !== "boolean") - return "smallcaps: boolean expected"; - if (message.fontWeight != null && message.hasOwnProperty("fontWeight")) - if (!$util.isInteger(message.fontWeight)) - return "fontWeight: integer expected"; - if (message.handwritten != null && message.hasOwnProperty("handwritten")) - if (typeof message.handwritten !== "boolean") - return "handwritten: boolean expected"; - if (message.textColor != null && message.hasOwnProperty("textColor")) { - var error = $root.google.type.Color.verify(message.textColor); - if (error) - return "textColor." + error; - } - if (message.backgroundColor != null && message.hasOwnProperty("backgroundColor")) { - var error = $root.google.type.Color.verify(message.backgroundColor); - if (error) - return "backgroundColor." + error; - } - return null; - }; - - /** - * Creates a StyleInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.Page.Token.StyleInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.Page.Token.StyleInfo} StyleInfo - */ - StyleInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.Page.Token.StyleInfo) - return object; - var message = new $root.google.cloud.documentai.v1.Document.Page.Token.StyleInfo(); - if (object.fontSize != null) - message.fontSize = object.fontSize | 0; - if (object.pixelFontSize != null) - message.pixelFontSize = Number(object.pixelFontSize); - if (object.letterSpacing != null) - message.letterSpacing = Number(object.letterSpacing); - if (object.fontType != null) - message.fontType = String(object.fontType); - if (object.bold != null) - message.bold = Boolean(object.bold); - if (object.italic != null) - message.italic = Boolean(object.italic); - if (object.underlined != null) - message.underlined = Boolean(object.underlined); - if (object.strikeout != null) - message.strikeout = Boolean(object.strikeout); - if (object.subscript != null) - message.subscript = Boolean(object.subscript); - if (object.superscript != null) - message.superscript = Boolean(object.superscript); - if (object.smallcaps != null) - message.smallcaps = Boolean(object.smallcaps); - if (object.fontWeight != null) - message.fontWeight = object.fontWeight | 0; - if (object.handwritten != null) - message.handwritten = Boolean(object.handwritten); - if (object.textColor != null) { - if (typeof object.textColor !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.Token.StyleInfo.textColor: object expected"); - message.textColor = $root.google.type.Color.fromObject(object.textColor); - } - if (object.backgroundColor != null) { - if (typeof object.backgroundColor !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.Token.StyleInfo.backgroundColor: object expected"); - message.backgroundColor = $root.google.type.Color.fromObject(object.backgroundColor); - } - return message; - }; - - /** - * Creates a plain object from a StyleInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.Page.Token.StyleInfo - * @static - * @param {google.cloud.documentai.v1.Document.Page.Token.StyleInfo} message StyleInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StyleInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.fontSize = 0; - object.pixelFontSize = 0; - object.letterSpacing = 0; - object.fontType = ""; - object.bold = false; - object.italic = false; - object.underlined = false; - object.strikeout = false; - object.subscript = false; - object.superscript = false; - object.smallcaps = false; - object.fontWeight = 0; - object.handwritten = false; - object.textColor = null; - object.backgroundColor = null; - } - if (message.fontSize != null && message.hasOwnProperty("fontSize")) - object.fontSize = message.fontSize; - if (message.pixelFontSize != null && message.hasOwnProperty("pixelFontSize")) - object.pixelFontSize = options.json && !isFinite(message.pixelFontSize) ? String(message.pixelFontSize) : message.pixelFontSize; - if (message.letterSpacing != null && message.hasOwnProperty("letterSpacing")) - object.letterSpacing = options.json && !isFinite(message.letterSpacing) ? String(message.letterSpacing) : message.letterSpacing; - if (message.fontType != null && message.hasOwnProperty("fontType")) - object.fontType = message.fontType; - if (message.bold != null && message.hasOwnProperty("bold")) - object.bold = message.bold; - if (message.italic != null && message.hasOwnProperty("italic")) - object.italic = message.italic; - if (message.underlined != null && message.hasOwnProperty("underlined")) - object.underlined = message.underlined; - if (message.strikeout != null && message.hasOwnProperty("strikeout")) - object.strikeout = message.strikeout; - if (message.subscript != null && message.hasOwnProperty("subscript")) - object.subscript = message.subscript; - if (message.superscript != null && message.hasOwnProperty("superscript")) - object.superscript = message.superscript; - if (message.smallcaps != null && message.hasOwnProperty("smallcaps")) - object.smallcaps = message.smallcaps; - if (message.fontWeight != null && message.hasOwnProperty("fontWeight")) - object.fontWeight = message.fontWeight; - if (message.handwritten != null && message.hasOwnProperty("handwritten")) - object.handwritten = message.handwritten; - if (message.textColor != null && message.hasOwnProperty("textColor")) - object.textColor = $root.google.type.Color.toObject(message.textColor, options); - if (message.backgroundColor != null && message.hasOwnProperty("backgroundColor")) - object.backgroundColor = $root.google.type.Color.toObject(message.backgroundColor, options); - return object; - }; - - /** - * Converts this StyleInfo to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.Page.Token.StyleInfo - * @instance - * @returns {Object.} JSON object - */ - StyleInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StyleInfo - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.Page.Token.StyleInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StyleInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Page.Token.StyleInfo"; - }; - - return StyleInfo; - })(); - - return Token; - })(); - - Page.Symbol = (function() { - - /** - * Properties of a Symbol. - * @memberof google.cloud.documentai.v1.Document.Page - * @interface ISymbol - * @property {google.cloud.documentai.v1.Document.Page.ILayout|null} [layout] Symbol layout - * @property {Array.|null} [detectedLanguages] Symbol detectedLanguages - */ - - /** - * Constructs a new Symbol. - * @memberof google.cloud.documentai.v1.Document.Page - * @classdesc Represents a Symbol. - * @implements ISymbol - * @constructor - * @param {google.cloud.documentai.v1.Document.Page.ISymbol=} [properties] Properties to set - */ - function Symbol(properties) { - this.detectedLanguages = []; - 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]]; - } - - /** - * Symbol layout. - * @member {google.cloud.documentai.v1.Document.Page.ILayout|null|undefined} layout - * @memberof google.cloud.documentai.v1.Document.Page.Symbol - * @instance - */ - Symbol.prototype.layout = null; - - /** - * Symbol detectedLanguages. - * @member {Array.} detectedLanguages - * @memberof google.cloud.documentai.v1.Document.Page.Symbol - * @instance - */ - Symbol.prototype.detectedLanguages = $util.emptyArray; - - /** - * Creates a new Symbol instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.Page.Symbol - * @static - * @param {google.cloud.documentai.v1.Document.Page.ISymbol=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.Page.Symbol} Symbol instance - */ - Symbol.create = function create(properties) { - return new Symbol(properties); - }; - - /** - * Encodes the specified Symbol message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Symbol.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.Page.Symbol - * @static - * @param {google.cloud.documentai.v1.Document.Page.ISymbol} message Symbol message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Symbol.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.layout != null && Object.hasOwnProperty.call(message, "layout")) - $root.google.cloud.documentai.v1.Document.Page.Layout.encode(message.layout, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.detectedLanguages != null && message.detectedLanguages.length) - for (var i = 0; i < message.detectedLanguages.length; ++i) - $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.encode(message.detectedLanguages[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Symbol message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Symbol.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.Page.Symbol - * @static - * @param {google.cloud.documentai.v1.Document.Page.ISymbol} message Symbol message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Symbol.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Symbol message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document.Page.Symbol - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.Page.Symbol} Symbol - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Symbol.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Page.Symbol(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.decode(reader, reader.uint32()); - break; - } - case 2: { - if (!(message.detectedLanguages && message.detectedLanguages.length)) - message.detectedLanguages = []; - message.detectedLanguages.push($root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Symbol message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document.Page.Symbol - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.Page.Symbol} Symbol - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Symbol.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Symbol message. - * @function verify - * @memberof google.cloud.documentai.v1.Document.Page.Symbol - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Symbol.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.layout != null && message.hasOwnProperty("layout")) { - var error = $root.google.cloud.documentai.v1.Document.Page.Layout.verify(message.layout); - if (error) - return "layout." + error; - } - if (message.detectedLanguages != null && message.hasOwnProperty("detectedLanguages")) { - if (!Array.isArray(message.detectedLanguages)) - return "detectedLanguages: array expected"; - for (var i = 0; i < message.detectedLanguages.length; ++i) { - var error = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.verify(message.detectedLanguages[i]); - if (error) - return "detectedLanguages." + error; - } - } - return null; - }; - - /** - * Creates a Symbol message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.Page.Symbol - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.Page.Symbol} Symbol - */ - Symbol.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.Page.Symbol) - return object; - var message = new $root.google.cloud.documentai.v1.Document.Page.Symbol(); - if (object.layout != null) { - if (typeof object.layout !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.Symbol.layout: object expected"); - message.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.fromObject(object.layout); - } - if (object.detectedLanguages) { - if (!Array.isArray(object.detectedLanguages)) - throw TypeError(".google.cloud.documentai.v1.Document.Page.Symbol.detectedLanguages: array expected"); - message.detectedLanguages = []; - for (var i = 0; i < object.detectedLanguages.length; ++i) { - if (typeof object.detectedLanguages[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.Symbol.detectedLanguages: object expected"); - message.detectedLanguages[i] = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.fromObject(object.detectedLanguages[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Symbol message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.Page.Symbol - * @static - * @param {google.cloud.documentai.v1.Document.Page.Symbol} message Symbol - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Symbol.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.detectedLanguages = []; - if (options.defaults) - object.layout = null; - if (message.layout != null && message.hasOwnProperty("layout")) - object.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.toObject(message.layout, options); - if (message.detectedLanguages && message.detectedLanguages.length) { - object.detectedLanguages = []; - for (var j = 0; j < message.detectedLanguages.length; ++j) - object.detectedLanguages[j] = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.toObject(message.detectedLanguages[j], options); - } - return object; - }; - - /** - * Converts this Symbol to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.Page.Symbol - * @instance - * @returns {Object.} JSON object - */ - Symbol.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Symbol - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.Page.Symbol - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Symbol.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Page.Symbol"; - }; - - return Symbol; - })(); - - Page.VisualElement = (function() { - - /** - * Properties of a VisualElement. - * @memberof google.cloud.documentai.v1.Document.Page - * @interface IVisualElement - * @property {google.cloud.documentai.v1.Document.Page.ILayout|null} [layout] VisualElement layout - * @property {string|null} [type] VisualElement type - * @property {Array.|null} [detectedLanguages] VisualElement detectedLanguages - */ - - /** - * Constructs a new VisualElement. - * @memberof google.cloud.documentai.v1.Document.Page - * @classdesc Represents a VisualElement. - * @implements IVisualElement - * @constructor - * @param {google.cloud.documentai.v1.Document.Page.IVisualElement=} [properties] Properties to set - */ - function VisualElement(properties) { - this.detectedLanguages = []; - 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]]; - } - - /** - * VisualElement layout. - * @member {google.cloud.documentai.v1.Document.Page.ILayout|null|undefined} layout - * @memberof google.cloud.documentai.v1.Document.Page.VisualElement - * @instance - */ - VisualElement.prototype.layout = null; - - /** - * VisualElement type. - * @member {string} type - * @memberof google.cloud.documentai.v1.Document.Page.VisualElement - * @instance - */ - VisualElement.prototype.type = ""; - - /** - * VisualElement detectedLanguages. - * @member {Array.} detectedLanguages - * @memberof google.cloud.documentai.v1.Document.Page.VisualElement - * @instance - */ - VisualElement.prototype.detectedLanguages = $util.emptyArray; - - /** - * Creates a new VisualElement instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.Page.VisualElement - * @static - * @param {google.cloud.documentai.v1.Document.Page.IVisualElement=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.Page.VisualElement} VisualElement instance - */ - VisualElement.create = function create(properties) { - return new VisualElement(properties); - }; - - /** - * Encodes the specified VisualElement message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.VisualElement.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.Page.VisualElement - * @static - * @param {google.cloud.documentai.v1.Document.Page.IVisualElement} message VisualElement message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VisualElement.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.layout != null && Object.hasOwnProperty.call(message, "layout")) - $root.google.cloud.documentai.v1.Document.Page.Layout.encode(message.layout, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); - if (message.detectedLanguages != null && message.detectedLanguages.length) - for (var i = 0; i < message.detectedLanguages.length; ++i) - $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.encode(message.detectedLanguages[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified VisualElement message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.VisualElement.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.Page.VisualElement - * @static - * @param {google.cloud.documentai.v1.Document.Page.IVisualElement} message VisualElement message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VisualElement.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a VisualElement message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document.Page.VisualElement - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.Page.VisualElement} VisualElement - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VisualElement.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Page.VisualElement(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.decode(reader, reader.uint32()); - break; - } - case 2: { - message.type = reader.string(); - break; - } - case 3: { - if (!(message.detectedLanguages && message.detectedLanguages.length)) - message.detectedLanguages = []; - message.detectedLanguages.push($root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a VisualElement message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document.Page.VisualElement - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.Page.VisualElement} VisualElement - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VisualElement.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a VisualElement message. - * @function verify - * @memberof google.cloud.documentai.v1.Document.Page.VisualElement - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - VisualElement.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.layout != null && message.hasOwnProperty("layout")) { - var error = $root.google.cloud.documentai.v1.Document.Page.Layout.verify(message.layout); - if (error) - return "layout." + error; - } - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.detectedLanguages != null && message.hasOwnProperty("detectedLanguages")) { - if (!Array.isArray(message.detectedLanguages)) - return "detectedLanguages: array expected"; - for (var i = 0; i < message.detectedLanguages.length; ++i) { - var error = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.verify(message.detectedLanguages[i]); - if (error) - return "detectedLanguages." + error; - } - } - return null; - }; - - /** - * Creates a VisualElement message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.Page.VisualElement - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.Page.VisualElement} VisualElement - */ - VisualElement.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.Page.VisualElement) - return object; - var message = new $root.google.cloud.documentai.v1.Document.Page.VisualElement(); - if (object.layout != null) { - if (typeof object.layout !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.VisualElement.layout: object expected"); - message.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.fromObject(object.layout); - } - if (object.type != null) - message.type = String(object.type); - if (object.detectedLanguages) { - if (!Array.isArray(object.detectedLanguages)) - throw TypeError(".google.cloud.documentai.v1.Document.Page.VisualElement.detectedLanguages: array expected"); - message.detectedLanguages = []; - for (var i = 0; i < object.detectedLanguages.length; ++i) { - if (typeof object.detectedLanguages[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.VisualElement.detectedLanguages: object expected"); - message.detectedLanguages[i] = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.fromObject(object.detectedLanguages[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a VisualElement message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.Page.VisualElement - * @static - * @param {google.cloud.documentai.v1.Document.Page.VisualElement} message VisualElement - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - VisualElement.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.detectedLanguages = []; - if (options.defaults) { - object.layout = null; - object.type = ""; - } - if (message.layout != null && message.hasOwnProperty("layout")) - object.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.toObject(message.layout, options); - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.detectedLanguages && message.detectedLanguages.length) { - object.detectedLanguages = []; - for (var j = 0; j < message.detectedLanguages.length; ++j) - object.detectedLanguages[j] = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.toObject(message.detectedLanguages[j], options); - } - return object; - }; - - /** - * Converts this VisualElement to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.Page.VisualElement - * @instance - * @returns {Object.} JSON object - */ - VisualElement.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for VisualElement - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.Page.VisualElement - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - VisualElement.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Page.VisualElement"; - }; - - return VisualElement; - })(); - - Page.Table = (function() { - - /** - * Properties of a Table. - * @memberof google.cloud.documentai.v1.Document.Page - * @interface ITable - * @property {google.cloud.documentai.v1.Document.Page.ILayout|null} [layout] Table layout - * @property {Array.|null} [headerRows] Table headerRows - * @property {Array.|null} [bodyRows] Table bodyRows - * @property {Array.|null} [detectedLanguages] Table detectedLanguages - * @property {google.cloud.documentai.v1.Document.IProvenance|null} [provenance] Table provenance - */ - - /** - * Constructs a new Table. - * @memberof google.cloud.documentai.v1.Document.Page - * @classdesc Represents a Table. - * @implements ITable - * @constructor - * @param {google.cloud.documentai.v1.Document.Page.ITable=} [properties] Properties to set - */ - function Table(properties) { - this.headerRows = []; - this.bodyRows = []; - this.detectedLanguages = []; - 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 layout. - * @member {google.cloud.documentai.v1.Document.Page.ILayout|null|undefined} layout - * @memberof google.cloud.documentai.v1.Document.Page.Table - * @instance - */ - Table.prototype.layout = null; - - /** - * Table headerRows. - * @member {Array.} headerRows - * @memberof google.cloud.documentai.v1.Document.Page.Table - * @instance - */ - Table.prototype.headerRows = $util.emptyArray; - - /** - * Table bodyRows. - * @member {Array.} bodyRows - * @memberof google.cloud.documentai.v1.Document.Page.Table - * @instance - */ - Table.prototype.bodyRows = $util.emptyArray; - - /** - * Table detectedLanguages. - * @member {Array.} detectedLanguages - * @memberof google.cloud.documentai.v1.Document.Page.Table - * @instance - */ - Table.prototype.detectedLanguages = $util.emptyArray; - - /** - * Table provenance. - * @member {google.cloud.documentai.v1.Document.IProvenance|null|undefined} provenance - * @memberof google.cloud.documentai.v1.Document.Page.Table - * @instance - */ - Table.prototype.provenance = null; - - /** - * Creates a new Table instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.Page.Table - * @static - * @param {google.cloud.documentai.v1.Document.Page.ITable=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.Page.Table} Table instance - */ - Table.create = function create(properties) { - return new Table(properties); - }; - - /** - * Encodes the specified Table message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Table.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.Page.Table - * @static - * @param {google.cloud.documentai.v1.Document.Page.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.layout != null && Object.hasOwnProperty.call(message, "layout")) - $root.google.cloud.documentai.v1.Document.Page.Layout.encode(message.layout, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.headerRows != null && message.headerRows.length) - for (var i = 0; i < message.headerRows.length; ++i) - $root.google.cloud.documentai.v1.Document.Page.Table.TableRow.encode(message.headerRows[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.bodyRows != null && message.bodyRows.length) - for (var i = 0; i < message.bodyRows.length; ++i) - $root.google.cloud.documentai.v1.Document.Page.Table.TableRow.encode(message.bodyRows[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.detectedLanguages != null && message.detectedLanguages.length) - for (var i = 0; i < message.detectedLanguages.length; ++i) - $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.encode(message.detectedLanguages[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.provenance != null && Object.hasOwnProperty.call(message, "provenance")) - $root.google.cloud.documentai.v1.Document.Provenance.encode(message.provenance, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Table message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Table.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.Page.Table - * @static - * @param {google.cloud.documentai.v1.Document.Page.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.cloud.documentai.v1.Document.Page.Table - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.Page.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Page.Table(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.decode(reader, reader.uint32()); - break; - } - case 2: { - if (!(message.headerRows && message.headerRows.length)) - message.headerRows = []; - message.headerRows.push($root.google.cloud.documentai.v1.Document.Page.Table.TableRow.decode(reader, reader.uint32())); - break; - } - case 3: { - if (!(message.bodyRows && message.bodyRows.length)) - message.bodyRows = []; - message.bodyRows.push($root.google.cloud.documentai.v1.Document.Page.Table.TableRow.decode(reader, reader.uint32())); - break; - } - case 4: { - if (!(message.detectedLanguages && message.detectedLanguages.length)) - message.detectedLanguages = []; - message.detectedLanguages.push($root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.decode(reader, reader.uint32())); - break; - } - case 5: { - message.provenance = $root.google.cloud.documentai.v1.Document.Provenance.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.cloud.documentai.v1.Document.Page.Table - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.Page.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.cloud.documentai.v1.Document.Page.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.layout != null && message.hasOwnProperty("layout")) { - var error = $root.google.cloud.documentai.v1.Document.Page.Layout.verify(message.layout); - if (error) - return "layout." + error; - } - if (message.headerRows != null && message.hasOwnProperty("headerRows")) { - if (!Array.isArray(message.headerRows)) - return "headerRows: array expected"; - for (var i = 0; i < message.headerRows.length; ++i) { - var error = $root.google.cloud.documentai.v1.Document.Page.Table.TableRow.verify(message.headerRows[i]); - if (error) - return "headerRows." + error; - } - } - if (message.bodyRows != null && message.hasOwnProperty("bodyRows")) { - if (!Array.isArray(message.bodyRows)) - return "bodyRows: array expected"; - for (var i = 0; i < message.bodyRows.length; ++i) { - var error = $root.google.cloud.documentai.v1.Document.Page.Table.TableRow.verify(message.bodyRows[i]); - if (error) - return "bodyRows." + error; - } - } - if (message.detectedLanguages != null && message.hasOwnProperty("detectedLanguages")) { - if (!Array.isArray(message.detectedLanguages)) - return "detectedLanguages: array expected"; - for (var i = 0; i < message.detectedLanguages.length; ++i) { - var error = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.verify(message.detectedLanguages[i]); - if (error) - return "detectedLanguages." + error; - } - } - if (message.provenance != null && message.hasOwnProperty("provenance")) { - var error = $root.google.cloud.documentai.v1.Document.Provenance.verify(message.provenance); - if (error) - return "provenance." + error; - } - return null; - }; - - /** - * Creates a Table message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.Page.Table - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.Page.Table} Table - */ - Table.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.Page.Table) - return object; - var message = new $root.google.cloud.documentai.v1.Document.Page.Table(); - if (object.layout != null) { - if (typeof object.layout !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.Table.layout: object expected"); - message.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.fromObject(object.layout); - } - if (object.headerRows) { - if (!Array.isArray(object.headerRows)) - throw TypeError(".google.cloud.documentai.v1.Document.Page.Table.headerRows: array expected"); - message.headerRows = []; - for (var i = 0; i < object.headerRows.length; ++i) { - if (typeof object.headerRows[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.Table.headerRows: object expected"); - message.headerRows[i] = $root.google.cloud.documentai.v1.Document.Page.Table.TableRow.fromObject(object.headerRows[i]); - } - } - if (object.bodyRows) { - if (!Array.isArray(object.bodyRows)) - throw TypeError(".google.cloud.documentai.v1.Document.Page.Table.bodyRows: array expected"); - message.bodyRows = []; - for (var i = 0; i < object.bodyRows.length; ++i) { - if (typeof object.bodyRows[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.Table.bodyRows: object expected"); - message.bodyRows[i] = $root.google.cloud.documentai.v1.Document.Page.Table.TableRow.fromObject(object.bodyRows[i]); - } - } - if (object.detectedLanguages) { - if (!Array.isArray(object.detectedLanguages)) - throw TypeError(".google.cloud.documentai.v1.Document.Page.Table.detectedLanguages: array expected"); - message.detectedLanguages = []; - for (var i = 0; i < object.detectedLanguages.length; ++i) { - if (typeof object.detectedLanguages[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.Table.detectedLanguages: object expected"); - message.detectedLanguages[i] = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.fromObject(object.detectedLanguages[i]); - } - } - if (object.provenance != null) { - if (typeof object.provenance !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.Table.provenance: object expected"); - message.provenance = $root.google.cloud.documentai.v1.Document.Provenance.fromObject(object.provenance); - } - return message; - }; - - /** - * Creates a plain object from a Table message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.Page.Table - * @static - * @param {google.cloud.documentai.v1.Document.Page.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.headerRows = []; - object.bodyRows = []; - object.detectedLanguages = []; - } - if (options.defaults) { - object.layout = null; - object.provenance = null; - } - if (message.layout != null && message.hasOwnProperty("layout")) - object.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.toObject(message.layout, options); - if (message.headerRows && message.headerRows.length) { - object.headerRows = []; - for (var j = 0; j < message.headerRows.length; ++j) - object.headerRows[j] = $root.google.cloud.documentai.v1.Document.Page.Table.TableRow.toObject(message.headerRows[j], options); - } - if (message.bodyRows && message.bodyRows.length) { - object.bodyRows = []; - for (var j = 0; j < message.bodyRows.length; ++j) - object.bodyRows[j] = $root.google.cloud.documentai.v1.Document.Page.Table.TableRow.toObject(message.bodyRows[j], options); - } - if (message.detectedLanguages && message.detectedLanguages.length) { - object.detectedLanguages = []; - for (var j = 0; j < message.detectedLanguages.length; ++j) - object.detectedLanguages[j] = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.toObject(message.detectedLanguages[j], options); - } - if (message.provenance != null && message.hasOwnProperty("provenance")) - object.provenance = $root.google.cloud.documentai.v1.Document.Provenance.toObject(message.provenance, options); - return object; - }; - - /** - * Converts this Table to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.Page.Table - * @instance - * @returns {Object.} JSON object - */ - Table.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Table - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.Page.Table - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Table.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Page.Table"; - }; - - Table.TableRow = (function() { - - /** - * Properties of a TableRow. - * @memberof google.cloud.documentai.v1.Document.Page.Table - * @interface ITableRow - * @property {Array.|null} [cells] TableRow cells - */ - - /** - * Constructs a new TableRow. - * @memberof google.cloud.documentai.v1.Document.Page.Table - * @classdesc Represents a TableRow. - * @implements ITableRow - * @constructor - * @param {google.cloud.documentai.v1.Document.Page.Table.ITableRow=} [properties] Properties to set - */ - function TableRow(properties) { - this.cells = []; - 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]]; - } - - /** - * TableRow cells. - * @member {Array.} cells - * @memberof google.cloud.documentai.v1.Document.Page.Table.TableRow - * @instance - */ - TableRow.prototype.cells = $util.emptyArray; - - /** - * Creates a new TableRow instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.Page.Table.TableRow - * @static - * @param {google.cloud.documentai.v1.Document.Page.Table.ITableRow=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.Page.Table.TableRow} TableRow instance - */ - TableRow.create = function create(properties) { - return new TableRow(properties); - }; - - /** - * Encodes the specified TableRow message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Table.TableRow.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.Page.Table.TableRow - * @static - * @param {google.cloud.documentai.v1.Document.Page.Table.ITableRow} message TableRow message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TableRow.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.cells != null && message.cells.length) - for (var i = 0; i < message.cells.length; ++i) - $root.google.cloud.documentai.v1.Document.Page.Table.TableCell.encode(message.cells[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TableRow message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Table.TableRow.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.Page.Table.TableRow - * @static - * @param {google.cloud.documentai.v1.Document.Page.Table.ITableRow} message TableRow message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TableRow.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TableRow message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document.Page.Table.TableRow - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.Page.Table.TableRow} TableRow - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TableRow.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Page.Table.TableRow(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.cells && message.cells.length)) - message.cells = []; - message.cells.push($root.google.cloud.documentai.v1.Document.Page.Table.TableCell.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TableRow message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document.Page.Table.TableRow - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.Page.Table.TableRow} TableRow - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TableRow.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TableRow message. - * @function verify - * @memberof google.cloud.documentai.v1.Document.Page.Table.TableRow - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TableRow.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.cells != null && message.hasOwnProperty("cells")) { - if (!Array.isArray(message.cells)) - return "cells: array expected"; - for (var i = 0; i < message.cells.length; ++i) { - var error = $root.google.cloud.documentai.v1.Document.Page.Table.TableCell.verify(message.cells[i]); - if (error) - return "cells." + error; - } - } - return null; - }; - - /** - * Creates a TableRow message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.Page.Table.TableRow - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.Page.Table.TableRow} TableRow - */ - TableRow.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.Page.Table.TableRow) - return object; - var message = new $root.google.cloud.documentai.v1.Document.Page.Table.TableRow(); - if (object.cells) { - if (!Array.isArray(object.cells)) - throw TypeError(".google.cloud.documentai.v1.Document.Page.Table.TableRow.cells: array expected"); - message.cells = []; - for (var i = 0; i < object.cells.length; ++i) { - if (typeof object.cells[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.Table.TableRow.cells: object expected"); - message.cells[i] = $root.google.cloud.documentai.v1.Document.Page.Table.TableCell.fromObject(object.cells[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a TableRow message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.Page.Table.TableRow - * @static - * @param {google.cloud.documentai.v1.Document.Page.Table.TableRow} message TableRow - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TableRow.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.cells = []; - if (message.cells && message.cells.length) { - object.cells = []; - for (var j = 0; j < message.cells.length; ++j) - object.cells[j] = $root.google.cloud.documentai.v1.Document.Page.Table.TableCell.toObject(message.cells[j], options); - } - return object; - }; - - /** - * Converts this TableRow to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.Page.Table.TableRow - * @instance - * @returns {Object.} JSON object - */ - TableRow.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TableRow - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.Page.Table.TableRow - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TableRow.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Page.Table.TableRow"; - }; - - return TableRow; - })(); - - Table.TableCell = (function() { - - /** - * Properties of a TableCell. - * @memberof google.cloud.documentai.v1.Document.Page.Table - * @interface ITableCell - * @property {google.cloud.documentai.v1.Document.Page.ILayout|null} [layout] TableCell layout - * @property {number|null} [rowSpan] TableCell rowSpan - * @property {number|null} [colSpan] TableCell colSpan - * @property {Array.|null} [detectedLanguages] TableCell detectedLanguages - */ - - /** - * Constructs a new TableCell. - * @memberof google.cloud.documentai.v1.Document.Page.Table - * @classdesc Represents a TableCell. - * @implements ITableCell - * @constructor - * @param {google.cloud.documentai.v1.Document.Page.Table.ITableCell=} [properties] Properties to set - */ - function TableCell(properties) { - this.detectedLanguages = []; - 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]]; - } - - /** - * TableCell layout. - * @member {google.cloud.documentai.v1.Document.Page.ILayout|null|undefined} layout - * @memberof google.cloud.documentai.v1.Document.Page.Table.TableCell - * @instance - */ - TableCell.prototype.layout = null; - - /** - * TableCell rowSpan. - * @member {number} rowSpan - * @memberof google.cloud.documentai.v1.Document.Page.Table.TableCell - * @instance - */ - TableCell.prototype.rowSpan = 0; - - /** - * TableCell colSpan. - * @member {number} colSpan - * @memberof google.cloud.documentai.v1.Document.Page.Table.TableCell - * @instance - */ - TableCell.prototype.colSpan = 0; - - /** - * TableCell detectedLanguages. - * @member {Array.} detectedLanguages - * @memberof google.cloud.documentai.v1.Document.Page.Table.TableCell - * @instance - */ - TableCell.prototype.detectedLanguages = $util.emptyArray; - - /** - * Creates a new TableCell instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.Page.Table.TableCell - * @static - * @param {google.cloud.documentai.v1.Document.Page.Table.ITableCell=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.Page.Table.TableCell} TableCell instance - */ - TableCell.create = function create(properties) { - return new TableCell(properties); - }; - - /** - * Encodes the specified TableCell message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Table.TableCell.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.Page.Table.TableCell - * @static - * @param {google.cloud.documentai.v1.Document.Page.Table.ITableCell} message TableCell message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TableCell.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.layout != null && Object.hasOwnProperty.call(message, "layout")) - $root.google.cloud.documentai.v1.Document.Page.Layout.encode(message.layout, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.rowSpan != null && Object.hasOwnProperty.call(message, "rowSpan")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.rowSpan); - if (message.colSpan != null && Object.hasOwnProperty.call(message, "colSpan")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.colSpan); - if (message.detectedLanguages != null && message.detectedLanguages.length) - for (var i = 0; i < message.detectedLanguages.length; ++i) - $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.encode(message.detectedLanguages[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TableCell message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.Table.TableCell.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.Page.Table.TableCell - * @static - * @param {google.cloud.documentai.v1.Document.Page.Table.ITableCell} message TableCell message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TableCell.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TableCell message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document.Page.Table.TableCell - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.Page.Table.TableCell} TableCell - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TableCell.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Page.Table.TableCell(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.decode(reader, reader.uint32()); - break; - } - case 2: { - message.rowSpan = reader.int32(); - break; - } - case 3: { - message.colSpan = reader.int32(); - break; - } - case 4: { - if (!(message.detectedLanguages && message.detectedLanguages.length)) - message.detectedLanguages = []; - message.detectedLanguages.push($root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TableCell message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document.Page.Table.TableCell - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.Page.Table.TableCell} TableCell - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TableCell.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TableCell message. - * @function verify - * @memberof google.cloud.documentai.v1.Document.Page.Table.TableCell - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TableCell.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.layout != null && message.hasOwnProperty("layout")) { - var error = $root.google.cloud.documentai.v1.Document.Page.Layout.verify(message.layout); - if (error) - return "layout." + error; - } - if (message.rowSpan != null && message.hasOwnProperty("rowSpan")) - if (!$util.isInteger(message.rowSpan)) - return "rowSpan: integer expected"; - if (message.colSpan != null && message.hasOwnProperty("colSpan")) - if (!$util.isInteger(message.colSpan)) - return "colSpan: integer expected"; - if (message.detectedLanguages != null && message.hasOwnProperty("detectedLanguages")) { - if (!Array.isArray(message.detectedLanguages)) - return "detectedLanguages: array expected"; - for (var i = 0; i < message.detectedLanguages.length; ++i) { - var error = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.verify(message.detectedLanguages[i]); - if (error) - return "detectedLanguages." + error; - } - } - return null; - }; - - /** - * Creates a TableCell message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.Page.Table.TableCell - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.Page.Table.TableCell} TableCell - */ - TableCell.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.Page.Table.TableCell) - return object; - var message = new $root.google.cloud.documentai.v1.Document.Page.Table.TableCell(); - if (object.layout != null) { - if (typeof object.layout !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.Table.TableCell.layout: object expected"); - message.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.fromObject(object.layout); - } - if (object.rowSpan != null) - message.rowSpan = object.rowSpan | 0; - if (object.colSpan != null) - message.colSpan = object.colSpan | 0; - if (object.detectedLanguages) { - if (!Array.isArray(object.detectedLanguages)) - throw TypeError(".google.cloud.documentai.v1.Document.Page.Table.TableCell.detectedLanguages: array expected"); - message.detectedLanguages = []; - for (var i = 0; i < object.detectedLanguages.length; ++i) { - if (typeof object.detectedLanguages[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.Table.TableCell.detectedLanguages: object expected"); - message.detectedLanguages[i] = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.fromObject(object.detectedLanguages[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a TableCell message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.Page.Table.TableCell - * @static - * @param {google.cloud.documentai.v1.Document.Page.Table.TableCell} message TableCell - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TableCell.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.detectedLanguages = []; - if (options.defaults) { - object.layout = null; - object.rowSpan = 0; - object.colSpan = 0; - } - if (message.layout != null && message.hasOwnProperty("layout")) - object.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.toObject(message.layout, options); - if (message.rowSpan != null && message.hasOwnProperty("rowSpan")) - object.rowSpan = message.rowSpan; - if (message.colSpan != null && message.hasOwnProperty("colSpan")) - object.colSpan = message.colSpan; - if (message.detectedLanguages && message.detectedLanguages.length) { - object.detectedLanguages = []; - for (var j = 0; j < message.detectedLanguages.length; ++j) - object.detectedLanguages[j] = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.toObject(message.detectedLanguages[j], options); - } - return object; - }; - - /** - * Converts this TableCell to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.Page.Table.TableCell - * @instance - * @returns {Object.} JSON object - */ - TableCell.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TableCell - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.Page.Table.TableCell - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TableCell.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Page.Table.TableCell"; - }; - - return TableCell; - })(); - - return Table; - })(); - - Page.FormField = (function() { - - /** - * Properties of a FormField. - * @memberof google.cloud.documentai.v1.Document.Page - * @interface IFormField - * @property {google.cloud.documentai.v1.Document.Page.ILayout|null} [fieldName] FormField fieldName - * @property {google.cloud.documentai.v1.Document.Page.ILayout|null} [fieldValue] FormField fieldValue - * @property {Array.|null} [nameDetectedLanguages] FormField nameDetectedLanguages - * @property {Array.|null} [valueDetectedLanguages] FormField valueDetectedLanguages - * @property {string|null} [valueType] FormField valueType - * @property {string|null} [correctedKeyText] FormField correctedKeyText - * @property {string|null} [correctedValueText] FormField correctedValueText - * @property {google.cloud.documentai.v1.Document.IProvenance|null} [provenance] FormField provenance - */ - - /** - * Constructs a new FormField. - * @memberof google.cloud.documentai.v1.Document.Page - * @classdesc Represents a FormField. - * @implements IFormField - * @constructor - * @param {google.cloud.documentai.v1.Document.Page.IFormField=} [properties] Properties to set - */ - function FormField(properties) { - this.nameDetectedLanguages = []; - this.valueDetectedLanguages = []; - 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]]; - } - - /** - * FormField fieldName. - * @member {google.cloud.documentai.v1.Document.Page.ILayout|null|undefined} fieldName - * @memberof google.cloud.documentai.v1.Document.Page.FormField - * @instance - */ - FormField.prototype.fieldName = null; - - /** - * FormField fieldValue. - * @member {google.cloud.documentai.v1.Document.Page.ILayout|null|undefined} fieldValue - * @memberof google.cloud.documentai.v1.Document.Page.FormField - * @instance - */ - FormField.prototype.fieldValue = null; - - /** - * FormField nameDetectedLanguages. - * @member {Array.} nameDetectedLanguages - * @memberof google.cloud.documentai.v1.Document.Page.FormField - * @instance - */ - FormField.prototype.nameDetectedLanguages = $util.emptyArray; - - /** - * FormField valueDetectedLanguages. - * @member {Array.} valueDetectedLanguages - * @memberof google.cloud.documentai.v1.Document.Page.FormField - * @instance - */ - FormField.prototype.valueDetectedLanguages = $util.emptyArray; - - /** - * FormField valueType. - * @member {string} valueType - * @memberof google.cloud.documentai.v1.Document.Page.FormField - * @instance - */ - FormField.prototype.valueType = ""; - - /** - * FormField correctedKeyText. - * @member {string} correctedKeyText - * @memberof google.cloud.documentai.v1.Document.Page.FormField - * @instance - */ - FormField.prototype.correctedKeyText = ""; - - /** - * FormField correctedValueText. - * @member {string} correctedValueText - * @memberof google.cloud.documentai.v1.Document.Page.FormField - * @instance - */ - FormField.prototype.correctedValueText = ""; - - /** - * FormField provenance. - * @member {google.cloud.documentai.v1.Document.IProvenance|null|undefined} provenance - * @memberof google.cloud.documentai.v1.Document.Page.FormField - * @instance - */ - FormField.prototype.provenance = null; - - /** - * Creates a new FormField instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.Page.FormField - * @static - * @param {google.cloud.documentai.v1.Document.Page.IFormField=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.Page.FormField} FormField instance - */ - FormField.create = function create(properties) { - return new FormField(properties); - }; - - /** - * Encodes the specified FormField message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.FormField.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.Page.FormField - * @static - * @param {google.cloud.documentai.v1.Document.Page.IFormField} message FormField message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FormField.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fieldName != null && Object.hasOwnProperty.call(message, "fieldName")) - $root.google.cloud.documentai.v1.Document.Page.Layout.encode(message.fieldName, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.fieldValue != null && Object.hasOwnProperty.call(message, "fieldValue")) - $root.google.cloud.documentai.v1.Document.Page.Layout.encode(message.fieldValue, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nameDetectedLanguages != null && message.nameDetectedLanguages.length) - for (var i = 0; i < message.nameDetectedLanguages.length; ++i) - $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.encode(message.nameDetectedLanguages[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.valueDetectedLanguages != null && message.valueDetectedLanguages.length) - for (var i = 0; i < message.valueDetectedLanguages.length; ++i) - $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.encode(message.valueDetectedLanguages[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.valueType != null && Object.hasOwnProperty.call(message, "valueType")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.valueType); - if (message.correctedKeyText != null && Object.hasOwnProperty.call(message, "correctedKeyText")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.correctedKeyText); - if (message.correctedValueText != null && Object.hasOwnProperty.call(message, "correctedValueText")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.correctedValueText); - if (message.provenance != null && Object.hasOwnProperty.call(message, "provenance")) - $root.google.cloud.documentai.v1.Document.Provenance.encode(message.provenance, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FormField message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.FormField.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.Page.FormField - * @static - * @param {google.cloud.documentai.v1.Document.Page.IFormField} message FormField message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FormField.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FormField message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document.Page.FormField - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.Page.FormField} FormField - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FormField.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Page.FormField(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.fieldName = $root.google.cloud.documentai.v1.Document.Page.Layout.decode(reader, reader.uint32()); - break; - } - case 2: { - message.fieldValue = $root.google.cloud.documentai.v1.Document.Page.Layout.decode(reader, reader.uint32()); - break; - } - case 3: { - if (!(message.nameDetectedLanguages && message.nameDetectedLanguages.length)) - message.nameDetectedLanguages = []; - message.nameDetectedLanguages.push($root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.decode(reader, reader.uint32())); - break; - } - case 4: { - if (!(message.valueDetectedLanguages && message.valueDetectedLanguages.length)) - message.valueDetectedLanguages = []; - message.valueDetectedLanguages.push($root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.decode(reader, reader.uint32())); - break; - } - case 5: { - message.valueType = reader.string(); - break; - } - case 6: { - message.correctedKeyText = reader.string(); - break; - } - case 7: { - message.correctedValueText = reader.string(); - break; - } - case 8: { - message.provenance = $root.google.cloud.documentai.v1.Document.Provenance.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FormField message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document.Page.FormField - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.Page.FormField} FormField - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FormField.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FormField message. - * @function verify - * @memberof google.cloud.documentai.v1.Document.Page.FormField - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FormField.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fieldName != null && message.hasOwnProperty("fieldName")) { - var error = $root.google.cloud.documentai.v1.Document.Page.Layout.verify(message.fieldName); - if (error) - return "fieldName." + error; - } - if (message.fieldValue != null && message.hasOwnProperty("fieldValue")) { - var error = $root.google.cloud.documentai.v1.Document.Page.Layout.verify(message.fieldValue); - if (error) - return "fieldValue." + error; - } - if (message.nameDetectedLanguages != null && message.hasOwnProperty("nameDetectedLanguages")) { - if (!Array.isArray(message.nameDetectedLanguages)) - return "nameDetectedLanguages: array expected"; - for (var i = 0; i < message.nameDetectedLanguages.length; ++i) { - var error = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.verify(message.nameDetectedLanguages[i]); - if (error) - return "nameDetectedLanguages." + error; - } - } - if (message.valueDetectedLanguages != null && message.hasOwnProperty("valueDetectedLanguages")) { - if (!Array.isArray(message.valueDetectedLanguages)) - return "valueDetectedLanguages: array expected"; - for (var i = 0; i < message.valueDetectedLanguages.length; ++i) { - var error = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.verify(message.valueDetectedLanguages[i]); - if (error) - return "valueDetectedLanguages." + error; - } - } - if (message.valueType != null && message.hasOwnProperty("valueType")) - if (!$util.isString(message.valueType)) - return "valueType: string expected"; - if (message.correctedKeyText != null && message.hasOwnProperty("correctedKeyText")) - if (!$util.isString(message.correctedKeyText)) - return "correctedKeyText: string expected"; - if (message.correctedValueText != null && message.hasOwnProperty("correctedValueText")) - if (!$util.isString(message.correctedValueText)) - return "correctedValueText: string expected"; - if (message.provenance != null && message.hasOwnProperty("provenance")) { - var error = $root.google.cloud.documentai.v1.Document.Provenance.verify(message.provenance); - if (error) - return "provenance." + error; - } - return null; - }; - - /** - * Creates a FormField message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.Page.FormField - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.Page.FormField} FormField - */ - FormField.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.Page.FormField) - return object; - var message = new $root.google.cloud.documentai.v1.Document.Page.FormField(); - if (object.fieldName != null) { - if (typeof object.fieldName !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.FormField.fieldName: object expected"); - message.fieldName = $root.google.cloud.documentai.v1.Document.Page.Layout.fromObject(object.fieldName); - } - if (object.fieldValue != null) { - if (typeof object.fieldValue !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.FormField.fieldValue: object expected"); - message.fieldValue = $root.google.cloud.documentai.v1.Document.Page.Layout.fromObject(object.fieldValue); - } - if (object.nameDetectedLanguages) { - if (!Array.isArray(object.nameDetectedLanguages)) - throw TypeError(".google.cloud.documentai.v1.Document.Page.FormField.nameDetectedLanguages: array expected"); - message.nameDetectedLanguages = []; - for (var i = 0; i < object.nameDetectedLanguages.length; ++i) { - if (typeof object.nameDetectedLanguages[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.FormField.nameDetectedLanguages: object expected"); - message.nameDetectedLanguages[i] = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.fromObject(object.nameDetectedLanguages[i]); - } - } - if (object.valueDetectedLanguages) { - if (!Array.isArray(object.valueDetectedLanguages)) - throw TypeError(".google.cloud.documentai.v1.Document.Page.FormField.valueDetectedLanguages: array expected"); - message.valueDetectedLanguages = []; - for (var i = 0; i < object.valueDetectedLanguages.length; ++i) { - if (typeof object.valueDetectedLanguages[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.FormField.valueDetectedLanguages: object expected"); - message.valueDetectedLanguages[i] = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.fromObject(object.valueDetectedLanguages[i]); - } - } - if (object.valueType != null) - message.valueType = String(object.valueType); - if (object.correctedKeyText != null) - message.correctedKeyText = String(object.correctedKeyText); - if (object.correctedValueText != null) - message.correctedValueText = String(object.correctedValueText); - if (object.provenance != null) { - if (typeof object.provenance !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.FormField.provenance: object expected"); - message.provenance = $root.google.cloud.documentai.v1.Document.Provenance.fromObject(object.provenance); - } - return message; - }; - - /** - * Creates a plain object from a FormField message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.Page.FormField - * @static - * @param {google.cloud.documentai.v1.Document.Page.FormField} message FormField - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FormField.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.nameDetectedLanguages = []; - object.valueDetectedLanguages = []; - } - if (options.defaults) { - object.fieldName = null; - object.fieldValue = null; - object.valueType = ""; - object.correctedKeyText = ""; - object.correctedValueText = ""; - object.provenance = null; - } - if (message.fieldName != null && message.hasOwnProperty("fieldName")) - object.fieldName = $root.google.cloud.documentai.v1.Document.Page.Layout.toObject(message.fieldName, options); - if (message.fieldValue != null && message.hasOwnProperty("fieldValue")) - object.fieldValue = $root.google.cloud.documentai.v1.Document.Page.Layout.toObject(message.fieldValue, options); - if (message.nameDetectedLanguages && message.nameDetectedLanguages.length) { - object.nameDetectedLanguages = []; - for (var j = 0; j < message.nameDetectedLanguages.length; ++j) - object.nameDetectedLanguages[j] = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.toObject(message.nameDetectedLanguages[j], options); - } - if (message.valueDetectedLanguages && message.valueDetectedLanguages.length) { - object.valueDetectedLanguages = []; - for (var j = 0; j < message.valueDetectedLanguages.length; ++j) - object.valueDetectedLanguages[j] = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.toObject(message.valueDetectedLanguages[j], options); - } - if (message.valueType != null && message.hasOwnProperty("valueType")) - object.valueType = message.valueType; - if (message.correctedKeyText != null && message.hasOwnProperty("correctedKeyText")) - object.correctedKeyText = message.correctedKeyText; - if (message.correctedValueText != null && message.hasOwnProperty("correctedValueText")) - object.correctedValueText = message.correctedValueText; - if (message.provenance != null && message.hasOwnProperty("provenance")) - object.provenance = $root.google.cloud.documentai.v1.Document.Provenance.toObject(message.provenance, options); - return object; - }; - - /** - * Converts this FormField to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.Page.FormField - * @instance - * @returns {Object.} JSON object - */ - FormField.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FormField - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.Page.FormField - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FormField.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Page.FormField"; - }; - - return FormField; - })(); - - Page.DetectedBarcode = (function() { - - /** - * Properties of a DetectedBarcode. - * @memberof google.cloud.documentai.v1.Document.Page - * @interface IDetectedBarcode - * @property {google.cloud.documentai.v1.Document.Page.ILayout|null} [layout] DetectedBarcode layout - * @property {google.cloud.documentai.v1.IBarcode|null} [barcode] DetectedBarcode barcode - */ - - /** - * Constructs a new DetectedBarcode. - * @memberof google.cloud.documentai.v1.Document.Page - * @classdesc Represents a DetectedBarcode. - * @implements IDetectedBarcode - * @constructor - * @param {google.cloud.documentai.v1.Document.Page.IDetectedBarcode=} [properties] Properties to set - */ - function DetectedBarcode(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]]; - } - - /** - * DetectedBarcode layout. - * @member {google.cloud.documentai.v1.Document.Page.ILayout|null|undefined} layout - * @memberof google.cloud.documentai.v1.Document.Page.DetectedBarcode - * @instance - */ - DetectedBarcode.prototype.layout = null; - - /** - * DetectedBarcode barcode. - * @member {google.cloud.documentai.v1.IBarcode|null|undefined} barcode - * @memberof google.cloud.documentai.v1.Document.Page.DetectedBarcode - * @instance - */ - DetectedBarcode.prototype.barcode = null; - - /** - * Creates a new DetectedBarcode instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.Page.DetectedBarcode - * @static - * @param {google.cloud.documentai.v1.Document.Page.IDetectedBarcode=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.Page.DetectedBarcode} DetectedBarcode instance - */ - DetectedBarcode.create = function create(properties) { - return new DetectedBarcode(properties); - }; - - /** - * Encodes the specified DetectedBarcode message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.DetectedBarcode.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.Page.DetectedBarcode - * @static - * @param {google.cloud.documentai.v1.Document.Page.IDetectedBarcode} message DetectedBarcode message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DetectedBarcode.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.layout != null && Object.hasOwnProperty.call(message, "layout")) - $root.google.cloud.documentai.v1.Document.Page.Layout.encode(message.layout, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.barcode != null && Object.hasOwnProperty.call(message, "barcode")) - $root.google.cloud.documentai.v1.Barcode.encode(message.barcode, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DetectedBarcode message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.DetectedBarcode.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.Page.DetectedBarcode - * @static - * @param {google.cloud.documentai.v1.Document.Page.IDetectedBarcode} message DetectedBarcode message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DetectedBarcode.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DetectedBarcode message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document.Page.DetectedBarcode - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.Page.DetectedBarcode} DetectedBarcode - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DetectedBarcode.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Page.DetectedBarcode(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.decode(reader, reader.uint32()); - break; - } - case 2: { - message.barcode = $root.google.cloud.documentai.v1.Barcode.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DetectedBarcode message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document.Page.DetectedBarcode - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.Page.DetectedBarcode} DetectedBarcode - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DetectedBarcode.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DetectedBarcode message. - * @function verify - * @memberof google.cloud.documentai.v1.Document.Page.DetectedBarcode - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DetectedBarcode.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.layout != null && message.hasOwnProperty("layout")) { - var error = $root.google.cloud.documentai.v1.Document.Page.Layout.verify(message.layout); - if (error) - return "layout." + error; - } - if (message.barcode != null && message.hasOwnProperty("barcode")) { - var error = $root.google.cloud.documentai.v1.Barcode.verify(message.barcode); - if (error) - return "barcode." + error; - } - return null; - }; - - /** - * Creates a DetectedBarcode message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.Page.DetectedBarcode - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.Page.DetectedBarcode} DetectedBarcode - */ - DetectedBarcode.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.Page.DetectedBarcode) - return object; - var message = new $root.google.cloud.documentai.v1.Document.Page.DetectedBarcode(); - if (object.layout != null) { - if (typeof object.layout !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.DetectedBarcode.layout: object expected"); - message.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.fromObject(object.layout); - } - if (object.barcode != null) { - if (typeof object.barcode !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.DetectedBarcode.barcode: object expected"); - message.barcode = $root.google.cloud.documentai.v1.Barcode.fromObject(object.barcode); - } - return message; - }; - - /** - * Creates a plain object from a DetectedBarcode message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.Page.DetectedBarcode - * @static - * @param {google.cloud.documentai.v1.Document.Page.DetectedBarcode} message DetectedBarcode - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DetectedBarcode.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.layout = null; - object.barcode = null; - } - if (message.layout != null && message.hasOwnProperty("layout")) - object.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.toObject(message.layout, options); - if (message.barcode != null && message.hasOwnProperty("barcode")) - object.barcode = $root.google.cloud.documentai.v1.Barcode.toObject(message.barcode, options); - return object; - }; - - /** - * Converts this DetectedBarcode to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.Page.DetectedBarcode - * @instance - * @returns {Object.} JSON object - */ - DetectedBarcode.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DetectedBarcode - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.Page.DetectedBarcode - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DetectedBarcode.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Page.DetectedBarcode"; - }; - - return DetectedBarcode; - })(); - - Page.DetectedLanguage = (function() { - - /** - * Properties of a DetectedLanguage. - * @memberof google.cloud.documentai.v1.Document.Page - * @interface IDetectedLanguage - * @property {string|null} [languageCode] DetectedLanguage languageCode - * @property {number|null} [confidence] DetectedLanguage confidence - */ - - /** - * Constructs a new DetectedLanguage. - * @memberof google.cloud.documentai.v1.Document.Page - * @classdesc Represents a DetectedLanguage. - * @implements IDetectedLanguage - * @constructor - * @param {google.cloud.documentai.v1.Document.Page.IDetectedLanguage=} [properties] Properties to set - */ - function DetectedLanguage(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]]; - } - - /** - * DetectedLanguage languageCode. - * @member {string} languageCode - * @memberof google.cloud.documentai.v1.Document.Page.DetectedLanguage - * @instance - */ - DetectedLanguage.prototype.languageCode = ""; - - /** - * DetectedLanguage confidence. - * @member {number} confidence - * @memberof google.cloud.documentai.v1.Document.Page.DetectedLanguage - * @instance - */ - DetectedLanguage.prototype.confidence = 0; - - /** - * Creates a new DetectedLanguage instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.Page.DetectedLanguage - * @static - * @param {google.cloud.documentai.v1.Document.Page.IDetectedLanguage=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.Page.DetectedLanguage} DetectedLanguage instance - */ - DetectedLanguage.create = function create(properties) { - return new DetectedLanguage(properties); - }; - - /** - * Encodes the specified DetectedLanguage message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.DetectedLanguage.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.Page.DetectedLanguage - * @static - * @param {google.cloud.documentai.v1.Document.Page.IDetectedLanguage} message DetectedLanguage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DetectedLanguage.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.confidence != null && Object.hasOwnProperty.call(message, "confidence")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); - return writer; - }; - - /** - * Encodes the specified DetectedLanguage message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.DetectedLanguage.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.Page.DetectedLanguage - * @static - * @param {google.cloud.documentai.v1.Document.Page.IDetectedLanguage} message DetectedLanguage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DetectedLanguage.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DetectedLanguage message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document.Page.DetectedLanguage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.Page.DetectedLanguage} DetectedLanguage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DetectedLanguage.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.languageCode = reader.string(); - break; - } - case 2: { - message.confidence = reader.float(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DetectedLanguage message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document.Page.DetectedLanguage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.Page.DetectedLanguage} DetectedLanguage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DetectedLanguage.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DetectedLanguage message. - * @function verify - * @memberof google.cloud.documentai.v1.Document.Page.DetectedLanguage - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DetectedLanguage.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; - if (message.confidence != null && message.hasOwnProperty("confidence")) - if (typeof message.confidence !== "number") - return "confidence: number expected"; - return null; - }; - - /** - * Creates a DetectedLanguage message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.Page.DetectedLanguage - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.Page.DetectedLanguage} DetectedLanguage - */ - DetectedLanguage.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage) - return object; - var message = new $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage(); - if (object.languageCode != null) - message.languageCode = String(object.languageCode); - if (object.confidence != null) - message.confidence = Number(object.confidence); - return message; - }; - - /** - * Creates a plain object from a DetectedLanguage message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.Page.DetectedLanguage - * @static - * @param {google.cloud.documentai.v1.Document.Page.DetectedLanguage} message DetectedLanguage - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DetectedLanguage.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.languageCode = ""; - object.confidence = 0; - } - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; - if (message.confidence != null && message.hasOwnProperty("confidence")) - object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; - return object; - }; - - /** - * Converts this DetectedLanguage to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.Page.DetectedLanguage - * @instance - * @returns {Object.} JSON object - */ - DetectedLanguage.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DetectedLanguage - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.Page.DetectedLanguage - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DetectedLanguage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Page.DetectedLanguage"; - }; - - return DetectedLanguage; - })(); - - Page.ImageQualityScores = (function() { - - /** - * Properties of an ImageQualityScores. - * @memberof google.cloud.documentai.v1.Document.Page - * @interface IImageQualityScores - * @property {number|null} [qualityScore] ImageQualityScores qualityScore - * @property {Array.|null} [detectedDefects] ImageQualityScores detectedDefects - */ - - /** - * Constructs a new ImageQualityScores. - * @memberof google.cloud.documentai.v1.Document.Page - * @classdesc Represents an ImageQualityScores. - * @implements IImageQualityScores - * @constructor - * @param {google.cloud.documentai.v1.Document.Page.IImageQualityScores=} [properties] Properties to set - */ - function ImageQualityScores(properties) { - this.detectedDefects = []; - 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]]; - } - - /** - * ImageQualityScores qualityScore. - * @member {number} qualityScore - * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores - * @instance - */ - ImageQualityScores.prototype.qualityScore = 0; - - /** - * ImageQualityScores detectedDefects. - * @member {Array.} detectedDefects - * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores - * @instance - */ - ImageQualityScores.prototype.detectedDefects = $util.emptyArray; - - /** - * Creates a new ImageQualityScores instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores - * @static - * @param {google.cloud.documentai.v1.Document.Page.IImageQualityScores=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.Page.ImageQualityScores} ImageQualityScores instance - */ - ImageQualityScores.create = function create(properties) { - return new ImageQualityScores(properties); - }; - - /** - * Encodes the specified ImageQualityScores message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.ImageQualityScores.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores - * @static - * @param {google.cloud.documentai.v1.Document.Page.IImageQualityScores} message ImageQualityScores message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImageQualityScores.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.qualityScore != null && Object.hasOwnProperty.call(message, "qualityScore")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.qualityScore); - if (message.detectedDefects != null && message.detectedDefects.length) - for (var i = 0; i < message.detectedDefects.length; ++i) - $root.google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect.encode(message.detectedDefects[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ImageQualityScores message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.ImageQualityScores.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores - * @static - * @param {google.cloud.documentai.v1.Document.Page.IImageQualityScores} message ImageQualityScores message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImageQualityScores.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ImageQualityScores message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.Page.ImageQualityScores} ImageQualityScores - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImageQualityScores.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Page.ImageQualityScores(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.qualityScore = reader.float(); - break; - } - case 2: { - if (!(message.detectedDefects && message.detectedDefects.length)) - message.detectedDefects = []; - message.detectedDefects.push($root.google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ImageQualityScores message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.Page.ImageQualityScores} ImageQualityScores - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImageQualityScores.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ImageQualityScores message. - * @function verify - * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ImageQualityScores.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.qualityScore != null && message.hasOwnProperty("qualityScore")) - if (typeof message.qualityScore !== "number") - return "qualityScore: number expected"; - if (message.detectedDefects != null && message.hasOwnProperty("detectedDefects")) { - if (!Array.isArray(message.detectedDefects)) - return "detectedDefects: array expected"; - for (var i = 0; i < message.detectedDefects.length; ++i) { - var error = $root.google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect.verify(message.detectedDefects[i]); - if (error) - return "detectedDefects." + error; - } - } - return null; - }; - - /** - * Creates an ImageQualityScores message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.Page.ImageQualityScores} ImageQualityScores - */ - ImageQualityScores.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.Page.ImageQualityScores) - return object; - var message = new $root.google.cloud.documentai.v1.Document.Page.ImageQualityScores(); - if (object.qualityScore != null) - message.qualityScore = Number(object.qualityScore); - if (object.detectedDefects) { - if (!Array.isArray(object.detectedDefects)) - throw TypeError(".google.cloud.documentai.v1.Document.Page.ImageQualityScores.detectedDefects: array expected"); - message.detectedDefects = []; - for (var i = 0; i < object.detectedDefects.length; ++i) { - if (typeof object.detectedDefects[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Page.ImageQualityScores.detectedDefects: object expected"); - message.detectedDefects[i] = $root.google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect.fromObject(object.detectedDefects[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an ImageQualityScores message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores - * @static - * @param {google.cloud.documentai.v1.Document.Page.ImageQualityScores} message ImageQualityScores - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ImageQualityScores.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.detectedDefects = []; - if (options.defaults) - object.qualityScore = 0; - if (message.qualityScore != null && message.hasOwnProperty("qualityScore")) - object.qualityScore = options.json && !isFinite(message.qualityScore) ? String(message.qualityScore) : message.qualityScore; - if (message.detectedDefects && message.detectedDefects.length) { - object.detectedDefects = []; - for (var j = 0; j < message.detectedDefects.length; ++j) - object.detectedDefects[j] = $root.google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect.toObject(message.detectedDefects[j], options); - } - return object; - }; - - /** - * Converts this ImageQualityScores to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores - * @instance - * @returns {Object.} JSON object - */ - ImageQualityScores.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ImageQualityScores - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ImageQualityScores.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Page.ImageQualityScores"; - }; - - ImageQualityScores.DetectedDefect = (function() { - - /** - * Properties of a DetectedDefect. - * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores - * @interface IDetectedDefect - * @property {string|null} [type] DetectedDefect type - * @property {number|null} [confidence] DetectedDefect confidence - */ - - /** - * Constructs a new DetectedDefect. - * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores - * @classdesc Represents a DetectedDefect. - * @implements IDetectedDefect - * @constructor - * @param {google.cloud.documentai.v1.Document.Page.ImageQualityScores.IDetectedDefect=} [properties] Properties to set - */ - function DetectedDefect(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]]; - } - - /** - * DetectedDefect type. - * @member {string} type - * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect - * @instance - */ - DetectedDefect.prototype.type = ""; - - /** - * DetectedDefect confidence. - * @member {number} confidence - * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect - * @instance - */ - DetectedDefect.prototype.confidence = 0; - - /** - * Creates a new DetectedDefect instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect - * @static - * @param {google.cloud.documentai.v1.Document.Page.ImageQualityScores.IDetectedDefect=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect} DetectedDefect instance - */ - DetectedDefect.create = function create(properties) { - return new DetectedDefect(properties); - }; - - /** - * Encodes the specified DetectedDefect message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect - * @static - * @param {google.cloud.documentai.v1.Document.Page.ImageQualityScores.IDetectedDefect} message DetectedDefect message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DetectedDefect.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.confidence != null && Object.hasOwnProperty.call(message, "confidence")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); - return writer; - }; - - /** - * Encodes the specified DetectedDefect message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect - * @static - * @param {google.cloud.documentai.v1.Document.Page.ImageQualityScores.IDetectedDefect} message DetectedDefect message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DetectedDefect.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DetectedDefect message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect} DetectedDefect - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DetectedDefect.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.type = reader.string(); - break; - } - case 2: { - message.confidence = reader.float(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DetectedDefect message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect} DetectedDefect - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DetectedDefect.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DetectedDefect message. - * @function verify - * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DetectedDefect.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.confidence != null && message.hasOwnProperty("confidence")) - if (typeof message.confidence !== "number") - return "confidence: number expected"; - return null; - }; - - /** - * Creates a DetectedDefect message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect} DetectedDefect - */ - DetectedDefect.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect) - return object; - var message = new $root.google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect(); - if (object.type != null) - message.type = String(object.type); - if (object.confidence != null) - message.confidence = Number(object.confidence); - return message; - }; - - /** - * Creates a plain object from a DetectedDefect message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect - * @static - * @param {google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect} message DetectedDefect - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DetectedDefect.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = ""; - object.confidence = 0; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.confidence != null && message.hasOwnProperty("confidence")) - object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; - return object; - }; - - /** - * Converts this DetectedDefect to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect - * @instance - * @returns {Object.} JSON object - */ - DetectedDefect.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DetectedDefect - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DetectedDefect.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect"; - }; - - return DetectedDefect; - })(); - - return ImageQualityScores; - })(); - - return Page; - })(); - - Document.Entity = (function() { - - /** - * Properties of an Entity. - * @memberof google.cloud.documentai.v1.Document - * @interface IEntity - * @property {google.cloud.documentai.v1.Document.ITextAnchor|null} [textAnchor] Entity textAnchor - * @property {string|null} [type] Entity type - * @property {string|null} [mentionText] Entity mentionText - * @property {string|null} [mentionId] Entity mentionId - * @property {number|null} [confidence] Entity confidence - * @property {google.cloud.documentai.v1.Document.IPageAnchor|null} [pageAnchor] Entity pageAnchor - * @property {string|null} [id] Entity id - * @property {google.cloud.documentai.v1.Document.Entity.INormalizedValue|null} [normalizedValue] Entity normalizedValue - * @property {Array.|null} [properties] Entity properties - * @property {google.cloud.documentai.v1.Document.IProvenance|null} [provenance] Entity provenance - * @property {boolean|null} [redacted] Entity redacted - * @property {google.cloud.documentai.v1.Document.Entity.Method|null} [method] Entity method - */ - - /** - * Constructs a new Entity. - * @memberof google.cloud.documentai.v1.Document - * @classdesc Represents an Entity. - * @implements IEntity - * @constructor - * @param {google.cloud.documentai.v1.Document.IEntity=} [properties] Properties to set - */ - function Entity(properties) { - this.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]]; - } - - /** - * Entity textAnchor. - * @member {google.cloud.documentai.v1.Document.ITextAnchor|null|undefined} textAnchor - * @memberof google.cloud.documentai.v1.Document.Entity - * @instance - */ - Entity.prototype.textAnchor = null; - - /** - * Entity type. - * @member {string} type - * @memberof google.cloud.documentai.v1.Document.Entity - * @instance - */ - Entity.prototype.type = ""; - - /** - * Entity mentionText. - * @member {string} mentionText - * @memberof google.cloud.documentai.v1.Document.Entity - * @instance - */ - Entity.prototype.mentionText = ""; - - /** - * Entity mentionId. - * @member {string} mentionId - * @memberof google.cloud.documentai.v1.Document.Entity - * @instance - */ - Entity.prototype.mentionId = ""; - - /** - * Entity confidence. - * @member {number} confidence - * @memberof google.cloud.documentai.v1.Document.Entity - * @instance - */ - Entity.prototype.confidence = 0; - - /** - * Entity pageAnchor. - * @member {google.cloud.documentai.v1.Document.IPageAnchor|null|undefined} pageAnchor - * @memberof google.cloud.documentai.v1.Document.Entity - * @instance - */ - Entity.prototype.pageAnchor = null; - - /** - * Entity id. - * @member {string} id - * @memberof google.cloud.documentai.v1.Document.Entity - * @instance - */ - Entity.prototype.id = ""; - - /** - * Entity normalizedValue. - * @member {google.cloud.documentai.v1.Document.Entity.INormalizedValue|null|undefined} normalizedValue - * @memberof google.cloud.documentai.v1.Document.Entity - * @instance - */ - Entity.prototype.normalizedValue = null; - - /** - * Entity properties. - * @member {Array.} properties - * @memberof google.cloud.documentai.v1.Document.Entity - * @instance - */ - Entity.prototype.properties = $util.emptyArray; - - /** - * Entity provenance. - * @member {google.cloud.documentai.v1.Document.IProvenance|null|undefined} provenance - * @memberof google.cloud.documentai.v1.Document.Entity - * @instance - */ - Entity.prototype.provenance = null; - - /** - * Entity redacted. - * @member {boolean} redacted - * @memberof google.cloud.documentai.v1.Document.Entity - * @instance - */ - Entity.prototype.redacted = false; - - /** - * Entity method. - * @member {google.cloud.documentai.v1.Document.Entity.Method} method - * @memberof google.cloud.documentai.v1.Document.Entity - * @instance - */ - Entity.prototype.method = 0; - - /** - * Creates a new Entity instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.Entity - * @static - * @param {google.cloud.documentai.v1.Document.IEntity=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.Entity} Entity instance - */ - Entity.create = function create(properties) { - return new Entity(properties); - }; - - /** - * Encodes the specified Entity message. Does not implicitly {@link google.cloud.documentai.v1.Document.Entity.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.Entity - * @static - * @param {google.cloud.documentai.v1.Document.IEntity} message Entity message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Entity.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.textAnchor != null && Object.hasOwnProperty.call(message, "textAnchor")) - $root.google.cloud.documentai.v1.Document.TextAnchor.encode(message.textAnchor, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); - if (message.mentionText != null && Object.hasOwnProperty.call(message, "mentionText")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.mentionText); - if (message.mentionId != null && Object.hasOwnProperty.call(message, "mentionId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.mentionId); - if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) - writer.uint32(/* id 5, wireType 5 =*/45).float(message.confidence); - if (message.pageAnchor != null && Object.hasOwnProperty.call(message, "pageAnchor")) - $root.google.cloud.documentai.v1.Document.PageAnchor.encode(message.pageAnchor, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.id); - if (message.normalizedValue != null && Object.hasOwnProperty.call(message, "normalizedValue")) - $root.google.cloud.documentai.v1.Document.Entity.NormalizedValue.encode(message.normalizedValue, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.properties != null && message.properties.length) - for (var i = 0; i < message.properties.length; ++i) - $root.google.cloud.documentai.v1.Document.Entity.encode(message.properties[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.provenance != null && Object.hasOwnProperty.call(message, "provenance")) - $root.google.cloud.documentai.v1.Document.Provenance.encode(message.provenance, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.redacted != null && Object.hasOwnProperty.call(message, "redacted")) - writer.uint32(/* id 12, wireType 0 =*/96).bool(message.redacted); - if (message.method != null && Object.hasOwnProperty.call(message, "method")) - writer.uint32(/* id 15, wireType 0 =*/120).int32(message.method); - return writer; - }; - - /** - * Encodes the specified Entity message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Entity.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.Entity - * @static - * @param {google.cloud.documentai.v1.Document.IEntity} message Entity message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Entity.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Entity message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document.Entity - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.Entity} Entity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Entity.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Entity(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.textAnchor = $root.google.cloud.documentai.v1.Document.TextAnchor.decode(reader, reader.uint32()); - break; - } - case 2: { - message.type = reader.string(); - break; - } - case 3: { - message.mentionText = reader.string(); - break; - } - case 4: { - message.mentionId = reader.string(); - break; - } - case 5: { - message.confidence = reader.float(); - break; - } - case 6: { - message.pageAnchor = $root.google.cloud.documentai.v1.Document.PageAnchor.decode(reader, reader.uint32()); - break; - } - case 7: { - message.id = reader.string(); - break; - } - case 9: { - message.normalizedValue = $root.google.cloud.documentai.v1.Document.Entity.NormalizedValue.decode(reader, reader.uint32()); - break; - } - case 10: { - if (!(message.properties && message.properties.length)) - message.properties = []; - message.properties.push($root.google.cloud.documentai.v1.Document.Entity.decode(reader, reader.uint32())); - break; - } - case 11: { - message.provenance = $root.google.cloud.documentai.v1.Document.Provenance.decode(reader, reader.uint32()); - break; - } - case 12: { - message.redacted = reader.bool(); - break; - } - case 15: { - message.method = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Entity message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document.Entity - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.Entity} Entity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Entity.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Entity message. - * @function verify - * @memberof google.cloud.documentai.v1.Document.Entity - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Entity.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.textAnchor != null && message.hasOwnProperty("textAnchor")) { - var error = $root.google.cloud.documentai.v1.Document.TextAnchor.verify(message.textAnchor); - if (error) - return "textAnchor." + error; - } - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.mentionText != null && message.hasOwnProperty("mentionText")) - if (!$util.isString(message.mentionText)) - return "mentionText: string expected"; - if (message.mentionId != null && message.hasOwnProperty("mentionId")) - if (!$util.isString(message.mentionId)) - return "mentionId: string expected"; - if (message.confidence != null && message.hasOwnProperty("confidence")) - if (typeof message.confidence !== "number") - return "confidence: number expected"; - if (message.pageAnchor != null && message.hasOwnProperty("pageAnchor")) { - var error = $root.google.cloud.documentai.v1.Document.PageAnchor.verify(message.pageAnchor); - if (error) - return "pageAnchor." + error; - } - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; - if (message.normalizedValue != null && message.hasOwnProperty("normalizedValue")) { - var error = $root.google.cloud.documentai.v1.Document.Entity.NormalizedValue.verify(message.normalizedValue); - if (error) - return "normalizedValue." + error; - } - if (message.properties != null && message.hasOwnProperty("properties")) { - if (!Array.isArray(message.properties)) - return "properties: array expected"; - for (var i = 0; i < message.properties.length; ++i) { - var error = $root.google.cloud.documentai.v1.Document.Entity.verify(message.properties[i]); - if (error) - return "properties." + error; - } - } - if (message.provenance != null && message.hasOwnProperty("provenance")) { - var error = $root.google.cloud.documentai.v1.Document.Provenance.verify(message.provenance); - if (error) - return "provenance." + error; - } - if (message.redacted != null && message.hasOwnProperty("redacted")) - if (typeof message.redacted !== "boolean") - return "redacted: boolean expected"; - if (message.method != null && message.hasOwnProperty("method")) - switch (message.method) { - default: - return "method: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates an Entity message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.Entity - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.Entity} Entity - */ - Entity.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.Entity) - return object; - var message = new $root.google.cloud.documentai.v1.Document.Entity(); - if (object.textAnchor != null) { - if (typeof object.textAnchor !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Entity.textAnchor: object expected"); - message.textAnchor = $root.google.cloud.documentai.v1.Document.TextAnchor.fromObject(object.textAnchor); - } - if (object.type != null) - message.type = String(object.type); - if (object.mentionText != null) - message.mentionText = String(object.mentionText); - if (object.mentionId != null) - message.mentionId = String(object.mentionId); - if (object.confidence != null) - message.confidence = Number(object.confidence); - if (object.pageAnchor != null) { - if (typeof object.pageAnchor !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Entity.pageAnchor: object expected"); - message.pageAnchor = $root.google.cloud.documentai.v1.Document.PageAnchor.fromObject(object.pageAnchor); - } - if (object.id != null) - message.id = String(object.id); - if (object.normalizedValue != null) { - if (typeof object.normalizedValue !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Entity.normalizedValue: object expected"); - message.normalizedValue = $root.google.cloud.documentai.v1.Document.Entity.NormalizedValue.fromObject(object.normalizedValue); - } - if (object.properties) { - if (!Array.isArray(object.properties)) - throw TypeError(".google.cloud.documentai.v1.Document.Entity.properties: array expected"); - message.properties = []; - for (var i = 0; i < object.properties.length; ++i) { - if (typeof object.properties[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Entity.properties: object expected"); - message.properties[i] = $root.google.cloud.documentai.v1.Document.Entity.fromObject(object.properties[i]); - } - } - if (object.provenance != null) { - if (typeof object.provenance !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Entity.provenance: object expected"); - message.provenance = $root.google.cloud.documentai.v1.Document.Provenance.fromObject(object.provenance); - } - if (object.redacted != null) - message.redacted = Boolean(object.redacted); - switch (object.method) { - default: - if (typeof object.method === "number") { - message.method = object.method; - break; - } - break; - case "METHOD_UNSPECIFIED": - case 0: - message.method = 0; - break; - case "EXTRACT": - case 1: - message.method = 1; - break; - case "DERIVE": - case 2: - message.method = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from an Entity message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.Entity - * @static - * @param {google.cloud.documentai.v1.Document.Entity} message Entity - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Entity.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.properties = []; - if (options.defaults) { - object.textAnchor = null; - object.type = ""; - object.mentionText = ""; - object.mentionId = ""; - object.confidence = 0; - object.pageAnchor = null; - object.id = ""; - object.normalizedValue = null; - object.provenance = null; - object.redacted = false; - object.method = options.enums === String ? "METHOD_UNSPECIFIED" : 0; - } - if (message.textAnchor != null && message.hasOwnProperty("textAnchor")) - object.textAnchor = $root.google.cloud.documentai.v1.Document.TextAnchor.toObject(message.textAnchor, options); - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.mentionText != null && message.hasOwnProperty("mentionText")) - object.mentionText = message.mentionText; - if (message.mentionId != null && message.hasOwnProperty("mentionId")) - object.mentionId = message.mentionId; - if (message.confidence != null && message.hasOwnProperty("confidence")) - object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; - if (message.pageAnchor != null && message.hasOwnProperty("pageAnchor")) - object.pageAnchor = $root.google.cloud.documentai.v1.Document.PageAnchor.toObject(message.pageAnchor, options); - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.normalizedValue != null && message.hasOwnProperty("normalizedValue")) - object.normalizedValue = $root.google.cloud.documentai.v1.Document.Entity.NormalizedValue.toObject(message.normalizedValue, options); - if (message.properties && message.properties.length) { - object.properties = []; - for (var j = 0; j < message.properties.length; ++j) - object.properties[j] = $root.google.cloud.documentai.v1.Document.Entity.toObject(message.properties[j], options); - } - if (message.provenance != null && message.hasOwnProperty("provenance")) - object.provenance = $root.google.cloud.documentai.v1.Document.Provenance.toObject(message.provenance, options); - if (message.redacted != null && message.hasOwnProperty("redacted")) - object.redacted = message.redacted; - if (message.method != null && message.hasOwnProperty("method")) - object.method = options.enums === String ? $root.google.cloud.documentai.v1.Document.Entity.Method[message.method] === undefined ? message.method : $root.google.cloud.documentai.v1.Document.Entity.Method[message.method] : message.method; - return object; - }; - - /** - * Converts this Entity to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.Entity - * @instance - * @returns {Object.} JSON object - */ - Entity.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Entity - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.Entity - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Entity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Entity"; - }; - - Entity.NormalizedValue = (function() { - - /** - * Properties of a NormalizedValue. - * @memberof google.cloud.documentai.v1.Document.Entity - * @interface INormalizedValue - * @property {google.type.IMoney|null} [moneyValue] NormalizedValue moneyValue - * @property {google.type.IDate|null} [dateValue] NormalizedValue dateValue - * @property {google.type.IDateTime|null} [datetimeValue] NormalizedValue datetimeValue - * @property {google.type.IPostalAddress|null} [addressValue] NormalizedValue addressValue - * @property {boolean|null} [booleanValue] NormalizedValue booleanValue - * @property {number|null} [integerValue] NormalizedValue integerValue - * @property {number|null} [floatValue] NormalizedValue floatValue - * @property {boolean|null} [signatureValue] NormalizedValue signatureValue - * @property {string|null} [text] NormalizedValue text - */ - - /** - * Constructs a new NormalizedValue. - * @memberof google.cloud.documentai.v1.Document.Entity - * @classdesc Represents a NormalizedValue. - * @implements INormalizedValue - * @constructor - * @param {google.cloud.documentai.v1.Document.Entity.INormalizedValue=} [properties] Properties to set - */ - function NormalizedValue(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]]; - } - - /** - * NormalizedValue moneyValue. - * @member {google.type.IMoney|null|undefined} moneyValue - * @memberof google.cloud.documentai.v1.Document.Entity.NormalizedValue - * @instance - */ - NormalizedValue.prototype.moneyValue = null; - - /** - * NormalizedValue dateValue. - * @member {google.type.IDate|null|undefined} dateValue - * @memberof google.cloud.documentai.v1.Document.Entity.NormalizedValue - * @instance - */ - NormalizedValue.prototype.dateValue = null; - - /** - * NormalizedValue datetimeValue. - * @member {google.type.IDateTime|null|undefined} datetimeValue - * @memberof google.cloud.documentai.v1.Document.Entity.NormalizedValue - * @instance - */ - NormalizedValue.prototype.datetimeValue = null; - - /** - * NormalizedValue addressValue. - * @member {google.type.IPostalAddress|null|undefined} addressValue - * @memberof google.cloud.documentai.v1.Document.Entity.NormalizedValue - * @instance - */ - NormalizedValue.prototype.addressValue = null; - - /** - * NormalizedValue booleanValue. - * @member {boolean|null|undefined} booleanValue - * @memberof google.cloud.documentai.v1.Document.Entity.NormalizedValue - * @instance - */ - NormalizedValue.prototype.booleanValue = null; - - /** - * NormalizedValue integerValue. - * @member {number|null|undefined} integerValue - * @memberof google.cloud.documentai.v1.Document.Entity.NormalizedValue - * @instance - */ - NormalizedValue.prototype.integerValue = null; - - /** - * NormalizedValue floatValue. - * @member {number|null|undefined} floatValue - * @memberof google.cloud.documentai.v1.Document.Entity.NormalizedValue - * @instance - */ - NormalizedValue.prototype.floatValue = null; - - /** - * NormalizedValue signatureValue. - * @member {boolean|null|undefined} signatureValue - * @memberof google.cloud.documentai.v1.Document.Entity.NormalizedValue - * @instance - */ - NormalizedValue.prototype.signatureValue = null; - - /** - * NormalizedValue text. - * @member {string} text - * @memberof google.cloud.documentai.v1.Document.Entity.NormalizedValue - * @instance - */ - NormalizedValue.prototype.text = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * NormalizedValue structuredValue. - * @member {"moneyValue"|"dateValue"|"datetimeValue"|"addressValue"|"booleanValue"|"integerValue"|"floatValue"|"signatureValue"|undefined} structuredValue - * @memberof google.cloud.documentai.v1.Document.Entity.NormalizedValue - * @instance - */ - Object.defineProperty(NormalizedValue.prototype, "structuredValue", { - get: $util.oneOfGetter($oneOfFields = ["moneyValue", "dateValue", "datetimeValue", "addressValue", "booleanValue", "integerValue", "floatValue", "signatureValue"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new NormalizedValue instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.Entity.NormalizedValue - * @static - * @param {google.cloud.documentai.v1.Document.Entity.INormalizedValue=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.Entity.NormalizedValue} NormalizedValue instance - */ - NormalizedValue.create = function create(properties) { - return new NormalizedValue(properties); - }; - - /** - * Encodes the specified NormalizedValue message. Does not implicitly {@link google.cloud.documentai.v1.Document.Entity.NormalizedValue.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.Entity.NormalizedValue - * @static - * @param {google.cloud.documentai.v1.Document.Entity.INormalizedValue} message NormalizedValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NormalizedValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.text != null && Object.hasOwnProperty.call(message, "text")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); - if (message.moneyValue != null && Object.hasOwnProperty.call(message, "moneyValue")) - $root.google.type.Money.encode(message.moneyValue, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.dateValue != null && Object.hasOwnProperty.call(message, "dateValue")) - $root.google.type.Date.encode(message.dateValue, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.datetimeValue != null && Object.hasOwnProperty.call(message, "datetimeValue")) - $root.google.type.DateTime.encode(message.datetimeValue, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.addressValue != null && Object.hasOwnProperty.call(message, "addressValue")) - $root.google.type.PostalAddress.encode(message.addressValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.booleanValue != null && Object.hasOwnProperty.call(message, "booleanValue")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.booleanValue); - if (message.integerValue != null && Object.hasOwnProperty.call(message, "integerValue")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.integerValue); - if (message.floatValue != null && Object.hasOwnProperty.call(message, "floatValue")) - writer.uint32(/* id 8, wireType 5 =*/69).float(message.floatValue); - if (message.signatureValue != null && Object.hasOwnProperty.call(message, "signatureValue")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.signatureValue); - return writer; - }; - - /** - * Encodes the specified NormalizedValue message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Entity.NormalizedValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.Entity.NormalizedValue - * @static - * @param {google.cloud.documentai.v1.Document.Entity.INormalizedValue} message NormalizedValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NormalizedValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NormalizedValue message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document.Entity.NormalizedValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.Entity.NormalizedValue} NormalizedValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NormalizedValue.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Entity.NormalizedValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.moneyValue = $root.google.type.Money.decode(reader, reader.uint32()); - break; - } - case 3: { - message.dateValue = $root.google.type.Date.decode(reader, reader.uint32()); - break; - } - case 4: { - message.datetimeValue = $root.google.type.DateTime.decode(reader, reader.uint32()); - break; - } - case 5: { - message.addressValue = $root.google.type.PostalAddress.decode(reader, reader.uint32()); - break; - } - case 6: { - message.booleanValue = reader.bool(); - break; - } - case 7: { - message.integerValue = reader.int32(); - break; - } - case 8: { - message.floatValue = reader.float(); - break; - } - case 10: { - message.signatureValue = reader.bool(); - break; - } - case 1: { - message.text = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NormalizedValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document.Entity.NormalizedValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.Entity.NormalizedValue} NormalizedValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NormalizedValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NormalizedValue message. - * @function verify - * @memberof google.cloud.documentai.v1.Document.Entity.NormalizedValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NormalizedValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.moneyValue != null && message.hasOwnProperty("moneyValue")) { - properties.structuredValue = 1; - { - var error = $root.google.type.Money.verify(message.moneyValue); - if (error) - return "moneyValue." + error; - } - } - if (message.dateValue != null && message.hasOwnProperty("dateValue")) { - if (properties.structuredValue === 1) - return "structuredValue: multiple values"; - properties.structuredValue = 1; - { - var error = $root.google.type.Date.verify(message.dateValue); - if (error) - return "dateValue." + error; - } - } - if (message.datetimeValue != null && message.hasOwnProperty("datetimeValue")) { - if (properties.structuredValue === 1) - return "structuredValue: multiple values"; - properties.structuredValue = 1; - { - var error = $root.google.type.DateTime.verify(message.datetimeValue); - if (error) - return "datetimeValue." + error; - } - } - if (message.addressValue != null && message.hasOwnProperty("addressValue")) { - if (properties.structuredValue === 1) - return "structuredValue: multiple values"; - properties.structuredValue = 1; - { - var error = $root.google.type.PostalAddress.verify(message.addressValue); - if (error) - return "addressValue." + error; - } - } - if (message.booleanValue != null && message.hasOwnProperty("booleanValue")) { - if (properties.structuredValue === 1) - return "structuredValue: multiple values"; - properties.structuredValue = 1; - if (typeof message.booleanValue !== "boolean") - return "booleanValue: boolean expected"; - } - if (message.integerValue != null && message.hasOwnProperty("integerValue")) { - if (properties.structuredValue === 1) - return "structuredValue: multiple values"; - properties.structuredValue = 1; - if (!$util.isInteger(message.integerValue)) - return "integerValue: integer expected"; - } - if (message.floatValue != null && message.hasOwnProperty("floatValue")) { - if (properties.structuredValue === 1) - return "structuredValue: multiple values"; - properties.structuredValue = 1; - if (typeof message.floatValue !== "number") - return "floatValue: number expected"; - } - if (message.signatureValue != null && message.hasOwnProperty("signatureValue")) { - if (properties.structuredValue === 1) - return "structuredValue: multiple values"; - properties.structuredValue = 1; - if (typeof message.signatureValue !== "boolean") - return "signatureValue: boolean expected"; - } - if (message.text != null && message.hasOwnProperty("text")) - if (!$util.isString(message.text)) - return "text: string expected"; - return null; - }; - - /** - * Creates a NormalizedValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.Entity.NormalizedValue - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.Entity.NormalizedValue} NormalizedValue - */ - NormalizedValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.Entity.NormalizedValue) - return object; - var message = new $root.google.cloud.documentai.v1.Document.Entity.NormalizedValue(); - if (object.moneyValue != null) { - if (typeof object.moneyValue !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Entity.NormalizedValue.moneyValue: object expected"); - message.moneyValue = $root.google.type.Money.fromObject(object.moneyValue); - } - if (object.dateValue != null) { - if (typeof object.dateValue !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Entity.NormalizedValue.dateValue: object expected"); - message.dateValue = $root.google.type.Date.fromObject(object.dateValue); - } - if (object.datetimeValue != null) { - if (typeof object.datetimeValue !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Entity.NormalizedValue.datetimeValue: object expected"); - message.datetimeValue = $root.google.type.DateTime.fromObject(object.datetimeValue); - } - if (object.addressValue != null) { - if (typeof object.addressValue !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Entity.NormalizedValue.addressValue: object expected"); - message.addressValue = $root.google.type.PostalAddress.fromObject(object.addressValue); - } - if (object.booleanValue != null) - message.booleanValue = Boolean(object.booleanValue); - if (object.integerValue != null) - message.integerValue = object.integerValue | 0; - if (object.floatValue != null) - message.floatValue = Number(object.floatValue); - if (object.signatureValue != null) - message.signatureValue = Boolean(object.signatureValue); - if (object.text != null) - message.text = String(object.text); - return message; - }; - - /** - * Creates a plain object from a NormalizedValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.Entity.NormalizedValue - * @static - * @param {google.cloud.documentai.v1.Document.Entity.NormalizedValue} message NormalizedValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NormalizedValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.text = ""; - if (message.text != null && message.hasOwnProperty("text")) - object.text = message.text; - if (message.moneyValue != null && message.hasOwnProperty("moneyValue")) { - object.moneyValue = $root.google.type.Money.toObject(message.moneyValue, options); - if (options.oneofs) - object.structuredValue = "moneyValue"; - } - if (message.dateValue != null && message.hasOwnProperty("dateValue")) { - object.dateValue = $root.google.type.Date.toObject(message.dateValue, options); - if (options.oneofs) - object.structuredValue = "dateValue"; - } - if (message.datetimeValue != null && message.hasOwnProperty("datetimeValue")) { - object.datetimeValue = $root.google.type.DateTime.toObject(message.datetimeValue, options); - if (options.oneofs) - object.structuredValue = "datetimeValue"; - } - if (message.addressValue != null && message.hasOwnProperty("addressValue")) { - object.addressValue = $root.google.type.PostalAddress.toObject(message.addressValue, options); - if (options.oneofs) - object.structuredValue = "addressValue"; - } - if (message.booleanValue != null && message.hasOwnProperty("booleanValue")) { - object.booleanValue = message.booleanValue; - if (options.oneofs) - object.structuredValue = "booleanValue"; - } - if (message.integerValue != null && message.hasOwnProperty("integerValue")) { - object.integerValue = message.integerValue; - if (options.oneofs) - object.structuredValue = "integerValue"; - } - if (message.floatValue != null && message.hasOwnProperty("floatValue")) { - object.floatValue = options.json && !isFinite(message.floatValue) ? String(message.floatValue) : message.floatValue; - if (options.oneofs) - object.structuredValue = "floatValue"; - } - if (message.signatureValue != null && message.hasOwnProperty("signatureValue")) { - object.signatureValue = message.signatureValue; - if (options.oneofs) - object.structuredValue = "signatureValue"; - } - return object; - }; - - /** - * Converts this NormalizedValue to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.Entity.NormalizedValue - * @instance - * @returns {Object.} JSON object - */ - NormalizedValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NormalizedValue - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.Entity.NormalizedValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NormalizedValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Entity.NormalizedValue"; - }; - - return NormalizedValue; - })(); - - /** - * Method enum. - * @name google.cloud.documentai.v1.Document.Entity.Method - * @enum {number} - * @property {number} METHOD_UNSPECIFIED=0 METHOD_UNSPECIFIED value - * @property {number} EXTRACT=1 EXTRACT value - * @property {number} DERIVE=2 DERIVE value - */ - Entity.Method = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "METHOD_UNSPECIFIED"] = 0; - values[valuesById[1] = "EXTRACT"] = 1; - values[valuesById[2] = "DERIVE"] = 2; - return values; - })(); - - return Entity; - })(); - - Document.EntityRelation = (function() { - - /** - * Properties of an EntityRelation. - * @memberof google.cloud.documentai.v1.Document - * @interface IEntityRelation - * @property {string|null} [subjectId] EntityRelation subjectId - * @property {string|null} [objectId] EntityRelation objectId - * @property {string|null} [relation] EntityRelation relation - */ - - /** - * Constructs a new EntityRelation. - * @memberof google.cloud.documentai.v1.Document - * @classdesc Represents an EntityRelation. - * @implements IEntityRelation - * @constructor - * @param {google.cloud.documentai.v1.Document.IEntityRelation=} [properties] Properties to set - */ - function EntityRelation(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]]; - } - - /** - * EntityRelation subjectId. - * @member {string} subjectId - * @memberof google.cloud.documentai.v1.Document.EntityRelation - * @instance - */ - EntityRelation.prototype.subjectId = ""; - - /** - * EntityRelation objectId. - * @member {string} objectId - * @memberof google.cloud.documentai.v1.Document.EntityRelation - * @instance - */ - EntityRelation.prototype.objectId = ""; - - /** - * EntityRelation relation. - * @member {string} relation - * @memberof google.cloud.documentai.v1.Document.EntityRelation - * @instance - */ - EntityRelation.prototype.relation = ""; - - /** - * Creates a new EntityRelation instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.EntityRelation - * @static - * @param {google.cloud.documentai.v1.Document.IEntityRelation=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.EntityRelation} EntityRelation instance - */ - EntityRelation.create = function create(properties) { - return new EntityRelation(properties); - }; - - /** - * Encodes the specified EntityRelation message. Does not implicitly {@link google.cloud.documentai.v1.Document.EntityRelation.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.EntityRelation - * @static - * @param {google.cloud.documentai.v1.Document.IEntityRelation} message EntityRelation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EntityRelation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.subjectId != null && Object.hasOwnProperty.call(message, "subjectId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.subjectId); - if (message.objectId != null && Object.hasOwnProperty.call(message, "objectId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.objectId); - if (message.relation != null && Object.hasOwnProperty.call(message, "relation")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.relation); - return writer; - }; - - /** - * Encodes the specified EntityRelation message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.EntityRelation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.EntityRelation - * @static - * @param {google.cloud.documentai.v1.Document.IEntityRelation} message EntityRelation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EntityRelation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EntityRelation message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document.EntityRelation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.EntityRelation} EntityRelation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EntityRelation.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.EntityRelation(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.subjectId = reader.string(); - break; - } - case 2: { - message.objectId = reader.string(); - break; - } - case 3: { - message.relation = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EntityRelation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document.EntityRelation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.EntityRelation} EntityRelation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EntityRelation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EntityRelation message. - * @function verify - * @memberof google.cloud.documentai.v1.Document.EntityRelation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EntityRelation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.subjectId != null && message.hasOwnProperty("subjectId")) - if (!$util.isString(message.subjectId)) - return "subjectId: string expected"; - if (message.objectId != null && message.hasOwnProperty("objectId")) - if (!$util.isString(message.objectId)) - return "objectId: string expected"; - if (message.relation != null && message.hasOwnProperty("relation")) - if (!$util.isString(message.relation)) - return "relation: string expected"; - return null; - }; - - /** - * Creates an EntityRelation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.EntityRelation - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.EntityRelation} EntityRelation - */ - EntityRelation.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.EntityRelation) - return object; - var message = new $root.google.cloud.documentai.v1.Document.EntityRelation(); - if (object.subjectId != null) - message.subjectId = String(object.subjectId); - if (object.objectId != null) - message.objectId = String(object.objectId); - if (object.relation != null) - message.relation = String(object.relation); - return message; - }; - - /** - * Creates a plain object from an EntityRelation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.EntityRelation - * @static - * @param {google.cloud.documentai.v1.Document.EntityRelation} message EntityRelation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EntityRelation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.subjectId = ""; - object.objectId = ""; - object.relation = ""; - } - if (message.subjectId != null && message.hasOwnProperty("subjectId")) - object.subjectId = message.subjectId; - if (message.objectId != null && message.hasOwnProperty("objectId")) - object.objectId = message.objectId; - if (message.relation != null && message.hasOwnProperty("relation")) - object.relation = message.relation; - return object; - }; - - /** - * Converts this EntityRelation to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.EntityRelation - * @instance - * @returns {Object.} JSON object - */ - EntityRelation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EntityRelation - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.EntityRelation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EntityRelation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.EntityRelation"; - }; - - return EntityRelation; - })(); - - Document.TextAnchor = (function() { - - /** - * Properties of a TextAnchor. - * @memberof google.cloud.documentai.v1.Document - * @interface ITextAnchor - * @property {Array.|null} [textSegments] TextAnchor textSegments - * @property {string|null} [content] TextAnchor content - */ - - /** - * Constructs a new TextAnchor. - * @memberof google.cloud.documentai.v1.Document - * @classdesc Represents a TextAnchor. - * @implements ITextAnchor - * @constructor - * @param {google.cloud.documentai.v1.Document.ITextAnchor=} [properties] Properties to set - */ - function TextAnchor(properties) { - this.textSegments = []; - 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]]; - } - - /** - * TextAnchor textSegments. - * @member {Array.} textSegments - * @memberof google.cloud.documentai.v1.Document.TextAnchor - * @instance - */ - TextAnchor.prototype.textSegments = $util.emptyArray; - - /** - * TextAnchor content. - * @member {string} content - * @memberof google.cloud.documentai.v1.Document.TextAnchor - * @instance - */ - TextAnchor.prototype.content = ""; - - /** - * Creates a new TextAnchor instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.TextAnchor - * @static - * @param {google.cloud.documentai.v1.Document.ITextAnchor=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.TextAnchor} TextAnchor instance - */ - TextAnchor.create = function create(properties) { - return new TextAnchor(properties); - }; - - /** - * Encodes the specified TextAnchor message. Does not implicitly {@link google.cloud.documentai.v1.Document.TextAnchor.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.TextAnchor - * @static - * @param {google.cloud.documentai.v1.Document.ITextAnchor} message TextAnchor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TextAnchor.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.textSegments != null && message.textSegments.length) - for (var i = 0; i < message.textSegments.length; ++i) - $root.google.cloud.documentai.v1.Document.TextAnchor.TextSegment.encode(message.textSegments[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.content != null && Object.hasOwnProperty.call(message, "content")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.content); - return writer; - }; - - /** - * Encodes the specified TextAnchor message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.TextAnchor.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.TextAnchor - * @static - * @param {google.cloud.documentai.v1.Document.ITextAnchor} message TextAnchor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TextAnchor.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TextAnchor message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document.TextAnchor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.TextAnchor} TextAnchor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TextAnchor.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.TextAnchor(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.textSegments && message.textSegments.length)) - message.textSegments = []; - message.textSegments.push($root.google.cloud.documentai.v1.Document.TextAnchor.TextSegment.decode(reader, reader.uint32())); - break; - } - case 2: { - message.content = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TextAnchor message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document.TextAnchor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.TextAnchor} TextAnchor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TextAnchor.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TextAnchor message. - * @function verify - * @memberof google.cloud.documentai.v1.Document.TextAnchor - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TextAnchor.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.textSegments != null && message.hasOwnProperty("textSegments")) { - if (!Array.isArray(message.textSegments)) - return "textSegments: array expected"; - for (var i = 0; i < message.textSegments.length; ++i) { - var error = $root.google.cloud.documentai.v1.Document.TextAnchor.TextSegment.verify(message.textSegments[i]); - if (error) - return "textSegments." + error; - } - } - if (message.content != null && message.hasOwnProperty("content")) - if (!$util.isString(message.content)) - return "content: string expected"; - return null; - }; - - /** - * Creates a TextAnchor message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.TextAnchor - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.TextAnchor} TextAnchor - */ - TextAnchor.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.TextAnchor) - return object; - var message = new $root.google.cloud.documentai.v1.Document.TextAnchor(); - if (object.textSegments) { - if (!Array.isArray(object.textSegments)) - throw TypeError(".google.cloud.documentai.v1.Document.TextAnchor.textSegments: array expected"); - message.textSegments = []; - for (var i = 0; i < object.textSegments.length; ++i) { - if (typeof object.textSegments[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.TextAnchor.textSegments: object expected"); - message.textSegments[i] = $root.google.cloud.documentai.v1.Document.TextAnchor.TextSegment.fromObject(object.textSegments[i]); - } - } - if (object.content != null) - message.content = String(object.content); - return message; - }; - - /** - * Creates a plain object from a TextAnchor message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.TextAnchor - * @static - * @param {google.cloud.documentai.v1.Document.TextAnchor} message TextAnchor - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TextAnchor.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.textSegments = []; - if (options.defaults) - object.content = ""; - if (message.textSegments && message.textSegments.length) { - object.textSegments = []; - for (var j = 0; j < message.textSegments.length; ++j) - object.textSegments[j] = $root.google.cloud.documentai.v1.Document.TextAnchor.TextSegment.toObject(message.textSegments[j], options); - } - if (message.content != null && message.hasOwnProperty("content")) - object.content = message.content; - return object; - }; - - /** - * Converts this TextAnchor to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.TextAnchor - * @instance - * @returns {Object.} JSON object - */ - TextAnchor.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TextAnchor - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.TextAnchor - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TextAnchor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.TextAnchor"; - }; - - TextAnchor.TextSegment = (function() { - - /** - * Properties of a TextSegment. - * @memberof google.cloud.documentai.v1.Document.TextAnchor - * @interface ITextSegment - * @property {number|Long|null} [startIndex] TextSegment startIndex - * @property {number|Long|null} [endIndex] TextSegment endIndex - */ - - /** - * Constructs a new TextSegment. - * @memberof google.cloud.documentai.v1.Document.TextAnchor - * @classdesc Represents a TextSegment. - * @implements ITextSegment - * @constructor - * @param {google.cloud.documentai.v1.Document.TextAnchor.ITextSegment=} [properties] Properties to set - */ - function TextSegment(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]]; - } - - /** - * TextSegment startIndex. - * @member {number|Long} startIndex - * @memberof google.cloud.documentai.v1.Document.TextAnchor.TextSegment - * @instance - */ - TextSegment.prototype.startIndex = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * TextSegment endIndex. - * @member {number|Long} endIndex - * @memberof google.cloud.documentai.v1.Document.TextAnchor.TextSegment - * @instance - */ - TextSegment.prototype.endIndex = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new TextSegment instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.TextAnchor.TextSegment - * @static - * @param {google.cloud.documentai.v1.Document.TextAnchor.ITextSegment=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.TextAnchor.TextSegment} TextSegment instance - */ - TextSegment.create = function create(properties) { - return new TextSegment(properties); - }; - - /** - * Encodes the specified TextSegment message. Does not implicitly {@link google.cloud.documentai.v1.Document.TextAnchor.TextSegment.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.TextAnchor.TextSegment - * @static - * @param {google.cloud.documentai.v1.Document.TextAnchor.ITextSegment} message TextSegment message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TextSegment.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startIndex != null && Object.hasOwnProperty.call(message, "startIndex")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.startIndex); - if (message.endIndex != null && Object.hasOwnProperty.call(message, "endIndex")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.endIndex); - return writer; - }; - - /** - * Encodes the specified TextSegment message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.TextAnchor.TextSegment.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.TextAnchor.TextSegment - * @static - * @param {google.cloud.documentai.v1.Document.TextAnchor.ITextSegment} message TextSegment message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TextSegment.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TextSegment message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document.TextAnchor.TextSegment - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.TextAnchor.TextSegment} TextSegment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TextSegment.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.TextAnchor.TextSegment(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.startIndex = reader.int64(); - break; - } - case 2: { - message.endIndex = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TextSegment message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document.TextAnchor.TextSegment - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.TextAnchor.TextSegment} TextSegment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TextSegment.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TextSegment message. - * @function verify - * @memberof google.cloud.documentai.v1.Document.TextAnchor.TextSegment - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TextSegment.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.startIndex != null && message.hasOwnProperty("startIndex")) - if (!$util.isInteger(message.startIndex) && !(message.startIndex && $util.isInteger(message.startIndex.low) && $util.isInteger(message.startIndex.high))) - return "startIndex: integer|Long expected"; - if (message.endIndex != null && message.hasOwnProperty("endIndex")) - if (!$util.isInteger(message.endIndex) && !(message.endIndex && $util.isInteger(message.endIndex.low) && $util.isInteger(message.endIndex.high))) - return "endIndex: integer|Long expected"; - return null; - }; - - /** - * Creates a TextSegment message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.TextAnchor.TextSegment - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.TextAnchor.TextSegment} TextSegment - */ - TextSegment.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.TextAnchor.TextSegment) - return object; - var message = new $root.google.cloud.documentai.v1.Document.TextAnchor.TextSegment(); - if (object.startIndex != null) - if ($util.Long) - (message.startIndex = $util.Long.fromValue(object.startIndex)).unsigned = false; - else if (typeof object.startIndex === "string") - message.startIndex = parseInt(object.startIndex, 10); - else if (typeof object.startIndex === "number") - message.startIndex = object.startIndex; - else if (typeof object.startIndex === "object") - message.startIndex = new $util.LongBits(object.startIndex.low >>> 0, object.startIndex.high >>> 0).toNumber(); - if (object.endIndex != null) - if ($util.Long) - (message.endIndex = $util.Long.fromValue(object.endIndex)).unsigned = false; - else if (typeof object.endIndex === "string") - message.endIndex = parseInt(object.endIndex, 10); - else if (typeof object.endIndex === "number") - message.endIndex = object.endIndex; - else if (typeof object.endIndex === "object") - message.endIndex = new $util.LongBits(object.endIndex.low >>> 0, object.endIndex.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a TextSegment message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.TextAnchor.TextSegment - * @static - * @param {google.cloud.documentai.v1.Document.TextAnchor.TextSegment} message TextSegment - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TextSegment.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.startIndex = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.startIndex = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.endIndex = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.endIndex = options.longs === String ? "0" : 0; - } - if (message.startIndex != null && message.hasOwnProperty("startIndex")) - if (typeof message.startIndex === "number") - object.startIndex = options.longs === String ? String(message.startIndex) : message.startIndex; - else - object.startIndex = options.longs === String ? $util.Long.prototype.toString.call(message.startIndex) : options.longs === Number ? new $util.LongBits(message.startIndex.low >>> 0, message.startIndex.high >>> 0).toNumber() : message.startIndex; - if (message.endIndex != null && message.hasOwnProperty("endIndex")) - if (typeof message.endIndex === "number") - object.endIndex = options.longs === String ? String(message.endIndex) : message.endIndex; - else - object.endIndex = options.longs === String ? $util.Long.prototype.toString.call(message.endIndex) : options.longs === Number ? new $util.LongBits(message.endIndex.low >>> 0, message.endIndex.high >>> 0).toNumber() : message.endIndex; - return object; - }; - - /** - * Converts this TextSegment to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.TextAnchor.TextSegment - * @instance - * @returns {Object.} JSON object - */ - TextSegment.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TextSegment - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.TextAnchor.TextSegment - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TextSegment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.TextAnchor.TextSegment"; - }; - - return TextSegment; - })(); - - return TextAnchor; - })(); - - Document.PageAnchor = (function() { - - /** - * Properties of a PageAnchor. - * @memberof google.cloud.documentai.v1.Document - * @interface IPageAnchor - * @property {Array.|null} [pageRefs] PageAnchor pageRefs - */ - - /** - * Constructs a new PageAnchor. - * @memberof google.cloud.documentai.v1.Document - * @classdesc Represents a PageAnchor. - * @implements IPageAnchor - * @constructor - * @param {google.cloud.documentai.v1.Document.IPageAnchor=} [properties] Properties to set - */ - function PageAnchor(properties) { - this.pageRefs = []; - 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]]; - } - - /** - * PageAnchor pageRefs. - * @member {Array.} pageRefs - * @memberof google.cloud.documentai.v1.Document.PageAnchor - * @instance - */ - PageAnchor.prototype.pageRefs = $util.emptyArray; - - /** - * Creates a new PageAnchor instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.PageAnchor - * @static - * @param {google.cloud.documentai.v1.Document.IPageAnchor=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.PageAnchor} PageAnchor instance - */ - PageAnchor.create = function create(properties) { - return new PageAnchor(properties); - }; - - /** - * Encodes the specified PageAnchor message. Does not implicitly {@link google.cloud.documentai.v1.Document.PageAnchor.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.PageAnchor - * @static - * @param {google.cloud.documentai.v1.Document.IPageAnchor} message PageAnchor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PageAnchor.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pageRefs != null && message.pageRefs.length) - for (var i = 0; i < message.pageRefs.length; ++i) - $root.google.cloud.documentai.v1.Document.PageAnchor.PageRef.encode(message.pageRefs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PageAnchor message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.PageAnchor.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.PageAnchor - * @static - * @param {google.cloud.documentai.v1.Document.IPageAnchor} message PageAnchor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PageAnchor.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PageAnchor message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document.PageAnchor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.PageAnchor} PageAnchor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PageAnchor.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.PageAnchor(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.pageRefs && message.pageRefs.length)) - message.pageRefs = []; - message.pageRefs.push($root.google.cloud.documentai.v1.Document.PageAnchor.PageRef.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PageAnchor message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document.PageAnchor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.PageAnchor} PageAnchor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PageAnchor.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PageAnchor message. - * @function verify - * @memberof google.cloud.documentai.v1.Document.PageAnchor - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PageAnchor.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pageRefs != null && message.hasOwnProperty("pageRefs")) { - if (!Array.isArray(message.pageRefs)) - return "pageRefs: array expected"; - for (var i = 0; i < message.pageRefs.length; ++i) { - var error = $root.google.cloud.documentai.v1.Document.PageAnchor.PageRef.verify(message.pageRefs[i]); - if (error) - return "pageRefs." + error; - } - } - return null; - }; - - /** - * Creates a PageAnchor message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.PageAnchor - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.PageAnchor} PageAnchor - */ - PageAnchor.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.PageAnchor) - return object; - var message = new $root.google.cloud.documentai.v1.Document.PageAnchor(); - if (object.pageRefs) { - if (!Array.isArray(object.pageRefs)) - throw TypeError(".google.cloud.documentai.v1.Document.PageAnchor.pageRefs: array expected"); - message.pageRefs = []; - for (var i = 0; i < object.pageRefs.length; ++i) { - if (typeof object.pageRefs[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.PageAnchor.pageRefs: object expected"); - message.pageRefs[i] = $root.google.cloud.documentai.v1.Document.PageAnchor.PageRef.fromObject(object.pageRefs[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a PageAnchor message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.PageAnchor - * @static - * @param {google.cloud.documentai.v1.Document.PageAnchor} message PageAnchor - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PageAnchor.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.pageRefs = []; - if (message.pageRefs && message.pageRefs.length) { - object.pageRefs = []; - for (var j = 0; j < message.pageRefs.length; ++j) - object.pageRefs[j] = $root.google.cloud.documentai.v1.Document.PageAnchor.PageRef.toObject(message.pageRefs[j], options); - } - return object; - }; - - /** - * Converts this PageAnchor to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.PageAnchor - * @instance - * @returns {Object.} JSON object - */ - PageAnchor.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PageAnchor - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.PageAnchor - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PageAnchor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.PageAnchor"; - }; - - PageAnchor.PageRef = (function() { - - /** - * Properties of a PageRef. - * @memberof google.cloud.documentai.v1.Document.PageAnchor - * @interface IPageRef - * @property {number|Long|null} [page] PageRef page - * @property {google.cloud.documentai.v1.Document.PageAnchor.PageRef.LayoutType|null} [layoutType] PageRef layoutType - * @property {string|null} [layoutId] PageRef layoutId - * @property {google.cloud.documentai.v1.IBoundingPoly|null} [boundingPoly] PageRef boundingPoly - * @property {number|null} [confidence] PageRef confidence - */ - - /** - * Constructs a new PageRef. - * @memberof google.cloud.documentai.v1.Document.PageAnchor - * @classdesc Represents a PageRef. - * @implements IPageRef - * @constructor - * @param {google.cloud.documentai.v1.Document.PageAnchor.IPageRef=} [properties] Properties to set - */ - function PageRef(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]]; - } - - /** - * PageRef page. - * @member {number|Long} page - * @memberof google.cloud.documentai.v1.Document.PageAnchor.PageRef - * @instance - */ - PageRef.prototype.page = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * PageRef layoutType. - * @member {google.cloud.documentai.v1.Document.PageAnchor.PageRef.LayoutType} layoutType - * @memberof google.cloud.documentai.v1.Document.PageAnchor.PageRef - * @instance - */ - PageRef.prototype.layoutType = 0; - - /** - * PageRef layoutId. - * @member {string} layoutId - * @memberof google.cloud.documentai.v1.Document.PageAnchor.PageRef - * @instance - */ - PageRef.prototype.layoutId = ""; - - /** - * PageRef boundingPoly. - * @member {google.cloud.documentai.v1.IBoundingPoly|null|undefined} boundingPoly - * @memberof google.cloud.documentai.v1.Document.PageAnchor.PageRef - * @instance - */ - PageRef.prototype.boundingPoly = null; - - /** - * PageRef confidence. - * @member {number} confidence - * @memberof google.cloud.documentai.v1.Document.PageAnchor.PageRef - * @instance - */ - PageRef.prototype.confidence = 0; - - /** - * Creates a new PageRef instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.PageAnchor.PageRef - * @static - * @param {google.cloud.documentai.v1.Document.PageAnchor.IPageRef=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.PageAnchor.PageRef} PageRef instance - */ - PageRef.create = function create(properties) { - return new PageRef(properties); - }; - - /** - * Encodes the specified PageRef message. Does not implicitly {@link google.cloud.documentai.v1.Document.PageAnchor.PageRef.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.PageAnchor.PageRef - * @static - * @param {google.cloud.documentai.v1.Document.PageAnchor.IPageRef} message PageRef message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PageRef.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.page != null && Object.hasOwnProperty.call(message, "page")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.page); - if (message.layoutType != null && Object.hasOwnProperty.call(message, "layoutType")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.layoutType); - if (message.layoutId != null && Object.hasOwnProperty.call(message, "layoutId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.layoutId); - if (message.boundingPoly != null && Object.hasOwnProperty.call(message, "boundingPoly")) - $root.google.cloud.documentai.v1.BoundingPoly.encode(message.boundingPoly, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) - writer.uint32(/* id 5, wireType 5 =*/45).float(message.confidence); - return writer; - }; - - /** - * Encodes the specified PageRef message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.PageAnchor.PageRef.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.PageAnchor.PageRef - * @static - * @param {google.cloud.documentai.v1.Document.PageAnchor.IPageRef} message PageRef message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PageRef.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PageRef message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document.PageAnchor.PageRef - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.PageAnchor.PageRef} PageRef - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PageRef.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.PageAnchor.PageRef(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.page = reader.int64(); - break; - } - case 2: { - message.layoutType = reader.int32(); - break; - } - case 3: { - message.layoutId = reader.string(); - break; - } - case 4: { - message.boundingPoly = $root.google.cloud.documentai.v1.BoundingPoly.decode(reader, reader.uint32()); - break; - } - case 5: { - message.confidence = reader.float(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PageRef message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document.PageAnchor.PageRef - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.PageAnchor.PageRef} PageRef - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PageRef.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PageRef message. - * @function verify - * @memberof google.cloud.documentai.v1.Document.PageAnchor.PageRef - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PageRef.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.page != null && message.hasOwnProperty("page")) - if (!$util.isInteger(message.page) && !(message.page && $util.isInteger(message.page.low) && $util.isInteger(message.page.high))) - return "page: integer|Long expected"; - if (message.layoutType != null && message.hasOwnProperty("layoutType")) - switch (message.layoutType) { - default: - return "layoutType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; - } - if (message.layoutId != null && message.hasOwnProperty("layoutId")) - if (!$util.isString(message.layoutId)) - return "layoutId: string expected"; - if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) { - var error = $root.google.cloud.documentai.v1.BoundingPoly.verify(message.boundingPoly); - if (error) - return "boundingPoly." + error; - } - if (message.confidence != null && message.hasOwnProperty("confidence")) - if (typeof message.confidence !== "number") - return "confidence: number expected"; - return null; - }; - - /** - * Creates a PageRef message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.PageAnchor.PageRef - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.PageAnchor.PageRef} PageRef - */ - PageRef.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.PageAnchor.PageRef) - return object; - var message = new $root.google.cloud.documentai.v1.Document.PageAnchor.PageRef(); - if (object.page != null) - if ($util.Long) - (message.page = $util.Long.fromValue(object.page)).unsigned = false; - else if (typeof object.page === "string") - message.page = parseInt(object.page, 10); - else if (typeof object.page === "number") - message.page = object.page; - else if (typeof object.page === "object") - message.page = new $util.LongBits(object.page.low >>> 0, object.page.high >>> 0).toNumber(); - switch (object.layoutType) { - default: - if (typeof object.layoutType === "number") { - message.layoutType = object.layoutType; - break; - } - break; - case "LAYOUT_TYPE_UNSPECIFIED": - case 0: - message.layoutType = 0; - break; - case "BLOCK": - case 1: - message.layoutType = 1; - break; - case "PARAGRAPH": - case 2: - message.layoutType = 2; - break; - case "LINE": - case 3: - message.layoutType = 3; - break; - case "TOKEN": - case 4: - message.layoutType = 4; - break; - case "VISUAL_ELEMENT": - case 5: - message.layoutType = 5; - break; - case "TABLE": - case 6: - message.layoutType = 6; - break; - case "FORM_FIELD": - case 7: - message.layoutType = 7; - break; - } - if (object.layoutId != null) - message.layoutId = String(object.layoutId); - if (object.boundingPoly != null) { - if (typeof object.boundingPoly !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.PageAnchor.PageRef.boundingPoly: object expected"); - message.boundingPoly = $root.google.cloud.documentai.v1.BoundingPoly.fromObject(object.boundingPoly); - } - if (object.confidence != null) - message.confidence = Number(object.confidence); - return message; - }; - - /** - * Creates a plain object from a PageRef message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.PageAnchor.PageRef - * @static - * @param {google.cloud.documentai.v1.Document.PageAnchor.PageRef} message PageRef - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PageRef.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.page = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.page = options.longs === String ? "0" : 0; - object.layoutType = options.enums === String ? "LAYOUT_TYPE_UNSPECIFIED" : 0; - object.layoutId = ""; - object.boundingPoly = null; - object.confidence = 0; - } - if (message.page != null && message.hasOwnProperty("page")) - if (typeof message.page === "number") - object.page = options.longs === String ? String(message.page) : message.page; - else - object.page = options.longs === String ? $util.Long.prototype.toString.call(message.page) : options.longs === Number ? new $util.LongBits(message.page.low >>> 0, message.page.high >>> 0).toNumber() : message.page; - if (message.layoutType != null && message.hasOwnProperty("layoutType")) - object.layoutType = options.enums === String ? $root.google.cloud.documentai.v1.Document.PageAnchor.PageRef.LayoutType[message.layoutType] === undefined ? message.layoutType : $root.google.cloud.documentai.v1.Document.PageAnchor.PageRef.LayoutType[message.layoutType] : message.layoutType; - if (message.layoutId != null && message.hasOwnProperty("layoutId")) - object.layoutId = message.layoutId; - if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) - object.boundingPoly = $root.google.cloud.documentai.v1.BoundingPoly.toObject(message.boundingPoly, options); - if (message.confidence != null && message.hasOwnProperty("confidence")) - object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; - return object; - }; - - /** - * Converts this PageRef to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.PageAnchor.PageRef - * @instance - * @returns {Object.} JSON object - */ - PageRef.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PageRef - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.PageAnchor.PageRef - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PageRef.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.PageAnchor.PageRef"; - }; - - /** - * LayoutType enum. - * @name google.cloud.documentai.v1.Document.PageAnchor.PageRef.LayoutType - * @enum {number} - * @property {number} LAYOUT_TYPE_UNSPECIFIED=0 LAYOUT_TYPE_UNSPECIFIED value - * @property {number} BLOCK=1 BLOCK value - * @property {number} PARAGRAPH=2 PARAGRAPH value - * @property {number} LINE=3 LINE value - * @property {number} TOKEN=4 TOKEN value - * @property {number} VISUAL_ELEMENT=5 VISUAL_ELEMENT value - * @property {number} TABLE=6 TABLE value - * @property {number} FORM_FIELD=7 FORM_FIELD value - */ - PageRef.LayoutType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "LAYOUT_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "BLOCK"] = 1; - values[valuesById[2] = "PARAGRAPH"] = 2; - values[valuesById[3] = "LINE"] = 3; - values[valuesById[4] = "TOKEN"] = 4; - values[valuesById[5] = "VISUAL_ELEMENT"] = 5; - values[valuesById[6] = "TABLE"] = 6; - values[valuesById[7] = "FORM_FIELD"] = 7; - return values; - })(); - - return PageRef; - })(); - - return PageAnchor; - })(); - - Document.Provenance = (function() { - - /** - * Properties of a Provenance. - * @memberof google.cloud.documentai.v1.Document - * @interface IProvenance - * @property {number|null} [revision] Provenance revision - * @property {number|null} [id] Provenance id - * @property {Array.|null} [parents] Provenance parents - * @property {google.cloud.documentai.v1.Document.Provenance.OperationType|null} [type] Provenance type - */ - - /** - * Constructs a new Provenance. - * @memberof google.cloud.documentai.v1.Document - * @classdesc Represents a Provenance. - * @implements IProvenance - * @constructor - * @param {google.cloud.documentai.v1.Document.IProvenance=} [properties] Properties to set - */ - function Provenance(properties) { - this.parents = []; - 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]]; - } - - /** - * Provenance revision. - * @member {number} revision - * @memberof google.cloud.documentai.v1.Document.Provenance - * @instance - */ - Provenance.prototype.revision = 0; - - /** - * Provenance id. - * @member {number} id - * @memberof google.cloud.documentai.v1.Document.Provenance - * @instance - */ - Provenance.prototype.id = 0; - - /** - * Provenance parents. - * @member {Array.} parents - * @memberof google.cloud.documentai.v1.Document.Provenance - * @instance - */ - Provenance.prototype.parents = $util.emptyArray; - - /** - * Provenance type. - * @member {google.cloud.documentai.v1.Document.Provenance.OperationType} type - * @memberof google.cloud.documentai.v1.Document.Provenance - * @instance - */ - Provenance.prototype.type = 0; - - /** - * Creates a new Provenance instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.Provenance - * @static - * @param {google.cloud.documentai.v1.Document.IProvenance=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.Provenance} Provenance instance - */ - Provenance.create = function create(properties) { - return new Provenance(properties); - }; - - /** - * Encodes the specified Provenance message. Does not implicitly {@link google.cloud.documentai.v1.Document.Provenance.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.Provenance - * @static - * @param {google.cloud.documentai.v1.Document.IProvenance} message Provenance message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Provenance.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.revision != null && Object.hasOwnProperty.call(message, "revision")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.revision); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.id); - if (message.parents != null && message.parents.length) - for (var i = 0; i < message.parents.length; ++i) - $root.google.cloud.documentai.v1.Document.Provenance.Parent.encode(message.parents[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.type); - return writer; - }; - - /** - * Encodes the specified Provenance message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Provenance.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.Provenance - * @static - * @param {google.cloud.documentai.v1.Document.IProvenance} message Provenance message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Provenance.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Provenance message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document.Provenance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.Provenance} Provenance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Provenance.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Provenance(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.revision = reader.int32(); - break; - } - case 2: { - message.id = reader.int32(); - break; - } - case 3: { - if (!(message.parents && message.parents.length)) - message.parents = []; - message.parents.push($root.google.cloud.documentai.v1.Document.Provenance.Parent.decode(reader, reader.uint32())); - break; - } - case 4: { - message.type = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Provenance message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document.Provenance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.Provenance} Provenance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Provenance.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Provenance message. - * @function verify - * @memberof google.cloud.documentai.v1.Document.Provenance - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Provenance.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.revision != null && message.hasOwnProperty("revision")) - if (!$util.isInteger(message.revision)) - return "revision: integer expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isInteger(message.id)) - return "id: integer expected"; - if (message.parents != null && message.hasOwnProperty("parents")) { - if (!Array.isArray(message.parents)) - return "parents: array expected"; - for (var i = 0; i < message.parents.length; ++i) { - var error = $root.google.cloud.documentai.v1.Document.Provenance.Parent.verify(message.parents[i]); - if (error) - return "parents." + error; - } - } - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - case 7: - case 3: - case 4: - case 5: - case 6: - break; - } - return null; - }; - - /** - * Creates a Provenance message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.Provenance - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.Provenance} Provenance - */ - Provenance.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.Provenance) - return object; - var message = new $root.google.cloud.documentai.v1.Document.Provenance(); - if (object.revision != null) - message.revision = object.revision | 0; - if (object.id != null) - message.id = object.id | 0; - if (object.parents) { - if (!Array.isArray(object.parents)) - throw TypeError(".google.cloud.documentai.v1.Document.Provenance.parents: array expected"); - message.parents = []; - for (var i = 0; i < object.parents.length; ++i) { - if (typeof object.parents[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Provenance.parents: object expected"); - message.parents[i] = $root.google.cloud.documentai.v1.Document.Provenance.Parent.fromObject(object.parents[i]); - } - } - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "OPERATION_TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "ADD": - case 1: - message.type = 1; - break; - case "REMOVE": - case 2: - message.type = 2; - break; - case "UPDATE": - case 7: - message.type = 7; - break; - case "REPLACE": - case 3: - message.type = 3; - break; - case "EVAL_REQUESTED": - case 4: - message.type = 4; - break; - case "EVAL_APPROVED": - case 5: - message.type = 5; - break; - case "EVAL_SKIPPED": - case 6: - message.type = 6; - break; - } - return message; - }; - - /** - * Creates a plain object from a Provenance message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.Provenance - * @static - * @param {google.cloud.documentai.v1.Document.Provenance} message Provenance - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Provenance.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.parents = []; - if (options.defaults) { - object.revision = 0; - object.id = 0; - object.type = options.enums === String ? "OPERATION_TYPE_UNSPECIFIED" : 0; - } - if (message.revision != null && message.hasOwnProperty("revision")) - object.revision = message.revision; - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.parents && message.parents.length) { - object.parents = []; - for (var j = 0; j < message.parents.length; ++j) - object.parents[j] = $root.google.cloud.documentai.v1.Document.Provenance.Parent.toObject(message.parents[j], options); - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.documentai.v1.Document.Provenance.OperationType[message.type] === undefined ? message.type : $root.google.cloud.documentai.v1.Document.Provenance.OperationType[message.type] : message.type; - return object; - }; - - /** - * Converts this Provenance to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.Provenance - * @instance - * @returns {Object.} JSON object - */ - Provenance.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Provenance - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.Provenance - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Provenance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Provenance"; - }; - - Provenance.Parent = (function() { - - /** - * Properties of a Parent. - * @memberof google.cloud.documentai.v1.Document.Provenance - * @interface IParent - * @property {number|null} [revision] Parent revision - * @property {number|null} [index] Parent index - * @property {number|null} [id] Parent id - */ - - /** - * Constructs a new Parent. - * @memberof google.cloud.documentai.v1.Document.Provenance - * @classdesc Represents a Parent. - * @implements IParent - * @constructor - * @param {google.cloud.documentai.v1.Document.Provenance.IParent=} [properties] Properties to set - */ - function Parent(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]]; - } - - /** - * Parent revision. - * @member {number} revision - * @memberof google.cloud.documentai.v1.Document.Provenance.Parent - * @instance - */ - Parent.prototype.revision = 0; - - /** - * Parent index. - * @member {number} index - * @memberof google.cloud.documentai.v1.Document.Provenance.Parent - * @instance - */ - Parent.prototype.index = 0; - - /** - * Parent id. - * @member {number} id - * @memberof google.cloud.documentai.v1.Document.Provenance.Parent - * @instance - */ - Parent.prototype.id = 0; - - /** - * Creates a new Parent instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.Provenance.Parent - * @static - * @param {google.cloud.documentai.v1.Document.Provenance.IParent=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.Provenance.Parent} Parent instance - */ - Parent.create = function create(properties) { - return new Parent(properties); - }; - - /** - * Encodes the specified Parent message. Does not implicitly {@link google.cloud.documentai.v1.Document.Provenance.Parent.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.Provenance.Parent - * @static - * @param {google.cloud.documentai.v1.Document.Provenance.IParent} message Parent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Parent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.revision != null && Object.hasOwnProperty.call(message, "revision")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.revision); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.id); - if (message.index != null && Object.hasOwnProperty.call(message, "index")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.index); - return writer; - }; - - /** - * Encodes the specified Parent message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Provenance.Parent.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.Provenance.Parent - * @static - * @param {google.cloud.documentai.v1.Document.Provenance.IParent} message Parent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Parent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Parent message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document.Provenance.Parent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.Provenance.Parent} Parent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Parent.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Provenance.Parent(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.revision = reader.int32(); - break; - } - case 3: { - message.index = reader.int32(); - break; - } - case 2: { - message.id = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Parent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document.Provenance.Parent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.Provenance.Parent} Parent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Parent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Parent message. - * @function verify - * @memberof google.cloud.documentai.v1.Document.Provenance.Parent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Parent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.revision != null && message.hasOwnProperty("revision")) - if (!$util.isInteger(message.revision)) - return "revision: integer expected"; - if (message.index != null && message.hasOwnProperty("index")) - if (!$util.isInteger(message.index)) - return "index: integer expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isInteger(message.id)) - return "id: integer expected"; - return null; - }; - - /** - * Creates a Parent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.Provenance.Parent - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.Provenance.Parent} Parent - */ - Parent.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.Provenance.Parent) - return object; - var message = new $root.google.cloud.documentai.v1.Document.Provenance.Parent(); - if (object.revision != null) - message.revision = object.revision | 0; - if (object.index != null) - message.index = object.index | 0; - if (object.id != null) - message.id = object.id | 0; - return message; - }; - - /** - * Creates a plain object from a Parent message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.Provenance.Parent - * @static - * @param {google.cloud.documentai.v1.Document.Provenance.Parent} message Parent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Parent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.revision = 0; - object.id = 0; - object.index = 0; - } - if (message.revision != null && message.hasOwnProperty("revision")) - object.revision = message.revision; - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.index != null && message.hasOwnProperty("index")) - object.index = message.index; - return object; - }; - - /** - * Converts this Parent to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.Provenance.Parent - * @instance - * @returns {Object.} JSON object - */ - Parent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Parent - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.Provenance.Parent - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Parent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Provenance.Parent"; - }; - - return Parent; - })(); - - /** - * OperationType enum. - * @name google.cloud.documentai.v1.Document.Provenance.OperationType - * @enum {number} - * @property {number} OPERATION_TYPE_UNSPECIFIED=0 OPERATION_TYPE_UNSPECIFIED value - * @property {number} ADD=1 ADD value - * @property {number} REMOVE=2 REMOVE value - * @property {number} UPDATE=7 UPDATE value - * @property {number} REPLACE=3 REPLACE value - * @property {number} EVAL_REQUESTED=4 EVAL_REQUESTED value - * @property {number} EVAL_APPROVED=5 EVAL_APPROVED value - * @property {number} EVAL_SKIPPED=6 EVAL_SKIPPED value - */ - Provenance.OperationType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "OPERATION_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ADD"] = 1; - values[valuesById[2] = "REMOVE"] = 2; - values[valuesById[7] = "UPDATE"] = 7; - values[valuesById[3] = "REPLACE"] = 3; - values[valuesById[4] = "EVAL_REQUESTED"] = 4; - values[valuesById[5] = "EVAL_APPROVED"] = 5; - values[valuesById[6] = "EVAL_SKIPPED"] = 6; - return values; - })(); - - return Provenance; - })(); - - Document.Revision = (function() { - - /** - * Properties of a Revision. - * @memberof google.cloud.documentai.v1.Document - * @interface IRevision - * @property {string|null} [agent] Revision agent - * @property {string|null} [processor] Revision processor - * @property {string|null} [id] Revision id - * @property {Array.|null} [parent] Revision parent - * @property {Array.|null} [parentIds] Revision parentIds - * @property {google.protobuf.ITimestamp|null} [createTime] Revision createTime - * @property {google.cloud.documentai.v1.Document.Revision.IHumanReview|null} [humanReview] Revision humanReview - */ - - /** - * Constructs a new Revision. - * @memberof google.cloud.documentai.v1.Document - * @classdesc Represents a Revision. - * @implements IRevision - * @constructor - * @param {google.cloud.documentai.v1.Document.IRevision=} [properties] Properties to set - */ - function Revision(properties) { - this.parent = []; - this.parentIds = []; - 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]]; - } - - /** - * Revision agent. - * @member {string|null|undefined} agent - * @memberof google.cloud.documentai.v1.Document.Revision - * @instance - */ - Revision.prototype.agent = null; - - /** - * Revision processor. - * @member {string|null|undefined} processor - * @memberof google.cloud.documentai.v1.Document.Revision - * @instance - */ - Revision.prototype.processor = null; - - /** - * Revision id. - * @member {string} id - * @memberof google.cloud.documentai.v1.Document.Revision - * @instance - */ - Revision.prototype.id = ""; - - /** - * Revision parent. - * @member {Array.} parent - * @memberof google.cloud.documentai.v1.Document.Revision - * @instance - */ - Revision.prototype.parent = $util.emptyArray; - - /** - * Revision parentIds. - * @member {Array.} parentIds - * @memberof google.cloud.documentai.v1.Document.Revision - * @instance - */ - Revision.prototype.parentIds = $util.emptyArray; - - /** - * Revision createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.documentai.v1.Document.Revision - * @instance - */ - Revision.prototype.createTime = null; - - /** - * Revision humanReview. - * @member {google.cloud.documentai.v1.Document.Revision.IHumanReview|null|undefined} humanReview - * @memberof google.cloud.documentai.v1.Document.Revision - * @instance - */ - Revision.prototype.humanReview = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Revision source. - * @member {"agent"|"processor"|undefined} source - * @memberof google.cloud.documentai.v1.Document.Revision - * @instance - */ - Object.defineProperty(Revision.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["agent", "processor"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Revision instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.Revision - * @static - * @param {google.cloud.documentai.v1.Document.IRevision=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.Revision} Revision instance - */ - Revision.create = function create(properties) { - return new Revision(properties); - }; - - /** - * Encodes the specified Revision message. Does not implicitly {@link google.cloud.documentai.v1.Document.Revision.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.Revision - * @static - * @param {google.cloud.documentai.v1.Document.IRevision} message Revision message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Revision.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); - if (message.parent != null && message.parent.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.parent.length; ++i) - writer.int32(message.parent[i]); - writer.ldelim(); - } - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.agent != null && Object.hasOwnProperty.call(message, "agent")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.agent); - if (message.processor != null && Object.hasOwnProperty.call(message, "processor")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.processor); - if (message.humanReview != null && Object.hasOwnProperty.call(message, "humanReview")) - $root.google.cloud.documentai.v1.Document.Revision.HumanReview.encode(message.humanReview, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.parentIds != null && message.parentIds.length) - for (var i = 0; i < message.parentIds.length; ++i) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.parentIds[i]); - return writer; - }; - - /** - * Encodes the specified Revision message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Revision.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.Revision - * @static - * @param {google.cloud.documentai.v1.Document.IRevision} message Revision message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Revision.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Revision message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document.Revision - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.Revision} Revision - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Revision.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Revision(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 4: { - message.agent = reader.string(); - break; - } - case 5: { - message.processor = reader.string(); - break; - } - case 1: { - message.id = reader.string(); - break; - } - case 2: { - if (!(message.parent && message.parent.length)) - message.parent = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.parent.push(reader.int32()); - } else - message.parent.push(reader.int32()); - break; - } - case 7: { - if (!(message.parentIds && message.parentIds.length)) - message.parentIds = []; - message.parentIds.push(reader.string()); - break; - } - case 3: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 6: { - message.humanReview = $root.google.cloud.documentai.v1.Document.Revision.HumanReview.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Revision message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document.Revision - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.Revision} Revision - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Revision.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Revision message. - * @function verify - * @memberof google.cloud.documentai.v1.Document.Revision - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Revision.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.agent != null && message.hasOwnProperty("agent")) { - properties.source = 1; - if (!$util.isString(message.agent)) - return "agent: string expected"; - } - if (message.processor != null && message.hasOwnProperty("processor")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - if (!$util.isString(message.processor)) - return "processor: string expected"; - } - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; - if (message.parent != null && message.hasOwnProperty("parent")) { - if (!Array.isArray(message.parent)) - return "parent: array expected"; - for (var i = 0; i < message.parent.length; ++i) - if (!$util.isInteger(message.parent[i])) - return "parent: integer[] expected"; - } - if (message.parentIds != null && message.hasOwnProperty("parentIds")) { - if (!Array.isArray(message.parentIds)) - return "parentIds: array expected"; - for (var i = 0; i < message.parentIds.length; ++i) - if (!$util.isString(message.parentIds[i])) - return "parentIds: 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.humanReview != null && message.hasOwnProperty("humanReview")) { - var error = $root.google.cloud.documentai.v1.Document.Revision.HumanReview.verify(message.humanReview); - if (error) - return "humanReview." + error; - } - return null; - }; - - /** - * Creates a Revision message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.Revision - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.Revision} Revision - */ - Revision.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.Revision) - return object; - var message = new $root.google.cloud.documentai.v1.Document.Revision(); - if (object.agent != null) - message.agent = String(object.agent); - if (object.processor != null) - message.processor = String(object.processor); - if (object.id != null) - message.id = String(object.id); - if (object.parent) { - if (!Array.isArray(object.parent)) - throw TypeError(".google.cloud.documentai.v1.Document.Revision.parent: array expected"); - message.parent = []; - for (var i = 0; i < object.parent.length; ++i) - message.parent[i] = object.parent[i] | 0; - } - if (object.parentIds) { - if (!Array.isArray(object.parentIds)) - throw TypeError(".google.cloud.documentai.v1.Document.Revision.parentIds: array expected"); - message.parentIds = []; - for (var i = 0; i < object.parentIds.length; ++i) - message.parentIds[i] = String(object.parentIds[i]); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Revision.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.humanReview != null) { - if (typeof object.humanReview !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.Revision.humanReview: object expected"); - message.humanReview = $root.google.cloud.documentai.v1.Document.Revision.HumanReview.fromObject(object.humanReview); - } - return message; - }; - - /** - * Creates a plain object from a Revision message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.Revision - * @static - * @param {google.cloud.documentai.v1.Document.Revision} message Revision - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Revision.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.parent = []; - object.parentIds = []; - } - if (options.defaults) { - object.id = ""; - object.createTime = null; - object.humanReview = null; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.parent && message.parent.length) { - object.parent = []; - for (var j = 0; j < message.parent.length; ++j) - object.parent[j] = message.parent[j]; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.agent != null && message.hasOwnProperty("agent")) { - object.agent = message.agent; - if (options.oneofs) - object.source = "agent"; - } - if (message.processor != null && message.hasOwnProperty("processor")) { - object.processor = message.processor; - if (options.oneofs) - object.source = "processor"; - } - if (message.humanReview != null && message.hasOwnProperty("humanReview")) - object.humanReview = $root.google.cloud.documentai.v1.Document.Revision.HumanReview.toObject(message.humanReview, options); - if (message.parentIds && message.parentIds.length) { - object.parentIds = []; - for (var j = 0; j < message.parentIds.length; ++j) - object.parentIds[j] = message.parentIds[j]; - } - return object; - }; - - /** - * Converts this Revision to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.Revision - * @instance - * @returns {Object.} JSON object - */ - Revision.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Revision - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.Revision - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Revision.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Revision"; - }; - - Revision.HumanReview = (function() { - - /** - * Properties of a HumanReview. - * @memberof google.cloud.documentai.v1.Document.Revision - * @interface IHumanReview - * @property {string|null} [state] HumanReview state - * @property {string|null} [stateMessage] HumanReview stateMessage - */ - - /** - * Constructs a new HumanReview. - * @memberof google.cloud.documentai.v1.Document.Revision - * @classdesc Represents a HumanReview. - * @implements IHumanReview - * @constructor - * @param {google.cloud.documentai.v1.Document.Revision.IHumanReview=} [properties] Properties to set - */ - function HumanReview(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]]; - } - - /** - * HumanReview state. - * @member {string} state - * @memberof google.cloud.documentai.v1.Document.Revision.HumanReview - * @instance - */ - HumanReview.prototype.state = ""; - - /** - * HumanReview stateMessage. - * @member {string} stateMessage - * @memberof google.cloud.documentai.v1.Document.Revision.HumanReview - * @instance - */ - HumanReview.prototype.stateMessage = ""; - - /** - * Creates a new HumanReview instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.Revision.HumanReview - * @static - * @param {google.cloud.documentai.v1.Document.Revision.IHumanReview=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.Revision.HumanReview} HumanReview instance - */ - HumanReview.create = function create(properties) { - return new HumanReview(properties); - }; - - /** - * Encodes the specified HumanReview message. Does not implicitly {@link google.cloud.documentai.v1.Document.Revision.HumanReview.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.Revision.HumanReview - * @static - * @param {google.cloud.documentai.v1.Document.Revision.IHumanReview} message HumanReview message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HumanReview.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.state); - if (message.stateMessage != null && Object.hasOwnProperty.call(message, "stateMessage")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.stateMessage); - return writer; - }; - - /** - * Encodes the specified HumanReview message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Revision.HumanReview.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.Revision.HumanReview - * @static - * @param {google.cloud.documentai.v1.Document.Revision.IHumanReview} message HumanReview message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HumanReview.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a HumanReview message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document.Revision.HumanReview - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.Revision.HumanReview} HumanReview - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HumanReview.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.Revision.HumanReview(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.state = reader.string(); - break; - } - case 2: { - message.stateMessage = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a HumanReview message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document.Revision.HumanReview - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.Revision.HumanReview} HumanReview - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HumanReview.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a HumanReview message. - * @function verify - * @memberof google.cloud.documentai.v1.Document.Revision.HumanReview - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - HumanReview.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.state != null && message.hasOwnProperty("state")) - if (!$util.isString(message.state)) - return "state: string expected"; - if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) - if (!$util.isString(message.stateMessage)) - return "stateMessage: string expected"; - return null; - }; - - /** - * Creates a HumanReview message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.Revision.HumanReview - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.Revision.HumanReview} HumanReview - */ - HumanReview.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.Revision.HumanReview) - return object; - var message = new $root.google.cloud.documentai.v1.Document.Revision.HumanReview(); - if (object.state != null) - message.state = String(object.state); - if (object.stateMessage != null) - message.stateMessage = String(object.stateMessage); - return message; - }; - - /** - * Creates a plain object from a HumanReview message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.Revision.HumanReview - * @static - * @param {google.cloud.documentai.v1.Document.Revision.HumanReview} message HumanReview - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HumanReview.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.state = ""; - object.stateMessage = ""; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = message.state; - if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) - object.stateMessage = message.stateMessage; - return object; - }; - - /** - * Converts this HumanReview to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.Revision.HumanReview - * @instance - * @returns {Object.} JSON object - */ - HumanReview.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for HumanReview - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.Revision.HumanReview - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - HumanReview.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Revision.HumanReview"; - }; - - return HumanReview; - })(); - - return Revision; - })(); - - Document.TextChange = (function() { - - /** - * Properties of a TextChange. - * @memberof google.cloud.documentai.v1.Document - * @interface ITextChange - * @property {google.cloud.documentai.v1.Document.ITextAnchor|null} [textAnchor] TextChange textAnchor - * @property {string|null} [changedText] TextChange changedText - * @property {Array.|null} [provenance] TextChange provenance - */ - - /** - * Constructs a new TextChange. - * @memberof google.cloud.documentai.v1.Document - * @classdesc Represents a TextChange. - * @implements ITextChange - * @constructor - * @param {google.cloud.documentai.v1.Document.ITextChange=} [properties] Properties to set - */ - function TextChange(properties) { - this.provenance = []; - 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]]; - } - - /** - * TextChange textAnchor. - * @member {google.cloud.documentai.v1.Document.ITextAnchor|null|undefined} textAnchor - * @memberof google.cloud.documentai.v1.Document.TextChange - * @instance - */ - TextChange.prototype.textAnchor = null; - - /** - * TextChange changedText. - * @member {string} changedText - * @memberof google.cloud.documentai.v1.Document.TextChange - * @instance - */ - TextChange.prototype.changedText = ""; - - /** - * TextChange provenance. - * @member {Array.} provenance - * @memberof google.cloud.documentai.v1.Document.TextChange - * @instance - */ - TextChange.prototype.provenance = $util.emptyArray; - - /** - * Creates a new TextChange instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.TextChange - * @static - * @param {google.cloud.documentai.v1.Document.ITextChange=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.TextChange} TextChange instance - */ - TextChange.create = function create(properties) { - return new TextChange(properties); - }; - - /** - * Encodes the specified TextChange message. Does not implicitly {@link google.cloud.documentai.v1.Document.TextChange.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.TextChange - * @static - * @param {google.cloud.documentai.v1.Document.ITextChange} message TextChange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TextChange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.textAnchor != null && Object.hasOwnProperty.call(message, "textAnchor")) - $root.google.cloud.documentai.v1.Document.TextAnchor.encode(message.textAnchor, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.changedText != null && Object.hasOwnProperty.call(message, "changedText")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.changedText); - if (message.provenance != null && message.provenance.length) - for (var i = 0; i < message.provenance.length; ++i) - $root.google.cloud.documentai.v1.Document.Provenance.encode(message.provenance[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TextChange message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.TextChange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.TextChange - * @static - * @param {google.cloud.documentai.v1.Document.ITextChange} message TextChange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TextChange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TextChange message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document.TextChange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.TextChange} TextChange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TextChange.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.TextChange(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.textAnchor = $root.google.cloud.documentai.v1.Document.TextAnchor.decode(reader, reader.uint32()); - break; - } - case 2: { - message.changedText = reader.string(); - break; - } - case 3: { - if (!(message.provenance && message.provenance.length)) - message.provenance = []; - message.provenance.push($root.google.cloud.documentai.v1.Document.Provenance.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TextChange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document.TextChange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.TextChange} TextChange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TextChange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TextChange message. - * @function verify - * @memberof google.cloud.documentai.v1.Document.TextChange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TextChange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.textAnchor != null && message.hasOwnProperty("textAnchor")) { - var error = $root.google.cloud.documentai.v1.Document.TextAnchor.verify(message.textAnchor); - if (error) - return "textAnchor." + error; - } - if (message.changedText != null && message.hasOwnProperty("changedText")) - if (!$util.isString(message.changedText)) - return "changedText: string expected"; - if (message.provenance != null && message.hasOwnProperty("provenance")) { - if (!Array.isArray(message.provenance)) - return "provenance: array expected"; - for (var i = 0; i < message.provenance.length; ++i) { - var error = $root.google.cloud.documentai.v1.Document.Provenance.verify(message.provenance[i]); - if (error) - return "provenance." + error; - } - } - return null; - }; - - /** - * Creates a TextChange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.TextChange - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.TextChange} TextChange - */ - TextChange.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.TextChange) - return object; - var message = new $root.google.cloud.documentai.v1.Document.TextChange(); - if (object.textAnchor != null) { - if (typeof object.textAnchor !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.TextChange.textAnchor: object expected"); - message.textAnchor = $root.google.cloud.documentai.v1.Document.TextAnchor.fromObject(object.textAnchor); - } - if (object.changedText != null) - message.changedText = String(object.changedText); - if (object.provenance) { - if (!Array.isArray(object.provenance)) - throw TypeError(".google.cloud.documentai.v1.Document.TextChange.provenance: array expected"); - message.provenance = []; - for (var i = 0; i < object.provenance.length; ++i) { - if (typeof object.provenance[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.TextChange.provenance: object expected"); - message.provenance[i] = $root.google.cloud.documentai.v1.Document.Provenance.fromObject(object.provenance[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a TextChange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.TextChange - * @static - * @param {google.cloud.documentai.v1.Document.TextChange} message TextChange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TextChange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.provenance = []; - if (options.defaults) { - object.textAnchor = null; - object.changedText = ""; - } - if (message.textAnchor != null && message.hasOwnProperty("textAnchor")) - object.textAnchor = $root.google.cloud.documentai.v1.Document.TextAnchor.toObject(message.textAnchor, options); - if (message.changedText != null && message.hasOwnProperty("changedText")) - object.changedText = message.changedText; - if (message.provenance && message.provenance.length) { - object.provenance = []; - for (var j = 0; j < message.provenance.length; ++j) - object.provenance[j] = $root.google.cloud.documentai.v1.Document.Provenance.toObject(message.provenance[j], options); - } - return object; - }; - - /** - * Converts this TextChange to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.TextChange - * @instance - * @returns {Object.} JSON object - */ - TextChange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TextChange - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.TextChange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TextChange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.TextChange"; - }; - - return TextChange; - })(); - - Document.DocumentLayout = (function() { - - /** - * Properties of a DocumentLayout. - * @memberof google.cloud.documentai.v1.Document - * @interface IDocumentLayout - * @property {Array.|null} [blocks] DocumentLayout blocks - */ - - /** - * Constructs a new DocumentLayout. - * @memberof google.cloud.documentai.v1.Document - * @classdesc Represents a DocumentLayout. - * @implements IDocumentLayout - * @constructor - * @param {google.cloud.documentai.v1.Document.IDocumentLayout=} [properties] Properties to set - */ - function DocumentLayout(properties) { - this.blocks = []; - 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]]; - } - - /** - * DocumentLayout blocks. - * @member {Array.} blocks - * @memberof google.cloud.documentai.v1.Document.DocumentLayout - * @instance - */ - DocumentLayout.prototype.blocks = $util.emptyArray; - - /** - * Creates a new DocumentLayout instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.DocumentLayout - * @static - * @param {google.cloud.documentai.v1.Document.IDocumentLayout=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.DocumentLayout} DocumentLayout instance - */ - DocumentLayout.create = function create(properties) { - return new DocumentLayout(properties); - }; - - /** - * Encodes the specified DocumentLayout message. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.DocumentLayout - * @static - * @param {google.cloud.documentai.v1.Document.IDocumentLayout} message DocumentLayout message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DocumentLayout.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.blocks != null && message.blocks.length) - for (var i = 0; i < message.blocks.length; ++i) - $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.encode(message.blocks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DocumentLayout message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.DocumentLayout - * @static - * @param {google.cloud.documentai.v1.Document.IDocumentLayout} message DocumentLayout message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DocumentLayout.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DocumentLayout message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document.DocumentLayout - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.DocumentLayout} DocumentLayout - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DocumentLayout.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.DocumentLayout(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.blocks && message.blocks.length)) - message.blocks = []; - message.blocks.push($root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DocumentLayout message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document.DocumentLayout - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.DocumentLayout} DocumentLayout - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DocumentLayout.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DocumentLayout message. - * @function verify - * @memberof google.cloud.documentai.v1.Document.DocumentLayout - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DocumentLayout.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.blocks != null && message.hasOwnProperty("blocks")) { - if (!Array.isArray(message.blocks)) - return "blocks: array expected"; - for (var i = 0; i < message.blocks.length; ++i) { - var error = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.verify(message.blocks[i]); - if (error) - return "blocks." + error; - } - } - return null; - }; - - /** - * Creates a DocumentLayout message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.DocumentLayout - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.DocumentLayout} DocumentLayout - */ - DocumentLayout.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.DocumentLayout) - return object; - var message = new $root.google.cloud.documentai.v1.Document.DocumentLayout(); - if (object.blocks) { - if (!Array.isArray(object.blocks)) - throw TypeError(".google.cloud.documentai.v1.Document.DocumentLayout.blocks: array expected"); - message.blocks = []; - for (var i = 0; i < object.blocks.length; ++i) { - if (typeof object.blocks[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.DocumentLayout.blocks: object expected"); - message.blocks[i] = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.fromObject(object.blocks[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a DocumentLayout message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.DocumentLayout - * @static - * @param {google.cloud.documentai.v1.Document.DocumentLayout} message DocumentLayout - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DocumentLayout.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.blocks = []; - if (message.blocks && message.blocks.length) { - object.blocks = []; - for (var j = 0; j < message.blocks.length; ++j) - object.blocks[j] = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.toObject(message.blocks[j], options); - } - return object; - }; - - /** - * Converts this DocumentLayout to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.DocumentLayout - * @instance - * @returns {Object.} JSON object - */ - DocumentLayout.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DocumentLayout - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.DocumentLayout - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DocumentLayout.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.DocumentLayout"; - }; - - DocumentLayout.DocumentLayoutBlock = (function() { - - /** - * Properties of a DocumentLayoutBlock. - * @memberof google.cloud.documentai.v1.Document.DocumentLayout - * @interface IDocumentLayoutBlock - * @property {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTextBlock|null} [textBlock] DocumentLayoutBlock textBlock - * @property {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableBlock|null} [tableBlock] DocumentLayoutBlock tableBlock - * @property {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListBlock|null} [listBlock] DocumentLayoutBlock listBlock - * @property {string|null} [blockId] DocumentLayoutBlock blockId - * @property {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutPageSpan|null} [pageSpan] DocumentLayoutBlock pageSpan - * @property {google.cloud.documentai.v1.IBoundingPoly|null} [boundingBox] DocumentLayoutBlock boundingBox - */ - - /** - * Constructs a new DocumentLayoutBlock. - * @memberof google.cloud.documentai.v1.Document.DocumentLayout - * @classdesc Represents a DocumentLayoutBlock. - * @implements IDocumentLayoutBlock - * @constructor - * @param {google.cloud.documentai.v1.Document.DocumentLayout.IDocumentLayoutBlock=} [properties] Properties to set - */ - function DocumentLayoutBlock(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]]; - } - - /** - * DocumentLayoutBlock textBlock. - * @member {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTextBlock|null|undefined} textBlock - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock - * @instance - */ - DocumentLayoutBlock.prototype.textBlock = null; - - /** - * DocumentLayoutBlock tableBlock. - * @member {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableBlock|null|undefined} tableBlock - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock - * @instance - */ - DocumentLayoutBlock.prototype.tableBlock = null; - - /** - * DocumentLayoutBlock listBlock. - * @member {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListBlock|null|undefined} listBlock - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock - * @instance - */ - DocumentLayoutBlock.prototype.listBlock = null; - - /** - * DocumentLayoutBlock blockId. - * @member {string} blockId - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock - * @instance - */ - DocumentLayoutBlock.prototype.blockId = ""; - - /** - * DocumentLayoutBlock pageSpan. - * @member {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutPageSpan|null|undefined} pageSpan - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock - * @instance - */ - DocumentLayoutBlock.prototype.pageSpan = null; - - /** - * DocumentLayoutBlock boundingBox. - * @member {google.cloud.documentai.v1.IBoundingPoly|null|undefined} boundingBox - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock - * @instance - */ - DocumentLayoutBlock.prototype.boundingBox = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * DocumentLayoutBlock block. - * @member {"textBlock"|"tableBlock"|"listBlock"|undefined} block - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock - * @instance - */ - Object.defineProperty(DocumentLayoutBlock.prototype, "block", { - get: $util.oneOfGetter($oneOfFields = ["textBlock", "tableBlock", "listBlock"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new DocumentLayoutBlock instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock - * @static - * @param {google.cloud.documentai.v1.Document.DocumentLayout.IDocumentLayoutBlock=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock} DocumentLayoutBlock instance - */ - DocumentLayoutBlock.create = function create(properties) { - return new DocumentLayoutBlock(properties); - }; - - /** - * Encodes the specified DocumentLayoutBlock message. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock - * @static - * @param {google.cloud.documentai.v1.Document.DocumentLayout.IDocumentLayoutBlock} message DocumentLayoutBlock message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DocumentLayoutBlock.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.blockId != null && Object.hasOwnProperty.call(message, "blockId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.blockId); - if (message.textBlock != null && Object.hasOwnProperty.call(message, "textBlock")) - $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock.encode(message.textBlock, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.tableBlock != null && Object.hasOwnProperty.call(message, "tableBlock")) - $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock.encode(message.tableBlock, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.listBlock != null && Object.hasOwnProperty.call(message, "listBlock")) - $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock.encode(message.listBlock, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.pageSpan != null && Object.hasOwnProperty.call(message, "pageSpan")) - $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan.encode(message.pageSpan, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.boundingBox != null && Object.hasOwnProperty.call(message, "boundingBox")) - $root.google.cloud.documentai.v1.BoundingPoly.encode(message.boundingBox, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DocumentLayoutBlock message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock - * @static - * @param {google.cloud.documentai.v1.Document.DocumentLayout.IDocumentLayoutBlock} message DocumentLayoutBlock message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DocumentLayoutBlock.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DocumentLayoutBlock message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock} DocumentLayoutBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DocumentLayoutBlock.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.textBlock = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock.decode(reader, reader.uint32()); - break; - } - case 3: { - message.tableBlock = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock.decode(reader, reader.uint32()); - break; - } - case 4: { - message.listBlock = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock.decode(reader, reader.uint32()); - break; - } - case 1: { - message.blockId = reader.string(); - break; - } - case 5: { - message.pageSpan = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan.decode(reader, reader.uint32()); - break; - } - case 6: { - message.boundingBox = $root.google.cloud.documentai.v1.BoundingPoly.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DocumentLayoutBlock message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock} DocumentLayoutBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DocumentLayoutBlock.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DocumentLayoutBlock message. - * @function verify - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DocumentLayoutBlock.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.textBlock != null && message.hasOwnProperty("textBlock")) { - properties.block = 1; - { - var error = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock.verify(message.textBlock); - if (error) - return "textBlock." + error; - } - } - if (message.tableBlock != null && message.hasOwnProperty("tableBlock")) { - if (properties.block === 1) - return "block: multiple values"; - properties.block = 1; - { - var error = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock.verify(message.tableBlock); - if (error) - return "tableBlock." + error; - } - } - if (message.listBlock != null && message.hasOwnProperty("listBlock")) { - if (properties.block === 1) - return "block: multiple values"; - properties.block = 1; - { - var error = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock.verify(message.listBlock); - if (error) - return "listBlock." + error; - } - } - if (message.blockId != null && message.hasOwnProperty("blockId")) - if (!$util.isString(message.blockId)) - return "blockId: string expected"; - if (message.pageSpan != null && message.hasOwnProperty("pageSpan")) { - var error = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan.verify(message.pageSpan); - if (error) - return "pageSpan." + error; - } - if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) { - var error = $root.google.cloud.documentai.v1.BoundingPoly.verify(message.boundingBox); - if (error) - return "boundingBox." + error; - } - return null; - }; - - /** - * Creates a DocumentLayoutBlock message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock} DocumentLayoutBlock - */ - DocumentLayoutBlock.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock) - return object; - var message = new $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock(); - if (object.textBlock != null) { - if (typeof object.textBlock !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.textBlock: object expected"); - message.textBlock = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock.fromObject(object.textBlock); - } - if (object.tableBlock != null) { - if (typeof object.tableBlock !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.tableBlock: object expected"); - message.tableBlock = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock.fromObject(object.tableBlock); - } - if (object.listBlock != null) { - if (typeof object.listBlock !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.listBlock: object expected"); - message.listBlock = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock.fromObject(object.listBlock); - } - if (object.blockId != null) - message.blockId = String(object.blockId); - if (object.pageSpan != null) { - if (typeof object.pageSpan !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.pageSpan: object expected"); - message.pageSpan = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan.fromObject(object.pageSpan); - } - if (object.boundingBox != null) { - if (typeof object.boundingBox !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.boundingBox: object expected"); - message.boundingBox = $root.google.cloud.documentai.v1.BoundingPoly.fromObject(object.boundingBox); - } - return message; - }; - - /** - * Creates a plain object from a DocumentLayoutBlock message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock - * @static - * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock} message DocumentLayoutBlock - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DocumentLayoutBlock.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.blockId = ""; - object.pageSpan = null; - object.boundingBox = null; - } - if (message.blockId != null && message.hasOwnProperty("blockId")) - object.blockId = message.blockId; - if (message.textBlock != null && message.hasOwnProperty("textBlock")) { - object.textBlock = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock.toObject(message.textBlock, options); - if (options.oneofs) - object.block = "textBlock"; - } - if (message.tableBlock != null && message.hasOwnProperty("tableBlock")) { - object.tableBlock = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock.toObject(message.tableBlock, options); - if (options.oneofs) - object.block = "tableBlock"; - } - if (message.listBlock != null && message.hasOwnProperty("listBlock")) { - object.listBlock = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock.toObject(message.listBlock, options); - if (options.oneofs) - object.block = "listBlock"; - } - if (message.pageSpan != null && message.hasOwnProperty("pageSpan")) - object.pageSpan = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan.toObject(message.pageSpan, options); - if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) - object.boundingBox = $root.google.cloud.documentai.v1.BoundingPoly.toObject(message.boundingBox, options); - return object; - }; - - /** - * Converts this DocumentLayoutBlock to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock - * @instance - * @returns {Object.} JSON object - */ - DocumentLayoutBlock.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DocumentLayoutBlock - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DocumentLayoutBlock.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock"; - }; - - DocumentLayoutBlock.LayoutPageSpan = (function() { - - /** - * Properties of a LayoutPageSpan. - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock - * @interface ILayoutPageSpan - * @property {number|null} [pageStart] LayoutPageSpan pageStart - * @property {number|null} [pageEnd] LayoutPageSpan pageEnd - */ - - /** - * Constructs a new LayoutPageSpan. - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock - * @classdesc Represents a LayoutPageSpan. - * @implements ILayoutPageSpan - * @constructor - * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutPageSpan=} [properties] Properties to set - */ - function LayoutPageSpan(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]]; - } - - /** - * LayoutPageSpan pageStart. - * @member {number} pageStart - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan - * @instance - */ - LayoutPageSpan.prototype.pageStart = 0; - - /** - * LayoutPageSpan pageEnd. - * @member {number} pageEnd - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan - * @instance - */ - LayoutPageSpan.prototype.pageEnd = 0; - - /** - * Creates a new LayoutPageSpan instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan - * @static - * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutPageSpan=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan} LayoutPageSpan instance - */ - LayoutPageSpan.create = function create(properties) { - return new LayoutPageSpan(properties); - }; - - /** - * Encodes the specified LayoutPageSpan message. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan - * @static - * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutPageSpan} message LayoutPageSpan message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LayoutPageSpan.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pageStart != null && Object.hasOwnProperty.call(message, "pageStart")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.pageStart); - if (message.pageEnd != null && Object.hasOwnProperty.call(message, "pageEnd")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageEnd); - return writer; - }; - - /** - * Encodes the specified LayoutPageSpan message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan - * @static - * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutPageSpan} message LayoutPageSpan message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LayoutPageSpan.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LayoutPageSpan message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan} LayoutPageSpan - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LayoutPageSpan.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.pageStart = reader.int32(); - break; - } - case 2: { - message.pageEnd = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LayoutPageSpan message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan} LayoutPageSpan - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LayoutPageSpan.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LayoutPageSpan message. - * @function verify - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LayoutPageSpan.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pageStart != null && message.hasOwnProperty("pageStart")) - if (!$util.isInteger(message.pageStart)) - return "pageStart: integer expected"; - if (message.pageEnd != null && message.hasOwnProperty("pageEnd")) - if (!$util.isInteger(message.pageEnd)) - return "pageEnd: integer expected"; - return null; - }; - - /** - * Creates a LayoutPageSpan message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan} LayoutPageSpan - */ - LayoutPageSpan.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan) - return object; - var message = new $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan(); - if (object.pageStart != null) - message.pageStart = object.pageStart | 0; - if (object.pageEnd != null) - message.pageEnd = object.pageEnd | 0; - return message; - }; - - /** - * Creates a plain object from a LayoutPageSpan message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan - * @static - * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan} message LayoutPageSpan - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LayoutPageSpan.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.pageStart = 0; - object.pageEnd = 0; - } - if (message.pageStart != null && message.hasOwnProperty("pageStart")) - object.pageStart = message.pageStart; - if (message.pageEnd != null && message.hasOwnProperty("pageEnd")) - object.pageEnd = message.pageEnd; - return object; - }; - - /** - * Converts this LayoutPageSpan to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan - * @instance - * @returns {Object.} JSON object - */ - LayoutPageSpan.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LayoutPageSpan - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LayoutPageSpan.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan"; - }; - - return LayoutPageSpan; - })(); - - DocumentLayoutBlock.LayoutTextBlock = (function() { - - /** - * Properties of a LayoutTextBlock. - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock - * @interface ILayoutTextBlock - * @property {string|null} [text] LayoutTextBlock text - * @property {string|null} [type] LayoutTextBlock type - * @property {Array.|null} [blocks] LayoutTextBlock blocks - */ - - /** - * Constructs a new LayoutTextBlock. - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock - * @classdesc Represents a LayoutTextBlock. - * @implements ILayoutTextBlock - * @constructor - * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTextBlock=} [properties] Properties to set - */ - function LayoutTextBlock(properties) { - this.blocks = []; - 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]]; - } - - /** - * LayoutTextBlock text. - * @member {string} text - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock - * @instance - */ - LayoutTextBlock.prototype.text = ""; - - /** - * LayoutTextBlock type. - * @member {string} type - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock - * @instance - */ - LayoutTextBlock.prototype.type = ""; - - /** - * LayoutTextBlock blocks. - * @member {Array.} blocks - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock - * @instance - */ - LayoutTextBlock.prototype.blocks = $util.emptyArray; - - /** - * Creates a new LayoutTextBlock instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock - * @static - * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTextBlock=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock} LayoutTextBlock instance - */ - LayoutTextBlock.create = function create(properties) { - return new LayoutTextBlock(properties); - }; - - /** - * Encodes the specified LayoutTextBlock message. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock - * @static - * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTextBlock} message LayoutTextBlock message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LayoutTextBlock.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.text != null && Object.hasOwnProperty.call(message, "text")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); - if (message.blocks != null && message.blocks.length) - for (var i = 0; i < message.blocks.length; ++i) - $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.encode(message.blocks[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified LayoutTextBlock message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock - * @static - * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTextBlock} message LayoutTextBlock message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LayoutTextBlock.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LayoutTextBlock message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock} LayoutTextBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LayoutTextBlock.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.text = reader.string(); - break; - } - case 2: { - message.type = reader.string(); - break; - } - case 3: { - if (!(message.blocks && message.blocks.length)) - message.blocks = []; - message.blocks.push($root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LayoutTextBlock message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock} LayoutTextBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LayoutTextBlock.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LayoutTextBlock message. - * @function verify - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LayoutTextBlock.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.text != null && message.hasOwnProperty("text")) - if (!$util.isString(message.text)) - return "text: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.blocks != null && message.hasOwnProperty("blocks")) { - if (!Array.isArray(message.blocks)) - return "blocks: array expected"; - for (var i = 0; i < message.blocks.length; ++i) { - var error = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.verify(message.blocks[i]); - if (error) - return "blocks." + error; - } - } - return null; - }; - - /** - * Creates a LayoutTextBlock message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock} LayoutTextBlock - */ - LayoutTextBlock.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock) - return object; - var message = new $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock(); - if (object.text != null) - message.text = String(object.text); - if (object.type != null) - message.type = String(object.type); - if (object.blocks) { - if (!Array.isArray(object.blocks)) - throw TypeError(".google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock.blocks: array expected"); - message.blocks = []; - for (var i = 0; i < object.blocks.length; ++i) { - if (typeof object.blocks[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock.blocks: object expected"); - message.blocks[i] = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.fromObject(object.blocks[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a LayoutTextBlock message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock - * @static - * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock} message LayoutTextBlock - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LayoutTextBlock.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.blocks = []; - if (options.defaults) { - object.text = ""; - object.type = ""; - } - if (message.text != null && message.hasOwnProperty("text")) - object.text = message.text; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.blocks && message.blocks.length) { - object.blocks = []; - for (var j = 0; j < message.blocks.length; ++j) - object.blocks[j] = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.toObject(message.blocks[j], options); - } - return object; - }; - - /** - * Converts this LayoutTextBlock to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock - * @instance - * @returns {Object.} JSON object - */ - LayoutTextBlock.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LayoutTextBlock - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LayoutTextBlock.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock"; - }; - - return LayoutTextBlock; - })(); - - DocumentLayoutBlock.LayoutTableBlock = (function() { - - /** - * Properties of a LayoutTableBlock. - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock - * @interface ILayoutTableBlock - * @property {Array.|null} [headerRows] LayoutTableBlock headerRows - * @property {Array.|null} [bodyRows] LayoutTableBlock bodyRows - * @property {string|null} [caption] LayoutTableBlock caption - */ - - /** - * Constructs a new LayoutTableBlock. - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock - * @classdesc Represents a LayoutTableBlock. - * @implements ILayoutTableBlock - * @constructor - * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableBlock=} [properties] Properties to set - */ - function LayoutTableBlock(properties) { - this.headerRows = []; - this.bodyRows = []; - 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]]; - } - - /** - * LayoutTableBlock headerRows. - * @member {Array.} headerRows - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock - * @instance - */ - LayoutTableBlock.prototype.headerRows = $util.emptyArray; - - /** - * LayoutTableBlock bodyRows. - * @member {Array.} bodyRows - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock - * @instance - */ - LayoutTableBlock.prototype.bodyRows = $util.emptyArray; - - /** - * LayoutTableBlock caption. - * @member {string} caption - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock - * @instance - */ - LayoutTableBlock.prototype.caption = ""; - - /** - * Creates a new LayoutTableBlock instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock - * @static - * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableBlock=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock} LayoutTableBlock instance - */ - LayoutTableBlock.create = function create(properties) { - return new LayoutTableBlock(properties); - }; - - /** - * Encodes the specified LayoutTableBlock message. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock - * @static - * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableBlock} message LayoutTableBlock message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LayoutTableBlock.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.headerRows != null && message.headerRows.length) - for (var i = 0; i < message.headerRows.length; ++i) - $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow.encode(message.headerRows[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.bodyRows != null && message.bodyRows.length) - for (var i = 0; i < message.bodyRows.length; ++i) - $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow.encode(message.bodyRows[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.caption != null && Object.hasOwnProperty.call(message, "caption")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.caption); - return writer; - }; - - /** - * Encodes the specified LayoutTableBlock message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock - * @static - * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableBlock} message LayoutTableBlock message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LayoutTableBlock.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LayoutTableBlock message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock} LayoutTableBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LayoutTableBlock.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.headerRows && message.headerRows.length)) - message.headerRows = []; - message.headerRows.push($root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.bodyRows && message.bodyRows.length)) - message.bodyRows = []; - message.bodyRows.push($root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow.decode(reader, reader.uint32())); - break; - } - case 3: { - message.caption = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LayoutTableBlock message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock} LayoutTableBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LayoutTableBlock.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LayoutTableBlock message. - * @function verify - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LayoutTableBlock.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.headerRows != null && message.hasOwnProperty("headerRows")) { - if (!Array.isArray(message.headerRows)) - return "headerRows: array expected"; - for (var i = 0; i < message.headerRows.length; ++i) { - var error = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow.verify(message.headerRows[i]); - if (error) - return "headerRows." + error; - } - } - if (message.bodyRows != null && message.hasOwnProperty("bodyRows")) { - if (!Array.isArray(message.bodyRows)) - return "bodyRows: array expected"; - for (var i = 0; i < message.bodyRows.length; ++i) { - var error = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow.verify(message.bodyRows[i]); - if (error) - return "bodyRows." + error; - } - } - if (message.caption != null && message.hasOwnProperty("caption")) - if (!$util.isString(message.caption)) - return "caption: string expected"; - return null; - }; - - /** - * Creates a LayoutTableBlock message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock} LayoutTableBlock - */ - LayoutTableBlock.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock) - return object; - var message = new $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock(); - if (object.headerRows) { - if (!Array.isArray(object.headerRows)) - throw TypeError(".google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock.headerRows: array expected"); - message.headerRows = []; - for (var i = 0; i < object.headerRows.length; ++i) { - if (typeof object.headerRows[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock.headerRows: object expected"); - message.headerRows[i] = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow.fromObject(object.headerRows[i]); - } - } - if (object.bodyRows) { - if (!Array.isArray(object.bodyRows)) - throw TypeError(".google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock.bodyRows: array expected"); - message.bodyRows = []; - for (var i = 0; i < object.bodyRows.length; ++i) { - if (typeof object.bodyRows[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock.bodyRows: object expected"); - message.bodyRows[i] = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow.fromObject(object.bodyRows[i]); - } - } - if (object.caption != null) - message.caption = String(object.caption); - return message; - }; - - /** - * Creates a plain object from a LayoutTableBlock message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock - * @static - * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock} message LayoutTableBlock - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LayoutTableBlock.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.headerRows = []; - object.bodyRows = []; - } - if (options.defaults) - object.caption = ""; - if (message.headerRows && message.headerRows.length) { - object.headerRows = []; - for (var j = 0; j < message.headerRows.length; ++j) - object.headerRows[j] = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow.toObject(message.headerRows[j], options); - } - if (message.bodyRows && message.bodyRows.length) { - object.bodyRows = []; - for (var j = 0; j < message.bodyRows.length; ++j) - object.bodyRows[j] = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow.toObject(message.bodyRows[j], options); - } - if (message.caption != null && message.hasOwnProperty("caption")) - object.caption = message.caption; - return object; - }; - - /** - * Converts this LayoutTableBlock to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock - * @instance - * @returns {Object.} JSON object - */ - LayoutTableBlock.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LayoutTableBlock - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LayoutTableBlock.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock"; - }; - - return LayoutTableBlock; - })(); - - DocumentLayoutBlock.LayoutTableRow = (function() { - - /** - * Properties of a LayoutTableRow. - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock - * @interface ILayoutTableRow - * @property {Array.|null} [cells] LayoutTableRow cells - */ - - /** - * Constructs a new LayoutTableRow. - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock - * @classdesc Represents a LayoutTableRow. - * @implements ILayoutTableRow - * @constructor - * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableRow=} [properties] Properties to set - */ - function LayoutTableRow(properties) { - this.cells = []; - 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]]; - } - - /** - * LayoutTableRow cells. - * @member {Array.} cells - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow - * @instance - */ - LayoutTableRow.prototype.cells = $util.emptyArray; - - /** - * Creates a new LayoutTableRow instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow - * @static - * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableRow=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow} LayoutTableRow instance - */ - LayoutTableRow.create = function create(properties) { - return new LayoutTableRow(properties); - }; - - /** - * Encodes the specified LayoutTableRow message. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow - * @static - * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableRow} message LayoutTableRow message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LayoutTableRow.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.cells != null && message.cells.length) - for (var i = 0; i < message.cells.length; ++i) - $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell.encode(message.cells[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified LayoutTableRow message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow - * @static - * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableRow} message LayoutTableRow message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LayoutTableRow.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LayoutTableRow message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow} LayoutTableRow - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LayoutTableRow.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.cells && message.cells.length)) - message.cells = []; - message.cells.push($root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LayoutTableRow message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow} LayoutTableRow - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LayoutTableRow.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LayoutTableRow message. - * @function verify - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LayoutTableRow.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.cells != null && message.hasOwnProperty("cells")) { - if (!Array.isArray(message.cells)) - return "cells: array expected"; - for (var i = 0; i < message.cells.length; ++i) { - var error = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell.verify(message.cells[i]); - if (error) - return "cells." + error; - } - } - return null; - }; - - /** - * Creates a LayoutTableRow message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow} LayoutTableRow - */ - LayoutTableRow.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow) - return object; - var message = new $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow(); - if (object.cells) { - if (!Array.isArray(object.cells)) - throw TypeError(".google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow.cells: array expected"); - message.cells = []; - for (var i = 0; i < object.cells.length; ++i) { - if (typeof object.cells[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow.cells: object expected"); - message.cells[i] = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell.fromObject(object.cells[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a LayoutTableRow message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow - * @static - * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow} message LayoutTableRow - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LayoutTableRow.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.cells = []; - if (message.cells && message.cells.length) { - object.cells = []; - for (var j = 0; j < message.cells.length; ++j) - object.cells[j] = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell.toObject(message.cells[j], options); - } - return object; - }; - - /** - * Converts this LayoutTableRow to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow - * @instance - * @returns {Object.} JSON object - */ - LayoutTableRow.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LayoutTableRow - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LayoutTableRow.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow"; - }; - - return LayoutTableRow; - })(); - - DocumentLayoutBlock.LayoutTableCell = (function() { - - /** - * Properties of a LayoutTableCell. - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock - * @interface ILayoutTableCell - * @property {Array.|null} [blocks] LayoutTableCell blocks - * @property {number|null} [rowSpan] LayoutTableCell rowSpan - * @property {number|null} [colSpan] LayoutTableCell colSpan - */ - - /** - * Constructs a new LayoutTableCell. - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock - * @classdesc Represents a LayoutTableCell. - * @implements ILayoutTableCell - * @constructor - * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableCell=} [properties] Properties to set - */ - function LayoutTableCell(properties) { - this.blocks = []; - 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]]; - } - - /** - * LayoutTableCell blocks. - * @member {Array.} blocks - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell - * @instance - */ - LayoutTableCell.prototype.blocks = $util.emptyArray; - - /** - * LayoutTableCell rowSpan. - * @member {number} rowSpan - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell - * @instance - */ - LayoutTableCell.prototype.rowSpan = 0; - - /** - * LayoutTableCell colSpan. - * @member {number} colSpan - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell - * @instance - */ - LayoutTableCell.prototype.colSpan = 0; - - /** - * Creates a new LayoutTableCell instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell - * @static - * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableCell=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell} LayoutTableCell instance - */ - LayoutTableCell.create = function create(properties) { - return new LayoutTableCell(properties); - }; - - /** - * Encodes the specified LayoutTableCell message. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell - * @static - * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableCell} message LayoutTableCell message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LayoutTableCell.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.blocks != null && message.blocks.length) - for (var i = 0; i < message.blocks.length; ++i) - $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.encode(message.blocks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.rowSpan != null && Object.hasOwnProperty.call(message, "rowSpan")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.rowSpan); - if (message.colSpan != null && Object.hasOwnProperty.call(message, "colSpan")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.colSpan); - return writer; - }; - - /** - * Encodes the specified LayoutTableCell message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell - * @static - * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableCell} message LayoutTableCell message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LayoutTableCell.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LayoutTableCell message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell} LayoutTableCell - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LayoutTableCell.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.blocks && message.blocks.length)) - message.blocks = []; - message.blocks.push($root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.decode(reader, reader.uint32())); - break; - } - case 2: { - message.rowSpan = reader.int32(); - break; - } - case 3: { - message.colSpan = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LayoutTableCell message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell} LayoutTableCell - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LayoutTableCell.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LayoutTableCell message. - * @function verify - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LayoutTableCell.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.blocks != null && message.hasOwnProperty("blocks")) { - if (!Array.isArray(message.blocks)) - return "blocks: array expected"; - for (var i = 0; i < message.blocks.length; ++i) { - var error = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.verify(message.blocks[i]); - if (error) - return "blocks." + error; - } - } - if (message.rowSpan != null && message.hasOwnProperty("rowSpan")) - if (!$util.isInteger(message.rowSpan)) - return "rowSpan: integer expected"; - if (message.colSpan != null && message.hasOwnProperty("colSpan")) - if (!$util.isInteger(message.colSpan)) - return "colSpan: integer expected"; - return null; - }; - - /** - * Creates a LayoutTableCell message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell} LayoutTableCell - */ - LayoutTableCell.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell) - return object; - var message = new $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell(); - if (object.blocks) { - if (!Array.isArray(object.blocks)) - throw TypeError(".google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell.blocks: array expected"); - message.blocks = []; - for (var i = 0; i < object.blocks.length; ++i) { - if (typeof object.blocks[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell.blocks: object expected"); - message.blocks[i] = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.fromObject(object.blocks[i]); - } - } - if (object.rowSpan != null) - message.rowSpan = object.rowSpan | 0; - if (object.colSpan != null) - message.colSpan = object.colSpan | 0; - return message; - }; - - /** - * Creates a plain object from a LayoutTableCell message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell - * @static - * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell} message LayoutTableCell - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LayoutTableCell.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.blocks = []; - if (options.defaults) { - object.rowSpan = 0; - object.colSpan = 0; - } - if (message.blocks && message.blocks.length) { - object.blocks = []; - for (var j = 0; j < message.blocks.length; ++j) - object.blocks[j] = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.toObject(message.blocks[j], options); - } - if (message.rowSpan != null && message.hasOwnProperty("rowSpan")) - object.rowSpan = message.rowSpan; - if (message.colSpan != null && message.hasOwnProperty("colSpan")) - object.colSpan = message.colSpan; - return object; - }; - - /** - * Converts this LayoutTableCell to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell - * @instance - * @returns {Object.} JSON object - */ - LayoutTableCell.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LayoutTableCell - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LayoutTableCell.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell"; - }; - - return LayoutTableCell; - })(); - - DocumentLayoutBlock.LayoutListBlock = (function() { - - /** - * Properties of a LayoutListBlock. - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock - * @interface ILayoutListBlock - * @property {Array.|null} [listEntries] LayoutListBlock listEntries - * @property {string|null} [type] LayoutListBlock type - */ - - /** - * Constructs a new LayoutListBlock. - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock - * @classdesc Represents a LayoutListBlock. - * @implements ILayoutListBlock - * @constructor - * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListBlock=} [properties] Properties to set - */ - function LayoutListBlock(properties) { - this.listEntries = []; - 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]]; - } - - /** - * LayoutListBlock listEntries. - * @member {Array.} listEntries - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock - * @instance - */ - LayoutListBlock.prototype.listEntries = $util.emptyArray; - - /** - * LayoutListBlock type. - * @member {string} type - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock - * @instance - */ - LayoutListBlock.prototype.type = ""; - - /** - * Creates a new LayoutListBlock instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock - * @static - * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListBlock=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock} LayoutListBlock instance - */ - LayoutListBlock.create = function create(properties) { - return new LayoutListBlock(properties); - }; - - /** - * Encodes the specified LayoutListBlock message. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock - * @static - * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListBlock} message LayoutListBlock message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LayoutListBlock.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.listEntries != null && message.listEntries.length) - for (var i = 0; i < message.listEntries.length; ++i) - $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry.encode(message.listEntries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); - return writer; - }; - - /** - * Encodes the specified LayoutListBlock message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock - * @static - * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListBlock} message LayoutListBlock message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LayoutListBlock.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LayoutListBlock message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock} LayoutListBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LayoutListBlock.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.listEntries && message.listEntries.length)) - message.listEntries = []; - message.listEntries.push($root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry.decode(reader, reader.uint32())); - break; - } - case 2: { - message.type = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LayoutListBlock message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock} LayoutListBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LayoutListBlock.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LayoutListBlock message. - * @function verify - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LayoutListBlock.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.listEntries != null && message.hasOwnProperty("listEntries")) { - if (!Array.isArray(message.listEntries)) - return "listEntries: array expected"; - for (var i = 0; i < message.listEntries.length; ++i) { - var error = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry.verify(message.listEntries[i]); - if (error) - return "listEntries." + error; - } - } - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - return null; - }; - - /** - * Creates a LayoutListBlock message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock} LayoutListBlock - */ - LayoutListBlock.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock) - return object; - var message = new $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock(); - if (object.listEntries) { - if (!Array.isArray(object.listEntries)) - throw TypeError(".google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock.listEntries: array expected"); - message.listEntries = []; - for (var i = 0; i < object.listEntries.length; ++i) { - if (typeof object.listEntries[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock.listEntries: object expected"); - message.listEntries[i] = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry.fromObject(object.listEntries[i]); - } - } - if (object.type != null) - message.type = String(object.type); - return message; - }; - - /** - * Creates a plain object from a LayoutListBlock message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock - * @static - * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock} message LayoutListBlock - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LayoutListBlock.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.listEntries = []; - if (options.defaults) - object.type = ""; - if (message.listEntries && message.listEntries.length) { - object.listEntries = []; - for (var j = 0; j < message.listEntries.length; ++j) - object.listEntries[j] = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry.toObject(message.listEntries[j], options); - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - return object; - }; - - /** - * Converts this LayoutListBlock to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock - * @instance - * @returns {Object.} JSON object - */ - LayoutListBlock.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LayoutListBlock - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LayoutListBlock.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock"; - }; - - return LayoutListBlock; - })(); - - DocumentLayoutBlock.LayoutListEntry = (function() { - - /** - * Properties of a LayoutListEntry. - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock - * @interface ILayoutListEntry - * @property {Array.|null} [blocks] LayoutListEntry blocks - */ - - /** - * Constructs a new LayoutListEntry. - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock - * @classdesc Represents a LayoutListEntry. - * @implements ILayoutListEntry - * @constructor - * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListEntry=} [properties] Properties to set - */ - function LayoutListEntry(properties) { - this.blocks = []; - 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]]; - } - - /** - * LayoutListEntry blocks. - * @member {Array.} blocks - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry - * @instance - */ - LayoutListEntry.prototype.blocks = $util.emptyArray; - - /** - * Creates a new LayoutListEntry instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry - * @static - * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListEntry=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry} LayoutListEntry instance - */ - LayoutListEntry.create = function create(properties) { - return new LayoutListEntry(properties); - }; - - /** - * Encodes the specified LayoutListEntry message. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry - * @static - * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListEntry} message LayoutListEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LayoutListEntry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.blocks != null && message.blocks.length) - for (var i = 0; i < message.blocks.length; ++i) - $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.encode(message.blocks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified LayoutListEntry message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry - * @static - * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListEntry} message LayoutListEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LayoutListEntry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LayoutListEntry message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry} LayoutListEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LayoutListEntry.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.blocks && message.blocks.length)) - message.blocks = []; - message.blocks.push($root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LayoutListEntry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry} LayoutListEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LayoutListEntry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LayoutListEntry message. - * @function verify - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LayoutListEntry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.blocks != null && message.hasOwnProperty("blocks")) { - if (!Array.isArray(message.blocks)) - return "blocks: array expected"; - for (var i = 0; i < message.blocks.length; ++i) { - var error = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.verify(message.blocks[i]); - if (error) - return "blocks." + error; - } - } - return null; - }; - - /** - * Creates a LayoutListEntry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry} LayoutListEntry - */ - LayoutListEntry.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry) - return object; - var message = new $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry(); - if (object.blocks) { - if (!Array.isArray(object.blocks)) - throw TypeError(".google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry.blocks: array expected"); - message.blocks = []; - for (var i = 0; i < object.blocks.length; ++i) { - if (typeof object.blocks[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry.blocks: object expected"); - message.blocks[i] = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.fromObject(object.blocks[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a LayoutListEntry message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry - * @static - * @param {google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry} message LayoutListEntry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LayoutListEntry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.blocks = []; - if (message.blocks && message.blocks.length) { - object.blocks = []; - for (var j = 0; j < message.blocks.length; ++j) - object.blocks[j] = $root.google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.toObject(message.blocks[j], options); - } - return object; - }; - - /** - * Converts this LayoutListEntry to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry - * @instance - * @returns {Object.} JSON object - */ - LayoutListEntry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LayoutListEntry - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LayoutListEntry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry"; - }; - - return LayoutListEntry; - })(); - - return DocumentLayoutBlock; - })(); - - return DocumentLayout; - })(); - - Document.ChunkedDocument = (function() { - - /** - * Properties of a ChunkedDocument. - * @memberof google.cloud.documentai.v1.Document - * @interface IChunkedDocument - * @property {Array.|null} [chunks] ChunkedDocument chunks - */ - - /** - * Constructs a new ChunkedDocument. - * @memberof google.cloud.documentai.v1.Document - * @classdesc Represents a ChunkedDocument. - * @implements IChunkedDocument - * @constructor - * @param {google.cloud.documentai.v1.Document.IChunkedDocument=} [properties] Properties to set - */ - function ChunkedDocument(properties) { - this.chunks = []; - 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]]; - } - - /** - * ChunkedDocument chunks. - * @member {Array.} chunks - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument - * @instance - */ - ChunkedDocument.prototype.chunks = $util.emptyArray; - - /** - * Creates a new ChunkedDocument instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument - * @static - * @param {google.cloud.documentai.v1.Document.IChunkedDocument=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.ChunkedDocument} ChunkedDocument instance - */ - ChunkedDocument.create = function create(properties) { - return new ChunkedDocument(properties); - }; - - /** - * Encodes the specified ChunkedDocument message. Does not implicitly {@link google.cloud.documentai.v1.Document.ChunkedDocument.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument - * @static - * @param {google.cloud.documentai.v1.Document.IChunkedDocument} message ChunkedDocument message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ChunkedDocument.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.chunks != null && message.chunks.length) - for (var i = 0; i < message.chunks.length; ++i) - $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.encode(message.chunks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ChunkedDocument message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.ChunkedDocument.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument - * @static - * @param {google.cloud.documentai.v1.Document.IChunkedDocument} message ChunkedDocument message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ChunkedDocument.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ChunkedDocument message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.ChunkedDocument} ChunkedDocument - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ChunkedDocument.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.ChunkedDocument(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.chunks && message.chunks.length)) - message.chunks = []; - message.chunks.push($root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ChunkedDocument message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.ChunkedDocument} ChunkedDocument - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ChunkedDocument.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ChunkedDocument message. - * @function verify - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ChunkedDocument.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.chunks != null && message.hasOwnProperty("chunks")) { - if (!Array.isArray(message.chunks)) - return "chunks: array expected"; - for (var i = 0; i < message.chunks.length; ++i) { - var error = $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.verify(message.chunks[i]); - if (error) - return "chunks." + error; - } - } - return null; - }; - - /** - * Creates a ChunkedDocument message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.ChunkedDocument} ChunkedDocument - */ - ChunkedDocument.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.ChunkedDocument) - return object; - var message = new $root.google.cloud.documentai.v1.Document.ChunkedDocument(); - if (object.chunks) { - if (!Array.isArray(object.chunks)) - throw TypeError(".google.cloud.documentai.v1.Document.ChunkedDocument.chunks: array expected"); - message.chunks = []; - for (var i = 0; i < object.chunks.length; ++i) { - if (typeof object.chunks[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.ChunkedDocument.chunks: object expected"); - message.chunks[i] = $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.fromObject(object.chunks[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a ChunkedDocument message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument - * @static - * @param {google.cloud.documentai.v1.Document.ChunkedDocument} message ChunkedDocument - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ChunkedDocument.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.chunks = []; - if (message.chunks && message.chunks.length) { - object.chunks = []; - for (var j = 0; j < message.chunks.length; ++j) - object.chunks[j] = $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.toObject(message.chunks[j], options); - } - return object; - }; - - /** - * Converts this ChunkedDocument to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument - * @instance - * @returns {Object.} JSON object - */ - ChunkedDocument.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ChunkedDocument - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ChunkedDocument.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.ChunkedDocument"; - }; - - ChunkedDocument.Chunk = (function() { - - /** - * Properties of a Chunk. - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument - * @interface IChunk - * @property {string|null} [chunkId] Chunk chunkId - * @property {Array.|null} [sourceBlockIds] Chunk sourceBlockIds - * @property {string|null} [content] Chunk content - * @property {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageSpan|null} [pageSpan] Chunk pageSpan - * @property {Array.|null} [pageHeaders] Chunk pageHeaders - * @property {Array.|null} [pageFooters] Chunk pageFooters - */ - - /** - * Constructs a new Chunk. - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument - * @classdesc Represents a Chunk. - * @implements IChunk - * @constructor - * @param {google.cloud.documentai.v1.Document.ChunkedDocument.IChunk=} [properties] Properties to set - */ - function Chunk(properties) { - this.sourceBlockIds = []; - this.pageHeaders = []; - this.pageFooters = []; - 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]]; - } - - /** - * Chunk chunkId. - * @member {string} chunkId - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk - * @instance - */ - Chunk.prototype.chunkId = ""; - - /** - * Chunk sourceBlockIds. - * @member {Array.} sourceBlockIds - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk - * @instance - */ - Chunk.prototype.sourceBlockIds = $util.emptyArray; - - /** - * Chunk content. - * @member {string} content - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk - * @instance - */ - Chunk.prototype.content = ""; - - /** - * Chunk pageSpan. - * @member {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageSpan|null|undefined} pageSpan - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk - * @instance - */ - Chunk.prototype.pageSpan = null; - - /** - * Chunk pageHeaders. - * @member {Array.} pageHeaders - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk - * @instance - */ - Chunk.prototype.pageHeaders = $util.emptyArray; - - /** - * Chunk pageFooters. - * @member {Array.} pageFooters - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk - * @instance - */ - Chunk.prototype.pageFooters = $util.emptyArray; - - /** - * Creates a new Chunk instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk - * @static - * @param {google.cloud.documentai.v1.Document.ChunkedDocument.IChunk=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk} Chunk instance - */ - Chunk.create = function create(properties) { - return new Chunk(properties); - }; - - /** - * Encodes the specified Chunk message. Does not implicitly {@link google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk - * @static - * @param {google.cloud.documentai.v1.Document.ChunkedDocument.IChunk} message Chunk message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Chunk.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.chunkId != null && Object.hasOwnProperty.call(message, "chunkId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.chunkId); - if (message.sourceBlockIds != null && message.sourceBlockIds.length) - for (var i = 0; i < message.sourceBlockIds.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceBlockIds[i]); - if (message.content != null && Object.hasOwnProperty.call(message, "content")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.content); - if (message.pageSpan != null && Object.hasOwnProperty.call(message, "pageSpan")) - $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan.encode(message.pageSpan, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.pageHeaders != null && message.pageHeaders.length) - for (var i = 0; i < message.pageHeaders.length; ++i) - $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader.encode(message.pageHeaders[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.pageFooters != null && message.pageFooters.length) - for (var i = 0; i < message.pageFooters.length; ++i) - $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter.encode(message.pageFooters[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Chunk message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk - * @static - * @param {google.cloud.documentai.v1.Document.ChunkedDocument.IChunk} message Chunk message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Chunk.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Chunk message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk} Chunk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Chunk.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.chunkId = reader.string(); - break; - } - case 2: { - if (!(message.sourceBlockIds && message.sourceBlockIds.length)) - message.sourceBlockIds = []; - message.sourceBlockIds.push(reader.string()); - break; - } - case 3: { - message.content = reader.string(); - break; - } - case 4: { - message.pageSpan = $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan.decode(reader, reader.uint32()); - break; - } - case 5: { - if (!(message.pageHeaders && message.pageHeaders.length)) - message.pageHeaders = []; - message.pageHeaders.push($root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.pageFooters && message.pageFooters.length)) - message.pageFooters = []; - message.pageFooters.push($root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Chunk message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk} Chunk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Chunk.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Chunk message. - * @function verify - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Chunk.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.chunkId != null && message.hasOwnProperty("chunkId")) - if (!$util.isString(message.chunkId)) - return "chunkId: string expected"; - if (message.sourceBlockIds != null && message.hasOwnProperty("sourceBlockIds")) { - if (!Array.isArray(message.sourceBlockIds)) - return "sourceBlockIds: array expected"; - for (var i = 0; i < message.sourceBlockIds.length; ++i) - if (!$util.isString(message.sourceBlockIds[i])) - return "sourceBlockIds: string[] expected"; - } - if (message.content != null && message.hasOwnProperty("content")) - if (!$util.isString(message.content)) - return "content: string expected"; - if (message.pageSpan != null && message.hasOwnProperty("pageSpan")) { - var error = $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan.verify(message.pageSpan); - if (error) - return "pageSpan." + error; - } - if (message.pageHeaders != null && message.hasOwnProperty("pageHeaders")) { - if (!Array.isArray(message.pageHeaders)) - return "pageHeaders: array expected"; - for (var i = 0; i < message.pageHeaders.length; ++i) { - var error = $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader.verify(message.pageHeaders[i]); - if (error) - return "pageHeaders." + error; - } - } - if (message.pageFooters != null && message.hasOwnProperty("pageFooters")) { - if (!Array.isArray(message.pageFooters)) - return "pageFooters: array expected"; - for (var i = 0; i < message.pageFooters.length; ++i) { - var error = $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter.verify(message.pageFooters[i]); - if (error) - return "pageFooters." + error; - } - } - return null; - }; - - /** - * Creates a Chunk message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk} Chunk - */ - Chunk.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk) - return object; - var message = new $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk(); - if (object.chunkId != null) - message.chunkId = String(object.chunkId); - if (object.sourceBlockIds) { - if (!Array.isArray(object.sourceBlockIds)) - throw TypeError(".google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.sourceBlockIds: array expected"); - message.sourceBlockIds = []; - for (var i = 0; i < object.sourceBlockIds.length; ++i) - message.sourceBlockIds[i] = String(object.sourceBlockIds[i]); - } - if (object.content != null) - message.content = String(object.content); - if (object.pageSpan != null) { - if (typeof object.pageSpan !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.pageSpan: object expected"); - message.pageSpan = $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan.fromObject(object.pageSpan); - } - if (object.pageHeaders) { - if (!Array.isArray(object.pageHeaders)) - throw TypeError(".google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.pageHeaders: array expected"); - message.pageHeaders = []; - for (var i = 0; i < object.pageHeaders.length; ++i) { - if (typeof object.pageHeaders[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.pageHeaders: object expected"); - message.pageHeaders[i] = $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader.fromObject(object.pageHeaders[i]); - } - } - if (object.pageFooters) { - if (!Array.isArray(object.pageFooters)) - throw TypeError(".google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.pageFooters: array expected"); - message.pageFooters = []; - for (var i = 0; i < object.pageFooters.length; ++i) { - if (typeof object.pageFooters[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.pageFooters: object expected"); - message.pageFooters[i] = $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter.fromObject(object.pageFooters[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Chunk message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk - * @static - * @param {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk} message Chunk - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Chunk.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.sourceBlockIds = []; - object.pageHeaders = []; - object.pageFooters = []; - } - if (options.defaults) { - object.chunkId = ""; - object.content = ""; - object.pageSpan = null; - } - if (message.chunkId != null && message.hasOwnProperty("chunkId")) - object.chunkId = message.chunkId; - if (message.sourceBlockIds && message.sourceBlockIds.length) { - object.sourceBlockIds = []; - for (var j = 0; j < message.sourceBlockIds.length; ++j) - object.sourceBlockIds[j] = message.sourceBlockIds[j]; - } - if (message.content != null && message.hasOwnProperty("content")) - object.content = message.content; - if (message.pageSpan != null && message.hasOwnProperty("pageSpan")) - object.pageSpan = $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan.toObject(message.pageSpan, options); - if (message.pageHeaders && message.pageHeaders.length) { - object.pageHeaders = []; - for (var j = 0; j < message.pageHeaders.length; ++j) - object.pageHeaders[j] = $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader.toObject(message.pageHeaders[j], options); - } - if (message.pageFooters && message.pageFooters.length) { - object.pageFooters = []; - for (var j = 0; j < message.pageFooters.length; ++j) - object.pageFooters[j] = $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter.toObject(message.pageFooters[j], options); - } - return object; - }; - - /** - * Converts this Chunk to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk - * @instance - * @returns {Object.} JSON object - */ - Chunk.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Chunk - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Chunk.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.ChunkedDocument.Chunk"; - }; - - Chunk.ChunkPageSpan = (function() { - - /** - * Properties of a ChunkPageSpan. - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk - * @interface IChunkPageSpan - * @property {number|null} [pageStart] ChunkPageSpan pageStart - * @property {number|null} [pageEnd] ChunkPageSpan pageEnd - */ - - /** - * Constructs a new ChunkPageSpan. - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk - * @classdesc Represents a ChunkPageSpan. - * @implements IChunkPageSpan - * @constructor - * @param {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageSpan=} [properties] Properties to set - */ - function ChunkPageSpan(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]]; - } - - /** - * ChunkPageSpan pageStart. - * @member {number} pageStart - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan - * @instance - */ - ChunkPageSpan.prototype.pageStart = 0; - - /** - * ChunkPageSpan pageEnd. - * @member {number} pageEnd - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan - * @instance - */ - ChunkPageSpan.prototype.pageEnd = 0; - - /** - * Creates a new ChunkPageSpan instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan - * @static - * @param {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageSpan=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan} ChunkPageSpan instance - */ - ChunkPageSpan.create = function create(properties) { - return new ChunkPageSpan(properties); - }; - - /** - * Encodes the specified ChunkPageSpan message. Does not implicitly {@link google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan - * @static - * @param {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageSpan} message ChunkPageSpan message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ChunkPageSpan.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pageStart != null && Object.hasOwnProperty.call(message, "pageStart")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.pageStart); - if (message.pageEnd != null && Object.hasOwnProperty.call(message, "pageEnd")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageEnd); - return writer; - }; - - /** - * Encodes the specified ChunkPageSpan message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan - * @static - * @param {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageSpan} message ChunkPageSpan message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ChunkPageSpan.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ChunkPageSpan message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan} ChunkPageSpan - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ChunkPageSpan.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.pageStart = reader.int32(); - break; - } - case 2: { - message.pageEnd = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ChunkPageSpan message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan} ChunkPageSpan - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ChunkPageSpan.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ChunkPageSpan message. - * @function verify - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ChunkPageSpan.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pageStart != null && message.hasOwnProperty("pageStart")) - if (!$util.isInteger(message.pageStart)) - return "pageStart: integer expected"; - if (message.pageEnd != null && message.hasOwnProperty("pageEnd")) - if (!$util.isInteger(message.pageEnd)) - return "pageEnd: integer expected"; - return null; - }; - - /** - * Creates a ChunkPageSpan message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan} ChunkPageSpan - */ - ChunkPageSpan.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan) - return object; - var message = new $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan(); - if (object.pageStart != null) - message.pageStart = object.pageStart | 0; - if (object.pageEnd != null) - message.pageEnd = object.pageEnd | 0; - return message; - }; - - /** - * Creates a plain object from a ChunkPageSpan message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan - * @static - * @param {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan} message ChunkPageSpan - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ChunkPageSpan.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.pageStart = 0; - object.pageEnd = 0; - } - if (message.pageStart != null && message.hasOwnProperty("pageStart")) - object.pageStart = message.pageStart; - if (message.pageEnd != null && message.hasOwnProperty("pageEnd")) - object.pageEnd = message.pageEnd; - return object; - }; - - /** - * Converts this ChunkPageSpan to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan - * @instance - * @returns {Object.} JSON object - */ - ChunkPageSpan.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ChunkPageSpan - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ChunkPageSpan.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan"; - }; - - return ChunkPageSpan; - })(); - - Chunk.ChunkPageHeader = (function() { - - /** - * Properties of a ChunkPageHeader. - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk - * @interface IChunkPageHeader - * @property {string|null} [text] ChunkPageHeader text - * @property {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageSpan|null} [pageSpan] ChunkPageHeader pageSpan - */ - - /** - * Constructs a new ChunkPageHeader. - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk - * @classdesc Represents a ChunkPageHeader. - * @implements IChunkPageHeader - * @constructor - * @param {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageHeader=} [properties] Properties to set - */ - function ChunkPageHeader(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]]; - } - - /** - * ChunkPageHeader text. - * @member {string} text - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader - * @instance - */ - ChunkPageHeader.prototype.text = ""; - - /** - * ChunkPageHeader pageSpan. - * @member {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageSpan|null|undefined} pageSpan - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader - * @instance - */ - ChunkPageHeader.prototype.pageSpan = null; - - /** - * Creates a new ChunkPageHeader instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader - * @static - * @param {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageHeader=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader} ChunkPageHeader instance - */ - ChunkPageHeader.create = function create(properties) { - return new ChunkPageHeader(properties); - }; - - /** - * Encodes the specified ChunkPageHeader message. Does not implicitly {@link google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader - * @static - * @param {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageHeader} message ChunkPageHeader message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ChunkPageHeader.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.text != null && Object.hasOwnProperty.call(message, "text")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); - if (message.pageSpan != null && Object.hasOwnProperty.call(message, "pageSpan")) - $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan.encode(message.pageSpan, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ChunkPageHeader message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader - * @static - * @param {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageHeader} message ChunkPageHeader message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ChunkPageHeader.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ChunkPageHeader message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader} ChunkPageHeader - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ChunkPageHeader.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.text = reader.string(); - break; - } - case 2: { - message.pageSpan = $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ChunkPageHeader message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader} ChunkPageHeader - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ChunkPageHeader.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ChunkPageHeader message. - * @function verify - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ChunkPageHeader.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.text != null && message.hasOwnProperty("text")) - if (!$util.isString(message.text)) - return "text: string expected"; - if (message.pageSpan != null && message.hasOwnProperty("pageSpan")) { - var error = $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan.verify(message.pageSpan); - if (error) - return "pageSpan." + error; - } - return null; - }; - - /** - * Creates a ChunkPageHeader message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader} ChunkPageHeader - */ - ChunkPageHeader.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader) - return object; - var message = new $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader(); - if (object.text != null) - message.text = String(object.text); - if (object.pageSpan != null) { - if (typeof object.pageSpan !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader.pageSpan: object expected"); - message.pageSpan = $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan.fromObject(object.pageSpan); - } - return message; - }; - - /** - * Creates a plain object from a ChunkPageHeader message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader - * @static - * @param {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader} message ChunkPageHeader - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ChunkPageHeader.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.text = ""; - object.pageSpan = null; - } - if (message.text != null && message.hasOwnProperty("text")) - object.text = message.text; - if (message.pageSpan != null && message.hasOwnProperty("pageSpan")) - object.pageSpan = $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan.toObject(message.pageSpan, options); - return object; - }; - - /** - * Converts this ChunkPageHeader to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader - * @instance - * @returns {Object.} JSON object - */ - ChunkPageHeader.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ChunkPageHeader - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ChunkPageHeader.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader"; - }; - - return ChunkPageHeader; - })(); - - Chunk.ChunkPageFooter = (function() { - - /** - * Properties of a ChunkPageFooter. - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk - * @interface IChunkPageFooter - * @property {string|null} [text] ChunkPageFooter text - * @property {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageSpan|null} [pageSpan] ChunkPageFooter pageSpan - */ - - /** - * Constructs a new ChunkPageFooter. - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk - * @classdesc Represents a ChunkPageFooter. - * @implements IChunkPageFooter - * @constructor - * @param {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageFooter=} [properties] Properties to set - */ - function ChunkPageFooter(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]]; - } - - /** - * ChunkPageFooter text. - * @member {string} text - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter - * @instance - */ - ChunkPageFooter.prototype.text = ""; - - /** - * ChunkPageFooter pageSpan. - * @member {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageSpan|null|undefined} pageSpan - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter - * @instance - */ - ChunkPageFooter.prototype.pageSpan = null; - - /** - * Creates a new ChunkPageFooter instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter - * @static - * @param {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageFooter=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter} ChunkPageFooter instance - */ - ChunkPageFooter.create = function create(properties) { - return new ChunkPageFooter(properties); - }; - - /** - * Encodes the specified ChunkPageFooter message. Does not implicitly {@link google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter - * @static - * @param {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageFooter} message ChunkPageFooter message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ChunkPageFooter.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.text != null && Object.hasOwnProperty.call(message, "text")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); - if (message.pageSpan != null && Object.hasOwnProperty.call(message, "pageSpan")) - $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan.encode(message.pageSpan, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ChunkPageFooter message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter - * @static - * @param {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.IChunkPageFooter} message ChunkPageFooter message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ChunkPageFooter.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ChunkPageFooter message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter} ChunkPageFooter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ChunkPageFooter.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.text = reader.string(); - break; - } - case 2: { - message.pageSpan = $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ChunkPageFooter message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter} ChunkPageFooter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ChunkPageFooter.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ChunkPageFooter message. - * @function verify - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ChunkPageFooter.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.text != null && message.hasOwnProperty("text")) - if (!$util.isString(message.text)) - return "text: string expected"; - if (message.pageSpan != null && message.hasOwnProperty("pageSpan")) { - var error = $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan.verify(message.pageSpan); - if (error) - return "pageSpan." + error; - } - return null; - }; - - /** - * Creates a ChunkPageFooter message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter} ChunkPageFooter - */ - ChunkPageFooter.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter) - return object; - var message = new $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter(); - if (object.text != null) - message.text = String(object.text); - if (object.pageSpan != null) { - if (typeof object.pageSpan !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter.pageSpan: object expected"); - message.pageSpan = $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan.fromObject(object.pageSpan); - } - return message; - }; - - /** - * Creates a plain object from a ChunkPageFooter message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter - * @static - * @param {google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter} message ChunkPageFooter - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ChunkPageFooter.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.text = ""; - object.pageSpan = null; - } - if (message.text != null && message.hasOwnProperty("text")) - object.text = message.text; - if (message.pageSpan != null && message.hasOwnProperty("pageSpan")) - object.pageSpan = $root.google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan.toObject(message.pageSpan, options); - return object; - }; - - /** - * Converts this ChunkPageFooter to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter - * @instance - * @returns {Object.} JSON object - */ - ChunkPageFooter.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ChunkPageFooter - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ChunkPageFooter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter"; - }; - - return ChunkPageFooter; - })(); - - return Chunk; - })(); - - return ChunkedDocument; - })(); - - Document.EntityValidationOutput = (function() { - - /** - * Properties of an EntityValidationOutput. - * @memberof google.cloud.documentai.v1.Document - * @interface IEntityValidationOutput - * @property {Array.|null} [validationResults] EntityValidationOutput validationResults - * @property {boolean|null} [passAllRules] EntityValidationOutput passAllRules - */ - - /** - * Constructs a new EntityValidationOutput. - * @memberof google.cloud.documentai.v1.Document - * @classdesc Represents an EntityValidationOutput. - * @implements IEntityValidationOutput - * @constructor - * @param {google.cloud.documentai.v1.Document.IEntityValidationOutput=} [properties] Properties to set - */ - function EntityValidationOutput(properties) { - this.validationResults = []; - 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]]; - } - - /** - * EntityValidationOutput validationResults. - * @member {Array.} validationResults - * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput - * @instance - */ - EntityValidationOutput.prototype.validationResults = $util.emptyArray; - - /** - * EntityValidationOutput passAllRules. - * @member {boolean} passAllRules - * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput - * @instance - */ - EntityValidationOutput.prototype.passAllRules = false; - - /** - * Creates a new EntityValidationOutput instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput - * @static - * @param {google.cloud.documentai.v1.Document.IEntityValidationOutput=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.EntityValidationOutput} EntityValidationOutput instance - */ - EntityValidationOutput.create = function create(properties) { - return new EntityValidationOutput(properties); - }; - - /** - * Encodes the specified EntityValidationOutput message. Does not implicitly {@link google.cloud.documentai.v1.Document.EntityValidationOutput.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput - * @static - * @param {google.cloud.documentai.v1.Document.IEntityValidationOutput} message EntityValidationOutput message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EntityValidationOutput.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.validationResults != null && message.validationResults.length) - for (var i = 0; i < message.validationResults.length; ++i) - $root.google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult.encode(message.validationResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.passAllRules != null && Object.hasOwnProperty.call(message, "passAllRules")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.passAllRules); - return writer; - }; - - /** - * Encodes the specified EntityValidationOutput message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.EntityValidationOutput.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput - * @static - * @param {google.cloud.documentai.v1.Document.IEntityValidationOutput} message EntityValidationOutput message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EntityValidationOutput.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EntityValidationOutput message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.EntityValidationOutput} EntityValidationOutput - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EntityValidationOutput.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.EntityValidationOutput(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.validationResults && message.validationResults.length)) - message.validationResults = []; - message.validationResults.push($root.google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult.decode(reader, reader.uint32())); - break; - } - case 2: { - message.passAllRules = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EntityValidationOutput message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.EntityValidationOutput} EntityValidationOutput - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EntityValidationOutput.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EntityValidationOutput message. - * @function verify - * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EntityValidationOutput.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.validationResults != null && message.hasOwnProperty("validationResults")) { - if (!Array.isArray(message.validationResults)) - return "validationResults: array expected"; - for (var i = 0; i < message.validationResults.length; ++i) { - var error = $root.google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult.verify(message.validationResults[i]); - if (error) - return "validationResults." + error; - } - } - if (message.passAllRules != null && message.hasOwnProperty("passAllRules")) - if (typeof message.passAllRules !== "boolean") - return "passAllRules: boolean expected"; - return null; - }; - - /** - * Creates an EntityValidationOutput message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.EntityValidationOutput} EntityValidationOutput - */ - EntityValidationOutput.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.EntityValidationOutput) - return object; - var message = new $root.google.cloud.documentai.v1.Document.EntityValidationOutput(); - if (object.validationResults) { - if (!Array.isArray(object.validationResults)) - throw TypeError(".google.cloud.documentai.v1.Document.EntityValidationOutput.validationResults: array expected"); - message.validationResults = []; - for (var i = 0; i < object.validationResults.length; ++i) { - if (typeof object.validationResults[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.EntityValidationOutput.validationResults: object expected"); - message.validationResults[i] = $root.google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult.fromObject(object.validationResults[i]); - } - } - if (object.passAllRules != null) - message.passAllRules = Boolean(object.passAllRules); - return message; - }; - - /** - * Creates a plain object from an EntityValidationOutput message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput - * @static - * @param {google.cloud.documentai.v1.Document.EntityValidationOutput} message EntityValidationOutput - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EntityValidationOutput.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.validationResults = []; - if (options.defaults) - object.passAllRules = false; - if (message.validationResults && message.validationResults.length) { - object.validationResults = []; - for (var j = 0; j < message.validationResults.length; ++j) - object.validationResults[j] = $root.google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult.toObject(message.validationResults[j], options); - } - if (message.passAllRules != null && message.hasOwnProperty("passAllRules")) - object.passAllRules = message.passAllRules; - return object; - }; - - /** - * Converts this EntityValidationOutput to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput - * @instance - * @returns {Object.} JSON object - */ - EntityValidationOutput.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EntityValidationOutput - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EntityValidationOutput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.EntityValidationOutput"; - }; - - EntityValidationOutput.ValidationResult = (function() { - - /** - * Properties of a ValidationResult. - * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput - * @interface IValidationResult - * @property {string|null} [ruleName] ValidationResult ruleName - * @property {string|null} [ruleDescription] ValidationResult ruleDescription - * @property {google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult.ValidationResultType|null} [validationResultType] ValidationResult validationResultType - * @property {string|null} [validationDetails] ValidationResult validationDetails - */ - - /** - * Constructs a new ValidationResult. - * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput - * @classdesc Represents a ValidationResult. - * @implements IValidationResult - * @constructor - * @param {google.cloud.documentai.v1.Document.EntityValidationOutput.IValidationResult=} [properties] Properties to set - */ - function ValidationResult(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]]; - } - - /** - * ValidationResult ruleName. - * @member {string} ruleName - * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult - * @instance - */ - ValidationResult.prototype.ruleName = ""; - - /** - * ValidationResult ruleDescription. - * @member {string} ruleDescription - * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult - * @instance - */ - ValidationResult.prototype.ruleDescription = ""; - - /** - * ValidationResult validationResultType. - * @member {google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult.ValidationResultType} validationResultType - * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult - * @instance - */ - ValidationResult.prototype.validationResultType = 0; - - /** - * ValidationResult validationDetails. - * @member {string} validationDetails - * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult - * @instance - */ - ValidationResult.prototype.validationDetails = ""; - - /** - * Creates a new ValidationResult instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult - * @static - * @param {google.cloud.documentai.v1.Document.EntityValidationOutput.IValidationResult=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult} ValidationResult instance - */ - ValidationResult.create = function create(properties) { - return new ValidationResult(properties); - }; - - /** - * Encodes the specified ValidationResult message. Does not implicitly {@link google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult - * @static - * @param {google.cloud.documentai.v1.Document.EntityValidationOutput.IValidationResult} message ValidationResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ValidationResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ruleName != null && Object.hasOwnProperty.call(message, "ruleName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.ruleName); - if (message.ruleDescription != null && Object.hasOwnProperty.call(message, "ruleDescription")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.ruleDescription); - if (message.validationResultType != null && Object.hasOwnProperty.call(message, "validationResultType")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.validationResultType); - if (message.validationDetails != null && Object.hasOwnProperty.call(message, "validationDetails")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.validationDetails); - return writer; - }; - - /** - * Encodes the specified ValidationResult message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult - * @static - * @param {google.cloud.documentai.v1.Document.EntityValidationOutput.IValidationResult} message ValidationResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ValidationResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ValidationResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult} ValidationResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ValidationResult.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.ruleName = reader.string(); - break; - } - case 2: { - message.ruleDescription = reader.string(); - break; - } - case 3: { - message.validationResultType = reader.int32(); - break; - } - case 4: { - message.validationDetails = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ValidationResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult} ValidationResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ValidationResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ValidationResult message. - * @function verify - * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ValidationResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ruleName != null && message.hasOwnProperty("ruleName")) - if (!$util.isString(message.ruleName)) - return "ruleName: string expected"; - if (message.ruleDescription != null && message.hasOwnProperty("ruleDescription")) - if (!$util.isString(message.ruleDescription)) - return "ruleDescription: string expected"; - if (message.validationResultType != null && message.hasOwnProperty("validationResultType")) - switch (message.validationResultType) { - default: - return "validationResultType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.validationDetails != null && message.hasOwnProperty("validationDetails")) - if (!$util.isString(message.validationDetails)) - return "validationDetails: string expected"; - return null; - }; - - /** - * Creates a ValidationResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult} ValidationResult - */ - ValidationResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult) - return object; - var message = new $root.google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult(); - if (object.ruleName != null) - message.ruleName = String(object.ruleName); - if (object.ruleDescription != null) - message.ruleDescription = String(object.ruleDescription); - switch (object.validationResultType) { - default: - if (typeof object.validationResultType === "number") { - message.validationResultType = object.validationResultType; - break; - } - break; - case "VALIDATION_RESULT_TYPE_UNSPECIFIED": - case 0: - message.validationResultType = 0; - break; - case "VALIDATION_RESULT_TYPE_VALID": - case 1: - message.validationResultType = 1; - break; - case "VALIDATION_RESULT_TYPE_INVALID": - case 2: - message.validationResultType = 2; - break; - case "VALIDATION_RESULT_TYPE_SKIPPED": - case 3: - message.validationResultType = 3; - break; - case "VALIDATION_RESULT_TYPE_NOT_APPLICABLE": - case 4: - message.validationResultType = 4; - break; - } - if (object.validationDetails != null) - message.validationDetails = String(object.validationDetails); - return message; - }; - - /** - * Creates a plain object from a ValidationResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult - * @static - * @param {google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult} message ValidationResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ValidationResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.ruleName = ""; - object.ruleDescription = ""; - object.validationResultType = options.enums === String ? "VALIDATION_RESULT_TYPE_UNSPECIFIED" : 0; - object.validationDetails = ""; - } - if (message.ruleName != null && message.hasOwnProperty("ruleName")) - object.ruleName = message.ruleName; - if (message.ruleDescription != null && message.hasOwnProperty("ruleDescription")) - object.ruleDescription = message.ruleDescription; - if (message.validationResultType != null && message.hasOwnProperty("validationResultType")) - object.validationResultType = options.enums === String ? $root.google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult.ValidationResultType[message.validationResultType] === undefined ? message.validationResultType : $root.google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult.ValidationResultType[message.validationResultType] : message.validationResultType; - if (message.validationDetails != null && message.hasOwnProperty("validationDetails")) - object.validationDetails = message.validationDetails; - return object; - }; - - /** - * Converts this ValidationResult to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult - * @instance - * @returns {Object.} JSON object - */ - ValidationResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ValidationResult - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ValidationResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult"; - }; - - /** - * ValidationResultType enum. - * @name google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult.ValidationResultType - * @enum {number} - * @property {number} VALIDATION_RESULT_TYPE_UNSPECIFIED=0 VALIDATION_RESULT_TYPE_UNSPECIFIED value - * @property {number} VALIDATION_RESULT_TYPE_VALID=1 VALIDATION_RESULT_TYPE_VALID value - * @property {number} VALIDATION_RESULT_TYPE_INVALID=2 VALIDATION_RESULT_TYPE_INVALID value - * @property {number} VALIDATION_RESULT_TYPE_SKIPPED=3 VALIDATION_RESULT_TYPE_SKIPPED value - * @property {number} VALIDATION_RESULT_TYPE_NOT_APPLICABLE=4 VALIDATION_RESULT_TYPE_NOT_APPLICABLE value - */ - ValidationResult.ValidationResultType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "VALIDATION_RESULT_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "VALIDATION_RESULT_TYPE_VALID"] = 1; - values[valuesById[2] = "VALIDATION_RESULT_TYPE_INVALID"] = 2; - values[valuesById[3] = "VALIDATION_RESULT_TYPE_SKIPPED"] = 3; - values[valuesById[4] = "VALIDATION_RESULT_TYPE_NOT_APPLICABLE"] = 4; - return values; - })(); - - return ValidationResult; - })(); - - return EntityValidationOutput; - })(); - - Document.EntitiesRevision = (function() { - - /** - * Properties of an EntitiesRevision. - * @memberof google.cloud.documentai.v1.Document - * @interface IEntitiesRevision - * @property {string|null} [revisionId] EntitiesRevision revisionId - * @property {Array.|null} [entities] EntitiesRevision entities - * @property {google.cloud.documentai.v1.Document.IEntityValidationOutput|null} [entityValidationOutput] EntitiesRevision entityValidationOutput - */ - - /** - * Constructs a new EntitiesRevision. - * @memberof google.cloud.documentai.v1.Document - * @classdesc Represents an EntitiesRevision. - * @implements IEntitiesRevision - * @constructor - * @param {google.cloud.documentai.v1.Document.IEntitiesRevision=} [properties] Properties to set - */ - function EntitiesRevision(properties) { - this.entities = []; - 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]]; - } - - /** - * EntitiesRevision revisionId. - * @member {string} revisionId - * @memberof google.cloud.documentai.v1.Document.EntitiesRevision - * @instance - */ - EntitiesRevision.prototype.revisionId = ""; - - /** - * EntitiesRevision entities. - * @member {Array.} entities - * @memberof google.cloud.documentai.v1.Document.EntitiesRevision - * @instance - */ - EntitiesRevision.prototype.entities = $util.emptyArray; - - /** - * EntitiesRevision entityValidationOutput. - * @member {google.cloud.documentai.v1.Document.IEntityValidationOutput|null|undefined} entityValidationOutput - * @memberof google.cloud.documentai.v1.Document.EntitiesRevision - * @instance - */ - EntitiesRevision.prototype.entityValidationOutput = null; - - /** - * Creates a new EntitiesRevision instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Document.EntitiesRevision - * @static - * @param {google.cloud.documentai.v1.Document.IEntitiesRevision=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Document.EntitiesRevision} EntitiesRevision instance - */ - EntitiesRevision.create = function create(properties) { - return new EntitiesRevision(properties); - }; - - /** - * Encodes the specified EntitiesRevision message. Does not implicitly {@link google.cloud.documentai.v1.Document.EntitiesRevision.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Document.EntitiesRevision - * @static - * @param {google.cloud.documentai.v1.Document.IEntitiesRevision} message EntitiesRevision message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EntitiesRevision.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.revisionId != null && Object.hasOwnProperty.call(message, "revisionId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.revisionId); - if (message.entities != null && message.entities.length) - for (var i = 0; i < message.entities.length; ++i) - $root.google.cloud.documentai.v1.Document.Entity.encode(message.entities[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.entityValidationOutput != null && Object.hasOwnProperty.call(message, "entityValidationOutput")) - $root.google.cloud.documentai.v1.Document.EntityValidationOutput.encode(message.entityValidationOutput, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EntitiesRevision message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.EntitiesRevision.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Document.EntitiesRevision - * @static - * @param {google.cloud.documentai.v1.Document.IEntitiesRevision} message EntitiesRevision message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EntitiesRevision.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EntitiesRevision message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Document.EntitiesRevision - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Document.EntitiesRevision} EntitiesRevision - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EntitiesRevision.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Document.EntitiesRevision(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.revisionId = reader.string(); - break; - } - case 2: { - if (!(message.entities && message.entities.length)) - message.entities = []; - message.entities.push($root.google.cloud.documentai.v1.Document.Entity.decode(reader, reader.uint32())); - break; - } - case 3: { - message.entityValidationOutput = $root.google.cloud.documentai.v1.Document.EntityValidationOutput.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EntitiesRevision message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Document.EntitiesRevision - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Document.EntitiesRevision} EntitiesRevision - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EntitiesRevision.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EntitiesRevision message. - * @function verify - * @memberof google.cloud.documentai.v1.Document.EntitiesRevision - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EntitiesRevision.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.revisionId != null && message.hasOwnProperty("revisionId")) - if (!$util.isString(message.revisionId)) - return "revisionId: string expected"; - if (message.entities != null && message.hasOwnProperty("entities")) { - if (!Array.isArray(message.entities)) - return "entities: array expected"; - for (var i = 0; i < message.entities.length; ++i) { - var error = $root.google.cloud.documentai.v1.Document.Entity.verify(message.entities[i]); - if (error) - return "entities." + error; - } - } - if (message.entityValidationOutput != null && message.hasOwnProperty("entityValidationOutput")) { - var error = $root.google.cloud.documentai.v1.Document.EntityValidationOutput.verify(message.entityValidationOutput); - if (error) - return "entityValidationOutput." + error; - } - return null; - }; - - /** - * Creates an EntitiesRevision message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Document.EntitiesRevision - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Document.EntitiesRevision} EntitiesRevision - */ - EntitiesRevision.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Document.EntitiesRevision) - return object; - var message = new $root.google.cloud.documentai.v1.Document.EntitiesRevision(); - if (object.revisionId != null) - message.revisionId = String(object.revisionId); - if (object.entities) { - if (!Array.isArray(object.entities)) - throw TypeError(".google.cloud.documentai.v1.Document.EntitiesRevision.entities: array expected"); - message.entities = []; - for (var i = 0; i < object.entities.length; ++i) { - if (typeof object.entities[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.EntitiesRevision.entities: object expected"); - message.entities[i] = $root.google.cloud.documentai.v1.Document.Entity.fromObject(object.entities[i]); - } - } - if (object.entityValidationOutput != null) { - if (typeof object.entityValidationOutput !== "object") - throw TypeError(".google.cloud.documentai.v1.Document.EntitiesRevision.entityValidationOutput: object expected"); - message.entityValidationOutput = $root.google.cloud.documentai.v1.Document.EntityValidationOutput.fromObject(object.entityValidationOutput); - } - return message; - }; - - /** - * Creates a plain object from an EntitiesRevision message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Document.EntitiesRevision - * @static - * @param {google.cloud.documentai.v1.Document.EntitiesRevision} message EntitiesRevision - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EntitiesRevision.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.entities = []; - if (options.defaults) { - object.revisionId = ""; - object.entityValidationOutput = null; - } - if (message.revisionId != null && message.hasOwnProperty("revisionId")) - object.revisionId = message.revisionId; - if (message.entities && message.entities.length) { - object.entities = []; - for (var j = 0; j < message.entities.length; ++j) - object.entities[j] = $root.google.cloud.documentai.v1.Document.Entity.toObject(message.entities[j], options); - } - if (message.entityValidationOutput != null && message.hasOwnProperty("entityValidationOutput")) - object.entityValidationOutput = $root.google.cloud.documentai.v1.Document.EntityValidationOutput.toObject(message.entityValidationOutput, options); - return object; - }; - - /** - * Converts this EntitiesRevision to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Document.EntitiesRevision - * @instance - * @returns {Object.} JSON object - */ - EntitiesRevision.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EntitiesRevision - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Document.EntitiesRevision - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EntitiesRevision.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Document.EntitiesRevision"; - }; - - return EntitiesRevision; - })(); - - return Document; - })(); - - v1.Barcode = (function() { - - /** - * Properties of a Barcode. - * @memberof google.cloud.documentai.v1 - * @interface IBarcode - * @property {string|null} [format] Barcode format - * @property {string|null} [valueFormat] Barcode valueFormat - * @property {string|null} [rawValue] Barcode rawValue - */ - - /** - * Constructs a new Barcode. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a Barcode. - * @implements IBarcode - * @constructor - * @param {google.cloud.documentai.v1.IBarcode=} [properties] Properties to set - */ - function Barcode(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]]; - } - - /** - * Barcode format. - * @member {string} format - * @memberof google.cloud.documentai.v1.Barcode - * @instance - */ - Barcode.prototype.format = ""; - - /** - * Barcode valueFormat. - * @member {string} valueFormat - * @memberof google.cloud.documentai.v1.Barcode - * @instance - */ - Barcode.prototype.valueFormat = ""; - - /** - * Barcode rawValue. - * @member {string} rawValue - * @memberof google.cloud.documentai.v1.Barcode - * @instance - */ - Barcode.prototype.rawValue = ""; - - /** - * Creates a new Barcode instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Barcode - * @static - * @param {google.cloud.documentai.v1.IBarcode=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Barcode} Barcode instance - */ - Barcode.create = function create(properties) { - return new Barcode(properties); - }; - - /** - * Encodes the specified Barcode message. Does not implicitly {@link google.cloud.documentai.v1.Barcode.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Barcode - * @static - * @param {google.cloud.documentai.v1.IBarcode} message Barcode message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Barcode.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.format != null && Object.hasOwnProperty.call(message, "format")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.format); - if (message.valueFormat != null && Object.hasOwnProperty.call(message, "valueFormat")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.valueFormat); - if (message.rawValue != null && Object.hasOwnProperty.call(message, "rawValue")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.rawValue); - return writer; - }; - - /** - * Encodes the specified Barcode message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Barcode.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Barcode - * @static - * @param {google.cloud.documentai.v1.IBarcode} message Barcode message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Barcode.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Barcode message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Barcode - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Barcode} Barcode - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Barcode.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Barcode(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.format = reader.string(); - break; - } - case 2: { - message.valueFormat = reader.string(); - break; - } - case 3: { - message.rawValue = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Barcode message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Barcode - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Barcode} Barcode - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Barcode.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Barcode message. - * @function verify - * @memberof google.cloud.documentai.v1.Barcode - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Barcode.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.format != null && message.hasOwnProperty("format")) - if (!$util.isString(message.format)) - return "format: string expected"; - if (message.valueFormat != null && message.hasOwnProperty("valueFormat")) - if (!$util.isString(message.valueFormat)) - return "valueFormat: string expected"; - if (message.rawValue != null && message.hasOwnProperty("rawValue")) - if (!$util.isString(message.rawValue)) - return "rawValue: string expected"; - return null; - }; - - /** - * Creates a Barcode message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Barcode - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Barcode} Barcode - */ - Barcode.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Barcode) - return object; - var message = new $root.google.cloud.documentai.v1.Barcode(); - if (object.format != null) - message.format = String(object.format); - if (object.valueFormat != null) - message.valueFormat = String(object.valueFormat); - if (object.rawValue != null) - message.rawValue = String(object.rawValue); - return message; - }; - - /** - * Creates a plain object from a Barcode message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Barcode - * @static - * @param {google.cloud.documentai.v1.Barcode} message Barcode - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Barcode.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.format = ""; - object.valueFormat = ""; - object.rawValue = ""; - } - if (message.format != null && message.hasOwnProperty("format")) - object.format = message.format; - if (message.valueFormat != null && message.hasOwnProperty("valueFormat")) - object.valueFormat = message.valueFormat; - if (message.rawValue != null && message.hasOwnProperty("rawValue")) - object.rawValue = message.rawValue; - return object; - }; - - /** - * Converts this Barcode to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Barcode - * @instance - * @returns {Object.} JSON object - */ - Barcode.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Barcode - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Barcode - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Barcode.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Barcode"; - }; - - return Barcode; - })(); - - v1.Vertex = (function() { - - /** - * Properties of a Vertex. - * @memberof google.cloud.documentai.v1 - * @interface IVertex - * @property {number|null} [x] Vertex x - * @property {number|null} [y] Vertex y - */ - - /** - * Constructs a new Vertex. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a Vertex. - * @implements IVertex - * @constructor - * @param {google.cloud.documentai.v1.IVertex=} [properties] Properties to set - */ - function Vertex(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]]; - } - - /** - * Vertex x. - * @member {number} x - * @memberof google.cloud.documentai.v1.Vertex - * @instance - */ - Vertex.prototype.x = 0; - - /** - * Vertex y. - * @member {number} y - * @memberof google.cloud.documentai.v1.Vertex - * @instance - */ - Vertex.prototype.y = 0; - - /** - * Creates a new Vertex instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Vertex - * @static - * @param {google.cloud.documentai.v1.IVertex=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Vertex} Vertex instance - */ - Vertex.create = function create(properties) { - return new Vertex(properties); - }; - - /** - * Encodes the specified Vertex message. Does not implicitly {@link google.cloud.documentai.v1.Vertex.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Vertex - * @static - * @param {google.cloud.documentai.v1.IVertex} message Vertex message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Vertex.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.x != null && Object.hasOwnProperty.call(message, "x")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.x); - if (message.y != null && Object.hasOwnProperty.call(message, "y")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.y); - return writer; - }; - - /** - * Encodes the specified Vertex message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Vertex.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Vertex - * @static - * @param {google.cloud.documentai.v1.IVertex} message Vertex message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Vertex.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Vertex message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Vertex - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.Vertex} Vertex - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Vertex.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.Vertex(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.x = reader.int32(); - break; - } - case 2: { - message.y = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Vertex message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Vertex - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Vertex} Vertex - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Vertex.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Vertex message. - * @function verify - * @memberof google.cloud.documentai.v1.Vertex - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Vertex.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.x != null && message.hasOwnProperty("x")) - if (!$util.isInteger(message.x)) - return "x: integer expected"; - if (message.y != null && message.hasOwnProperty("y")) - if (!$util.isInteger(message.y)) - return "y: integer expected"; - return null; - }; - - /** - * Creates a Vertex message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Vertex - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Vertex} Vertex - */ - Vertex.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Vertex) - return object; - var message = new $root.google.cloud.documentai.v1.Vertex(); - if (object.x != null) - message.x = object.x | 0; - if (object.y != null) - message.y = object.y | 0; - return message; - }; - - /** - * Creates a plain object from a Vertex message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Vertex - * @static - * @param {google.cloud.documentai.v1.Vertex} message Vertex - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Vertex.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.x = 0; - object.y = 0; - } - if (message.x != null && message.hasOwnProperty("x")) - object.x = message.x; - if (message.y != null && message.hasOwnProperty("y")) - object.y = message.y; - return object; - }; - - /** - * Converts this Vertex to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Vertex - * @instance - * @returns {Object.} JSON object - */ - Vertex.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Vertex - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Vertex - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Vertex.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Vertex"; - }; - - return Vertex; - })(); - - v1.NormalizedVertex = (function() { - - /** - * Properties of a NormalizedVertex. - * @memberof google.cloud.documentai.v1 - * @interface INormalizedVertex - * @property {number|null} [x] NormalizedVertex x - * @property {number|null} [y] NormalizedVertex y - */ - - /** - * Constructs a new NormalizedVertex. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a NormalizedVertex. - * @implements INormalizedVertex - * @constructor - * @param {google.cloud.documentai.v1.INormalizedVertex=} [properties] Properties to set - */ - function NormalizedVertex(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]]; - } - - /** - * NormalizedVertex x. - * @member {number} x - * @memberof google.cloud.documentai.v1.NormalizedVertex - * @instance - */ - NormalizedVertex.prototype.x = 0; - - /** - * NormalizedVertex y. - * @member {number} y - * @memberof google.cloud.documentai.v1.NormalizedVertex - * @instance - */ - NormalizedVertex.prototype.y = 0; - - /** - * Creates a new NormalizedVertex instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.NormalizedVertex - * @static - * @param {google.cloud.documentai.v1.INormalizedVertex=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.NormalizedVertex} NormalizedVertex instance - */ - NormalizedVertex.create = function create(properties) { - return new NormalizedVertex(properties); - }; - - /** - * Encodes the specified NormalizedVertex message. Does not implicitly {@link google.cloud.documentai.v1.NormalizedVertex.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.NormalizedVertex - * @static - * @param {google.cloud.documentai.v1.INormalizedVertex} message NormalizedVertex message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NormalizedVertex.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.x != null && Object.hasOwnProperty.call(message, "x")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.x); - if (message.y != null && Object.hasOwnProperty.call(message, "y")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.y); - return writer; - }; - - /** - * Encodes the specified NormalizedVertex message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.NormalizedVertex.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.NormalizedVertex - * @static - * @param {google.cloud.documentai.v1.INormalizedVertex} message NormalizedVertex message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NormalizedVertex.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NormalizedVertex message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.NormalizedVertex - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.NormalizedVertex} NormalizedVertex - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NormalizedVertex.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.NormalizedVertex(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.x = reader.float(); - break; - } - case 2: { - message.y = reader.float(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NormalizedVertex message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.NormalizedVertex - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.NormalizedVertex} NormalizedVertex - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NormalizedVertex.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NormalizedVertex message. - * @function verify - * @memberof google.cloud.documentai.v1.NormalizedVertex - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NormalizedVertex.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.x != null && message.hasOwnProperty("x")) - if (typeof message.x !== "number") - return "x: number expected"; - if (message.y != null && message.hasOwnProperty("y")) - if (typeof message.y !== "number") - return "y: number expected"; - return null; - }; - - /** - * Creates a NormalizedVertex message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.NormalizedVertex - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.NormalizedVertex} NormalizedVertex - */ - NormalizedVertex.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.NormalizedVertex) - return object; - var message = new $root.google.cloud.documentai.v1.NormalizedVertex(); - if (object.x != null) - message.x = Number(object.x); - if (object.y != null) - message.y = Number(object.y); - return message; - }; - - /** - * Creates a plain object from a NormalizedVertex message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.NormalizedVertex - * @static - * @param {google.cloud.documentai.v1.NormalizedVertex} message NormalizedVertex - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NormalizedVertex.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.x = 0; - object.y = 0; - } - if (message.x != null && message.hasOwnProperty("x")) - object.x = options.json && !isFinite(message.x) ? String(message.x) : message.x; - if (message.y != null && message.hasOwnProperty("y")) - object.y = options.json && !isFinite(message.y) ? String(message.y) : message.y; - return object; - }; - - /** - * Converts this NormalizedVertex to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.NormalizedVertex - * @instance - * @returns {Object.} JSON object - */ - NormalizedVertex.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NormalizedVertex - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.NormalizedVertex - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NormalizedVertex.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.NormalizedVertex"; - }; - - return NormalizedVertex; - })(); - - v1.BoundingPoly = (function() { - - /** - * Properties of a BoundingPoly. - * @memberof google.cloud.documentai.v1 - * @interface IBoundingPoly - * @property {Array.|null} [vertices] BoundingPoly vertices - * @property {Array.|null} [normalizedVertices] BoundingPoly normalizedVertices - */ - - /** - * Constructs a new BoundingPoly. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a BoundingPoly. - * @implements IBoundingPoly - * @constructor - * @param {google.cloud.documentai.v1.IBoundingPoly=} [properties] Properties to set - */ - function BoundingPoly(properties) { - this.vertices = []; - this.normalizedVertices = []; - 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]]; - } - - /** - * BoundingPoly vertices. - * @member {Array.} vertices - * @memberof google.cloud.documentai.v1.BoundingPoly - * @instance - */ - BoundingPoly.prototype.vertices = $util.emptyArray; - - /** - * BoundingPoly normalizedVertices. - * @member {Array.} normalizedVertices - * @memberof google.cloud.documentai.v1.BoundingPoly - * @instance - */ - BoundingPoly.prototype.normalizedVertices = $util.emptyArray; - - /** - * Creates a new BoundingPoly instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.BoundingPoly - * @static - * @param {google.cloud.documentai.v1.IBoundingPoly=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.BoundingPoly} BoundingPoly instance - */ - BoundingPoly.create = function create(properties) { - return new BoundingPoly(properties); - }; - - /** - * Encodes the specified BoundingPoly message. Does not implicitly {@link google.cloud.documentai.v1.BoundingPoly.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.BoundingPoly - * @static - * @param {google.cloud.documentai.v1.IBoundingPoly} message BoundingPoly message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BoundingPoly.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.vertices != null && message.vertices.length) - for (var i = 0; i < message.vertices.length; ++i) - $root.google.cloud.documentai.v1.Vertex.encode(message.vertices[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.normalizedVertices != null && message.normalizedVertices.length) - for (var i = 0; i < message.normalizedVertices.length; ++i) - $root.google.cloud.documentai.v1.NormalizedVertex.encode(message.normalizedVertices[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BoundingPoly message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.BoundingPoly.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.BoundingPoly - * @static - * @param {google.cloud.documentai.v1.IBoundingPoly} message BoundingPoly message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BoundingPoly.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BoundingPoly message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.BoundingPoly - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1.BoundingPoly} BoundingPoly - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BoundingPoly.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.BoundingPoly(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.vertices && message.vertices.length)) - message.vertices = []; - message.vertices.push($root.google.cloud.documentai.v1.Vertex.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.normalizedVertices && message.normalizedVertices.length)) - message.normalizedVertices = []; - message.normalizedVertices.push($root.google.cloud.documentai.v1.NormalizedVertex.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BoundingPoly message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.BoundingPoly - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.BoundingPoly} BoundingPoly - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BoundingPoly.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BoundingPoly message. - * @function verify - * @memberof google.cloud.documentai.v1.BoundingPoly - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BoundingPoly.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.vertices != null && message.hasOwnProperty("vertices")) { - if (!Array.isArray(message.vertices)) - return "vertices: array expected"; - for (var i = 0; i < message.vertices.length; ++i) { - var error = $root.google.cloud.documentai.v1.Vertex.verify(message.vertices[i]); - if (error) - return "vertices." + error; - } - } - if (message.normalizedVertices != null && message.hasOwnProperty("normalizedVertices")) { - if (!Array.isArray(message.normalizedVertices)) - return "normalizedVertices: array expected"; - for (var i = 0; i < message.normalizedVertices.length; ++i) { - var error = $root.google.cloud.documentai.v1.NormalizedVertex.verify(message.normalizedVertices[i]); - if (error) - return "normalizedVertices." + error; - } - } - return null; - }; - - /** - * Creates a BoundingPoly message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.BoundingPoly - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.BoundingPoly} BoundingPoly - */ - BoundingPoly.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.BoundingPoly) - return object; - var message = new $root.google.cloud.documentai.v1.BoundingPoly(); - if (object.vertices) { - if (!Array.isArray(object.vertices)) - throw TypeError(".google.cloud.documentai.v1.BoundingPoly.vertices: array expected"); - message.vertices = []; - for (var i = 0; i < object.vertices.length; ++i) { - if (typeof object.vertices[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.BoundingPoly.vertices: object expected"); - message.vertices[i] = $root.google.cloud.documentai.v1.Vertex.fromObject(object.vertices[i]); - } - } - if (object.normalizedVertices) { - if (!Array.isArray(object.normalizedVertices)) - throw TypeError(".google.cloud.documentai.v1.BoundingPoly.normalizedVertices: array expected"); - message.normalizedVertices = []; - for (var i = 0; i < object.normalizedVertices.length; ++i) { - if (typeof object.normalizedVertices[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.BoundingPoly.normalizedVertices: object expected"); - message.normalizedVertices[i] = $root.google.cloud.documentai.v1.NormalizedVertex.fromObject(object.normalizedVertices[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a BoundingPoly message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.BoundingPoly - * @static - * @param {google.cloud.documentai.v1.BoundingPoly} message BoundingPoly - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BoundingPoly.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.vertices = []; - object.normalizedVertices = []; - } - if (message.vertices && message.vertices.length) { - object.vertices = []; - for (var j = 0; j < message.vertices.length; ++j) - object.vertices[j] = $root.google.cloud.documentai.v1.Vertex.toObject(message.vertices[j], options); - } - if (message.normalizedVertices && message.normalizedVertices.length) { - object.normalizedVertices = []; - for (var j = 0; j < message.normalizedVertices.length; ++j) - object.normalizedVertices[j] = $root.google.cloud.documentai.v1.NormalizedVertex.toObject(message.normalizedVertices[j], options); - } - return object; - }; - - /** - * Converts this BoundingPoly to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.BoundingPoly - * @instance - * @returns {Object.} JSON object - */ - BoundingPoly.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BoundingPoly - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.BoundingPoly - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BoundingPoly.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.BoundingPoly"; - }; - - return BoundingPoly; - })(); - - return v1; - })(); - - return documentai; - })(); - - return cloud; - })(); - - 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 - * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value - * @property {number} IDENTIFIER=8 IDENTIFIER value - */ - api.FieldBehavior = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; - values[valuesById[1] = "OPTIONAL"] = 1; - values[valuesById[2] = "REQUIRED"] = 2; - values[valuesById[3] = "OUTPUT_ONLY"] = 3; - values[valuesById[4] = "INPUT_ONLY"] = 4; - values[valuesById[5] = "IMMUTABLE"] = 5; - values[valuesById[6] = "UNORDERED_LIST"] = 6; - values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; - values[valuesById[8] = "IDENTIFIER"] = 8; - 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, error) { - 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(); - if (tag === error) - break; - 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) { - default: - if (typeof object.history === "number") { - message.history = object.history; - break; - } - break; - 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: - if (typeof object.style[i] === "number") { - message.style[i] = object.style[i]; - break; - } - 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] === undefined ? message.history : $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]] === undefined ? message.style[j] : $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); - }; - - /** - * Gets the default type url for ResourceDescriptor - * @function getTypeUrl - * @memberof google.api.ResourceDescriptor - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ResourceDescriptor"; - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * Gets the default type url for ResourceReference - * @function getTypeUrl - * @memberof google.api.ResourceReference - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ResourceReference"; - }; - - 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * Gets the default type url for Http - * @function getTypeUrl - * @memberof google.api.Http - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.Http"; - }; - - 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|null|undefined} get - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.get = null; - - /** - * HttpRule put. - * @member {string|null|undefined} put - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.put = null; - - /** - * HttpRule post. - * @member {string|null|undefined} post - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.post = null; - - /** - * HttpRule delete. - * @member {string|null|undefined} delete - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype["delete"] = null; - - /** - * HttpRule patch. - * @member {string|null|undefined} patch - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.patch = null; - - /** - * HttpRule custom. - * @member {google.api.ICustomHttpPattern|null|undefined} custom - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.custom = null; - - /** - * HttpRule body. - * @member {string} body - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.body = ""; - - /** - * HttpRule responseBody. - * @member {string} responseBody - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.responseBody = ""; - - /** - * HttpRule additionalBindings. - * @member {Array.} additionalBindings - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.additionalBindings = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * HttpRule pattern. - * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern - * @memberof google.api.HttpRule - * @instance - */ - Object.defineProperty(HttpRule.prototype, "pattern", { - get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new HttpRule instance using the specified properties. - * @function create - * @memberof google.api.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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * Gets the default type url for HttpRule - * @function getTypeUrl - * @memberof google.api.HttpRule - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.HttpRule"; - }; - - 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * Gets the default type url for CustomHttpPattern - * @function getTypeUrl - * @memberof google.api.CustomHttpPattern - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CustomHttpPattern"; - }; - - return CustomHttpPattern; - })(); - - api.CommonLanguageSettings = (function() { - - /** - * Properties of a CommonLanguageSettings. - * @memberof google.api - * @interface ICommonLanguageSettings - * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri - * @property {Array.|null} [destinations] CommonLanguageSettings destinations - */ - - /** - * Constructs a new CommonLanguageSettings. - * @memberof google.api - * @classdesc Represents a CommonLanguageSettings. - * @implements ICommonLanguageSettings - * @constructor - * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set - */ - function CommonLanguageSettings(properties) { - this.destinations = []; - 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]]; - } - - /** - * CommonLanguageSettings referenceDocsUri. - * @member {string} referenceDocsUri - * @memberof google.api.CommonLanguageSettings - * @instance - */ - CommonLanguageSettings.prototype.referenceDocsUri = ""; - - /** - * CommonLanguageSettings destinations. - * @member {Array.} destinations - * @memberof google.api.CommonLanguageSettings - * @instance - */ - CommonLanguageSettings.prototype.destinations = $util.emptyArray; - - /** - * Creates a new CommonLanguageSettings instance using the specified properties. - * @function create - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance - */ - CommonLanguageSettings.create = function create(properties) { - return new CommonLanguageSettings(properties); - }; - - /** - * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @function encode - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommonLanguageSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); - if (message.destinations != null && message.destinations.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.destinations.length; ++i) - writer.int32(message.destinations[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.CommonLanguageSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommonLanguageSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.referenceDocsUri = reader.string(); - break; - } - case 2: { - if (!(message.destinations && message.destinations.length)) - message.destinations = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.destinations.push(reader.int32()); - } else - message.destinations.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CommonLanguageSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CommonLanguageSettings message. - * @function verify - * @memberof google.api.CommonLanguageSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CommonLanguageSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) - if (!$util.isString(message.referenceDocsUri)) - return "referenceDocsUri: string expected"; - if (message.destinations != null && message.hasOwnProperty("destinations")) { - if (!Array.isArray(message.destinations)) - return "destinations: array expected"; - for (var i = 0; i < message.destinations.length; ++i) - switch (message.destinations[i]) { - default: - return "destinations: enum value[] expected"; - case 0: - case 10: - case 20: - break; - } - } - return null; - }; - - /** - * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CommonLanguageSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - */ - CommonLanguageSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CommonLanguageSettings) - return object; - var message = new $root.google.api.CommonLanguageSettings(); - if (object.referenceDocsUri != null) - message.referenceDocsUri = String(object.referenceDocsUri); - if (object.destinations) { - if (!Array.isArray(object.destinations)) - throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); - message.destinations = []; - for (var i = 0; i < object.destinations.length; ++i) - switch (object.destinations[i]) { - default: - if (typeof object.destinations[i] === "number") { - message.destinations[i] = object.destinations[i]; - break; - } - case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": - case 0: - message.destinations[i] = 0; - break; - case "GITHUB": - case 10: - message.destinations[i] = 10; - break; - case "PACKAGE_MANAGER": - case 20: - message.destinations[i] = 20; - break; - } - } - return message; - }; - - /** - * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CommonLanguageSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.destinations = []; - if (options.defaults) - object.referenceDocsUri = ""; - if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) - object.referenceDocsUri = message.referenceDocsUri; - if (message.destinations && message.destinations.length) { - object.destinations = []; - for (var j = 0; j < message.destinations.length; ++j) - object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; - } - return object; - }; - - /** - * Converts this CommonLanguageSettings to JSON. - * @function toJSON - * @memberof google.api.CommonLanguageSettings - * @instance - * @returns {Object.} JSON object - */ - CommonLanguageSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CommonLanguageSettings - * @function getTypeUrl - * @memberof google.api.CommonLanguageSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CommonLanguageSettings"; - }; - - return CommonLanguageSettings; - })(); - - api.ClientLibrarySettings = (function() { - - /** - * Properties of a ClientLibrarySettings. - * @memberof google.api - * @interface IClientLibrarySettings - * @property {string|null} [version] ClientLibrarySettings version - * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage - * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums - * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings - * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings - * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings - * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings - * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings - * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings - * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings - * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings - */ - - /** - * Constructs a new ClientLibrarySettings. - * @memberof google.api - * @classdesc Represents a ClientLibrarySettings. - * @implements IClientLibrarySettings - * @constructor - * @param {google.api.IClientLibrarySettings=} [properties] Properties to set - */ - function ClientLibrarySettings(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]]; - } - - /** - * ClientLibrarySettings version. - * @member {string} version - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.version = ""; - - /** - * ClientLibrarySettings launchStage. - * @member {google.api.LaunchStage} launchStage - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.launchStage = 0; - - /** - * ClientLibrarySettings restNumericEnums. - * @member {boolean} restNumericEnums - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.restNumericEnums = false; - - /** - * ClientLibrarySettings javaSettings. - * @member {google.api.IJavaSettings|null|undefined} javaSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.javaSettings = null; - - /** - * ClientLibrarySettings cppSettings. - * @member {google.api.ICppSettings|null|undefined} cppSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.cppSettings = null; - - /** - * ClientLibrarySettings phpSettings. - * @member {google.api.IPhpSettings|null|undefined} phpSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.phpSettings = null; - - /** - * ClientLibrarySettings pythonSettings. - * @member {google.api.IPythonSettings|null|undefined} pythonSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.pythonSettings = null; - - /** - * ClientLibrarySettings nodeSettings. - * @member {google.api.INodeSettings|null|undefined} nodeSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.nodeSettings = null; - - /** - * ClientLibrarySettings dotnetSettings. - * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.dotnetSettings = null; - - /** - * ClientLibrarySettings rubySettings. - * @member {google.api.IRubySettings|null|undefined} rubySettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.rubySettings = null; - - /** - * ClientLibrarySettings goSettings. - * @member {google.api.IGoSettings|null|undefined} goSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.goSettings = null; - - /** - * Creates a new ClientLibrarySettings instance using the specified properties. - * @function create - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings=} [properties] Properties to set - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance - */ - ClientLibrarySettings.create = function create(properties) { - return new ClientLibrarySettings(properties); - }; - - /** - * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @function encode - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientLibrarySettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); - if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); - if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); - if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) - $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) - $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) - $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); - if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) - $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); - if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) - $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); - if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) - $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); - if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) - $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); - if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) - $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.ClientLibrarySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientLibrarySettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.version = reader.string(); - break; - } - case 2: { - message.launchStage = reader.int32(); - break; - } - case 3: { - message.restNumericEnums = reader.bool(); - break; - } - case 21: { - message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32()); - break; - } - case 22: { - message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); - break; - } - case 23: { - message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); - break; - } - case 24: { - message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); - break; - } - case 25: { - message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); - break; - } - case 26: { - message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); - break; - } - case 27: { - message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); - break; - } - case 28: { - message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.ClientLibrarySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClientLibrarySettings message. - * @function verify - * @memberof google.api.ClientLibrarySettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClientLibrarySettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - if (message.launchStage != null && message.hasOwnProperty("launchStage")) - switch (message.launchStage) { - default: - return "launchStage: enum value expected"; - case 0: - case 6: - case 7: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) - if (typeof message.restNumericEnums !== "boolean") - return "restNumericEnums: boolean expected"; - if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { - var error = $root.google.api.JavaSettings.verify(message.javaSettings); - if (error) - return "javaSettings." + error; - } - if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { - var error = $root.google.api.CppSettings.verify(message.cppSettings); - if (error) - return "cppSettings." + error; - } - if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { - var error = $root.google.api.PhpSettings.verify(message.phpSettings); - if (error) - return "phpSettings." + error; - } - if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { - var error = $root.google.api.PythonSettings.verify(message.pythonSettings); - if (error) - return "pythonSettings." + error; - } - if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { - var error = $root.google.api.NodeSettings.verify(message.nodeSettings); - if (error) - return "nodeSettings." + error; - } - if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { - var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings); - if (error) - return "dotnetSettings." + error; - } - if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { - var error = $root.google.api.RubySettings.verify(message.rubySettings); - if (error) - return "rubySettings." + error; - } - if (message.goSettings != null && message.hasOwnProperty("goSettings")) { - var error = $root.google.api.GoSettings.verify(message.goSettings); - if (error) - return "goSettings." + error; - } - return null; - }; - - /** - * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ClientLibrarySettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - */ - ClientLibrarySettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ClientLibrarySettings) - return object; - var message = new $root.google.api.ClientLibrarySettings(); - if (object.version != null) - message.version = String(object.version); - switch (object.launchStage) { - default: - if (typeof object.launchStage === "number") { - message.launchStage = object.launchStage; - break; - } - break; - case "LAUNCH_STAGE_UNSPECIFIED": - case 0: - message.launchStage = 0; - break; - case "UNIMPLEMENTED": - case 6: - message.launchStage = 6; - break; - case "PRELAUNCH": - case 7: - message.launchStage = 7; - break; - case "EARLY_ACCESS": - case 1: - message.launchStage = 1; - break; - case "ALPHA": - case 2: - message.launchStage = 2; - break; - case "BETA": - case 3: - message.launchStage = 3; - break; - case "GA": - case 4: - message.launchStage = 4; - break; - case "DEPRECATED": - case 5: - message.launchStage = 5; - break; - } - if (object.restNumericEnums != null) - message.restNumericEnums = Boolean(object.restNumericEnums); - if (object.javaSettings != null) { - if (typeof object.javaSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); - message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); - } - if (object.cppSettings != null) { - if (typeof object.cppSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); - message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); - } - if (object.phpSettings != null) { - if (typeof object.phpSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); - message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); - } - if (object.pythonSettings != null) { - if (typeof object.pythonSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); - message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); - } - if (object.nodeSettings != null) { - if (typeof object.nodeSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); - message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); - } - if (object.dotnetSettings != null) { - if (typeof object.dotnetSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); - message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); - } - if (object.rubySettings != null) { - if (typeof object.rubySettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); - message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); - } - if (object.goSettings != null) { - if (typeof object.goSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); - message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); - } - return message; - }; - - /** - * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClientLibrarySettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.version = ""; - object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; - object.restNumericEnums = false; - object.javaSettings = null; - object.cppSettings = null; - object.phpSettings = null; - object.pythonSettings = null; - object.nodeSettings = null; - object.dotnetSettings = null; - object.rubySettings = null; - object.goSettings = null; - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.launchStage != null && message.hasOwnProperty("launchStage")) - object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; - if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) - object.restNumericEnums = message.restNumericEnums; - if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) - object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); - if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) - object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); - if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) - object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); - if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) - object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); - if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) - object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); - if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) - object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); - if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) - object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); - if (message.goSettings != null && message.hasOwnProperty("goSettings")) - object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); - return object; - }; - - /** - * Converts this ClientLibrarySettings to JSON. - * @function toJSON - * @memberof google.api.ClientLibrarySettings - * @instance - * @returns {Object.} JSON object - */ - ClientLibrarySettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ClientLibrarySettings - * @function getTypeUrl - * @memberof google.api.ClientLibrarySettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ClientLibrarySettings"; - }; - - return ClientLibrarySettings; - })(); - - api.Publishing = (function() { - - /** - * Properties of a Publishing. - * @memberof google.api - * @interface IPublishing - * @property {Array.|null} [methodSettings] Publishing methodSettings - * @property {string|null} [newIssueUri] Publishing newIssueUri - * @property {string|null} [documentationUri] Publishing documentationUri - * @property {string|null} [apiShortName] Publishing apiShortName - * @property {string|null} [githubLabel] Publishing githubLabel - * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams - * @property {string|null} [docTagPrefix] Publishing docTagPrefix - * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization - * @property {Array.|null} [librarySettings] Publishing librarySettings - * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri - * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri - */ - - /** - * Constructs a new Publishing. - * @memberof google.api - * @classdesc Represents a Publishing. - * @implements IPublishing - * @constructor - * @param {google.api.IPublishing=} [properties] Properties to set - */ - function Publishing(properties) { - this.methodSettings = []; - this.codeownerGithubTeams = []; - this.librarySettings = []; - 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]]; - } - - /** - * Publishing methodSettings. - * @member {Array.} methodSettings - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.methodSettings = $util.emptyArray; - - /** - * Publishing newIssueUri. - * @member {string} newIssueUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.newIssueUri = ""; - - /** - * Publishing documentationUri. - * @member {string} documentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.documentationUri = ""; - - /** - * Publishing apiShortName. - * @member {string} apiShortName - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.apiShortName = ""; - - /** - * Publishing githubLabel. - * @member {string} githubLabel - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.githubLabel = ""; - - /** - * Publishing codeownerGithubTeams. - * @member {Array.} codeownerGithubTeams - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.codeownerGithubTeams = $util.emptyArray; - - /** - * Publishing docTagPrefix. - * @member {string} docTagPrefix - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.docTagPrefix = ""; - - /** - * Publishing organization. - * @member {google.api.ClientLibraryOrganization} organization - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.organization = 0; - - /** - * Publishing librarySettings. - * @member {Array.} librarySettings - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.librarySettings = $util.emptyArray; - - /** - * Publishing protoReferenceDocumentationUri. - * @member {string} protoReferenceDocumentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.protoReferenceDocumentationUri = ""; - - /** - * Publishing restReferenceDocumentationUri. - * @member {string} restReferenceDocumentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.restReferenceDocumentationUri = ""; - - /** - * Creates a new Publishing instance using the specified properties. - * @function create - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing=} [properties] Properties to set - * @returns {google.api.Publishing} Publishing instance - */ - Publishing.create = function create(properties) { - return new Publishing(properties); - }; - - /** - * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @function encode - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing} message Publishing message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Publishing.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.methodSettings != null && message.methodSettings.length) - for (var i = 0; i < message.methodSettings.length; ++i) - $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) - writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); - if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) - writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); - if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) - writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); - if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) - writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); - if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) - for (var i = 0; i < message.codeownerGithubTeams.length; ++i) - writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); - if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) - writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); - if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) - writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); - if (message.librarySettings != null && message.librarySettings.length) - for (var i = 0; i < message.librarySettings.length; ++i) - $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); - if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) - writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); - if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) - writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); - return writer; - }; - - /** - * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing} message Publishing message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Publishing.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Publishing message from the specified reader or buffer. - * @function decode - * @memberof google.api.Publishing - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.Publishing} Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Publishing.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - if (!(message.methodSettings && message.methodSettings.length)) - message.methodSettings = []; - message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); - break; - } - case 101: { - message.newIssueUri = reader.string(); - break; - } - case 102: { - message.documentationUri = reader.string(); - break; - } - case 103: { - message.apiShortName = reader.string(); - break; - } - case 104: { - message.githubLabel = reader.string(); - break; - } - case 105: { - if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) - message.codeownerGithubTeams = []; - message.codeownerGithubTeams.push(reader.string()); - break; - } - case 106: { - message.docTagPrefix = reader.string(); - break; - } - case 107: { - message.organization = reader.int32(); - break; - } - case 109: { - if (!(message.librarySettings && message.librarySettings.length)) - message.librarySettings = []; - message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); - break; - } - case 110: { - message.protoReferenceDocumentationUri = reader.string(); - break; - } - case 111: { - message.restReferenceDocumentationUri = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Publishing message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.Publishing - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Publishing} Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Publishing.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Publishing message. - * @function verify - * @memberof google.api.Publishing - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Publishing.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { - if (!Array.isArray(message.methodSettings)) - return "methodSettings: array expected"; - for (var i = 0; i < message.methodSettings.length; ++i) { - var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); - if (error) - return "methodSettings." + error; - } - } - if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) - if (!$util.isString(message.newIssueUri)) - return "newIssueUri: string expected"; - if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) - if (!$util.isString(message.documentationUri)) - return "documentationUri: string expected"; - if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) - if (!$util.isString(message.apiShortName)) - return "apiShortName: string expected"; - if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) - if (!$util.isString(message.githubLabel)) - return "githubLabel: string expected"; - if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { - if (!Array.isArray(message.codeownerGithubTeams)) - return "codeownerGithubTeams: array expected"; - for (var i = 0; i < message.codeownerGithubTeams.length; ++i) - if (!$util.isString(message.codeownerGithubTeams[i])) - return "codeownerGithubTeams: string[] expected"; - } - if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) - if (!$util.isString(message.docTagPrefix)) - return "docTagPrefix: string expected"; - if (message.organization != null && message.hasOwnProperty("organization")) - switch (message.organization) { - default: - return "organization: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; - } - if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { - if (!Array.isArray(message.librarySettings)) - return "librarySettings: array expected"; - for (var i = 0; i < message.librarySettings.length; ++i) { - var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); - if (error) - return "librarySettings." + error; - } - } - if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) - if (!$util.isString(message.protoReferenceDocumentationUri)) - return "protoReferenceDocumentationUri: string expected"; - if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) - if (!$util.isString(message.restReferenceDocumentationUri)) - return "restReferenceDocumentationUri: string expected"; - return null; - }; - - /** - * Creates a Publishing message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Publishing - * @static - * @param {Object.} object Plain object - * @returns {google.api.Publishing} Publishing - */ - Publishing.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Publishing) - return object; - var message = new $root.google.api.Publishing(); - if (object.methodSettings) { - if (!Array.isArray(object.methodSettings)) - throw TypeError(".google.api.Publishing.methodSettings: array expected"); - message.methodSettings = []; - for (var i = 0; i < object.methodSettings.length; ++i) { - if (typeof object.methodSettings[i] !== "object") - throw TypeError(".google.api.Publishing.methodSettings: object expected"); - message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); - } - } - if (object.newIssueUri != null) - message.newIssueUri = String(object.newIssueUri); - if (object.documentationUri != null) - message.documentationUri = String(object.documentationUri); - if (object.apiShortName != null) - message.apiShortName = String(object.apiShortName); - if (object.githubLabel != null) - message.githubLabel = String(object.githubLabel); - if (object.codeownerGithubTeams) { - if (!Array.isArray(object.codeownerGithubTeams)) - throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); - message.codeownerGithubTeams = []; - for (var i = 0; i < object.codeownerGithubTeams.length; ++i) - message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); - } - if (object.docTagPrefix != null) - message.docTagPrefix = String(object.docTagPrefix); - switch (object.organization) { - default: - if (typeof object.organization === "number") { - message.organization = object.organization; - break; - } - break; - case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": - case 0: - message.organization = 0; - break; - case "CLOUD": - case 1: - message.organization = 1; - break; - case "ADS": - case 2: - message.organization = 2; - break; - case "PHOTOS": - case 3: - message.organization = 3; - break; - case "STREET_VIEW": - case 4: - message.organization = 4; - break; - case "SHOPPING": - case 5: - message.organization = 5; - break; - case "GEO": - case 6: - message.organization = 6; - break; - case "GENERATIVE_AI": - case 7: - message.organization = 7; - break; - } - if (object.librarySettings) { - if (!Array.isArray(object.librarySettings)) - throw TypeError(".google.api.Publishing.librarySettings: array expected"); - message.librarySettings = []; - for (var i = 0; i < object.librarySettings.length; ++i) { - if (typeof object.librarySettings[i] !== "object") - throw TypeError(".google.api.Publishing.librarySettings: object expected"); - message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); - } - } - if (object.protoReferenceDocumentationUri != null) - message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); - if (object.restReferenceDocumentationUri != null) - message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); - return message; - }; - - /** - * Creates a plain object from a Publishing message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Publishing - * @static - * @param {google.api.Publishing} message Publishing - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Publishing.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.methodSettings = []; - object.codeownerGithubTeams = []; - object.librarySettings = []; - } - if (options.defaults) { - object.newIssueUri = ""; - object.documentationUri = ""; - object.apiShortName = ""; - object.githubLabel = ""; - object.docTagPrefix = ""; - object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; - object.protoReferenceDocumentationUri = ""; - object.restReferenceDocumentationUri = ""; - } - if (message.methodSettings && message.methodSettings.length) { - object.methodSettings = []; - for (var j = 0; j < message.methodSettings.length; ++j) - object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); - } - if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) - object.newIssueUri = message.newIssueUri; - if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) - object.documentationUri = message.documentationUri; - if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) - object.apiShortName = message.apiShortName; - if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) - object.githubLabel = message.githubLabel; - if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { - object.codeownerGithubTeams = []; - for (var j = 0; j < message.codeownerGithubTeams.length; ++j) - object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; - } - if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) - object.docTagPrefix = message.docTagPrefix; - if (message.organization != null && message.hasOwnProperty("organization")) - object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; - if (message.librarySettings && message.librarySettings.length) { - object.librarySettings = []; - for (var j = 0; j < message.librarySettings.length; ++j) - object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); - } - if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) - object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; - if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) - object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; - return object; - }; - - /** - * Converts this Publishing to JSON. - * @function toJSON - * @memberof google.api.Publishing - * @instance - * @returns {Object.} JSON object - */ - Publishing.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Publishing - * @function getTypeUrl - * @memberof google.api.Publishing - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.Publishing"; - }; - - return Publishing; - })(); - - api.JavaSettings = (function() { - - /** - * Properties of a JavaSettings. - * @memberof google.api - * @interface IJavaSettings - * @property {string|null} [libraryPackage] JavaSettings libraryPackage - * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames - * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common - */ - - /** - * Constructs a new JavaSettings. - * @memberof google.api - * @classdesc Represents a JavaSettings. - * @implements IJavaSettings - * @constructor - * @param {google.api.IJavaSettings=} [properties] Properties to set - */ - function JavaSettings(properties) { - this.serviceClassNames = {}; - 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]]; - } - - /** - * JavaSettings libraryPackage. - * @member {string} libraryPackage - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.libraryPackage = ""; - - /** - * JavaSettings serviceClassNames. - * @member {Object.} serviceClassNames - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.serviceClassNames = $util.emptyObject; - - /** - * JavaSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.common = null; - - /** - * Creates a new JavaSettings instance using the specified properties. - * @function create - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings=} [properties] Properties to set - * @returns {google.api.JavaSettings} JavaSettings instance - */ - JavaSettings.create = function create(properties) { - return new JavaSettings(properties); - }; - - /** - * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @function encode - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JavaSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); - if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) - for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a JavaSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.JavaSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.JavaSettings} JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JavaSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.libraryPackage = reader.string(); - break; - } - case 2: { - if (message.serviceClassNames === $util.emptyObject) - message.serviceClassNames = {}; - 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.serviceClassNames[key] = value; - break; - } - case 3: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a JavaSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.JavaSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.JavaSettings} JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JavaSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a JavaSettings message. - * @function verify - * @memberof google.api.JavaSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - JavaSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) - if (!$util.isString(message.libraryPackage)) - return "libraryPackage: string expected"; - if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { - if (!$util.isObject(message.serviceClassNames)) - return "serviceClassNames: object expected"; - var key = Object.keys(message.serviceClassNames); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.serviceClassNames[key[i]])) - return "serviceClassNames: string{k:string} expected"; - } - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.JavaSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.JavaSettings} JavaSettings - */ - JavaSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.JavaSettings) - return object; - var message = new $root.google.api.JavaSettings(); - if (object.libraryPackage != null) - message.libraryPackage = String(object.libraryPackage); - if (object.serviceClassNames) { - if (typeof object.serviceClassNames !== "object") - throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); - message.serviceClassNames = {}; - for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) - message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); - } - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.JavaSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.JavaSettings - * @static - * @param {google.api.JavaSettings} message JavaSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - JavaSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.serviceClassNames = {}; - if (options.defaults) { - object.libraryPackage = ""; - object.common = null; - } - if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) - object.libraryPackage = message.libraryPackage; - var keys2; - if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { - object.serviceClassNames = {}; - for (var j = 0; j < keys2.length; ++j) - object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; - } - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this JavaSettings to JSON. - * @function toJSON - * @memberof google.api.JavaSettings - * @instance - * @returns {Object.} JSON object - */ - JavaSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for JavaSettings - * @function getTypeUrl - * @memberof google.api.JavaSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.JavaSettings"; - }; - - return JavaSettings; - })(); - - api.CppSettings = (function() { - - /** - * Properties of a CppSettings. - * @memberof google.api - * @interface ICppSettings - * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common - */ - - /** - * Constructs a new CppSettings. - * @memberof google.api - * @classdesc Represents a CppSettings. - * @implements ICppSettings - * @constructor - * @param {google.api.ICppSettings=} [properties] Properties to set - */ - function CppSettings(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]]; - } - - /** - * CppSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.CppSettings - * @instance - */ - CppSettings.prototype.common = null; - - /** - * Creates a new CppSettings instance using the specified properties. - * @function create - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings=} [properties] Properties to set - * @returns {google.api.CppSettings} CppSettings instance - */ - CppSettings.create = function create(properties) { - return new CppSettings(properties); - }; - - /** - * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @function encode - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings} message CppSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CppSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings} message CppSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CppSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CppSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.CppSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CppSettings} CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CppSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CppSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CppSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CppSettings} CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CppSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CppSettings message. - * @function verify - * @memberof google.api.CppSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CppSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CppSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.CppSettings} CppSettings - */ - CppSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CppSettings) - return object; - var message = new $root.google.api.CppSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.CppSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a CppSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CppSettings - * @static - * @param {google.api.CppSettings} message CppSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CppSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this CppSettings to JSON. - * @function toJSON - * @memberof google.api.CppSettings - * @instance - * @returns {Object.} JSON object - */ - CppSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CppSettings - * @function getTypeUrl - * @memberof google.api.CppSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CppSettings"; - }; - - return CppSettings; - })(); - - api.PhpSettings = (function() { - - /** - * Properties of a PhpSettings. - * @memberof google.api - * @interface IPhpSettings - * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common - */ - - /** - * Constructs a new PhpSettings. - * @memberof google.api - * @classdesc Represents a PhpSettings. - * @implements IPhpSettings - * @constructor - * @param {google.api.IPhpSettings=} [properties] Properties to set - */ - function PhpSettings(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]]; - } - - /** - * PhpSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.PhpSettings - * @instance - */ - PhpSettings.prototype.common = null; - - /** - * Creates a new PhpSettings instance using the specified properties. - * @function create - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings=} [properties] Properties to set - * @returns {google.api.PhpSettings} PhpSettings instance - */ - PhpSettings.create = function create(properties) { - return new PhpSettings(properties); - }; - - /** - * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @function encode - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PhpSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PhpSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.PhpSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.PhpSettings} PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PhpSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PhpSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.PhpSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.PhpSettings} PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PhpSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PhpSettings message. - * @function verify - * @memberof google.api.PhpSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PhpSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.PhpSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.PhpSettings} PhpSettings - */ - PhpSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.PhpSettings) - return object; - var message = new $root.google.api.PhpSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.PhpSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.PhpSettings - * @static - * @param {google.api.PhpSettings} message PhpSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PhpSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this PhpSettings to JSON. - * @function toJSON - * @memberof google.api.PhpSettings - * @instance - * @returns {Object.} JSON object - */ - PhpSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PhpSettings - * @function getTypeUrl - * @memberof google.api.PhpSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.PhpSettings"; - }; - - return PhpSettings; - })(); - - api.PythonSettings = (function() { - - /** - * Properties of a PythonSettings. - * @memberof google.api - * @interface IPythonSettings - * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common - */ - - /** - * Constructs a new PythonSettings. - * @memberof google.api - * @classdesc Represents a PythonSettings. - * @implements IPythonSettings - * @constructor - * @param {google.api.IPythonSettings=} [properties] Properties to set - */ - function PythonSettings(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]]; - } - - /** - * PythonSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.PythonSettings - * @instance - */ - PythonSettings.prototype.common = null; - - /** - * Creates a new PythonSettings instance using the specified properties. - * @function create - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings=} [properties] Properties to set - * @returns {google.api.PythonSettings} PythonSettings instance - */ - PythonSettings.create = function create(properties) { - return new PythonSettings(properties); - }; - - /** - * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @function encode - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PythonSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PythonSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.PythonSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.PythonSettings} PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PythonSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PythonSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.PythonSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.PythonSettings} PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PythonSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PythonSettings message. - * @function verify - * @memberof google.api.PythonSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PythonSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.PythonSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.PythonSettings} PythonSettings - */ - PythonSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.PythonSettings) - return object; - var message = new $root.google.api.PythonSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.PythonSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.PythonSettings - * @static - * @param {google.api.PythonSettings} message PythonSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PythonSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this PythonSettings to JSON. - * @function toJSON - * @memberof google.api.PythonSettings - * @instance - * @returns {Object.} JSON object - */ - PythonSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PythonSettings - * @function getTypeUrl - * @memberof google.api.PythonSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.PythonSettings"; - }; - - return PythonSettings; - })(); - - api.NodeSettings = (function() { - - /** - * Properties of a NodeSettings. - * @memberof google.api - * @interface INodeSettings - * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common - */ - - /** - * Constructs a new NodeSettings. - * @memberof google.api - * @classdesc Represents a NodeSettings. - * @implements INodeSettings - * @constructor - * @param {google.api.INodeSettings=} [properties] Properties to set - */ - function NodeSettings(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]]; - } - - /** - * NodeSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.NodeSettings - * @instance - */ - NodeSettings.prototype.common = null; - - /** - * Creates a new NodeSettings instance using the specified properties. - * @function create - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings=} [properties] Properties to set - * @returns {google.api.NodeSettings} NodeSettings instance - */ - NodeSettings.create = function create(properties) { - return new NodeSettings(properties); - }; - - /** - * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @function encode - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodeSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NodeSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.NodeSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.NodeSettings} NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodeSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NodeSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.NodeSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.NodeSettings} NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodeSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NodeSettings message. - * @function verify - * @memberof google.api.NodeSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NodeSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.NodeSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.NodeSettings} NodeSettings - */ - NodeSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.NodeSettings) - return object; - var message = new $root.google.api.NodeSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.NodeSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.NodeSettings - * @static - * @param {google.api.NodeSettings} message NodeSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NodeSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this NodeSettings to JSON. - * @function toJSON - * @memberof google.api.NodeSettings - * @instance - * @returns {Object.} JSON object - */ - NodeSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NodeSettings - * @function getTypeUrl - * @memberof google.api.NodeSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.NodeSettings"; - }; - - return NodeSettings; - })(); - - api.DotnetSettings = (function() { - - /** - * Properties of a DotnetSettings. - * @memberof google.api - * @interface IDotnetSettings - * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common - * @property {Object.|null} [renamedServices] DotnetSettings renamedServices - * @property {Object.|null} [renamedResources] DotnetSettings renamedResources - * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources - * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases - * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures - */ - - /** - * Constructs a new DotnetSettings. - * @memberof google.api - * @classdesc Represents a DotnetSettings. - * @implements IDotnetSettings - * @constructor - * @param {google.api.IDotnetSettings=} [properties] Properties to set - */ - function DotnetSettings(properties) { - this.renamedServices = {}; - this.renamedResources = {}; - this.ignoredResources = []; - this.forcedNamespaceAliases = []; - this.handwrittenSignatures = []; - 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]]; - } - - /** - * DotnetSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.common = null; - - /** - * DotnetSettings renamedServices. - * @member {Object.} renamedServices - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.renamedServices = $util.emptyObject; - - /** - * DotnetSettings renamedResources. - * @member {Object.} renamedResources - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.renamedResources = $util.emptyObject; - - /** - * DotnetSettings ignoredResources. - * @member {Array.} ignoredResources - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.ignoredResources = $util.emptyArray; - - /** - * DotnetSettings forcedNamespaceAliases. - * @member {Array.} forcedNamespaceAliases - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; - - /** - * DotnetSettings handwrittenSignatures. - * @member {Array.} handwrittenSignatures - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; - - /** - * Creates a new DotnetSettings instance using the specified properties. - * @function create - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings=} [properties] Properties to set - * @returns {google.api.DotnetSettings} DotnetSettings instance - */ - DotnetSettings.create = function create(properties) { - return new DotnetSettings(properties); - }; - - /** - * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @function encode - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DotnetSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) - for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); - if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) - for (var keys = Object.keys(message.renamedResources), 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.renamedResources[keys[i]]).ldelim(); - if (message.ignoredResources != null && message.ignoredResources.length) - for (var i = 0; i < message.ignoredResources.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); - if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) - for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); - if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) - for (var i = 0; i < message.handwrittenSignatures.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); - return writer; - }; - - /** - * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.DotnetSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.DotnetSettings} DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DotnetSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - case 2: { - if (message.renamedServices === $util.emptyObject) - message.renamedServices = {}; - 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.renamedServices[key] = value; - break; - } - case 3: { - if (message.renamedResources === $util.emptyObject) - message.renamedResources = {}; - 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.renamedResources[key] = value; - break; - } - case 4: { - if (!(message.ignoredResources && message.ignoredResources.length)) - message.ignoredResources = []; - message.ignoredResources.push(reader.string()); - break; - } - case 5: { - if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) - message.forcedNamespaceAliases = []; - message.forcedNamespaceAliases.push(reader.string()); - break; - } - case 6: { - if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) - message.handwrittenSignatures = []; - message.handwrittenSignatures.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.DotnetSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.DotnetSettings} DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DotnetSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DotnetSettings message. - * @function verify - * @memberof google.api.DotnetSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DotnetSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { - if (!$util.isObject(message.renamedServices)) - return "renamedServices: object expected"; - var key = Object.keys(message.renamedServices); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.renamedServices[key[i]])) - return "renamedServices: string{k:string} expected"; - } - if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { - if (!$util.isObject(message.renamedResources)) - return "renamedResources: object expected"; - var key = Object.keys(message.renamedResources); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.renamedResources[key[i]])) - return "renamedResources: string{k:string} expected"; - } - if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { - if (!Array.isArray(message.ignoredResources)) - return "ignoredResources: array expected"; - for (var i = 0; i < message.ignoredResources.length; ++i) - if (!$util.isString(message.ignoredResources[i])) - return "ignoredResources: string[] expected"; - } - if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { - if (!Array.isArray(message.forcedNamespaceAliases)) - return "forcedNamespaceAliases: array expected"; - for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) - if (!$util.isString(message.forcedNamespaceAliases[i])) - return "forcedNamespaceAliases: string[] expected"; - } - if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { - if (!Array.isArray(message.handwrittenSignatures)) - return "handwrittenSignatures: array expected"; - for (var i = 0; i < message.handwrittenSignatures.length; ++i) - if (!$util.isString(message.handwrittenSignatures[i])) - return "handwrittenSignatures: string[] expected"; - } - return null; - }; - - /** - * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.DotnetSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.DotnetSettings} DotnetSettings - */ - DotnetSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.DotnetSettings) - return object; - var message = new $root.google.api.DotnetSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.DotnetSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - if (object.renamedServices) { - if (typeof object.renamedServices !== "object") - throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); - message.renamedServices = {}; - for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) - message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); - } - if (object.renamedResources) { - if (typeof object.renamedResources !== "object") - throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); - message.renamedResources = {}; - for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) - message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); - } - if (object.ignoredResources) { - if (!Array.isArray(object.ignoredResources)) - throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); - message.ignoredResources = []; - for (var i = 0; i < object.ignoredResources.length; ++i) - message.ignoredResources[i] = String(object.ignoredResources[i]); - } - if (object.forcedNamespaceAliases) { - if (!Array.isArray(object.forcedNamespaceAliases)) - throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); - message.forcedNamespaceAliases = []; - for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) - message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); - } - if (object.handwrittenSignatures) { - if (!Array.isArray(object.handwrittenSignatures)) - throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); - message.handwrittenSignatures = []; - for (var i = 0; i < object.handwrittenSignatures.length; ++i) - message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); - } - return message; - }; - - /** - * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.DotnetSettings} message DotnetSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DotnetSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.ignoredResources = []; - object.forcedNamespaceAliases = []; - object.handwrittenSignatures = []; - } - if (options.objects || options.defaults) { - object.renamedServices = {}; - object.renamedResources = {}; - } - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - var keys2; - if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { - object.renamedServices = {}; - for (var j = 0; j < keys2.length; ++j) - object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; - } - if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { - object.renamedResources = {}; - for (var j = 0; j < keys2.length; ++j) - object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; - } - if (message.ignoredResources && message.ignoredResources.length) { - object.ignoredResources = []; - for (var j = 0; j < message.ignoredResources.length; ++j) - object.ignoredResources[j] = message.ignoredResources[j]; - } - if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { - object.forcedNamespaceAliases = []; - for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) - object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; - } - if (message.handwrittenSignatures && message.handwrittenSignatures.length) { - object.handwrittenSignatures = []; - for (var j = 0; j < message.handwrittenSignatures.length; ++j) - object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; - } - return object; - }; - - /** - * Converts this DotnetSettings to JSON. - * @function toJSON - * @memberof google.api.DotnetSettings - * @instance - * @returns {Object.} JSON object - */ - DotnetSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DotnetSettings - * @function getTypeUrl - * @memberof google.api.DotnetSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.DotnetSettings"; - }; - - return DotnetSettings; - })(); - - api.RubySettings = (function() { - - /** - * Properties of a RubySettings. - * @memberof google.api - * @interface IRubySettings - * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common - */ - - /** - * Constructs a new RubySettings. - * @memberof google.api - * @classdesc Represents a RubySettings. - * @implements IRubySettings - * @constructor - * @param {google.api.IRubySettings=} [properties] Properties to set - */ - function RubySettings(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]]; - } - - /** - * RubySettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.RubySettings - * @instance - */ - RubySettings.prototype.common = null; - - /** - * Creates a new RubySettings instance using the specified properties. - * @function create - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings=} [properties] Properties to set - * @returns {google.api.RubySettings} RubySettings instance - */ - RubySettings.create = function create(properties) { - return new RubySettings(properties); - }; - - /** - * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @function encode - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings} message RubySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RubySettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings} message RubySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RubySettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RubySettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.RubySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.RubySettings} RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RubySettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RubySettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.RubySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.RubySettings} RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RubySettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RubySettings message. - * @function verify - * @memberof google.api.RubySettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RubySettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.RubySettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.RubySettings} RubySettings - */ - RubySettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.RubySettings) - return object; - var message = new $root.google.api.RubySettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.RubySettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a RubySettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.RubySettings - * @static - * @param {google.api.RubySettings} message RubySettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RubySettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this RubySettings to JSON. - * @function toJSON - * @memberof google.api.RubySettings - * @instance - * @returns {Object.} JSON object - */ - RubySettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RubySettings - * @function getTypeUrl - * @memberof google.api.RubySettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.RubySettings"; - }; - - return RubySettings; - })(); - - api.GoSettings = (function() { - - /** - * Properties of a GoSettings. - * @memberof google.api - * @interface IGoSettings - * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common - */ - - /** - * Constructs a new GoSettings. - * @memberof google.api - * @classdesc Represents a GoSettings. - * @implements IGoSettings - * @constructor - * @param {google.api.IGoSettings=} [properties] Properties to set - */ - function GoSettings(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]]; - } - - /** - * GoSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.GoSettings - * @instance - */ - GoSettings.prototype.common = null; - - /** - * Creates a new GoSettings instance using the specified properties. - * @function create - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings=} [properties] Properties to set - * @returns {google.api.GoSettings} GoSettings instance - */ - GoSettings.create = function create(properties) { - return new GoSettings(properties); - }; - - /** - * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @function encode - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings} message GoSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings} message GoSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GoSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.GoSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.GoSettings} GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GoSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.GoSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.GoSettings} GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GoSettings message. - * @function verify - * @memberof google.api.GoSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GoSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.GoSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.GoSettings} GoSettings - */ - GoSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.GoSettings) - return object; - var message = new $root.google.api.GoSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.GoSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a GoSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.GoSettings - * @static - * @param {google.api.GoSettings} message GoSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GoSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this GoSettings to JSON. - * @function toJSON - * @memberof google.api.GoSettings - * @instance - * @returns {Object.} JSON object - */ - GoSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GoSettings - * @function getTypeUrl - * @memberof google.api.GoSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.GoSettings"; - }; - - return GoSettings; - })(); - - api.MethodSettings = (function() { - - /** - * Properties of a MethodSettings. - * @memberof google.api - * @interface IMethodSettings - * @property {string|null} [selector] MethodSettings selector - * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning - * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields - */ - - /** - * Constructs a new MethodSettings. - * @memberof google.api - * @classdesc Represents a MethodSettings. - * @implements IMethodSettings - * @constructor - * @param {google.api.IMethodSettings=} [properties] Properties to set - */ - function MethodSettings(properties) { - this.autoPopulatedFields = []; - 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]]; - } - - /** - * MethodSettings selector. - * @member {string} selector - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.selector = ""; - - /** - * MethodSettings longRunning. - * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.longRunning = null; - - /** - * MethodSettings autoPopulatedFields. - * @member {Array.} autoPopulatedFields - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; - - /** - * Creates a new MethodSettings instance using the specified properties. - * @function create - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings=} [properties] Properties to set - * @returns {google.api.MethodSettings} MethodSettings instance - */ - MethodSettings.create = function create(properties) { - return new MethodSettings(properties); - }; - - /** - * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @function encode - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodSettings.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.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) - $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) - for (var i = 0; i < message.autoPopulatedFields.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); - return writer; - }; - - /** - * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.MethodSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.MethodSettings} MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.selector = reader.string(); - break; - } - case 2: { - message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); - break; - } - case 3: { - if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) - message.autoPopulatedFields = []; - message.autoPopulatedFields.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.MethodSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.MethodSettings} MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodSettings message. - * @function verify - * @memberof google.api.MethodSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.selector != null && message.hasOwnProperty("selector")) - if (!$util.isString(message.selector)) - return "selector: string expected"; - if (message.longRunning != null && message.hasOwnProperty("longRunning")) { - var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); - if (error) - return "longRunning." + error; - } - if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { - if (!Array.isArray(message.autoPopulatedFields)) - return "autoPopulatedFields: array expected"; - for (var i = 0; i < message.autoPopulatedFields.length; ++i) - if (!$util.isString(message.autoPopulatedFields[i])) - return "autoPopulatedFields: string[] expected"; - } - return null; - }; - - /** - * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.MethodSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.MethodSettings} MethodSettings - */ - MethodSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.MethodSettings) - return object; - var message = new $root.google.api.MethodSettings(); - if (object.selector != null) - message.selector = String(object.selector); - if (object.longRunning != null) { - if (typeof object.longRunning !== "object") - throw TypeError(".google.api.MethodSettings.longRunning: object expected"); - message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); - } - if (object.autoPopulatedFields) { - if (!Array.isArray(object.autoPopulatedFields)) - throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); - message.autoPopulatedFields = []; - for (var i = 0; i < object.autoPopulatedFields.length; ++i) - message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); - } - return message; - }; - - /** - * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.MethodSettings - * @static - * @param {google.api.MethodSettings} message MethodSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.autoPopulatedFields = []; - if (options.defaults) { - object.selector = ""; - object.longRunning = null; - } - if (message.selector != null && message.hasOwnProperty("selector")) - object.selector = message.selector; - if (message.longRunning != null && message.hasOwnProperty("longRunning")) - object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); - if (message.autoPopulatedFields && message.autoPopulatedFields.length) { - object.autoPopulatedFields = []; - for (var j = 0; j < message.autoPopulatedFields.length; ++j) - object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; - } - return object; - }; - - /** - * Converts this MethodSettings to JSON. - * @function toJSON - * @memberof google.api.MethodSettings - * @instance - * @returns {Object.} JSON object - */ - MethodSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodSettings - * @function getTypeUrl - * @memberof google.api.MethodSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.MethodSettings"; - }; - - MethodSettings.LongRunning = (function() { - - /** - * Properties of a LongRunning. - * @memberof google.api.MethodSettings - * @interface ILongRunning - * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay - * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier - * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay - * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout - */ - - /** - * Constructs a new LongRunning. - * @memberof google.api.MethodSettings - * @classdesc Represents a LongRunning. - * @implements ILongRunning - * @constructor - * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set - */ - function LongRunning(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]]; - } - - /** - * LongRunning initialPollDelay. - * @member {google.protobuf.IDuration|null|undefined} initialPollDelay - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.initialPollDelay = null; - - /** - * LongRunning pollDelayMultiplier. - * @member {number} pollDelayMultiplier - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.pollDelayMultiplier = 0; - - /** - * LongRunning maxPollDelay. - * @member {google.protobuf.IDuration|null|undefined} maxPollDelay - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.maxPollDelay = null; - - /** - * LongRunning totalPollTimeout. - * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.totalPollTimeout = null; - - /** - * Creates a new LongRunning instance using the specified properties. - * @function create - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set - * @returns {google.api.MethodSettings.LongRunning} LongRunning instance - */ - LongRunning.create = function create(properties) { - return new LongRunning(properties); - }; - - /** - * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @function encode - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LongRunning.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) - $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); - if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) - $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) - $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LongRunning.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LongRunning message from the specified reader or buffer. - * @function decode - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.MethodSettings.LongRunning} LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LongRunning.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 2: { - message.pollDelayMultiplier = reader.float(); - break; - } - case 3: { - message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 4: { - message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LongRunning message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.MethodSettings.LongRunning} LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LongRunning.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LongRunning message. - * @function verify - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LongRunning.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { - var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); - if (error) - return "initialPollDelay." + error; - } - if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) - if (typeof message.pollDelayMultiplier !== "number") - return "pollDelayMultiplier: number expected"; - if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { - var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); - if (error) - return "maxPollDelay." + error; - } - if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { - var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); - if (error) - return "totalPollTimeout." + error; - } - return null; - }; - - /** - * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {Object.} object Plain object - * @returns {google.api.MethodSettings.LongRunning} LongRunning - */ - LongRunning.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.MethodSettings.LongRunning) - return object; - var message = new $root.google.api.MethodSettings.LongRunning(); - if (object.initialPollDelay != null) { - if (typeof object.initialPollDelay !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); - message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); - } - if (object.pollDelayMultiplier != null) - message.pollDelayMultiplier = Number(object.pollDelayMultiplier); - if (object.maxPollDelay != null) { - if (typeof object.maxPollDelay !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); - message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); - } - if (object.totalPollTimeout != null) { - if (typeof object.totalPollTimeout !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); - message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); - } - return message; - }; - - /** - * Creates a plain object from a LongRunning message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.LongRunning} message LongRunning - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LongRunning.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.initialPollDelay = null; - object.pollDelayMultiplier = 0; - object.maxPollDelay = null; - object.totalPollTimeout = null; - } - if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) - object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); - if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) - object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; - if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) - object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); - if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) - object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); - return object; - }; - - /** - * Converts this LongRunning to JSON. - * @function toJSON - * @memberof google.api.MethodSettings.LongRunning - * @instance - * @returns {Object.} JSON object - */ - LongRunning.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LongRunning - * @function getTypeUrl - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; - }; - - return LongRunning; - })(); - - return MethodSettings; - })(); - - /** - * ClientLibraryOrganization enum. - * @name google.api.ClientLibraryOrganization - * @enum {number} - * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value - * @property {number} CLOUD=1 CLOUD value - * @property {number} ADS=2 ADS value - * @property {number} PHOTOS=3 PHOTOS value - * @property {number} STREET_VIEW=4 STREET_VIEW value - * @property {number} SHOPPING=5 SHOPPING value - * @property {number} GEO=6 GEO value - * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value - */ - api.ClientLibraryOrganization = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; - values[valuesById[1] = "CLOUD"] = 1; - values[valuesById[2] = "ADS"] = 2; - values[valuesById[3] = "PHOTOS"] = 3; - values[valuesById[4] = "STREET_VIEW"] = 4; - values[valuesById[5] = "SHOPPING"] = 5; - values[valuesById[6] = "GEO"] = 6; - values[valuesById[7] = "GENERATIVE_AI"] = 7; - return values; - })(); - - /** - * ClientLibraryDestination enum. - * @name google.api.ClientLibraryDestination - * @enum {number} - * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value - * @property {number} GITHUB=10 GITHUB value - * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value - */ - api.ClientLibraryDestination = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; - values[valuesById[10] = "GITHUB"] = 10; - values[valuesById[20] = "PACKAGE_MANAGER"] = 20; - return values; - })(); - - /** - * LaunchStage enum. - * @name google.api.LaunchStage - * @enum {number} - * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value - * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value - * @property {number} PRELAUNCH=7 PRELAUNCH value - * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value - * @property {number} ALPHA=2 ALPHA value - * @property {number} BETA=3 BETA value - * @property {number} GA=4 GA value - * @property {number} DEPRECATED=5 DEPRECATED value - */ - api.LaunchStage = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; - values[valuesById[6] = "UNIMPLEMENTED"] = 6; - values[valuesById[7] = "PRELAUNCH"] = 7; - values[valuesById[1] = "EARLY_ACCESS"] = 1; - values[valuesById[2] = "ALPHA"] = 2; - values[valuesById[3] = "BETA"] = 3; - values[valuesById[4] = "GA"] = 4; - values[valuesById[5] = "DEPRECATED"] = 5; - return values; - })(); - - 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * Gets the default type url for FileDescriptorSet - * @function getTypeUrl - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; - }; - - return FileDescriptorSet; - })(); - - /** - * Edition enum. - * @name google.protobuf.Edition - * @enum {number} - * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value - * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value - * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value - * @property {number} EDITION_2023=1000 EDITION_2023 value - * @property {number} EDITION_2024=1001 EDITION_2024 value - * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value - * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value - * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value - * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value - * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value - * @property {number} EDITION_MAX=2147483647 EDITION_MAX value - */ - protobuf.Edition = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "EDITION_UNKNOWN"] = 0; - values[valuesById[998] = "EDITION_PROTO2"] = 998; - values[valuesById[999] = "EDITION_PROTO3"] = 999; - values[valuesById[1000] = "EDITION_2023"] = 1000; - values[valuesById[1001] = "EDITION_2024"] = 1001; - values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; - values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; - values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; - values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; - values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; - values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; - return values; - })(); - - 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 - * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition - */ - - /** - * 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 = ""; - - /** - * FileDescriptorProto edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.edition = 0; - - /** - * 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); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); - 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, error) { - 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(); - if (tag === error) - break; - 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; - } - case 14: { - message.edition = reader.int32(); - 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"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - 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); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - 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 = ""; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - 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; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - 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); - }; - - /** - * Gets the default type url for FileDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; - }; - - 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * Gets the default type url for DescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto"; - }; - - 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * Gets the default type url for ExtensionRange - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; - }; - - 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * Gets the default type url for ReservedRange - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; - }; - - return ReservedRange; - })(); - - return DescriptorProto; - })(); - - protobuf.ExtensionRangeOptions = (function() { - - /** - * Properties of an ExtensionRangeOptions. - * @memberof google.protobuf - * @interface IExtensionRangeOptions - * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption - * @property {Array.|null} [declaration] ExtensionRangeOptions declaration - * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features - * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification - */ - - /** - * 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 = []; - this.declaration = []; - 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; - - /** - * ExtensionRangeOptions declaration. - * @member {Array.} declaration - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.declaration = $util.emptyArray; - - /** - * ExtensionRangeOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.features = null; - - /** - * ExtensionRangeOptions verification. - * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.verification = 1; - - /** - * 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.declaration != null && message.declaration.length) - for (var i = 0; i < message.declaration.length; ++i) - $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); - 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, error) { - 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(); - if (tag === error) - break; - 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; - } - case 2: { - if (!(message.declaration && message.declaration.length)) - message.declaration = []; - message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); - break; - } - case 50: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 3: { - message.verification = reader.int32(); - 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; - } - } - if (message.declaration != null && message.hasOwnProperty("declaration")) { - if (!Array.isArray(message.declaration)) - return "declaration: array expected"; - for (var i = 0; i < message.declaration.length; ++i) { - var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); - if (error) - return "declaration." + error; - } - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.verification != null && message.hasOwnProperty("verification")) - switch (message.verification) { - default: - return "verification: enum value expected"; - case 0: - case 1: - break; - } - 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]); - } - } - if (object.declaration) { - if (!Array.isArray(object.declaration)) - throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); - message.declaration = []; - for (var i = 0; i < object.declaration.length; ++i) { - if (typeof object.declaration[i] !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); - message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); - } - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - switch (object.verification) { - case "DECLARATION": - case 0: - message.verification = 0; - break; - default: - if (typeof object.verification === "number") { - message.verification = object.verification; - break; - } - break; - case "UNVERIFIED": - case 1: - message.verification = 1; - break; - } - 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.declaration = []; - object.uninterpretedOption = []; - } - if (options.defaults) { - object.verification = options.enums === String ? "UNVERIFIED" : 1; - object.features = null; - } - if (message.declaration && message.declaration.length) { - object.declaration = []; - for (var j = 0; j < message.declaration.length; ++j) - object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); - } - if (message.verification != null && message.hasOwnProperty("verification")) - object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - 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); - }; - - /** - * Gets the default type url for ExtensionRangeOptions - * @function getTypeUrl - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; - }; - - ExtensionRangeOptions.Declaration = (function() { - - /** - * Properties of a Declaration. - * @memberof google.protobuf.ExtensionRangeOptions - * @interface IDeclaration - * @property {number|null} [number] Declaration number - * @property {string|null} [fullName] Declaration fullName - * @property {string|null} [type] Declaration type - * @property {boolean|null} [reserved] Declaration reserved - * @property {boolean|null} [repeated] Declaration repeated - */ - - /** - * Constructs a new Declaration. - * @memberof google.protobuf.ExtensionRangeOptions - * @classdesc Represents a Declaration. - * @implements IDeclaration - * @constructor - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set - */ - function Declaration(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]]; - } - - /** - * Declaration number. - * @member {number} number - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.number = 0; - - /** - * Declaration fullName. - * @member {string} fullName - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.fullName = ""; - - /** - * Declaration type. - * @member {string} type - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.type = ""; - - /** - * Declaration reserved. - * @member {boolean} reserved - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.reserved = false; - - /** - * Declaration repeated. - * @member {boolean} repeated - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.repeated = false; - - /** - * Creates a new Declaration instance using the specified properties. - * @function create - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance - */ - Declaration.create = function create(properties) { - return new Declaration(properties); - }; - - /** - * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Declaration.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); - if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); - if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); - if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); - return writer; - }; - - /** - * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Declaration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Declaration message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Declaration.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.number = reader.int32(); - break; - } - case 2: { - message.fullName = reader.string(); - break; - } - case 3: { - message.type = reader.string(); - break; - } - case 5: { - message.reserved = reader.bool(); - break; - } - case 6: { - message.repeated = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Declaration message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Declaration.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Declaration message. - * @function verify - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Declaration.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.fullName != null && message.hasOwnProperty("fullName")) - if (!$util.isString(message.fullName)) - return "fullName: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.reserved != null && message.hasOwnProperty("reserved")) - if (typeof message.reserved !== "boolean") - return "reserved: boolean expected"; - if (message.repeated != null && message.hasOwnProperty("repeated")) - if (typeof message.repeated !== "boolean") - return "repeated: boolean expected"; - return null; - }; - - /** - * Creates a Declaration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - */ - Declaration.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) - return object; - var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); - if (object.number != null) - message.number = object.number | 0; - if (object.fullName != null) - message.fullName = String(object.fullName); - if (object.type != null) - message.type = String(object.type); - if (object.reserved != null) - message.reserved = Boolean(object.reserved); - if (object.repeated != null) - message.repeated = Boolean(object.repeated); - return message; - }; - - /** - * Creates a plain object from a Declaration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Declaration.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.number = 0; - object.fullName = ""; - object.type = ""; - object.reserved = false; - object.repeated = false; - } - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.fullName != null && message.hasOwnProperty("fullName")) - object.fullName = message.fullName; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.reserved != null && message.hasOwnProperty("reserved")) - object.reserved = message.reserved; - if (message.repeated != null && message.hasOwnProperty("repeated")) - object.repeated = message.repeated; - return object; - }; - - /** - * Converts this Declaration to JSON. - * @function toJSON - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - * @returns {Object.} JSON object - */ - Declaration.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Declaration - * @function getTypeUrl - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; - }; - - return Declaration; - })(); - - /** - * VerificationState enum. - * @name google.protobuf.ExtensionRangeOptions.VerificationState - * @enum {number} - * @property {number} DECLARATION=0 DECLARATION value - * @property {number} UNVERIFIED=1 UNVERIFIED value - */ - ExtensionRangeOptions.VerificationState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DECLARATION"] = 0; - values[valuesById[1] = "UNVERIFIED"] = 1; - return values; - })(); - - 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, error) { - 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(); - if (tag === error) - break; - 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 3: - case 2: - 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) { - default: - if (typeof object.label === "number") { - message.label = object.label; - break; - } - break; - case "LABEL_OPTIONAL": - case 1: - message.label = 1; - break; - case "LABEL_REPEATED": - case 3: - message.label = 3; - break; - case "LABEL_REQUIRED": - case 2: - message.label = 2; - break; - } - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - 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] === undefined ? message.label : $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] === undefined ? message.type : $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); - }; - - /** - * Gets the default type url for FieldDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; - }; - - /** - * 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_REPEATED=3 LABEL_REPEATED value - * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value - */ - FieldDescriptorProto.Label = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "LABEL_OPTIONAL"] = 1; - values[valuesById[3] = "LABEL_REPEATED"] = 3; - values[valuesById[2] = "LABEL_REQUIRED"] = 2; - 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * Gets the default type url for OneofDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; - }; - - 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * Gets the default type url for EnumDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; - }; - - 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * Gets the default type url for EnumReservedRange - * @function getTypeUrl - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; - }; - - 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * Gets the default type url for EnumValueDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; - }; - - 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * Gets the default type url for ServiceDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; - }; - - 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * Gets the default type url for MethodDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; - }; - - 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} [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 {google.protobuf.IFeatureSet|null} [features] FileOptions features - * @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 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 features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.features = null; - - /** - * 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.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.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); - 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, error) { - 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(); - if (tag === error) - break; - 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 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 50: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - 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.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.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - 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) { - default: - if (typeof object.optimizeFor === "number") { - message.optimizeFor = object.optimizeFor; - break; - } - break; - 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.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.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FileOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - 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.phpMetadataNamespace = ""; - object.rubyPackage = ""; - object.features = null; - } - 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] === undefined ? message.optimizeFor : $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.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - object.phpMetadataNamespace = message.phpMetadataNamespace; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - object.rubyPackage = message.rubyPackage; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - 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); - }; - - /** - * Gets the default type url for FileOptions - * @function getTypeUrl - * @memberof google.protobuf.FileOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileOptions"; - }; - - /** - * 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 {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts - * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features - * @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 deprecatedLegacyJsonFieldConflicts. - * @member {boolean} deprecatedLegacyJsonFieldConflicts - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; - - /** - * MessageOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.features = null; - - /** - * 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.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) - writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - 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, error) { - 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(); - if (tag === error) - break; - 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 11: { - message.deprecatedLegacyJsonFieldConflicts = reader.bool(); - break; - } - case 12: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - 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.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") - return "deprecatedLegacyJsonFieldConflicts: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - 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.deprecatedLegacyJsonFieldConflicts != null) - message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.MessageOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - 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.deprecatedLegacyJsonFieldConflicts = false; - object.features = null; - 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.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - 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); - }; - - /** - * Gets the default type url for MessageOptions - * @function getTypeUrl - * @memberof google.protobuf.MessageOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MessageOptions"; - }; - - 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} [unverifiedLazy] FieldOptions unverifiedLazy - * @property {boolean|null} [deprecated] FieldOptions deprecated - * @property {boolean|null} [weak] FieldOptions weak - * @property {boolean|null} [debugRedact] FieldOptions debugRedact - * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention - * @property {Array.|null} [targets] FieldOptions targets - * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults - * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features - * @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.targets = []; - this.editionDefaults = []; - 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 unverifiedLazy. - * @member {boolean} unverifiedLazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.unverifiedLazy = 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 debugRedact. - * @member {boolean} debugRedact - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.debugRedact = false; - - /** - * FieldOptions retention. - * @member {google.protobuf.FieldOptions.OptionRetention} retention - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.retention = 0; - - /** - * FieldOptions targets. - * @member {Array.} targets - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.targets = $util.emptyArray; - - /** - * FieldOptions editionDefaults. - * @member {Array.} editionDefaults - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.editionDefaults = $util.emptyArray; - - /** - * FieldOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.features = null; - - /** - * 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.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) - writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); - if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); - if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) - writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); - if (message.targets != null && message.targets.length) - for (var i = 0; i < message.targets.length; ++i) - writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); - if (message.editionDefaults != null && message.editionDefaults.length) - for (var i = 0; i < message.editionDefaults.length; ++i) - $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - 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) - for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) - writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); - 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, error) { - 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(); - if (tag === error) - break; - 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 15: { - message.unverifiedLazy = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 10: { - message.weak = reader.bool(); - break; - } - case 16: { - message.debugRedact = reader.bool(); - break; - } - case 17: { - message.retention = reader.int32(); - break; - } - case 19: { - if (!(message.targets && message.targets.length)) - message.targets = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.targets.push(reader.int32()); - } else - message.targets.push(reader.int32()); - break; - } - case 20: { - if (!(message.editionDefaults && message.editionDefaults.length)) - message.editionDefaults = []; - message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); - break; - } - case 21: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - 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.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) - if (typeof message.unverifiedLazy !== "boolean") - return "unverifiedLazy: 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.debugRedact != null && message.hasOwnProperty("debugRedact")) - if (typeof message.debugRedact !== "boolean") - return "debugRedact: boolean expected"; - if (message.retention != null && message.hasOwnProperty("retention")) - switch (message.retention) { - default: - return "retention: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.targets != null && message.hasOwnProperty("targets")) { - if (!Array.isArray(message.targets)) - return "targets: array expected"; - for (var i = 0; i < message.targets.length; ++i) - switch (message.targets[i]) { - default: - return "targets: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - break; - } - } - if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { - if (!Array.isArray(message.editionDefaults)) - return "editionDefaults: array expected"; - for (var i = 0; i < message.editionDefaults.length; ++i) { - var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]); - if (error) - return "editionDefaults." + error; - } - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - 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: - case 7: - case 8: - 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) { - default: - if (typeof object.ctype === "number") { - message.ctype = object.ctype; - break; - } - break; - 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) { - default: - if (typeof object.jstype === "number") { - message.jstype = object.jstype; - break; - } - break; - 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.unverifiedLazy != null) - message.unverifiedLazy = Boolean(object.unverifiedLazy); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.weak != null) - message.weak = Boolean(object.weak); - if (object.debugRedact != null) - message.debugRedact = Boolean(object.debugRedact); - switch (object.retention) { - default: - if (typeof object.retention === "number") { - message.retention = object.retention; - break; - } - break; - case "RETENTION_UNKNOWN": - case 0: - message.retention = 0; - break; - case "RETENTION_RUNTIME": - case 1: - message.retention = 1; - break; - case "RETENTION_SOURCE": - case 2: - message.retention = 2; - break; - } - if (object.targets) { - if (!Array.isArray(object.targets)) - throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); - message.targets = []; - for (var i = 0; i < object.targets.length; ++i) - switch (object.targets[i]) { - default: - if (typeof object.targets[i] === "number") { - message.targets[i] = object.targets[i]; - break; - } - case "TARGET_TYPE_UNKNOWN": - case 0: - message.targets[i] = 0; - break; - case "TARGET_TYPE_FILE": - case 1: - message.targets[i] = 1; - break; - case "TARGET_TYPE_EXTENSION_RANGE": - case 2: - message.targets[i] = 2; - break; - case "TARGET_TYPE_MESSAGE": - case 3: - message.targets[i] = 3; - break; - case "TARGET_TYPE_FIELD": - case 4: - message.targets[i] = 4; - break; - case "TARGET_TYPE_ONEOF": - case 5: - message.targets[i] = 5; - break; - case "TARGET_TYPE_ENUM": - case 6: - message.targets[i] = 6; - break; - case "TARGET_TYPE_ENUM_ENTRY": - case 7: - message.targets[i] = 7; - break; - case "TARGET_TYPE_SERVICE": - case 8: - message.targets[i] = 8; - break; - case "TARGET_TYPE_METHOD": - case 9: - message.targets[i] = 9; - break; - } - } - if (object.editionDefaults) { - if (!Array.isArray(object.editionDefaults)) - throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); - message.editionDefaults = []; - for (var i = 0; i < object.editionDefaults.length; ++i) { - if (typeof object.editionDefaults[i] !== "object") - throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); - message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); - } - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FieldOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - 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: - if (typeof object[".google.api.fieldBehavior"][i] === "number") { - message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; - break; - } - 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; - case "NON_EMPTY_DEFAULT": - case 7: - message[".google.api.fieldBehavior"][i] = 7; - break; - case "IDENTIFIER": - case 8: - message[".google.api.fieldBehavior"][i] = 8; - 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.targets = []; - object.editionDefaults = []; - 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.unverifiedLazy = false; - object.debugRedact = false; - object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; - object.features = null; - object[".google.api.resourceReference"] = null; - } - if (message.ctype != null && message.hasOwnProperty("ctype")) - object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $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] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; - if (message.weak != null && message.hasOwnProperty("weak")) - object.weak = message.weak; - if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) - object.unverifiedLazy = message.unverifiedLazy; - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - object.debugRedact = message.debugRedact; - if (message.retention != null && message.hasOwnProperty("retention")) - object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; - if (message.targets && message.targets.length) { - object.targets = []; - for (var j = 0; j < message.targets.length; ++j) - object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; - } - if (message.editionDefaults && message.editionDefaults.length) { - object.editionDefaults = []; - for (var j = 0; j < message.editionDefaults.length; ++j) - object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options); - } - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - 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]] === undefined ? message[".google.api.fieldBehavior"][j] : $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); - }; - - /** - * Gets the default type url for FieldOptions - * @function getTypeUrl - * @memberof google.protobuf.FieldOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldOptions"; - }; - - /** - * 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; - })(); - - /** - * OptionRetention enum. - * @name google.protobuf.FieldOptions.OptionRetention - * @enum {number} - * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value - * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value - * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value - */ - FieldOptions.OptionRetention = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; - values[valuesById[1] = "RETENTION_RUNTIME"] = 1; - values[valuesById[2] = "RETENTION_SOURCE"] = 2; - return values; - })(); - - /** - * OptionTargetType enum. - * @name google.protobuf.FieldOptions.OptionTargetType - * @enum {number} - * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value - * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value - * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value - * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value - * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value - * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value - * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value - * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value - * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value - * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value - */ - FieldOptions.OptionTargetType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; - values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; - values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; - values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; - values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; - values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; - values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; - values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; - values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; - values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; - return values; - })(); - - FieldOptions.EditionDefault = (function() { - - /** - * Properties of an EditionDefault. - * @memberof google.protobuf.FieldOptions - * @interface IEditionDefault - * @property {google.protobuf.Edition|null} [edition] EditionDefault edition - * @property {string|null} [value] EditionDefault value - */ - - /** - * Constructs a new EditionDefault. - * @memberof google.protobuf.FieldOptions - * @classdesc Represents an EditionDefault. - * @implements IEditionDefault - * @constructor - * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set - */ - function EditionDefault(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]]; - } - - /** - * EditionDefault edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - */ - EditionDefault.prototype.edition = 0; - - /** - * EditionDefault value. - * @member {string} value - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - */ - EditionDefault.prototype.value = ""; - - /** - * Creates a new EditionDefault instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance - */ - EditionDefault.create = function create(properties) { - return new EditionDefault(properties); - }; - - /** - * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EditionDefault.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EditionDefault message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EditionDefault.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.edition = reader.int32(); - break; - } - case 2: { - message.value = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EditionDefault message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EditionDefault.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EditionDefault message. - * @function verify - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EditionDefault.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; - return null; - }; - - /** - * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - */ - EditionDefault.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) - return object; - var message = new $root.google.protobuf.FieldOptions.EditionDefault(); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - if (object.value != null) - message.value = String(object.value); - return message; - }; - - /** - * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EditionDefault.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.value = ""; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this EditionDefault to JSON. - * @function toJSON - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - * @returns {Object.} JSON object - */ - EditionDefault.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EditionDefault - * @function getTypeUrl - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; - }; - - return EditionDefault; - })(); - - return FieldOptions; - })(); - - protobuf.OneofOptions = (function() { - - /** - * Properties of an OneofOptions. - * @memberof google.protobuf - * @interface IOneofOptions - * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features - * @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 features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.features = null; - - /** - * 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.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - 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, error) { - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - 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 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.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - 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.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.OneofOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - 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 (options.defaults) - object.features = null; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - 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); - }; - - /** - * Gets the default type url for OneofOptions - * @function getTypeUrl - * @memberof google.protobuf.OneofOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.OneofOptions"; - }; - - 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 {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts - * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features - * @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 deprecatedLegacyJsonFieldConflicts. - * @member {boolean} deprecatedLegacyJsonFieldConflicts - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; - - /** - * EnumOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.features = null; - - /** - * 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.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - 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, error) { - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.allowAlias = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 6: { - message.deprecatedLegacyJsonFieldConflicts = reader.bool(); - break; - } - case 7: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - 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.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") - return "deprecatedLegacyJsonFieldConflicts: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - 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.deprecatedLegacyJsonFieldConflicts != null) - message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.EnumOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - 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; - object.deprecatedLegacyJsonFieldConflicts = false; - object.features = null; - } - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - object.allowAlias = message.allowAlias; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - 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); - }; - - /** - * Gets the default type url for EnumOptions - * @function getTypeUrl - * @memberof google.protobuf.EnumOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumOptions"; - }; - - return EnumOptions; - })(); - - protobuf.EnumValueOptions = (function() { - - /** - * Properties of an EnumValueOptions. - * @memberof google.protobuf - * @interface IEnumValueOptions - * @property {boolean|null} [deprecated] EnumValueOptions deprecated - * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features - * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact - * @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 features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.features = null; - - /** - * EnumValueOptions debugRedact. - * @member {boolean} debugRedact - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.debugRedact = 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.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); - 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, error) { - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.deprecated = reader.bool(); - break; - } - case 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 3: { - message.debugRedact = 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.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - if (typeof message.debugRedact !== "boolean") - return "debugRedact: 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.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.debugRedact != null) - message.debugRedact = Boolean(object.debugRedact); - 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; - object.features = null; - object.debugRedact = false; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - object.debugRedact = message.debugRedact; - 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); - }; - - /** - * Gets the default type url for EnumValueOptions - * @function getTypeUrl - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; - }; - - return EnumValueOptions; - })(); - - protobuf.ServiceOptions = (function() { - - /** - * Properties of a ServiceOptions. - * @memberof google.protobuf - * @interface IServiceOptions - * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features - * @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 - * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion - */ - - /** - * 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 features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.features = null; - - /** - * 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"] = ""; - - /** - * ServiceOptions .google.api.apiVersion. - * @member {string} .google.api.apiVersion - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.apiVersion"] = ""; - - /** - * 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.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); - 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"]); - if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) - writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); - 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, error) { - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 34: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - 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; - } - case 525000001: { - message[".google.api.apiVersion"] = 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.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - 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"; - if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) - if (!$util.isString(message[".google.api.apiVersion"])) - return ".google.api.apiVersion: 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.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - 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"]); - if (object[".google.api.apiVersion"] != null) - message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); - 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.features = null; - object[".google.api.defaultHost"] = ""; - object[".google.api.oauthScopes"] = ""; - object[".google.api.apiVersion"] = ""; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - 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"]; - if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) - object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; - 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); - }; - - /** - * Gets the default type url for ServiceOptions - * @function getTypeUrl - * @memberof google.protobuf.ServiceOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ServiceOptions"; - }; - - 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 {google.protobuf.IFeatureSet|null} [features] MethodOptions features - * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption - * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http - * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature - * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo - */ - - /** - * 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 features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.features = null; - - /** - * MethodOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.uninterpretedOption = $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; - - /** - * MethodOptions .google.api.methodSignature. - * @member {Array.} .google.api.methodSignature - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; - - /** - * MethodOptions .google.longrunning.operationInfo. - * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.longrunning.operationInfo"] = 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.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); - 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.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) - $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).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, error) { - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 33: { - message.deprecated = reader.bool(); - break; - } - case 34: { - message.idempotencyLevel = reader.int32(); - break; - } - case 35: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 72295728: { - message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); - break; - } - case 1051: { - if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) - message[".google.api.methodSignature"] = []; - message[".google.api.methodSignature"].push(reader.string()); - break; - } - case 1049: { - message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.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.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - 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.http"] != null && message.hasOwnProperty(".google.api.http")) { - var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); - if (error) - return ".google.api.http." + error; - } - if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { - if (!Array.isArray(message[".google.api.methodSignature"])) - return ".google.api.methodSignature: array expected"; - 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.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { - var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); - if (error) - return ".google.longrunning.operationInfo." + 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) { - default: - if (typeof object.idempotencyLevel === "number") { - message.idempotencyLevel = object.idempotencyLevel; - break; - } - break; - 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.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.MethodOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - 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.http"] != null) { - if (typeof object[".google.api.http"] !== "object") - throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); - message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); - } - if (object[".google.api.methodSignature"]) { - if (!Array.isArray(object[".google.api.methodSignature"])) - throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); - 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.longrunning.operationInfo"] != null) { - if (typeof object[".google.longrunning.operationInfo"] !== "object") - throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); - message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); - } - 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.features = null; - object[".google.longrunning.operationInfo"] = null; - 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] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - 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.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) - object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], 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); - }; - - /** - * Gets the default type url for MethodOptions - * @function getTypeUrl - * @memberof google.protobuf.MethodOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MethodOptions"; - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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 >= 0) - 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); - }; - - /** - * Gets the default type url for UninterpretedOption - * @function getTypeUrl - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; - }; - - 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * Gets the default type url for NamePart - * @function getTypeUrl - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; - }; - - return NamePart; - })(); - - return UninterpretedOption; - })(); - - protobuf.FeatureSet = (function() { - - /** - * Properties of a FeatureSet. - * @memberof google.protobuf - * @interface IFeatureSet - * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence - * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType - * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding - * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation - * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding - * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat - */ - - /** - * Constructs a new FeatureSet. - * @memberof google.protobuf - * @classdesc Represents a FeatureSet. - * @implements IFeatureSet - * @constructor - * @param {google.protobuf.IFeatureSet=} [properties] Properties to set - */ - function FeatureSet(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]]; - } - - /** - * FeatureSet fieldPresence. - * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.fieldPresence = 0; - - /** - * FeatureSet enumType. - * @member {google.protobuf.FeatureSet.EnumType} enumType - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.enumType = 0; - - /** - * FeatureSet repeatedFieldEncoding. - * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.repeatedFieldEncoding = 0; - - /** - * FeatureSet utf8Validation. - * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.utf8Validation = 0; - - /** - * FeatureSet messageEncoding. - * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.messageEncoding = 0; - - /** - * FeatureSet jsonFormat. - * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.jsonFormat = 0; - - /** - * Creates a new FeatureSet instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet=} [properties] Properties to set - * @returns {google.protobuf.FeatureSet} FeatureSet instance - */ - FeatureSet.create = function create(properties) { - return new FeatureSet(properties); - }; - - /** - * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); - if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); - if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); - if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); - if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); - if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); - return writer; - }; - - /** - * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSet message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSet} FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSet.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.fieldPresence = reader.int32(); - break; - } - case 2: { - message.enumType = reader.int32(); - break; - } - case 3: { - message.repeatedFieldEncoding = reader.int32(); - break; - } - case 4: { - message.utf8Validation = reader.int32(); - break; - } - case 5: { - message.messageEncoding = reader.int32(); - break; - } - case 6: { - message.jsonFormat = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSet} FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSet message. - * @function verify - * @memberof google.protobuf.FeatureSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) - switch (message.fieldPresence) { - default: - return "fieldPresence: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.enumType != null && message.hasOwnProperty("enumType")) - switch (message.enumType) { - default: - return "enumType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) - switch (message.repeatedFieldEncoding) { - default: - return "repeatedFieldEncoding: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) - switch (message.utf8Validation) { - default: - return "utf8Validation: enum value expected"; - case 0: - case 2: - case 3: - break; - } - if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) - switch (message.messageEncoding) { - default: - return "messageEncoding: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) - switch (message.jsonFormat) { - default: - return "jsonFormat: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSet - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSet} FeatureSet - */ - FeatureSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSet) - return object; - var message = new $root.google.protobuf.FeatureSet(); - switch (object.fieldPresence) { - default: - if (typeof object.fieldPresence === "number") { - message.fieldPresence = object.fieldPresence; - break; - } - break; - case "FIELD_PRESENCE_UNKNOWN": - case 0: - message.fieldPresence = 0; - break; - case "EXPLICIT": - case 1: - message.fieldPresence = 1; - break; - case "IMPLICIT": - case 2: - message.fieldPresence = 2; - break; - case "LEGACY_REQUIRED": - case 3: - message.fieldPresence = 3; - break; - } - switch (object.enumType) { - default: - if (typeof object.enumType === "number") { - message.enumType = object.enumType; - break; - } - break; - case "ENUM_TYPE_UNKNOWN": - case 0: - message.enumType = 0; - break; - case "OPEN": - case 1: - message.enumType = 1; - break; - case "CLOSED": - case 2: - message.enumType = 2; - break; - } - switch (object.repeatedFieldEncoding) { - default: - if (typeof object.repeatedFieldEncoding === "number") { - message.repeatedFieldEncoding = object.repeatedFieldEncoding; - break; - } - break; - case "REPEATED_FIELD_ENCODING_UNKNOWN": - case 0: - message.repeatedFieldEncoding = 0; - break; - case "PACKED": - case 1: - message.repeatedFieldEncoding = 1; - break; - case "EXPANDED": - case 2: - message.repeatedFieldEncoding = 2; - break; - } - switch (object.utf8Validation) { - default: - if (typeof object.utf8Validation === "number") { - message.utf8Validation = object.utf8Validation; - break; - } - break; - case "UTF8_VALIDATION_UNKNOWN": - case 0: - message.utf8Validation = 0; - break; - case "VERIFY": - case 2: - message.utf8Validation = 2; - break; - case "NONE": - case 3: - message.utf8Validation = 3; - break; - } - switch (object.messageEncoding) { - default: - if (typeof object.messageEncoding === "number") { - message.messageEncoding = object.messageEncoding; - break; - } - break; - case "MESSAGE_ENCODING_UNKNOWN": - case 0: - message.messageEncoding = 0; - break; - case "LENGTH_PREFIXED": - case 1: - message.messageEncoding = 1; - break; - case "DELIMITED": - case 2: - message.messageEncoding = 2; - break; - } - switch (object.jsonFormat) { - default: - if (typeof object.jsonFormat === "number") { - message.jsonFormat = object.jsonFormat; - break; - } - break; - case "JSON_FORMAT_UNKNOWN": - case 0: - message.jsonFormat = 0; - break; - case "ALLOW": - case 1: - message.jsonFormat = 1; - break; - case "LEGACY_BEST_EFFORT": - case 2: - message.jsonFormat = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.FeatureSet} message FeatureSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; - object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; - object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; - object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; - object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; - object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; - } - if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) - object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; - if (message.enumType != null && message.hasOwnProperty("enumType")) - object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; - if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) - object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; - if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) - object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; - if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) - object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; - if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) - object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; - return object; - }; - - /** - * Converts this FeatureSet to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSet - * @instance - * @returns {Object.} JSON object - */ - FeatureSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSet - * @function getTypeUrl - * @memberof google.protobuf.FeatureSet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSet"; - }; - - /** - * FieldPresence enum. - * @name google.protobuf.FeatureSet.FieldPresence - * @enum {number} - * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value - * @property {number} EXPLICIT=1 EXPLICIT value - * @property {number} IMPLICIT=2 IMPLICIT value - * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value - */ - FeatureSet.FieldPresence = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; - values[valuesById[1] = "EXPLICIT"] = 1; - values[valuesById[2] = "IMPLICIT"] = 2; - values[valuesById[3] = "LEGACY_REQUIRED"] = 3; - return values; - })(); - - /** - * EnumType enum. - * @name google.protobuf.FeatureSet.EnumType - * @enum {number} - * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value - * @property {number} OPEN=1 OPEN value - * @property {number} CLOSED=2 CLOSED value - */ - FeatureSet.EnumType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; - values[valuesById[1] = "OPEN"] = 1; - values[valuesById[2] = "CLOSED"] = 2; - return values; - })(); - - /** - * RepeatedFieldEncoding enum. - * @name google.protobuf.FeatureSet.RepeatedFieldEncoding - * @enum {number} - * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value - * @property {number} PACKED=1 PACKED value - * @property {number} EXPANDED=2 EXPANDED value - */ - FeatureSet.RepeatedFieldEncoding = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; - values[valuesById[1] = "PACKED"] = 1; - values[valuesById[2] = "EXPANDED"] = 2; - return values; - })(); - - /** - * Utf8Validation enum. - * @name google.protobuf.FeatureSet.Utf8Validation - * @enum {number} - * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value - * @property {number} VERIFY=2 VERIFY value - * @property {number} NONE=3 NONE value - */ - FeatureSet.Utf8Validation = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; - values[valuesById[2] = "VERIFY"] = 2; - values[valuesById[3] = "NONE"] = 3; - return values; - })(); - - /** - * MessageEncoding enum. - * @name google.protobuf.FeatureSet.MessageEncoding - * @enum {number} - * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value - * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value - * @property {number} DELIMITED=2 DELIMITED value - */ - FeatureSet.MessageEncoding = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; - values[valuesById[1] = "LENGTH_PREFIXED"] = 1; - values[valuesById[2] = "DELIMITED"] = 2; - return values; - })(); - - /** - * JsonFormat enum. - * @name google.protobuf.FeatureSet.JsonFormat - * @enum {number} - * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value - * @property {number} ALLOW=1 ALLOW value - * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value - */ - FeatureSet.JsonFormat = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; - values[valuesById[1] = "ALLOW"] = 1; - values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; - return values; - })(); - - return FeatureSet; - })(); - - protobuf.FeatureSetDefaults = (function() { - - /** - * Properties of a FeatureSetDefaults. - * @memberof google.protobuf - * @interface IFeatureSetDefaults - * @property {Array.|null} [defaults] FeatureSetDefaults defaults - * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition - * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition - */ - - /** - * Constructs a new FeatureSetDefaults. - * @memberof google.protobuf - * @classdesc Represents a FeatureSetDefaults. - * @implements IFeatureSetDefaults - * @constructor - * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set - */ - function FeatureSetDefaults(properties) { - this.defaults = []; - 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]]; - } - - /** - * FeatureSetDefaults defaults. - * @member {Array.} defaults - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.defaults = $util.emptyArray; - - /** - * FeatureSetDefaults minimumEdition. - * @member {google.protobuf.Edition} minimumEdition - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.minimumEdition = 0; - - /** - * FeatureSetDefaults maximumEdition. - * @member {google.protobuf.Edition} maximumEdition - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.maximumEdition = 0; - - /** - * Creates a new FeatureSetDefaults instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance - */ - FeatureSetDefaults.create = function create(properties) { - return new FeatureSetDefaults(properties); - }; - - /** - * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetDefaults.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.defaults != null && message.defaults.length) - for (var i = 0; i < message.defaults.length; ++i) - $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); - if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); - return writer; - }; - - /** - * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetDefaults.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.defaults && message.defaults.length)) - message.defaults = []; - message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); - break; - } - case 4: { - message.minimumEdition = reader.int32(); - break; - } - case 5: { - message.maximumEdition = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSetDefaults message. - * @function verify - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSetDefaults.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.defaults != null && message.hasOwnProperty("defaults")) { - if (!Array.isArray(message.defaults)) - return "defaults: array expected"; - for (var i = 0; i < message.defaults.length; ++i) { - var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); - if (error) - return "defaults." + error; - } - } - if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) - switch (message.minimumEdition) { - default: - return "minimumEdition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) - switch (message.maximumEdition) { - default: - return "maximumEdition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - return null; - }; - - /** - * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - */ - FeatureSetDefaults.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSetDefaults) - return object; - var message = new $root.google.protobuf.FeatureSetDefaults(); - if (object.defaults) { - if (!Array.isArray(object.defaults)) - throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); - message.defaults = []; - for (var i = 0; i < object.defaults.length; ++i) { - if (typeof object.defaults[i] !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); - message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]); - } - } - switch (object.minimumEdition) { - default: - if (typeof object.minimumEdition === "number") { - message.minimumEdition = object.minimumEdition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.minimumEdition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.minimumEdition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.minimumEdition = 999; - break; - case "EDITION_2023": - case 1000: - message.minimumEdition = 1000; - break; - case "EDITION_2024": - case 1001: - message.minimumEdition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.minimumEdition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.minimumEdition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.minimumEdition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.minimumEdition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.minimumEdition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.minimumEdition = 2147483647; - break; - } - switch (object.maximumEdition) { - default: - if (typeof object.maximumEdition === "number") { - message.maximumEdition = object.maximumEdition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.maximumEdition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.maximumEdition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.maximumEdition = 999; - break; - case "EDITION_2023": - case 1000: - message.maximumEdition = 1000; - break; - case "EDITION_2024": - case 1001: - message.maximumEdition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.maximumEdition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.maximumEdition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.maximumEdition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.maximumEdition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.maximumEdition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.maximumEdition = 2147483647; - break; - } - return message; - }; - - /** - * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSetDefaults.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.defaults = []; - if (options.defaults) { - object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; - object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.defaults && message.defaults.length) { - object.defaults = []; - for (var j = 0; j < message.defaults.length; ++j) - object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); - } - if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) - object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; - if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) - object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; - return object; - }; - - /** - * Converts this FeatureSetDefaults to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSetDefaults - * @instance - * @returns {Object.} JSON object - */ - FeatureSetDefaults.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSetDefaults - * @function getTypeUrl - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; - }; - - FeatureSetDefaults.FeatureSetEditionDefault = (function() { - - /** - * Properties of a FeatureSetEditionDefault. - * @memberof google.protobuf.FeatureSetDefaults - * @interface IFeatureSetEditionDefault - * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition - * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features - */ - - /** - * Constructs a new FeatureSetEditionDefault. - * @memberof google.protobuf.FeatureSetDefaults - * @classdesc Represents a FeatureSetEditionDefault. - * @implements IFeatureSetEditionDefault - * @constructor - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set - */ - function FeatureSetEditionDefault(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]]; - } - - /** - * FeatureSetEditionDefault edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - */ - FeatureSetEditionDefault.prototype.edition = 0; - - /** - * FeatureSetEditionDefault features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - */ - FeatureSetEditionDefault.prototype.features = null; - - /** - * Creates a new FeatureSetEditionDefault instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance - */ - FeatureSetEditionDefault.create = function create(properties) { - return new FeatureSetEditionDefault(properties); - }; - - /** - * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetEditionDefault.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetEditionDefault.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.edition = reader.int32(); - break; - } - case 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSetEditionDefault message. - * @function verify - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSetEditionDefault.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - return null; - }; - - /** - * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - */ - FeatureSetEditionDefault.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) - return object; - var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - return message; - }; - - /** - * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSetEditionDefault.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.features = null; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this FeatureSetEditionDefault to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - * @returns {Object.} JSON object - */ - FeatureSetEditionDefault.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSetEditionDefault - * @function getTypeUrl - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; - }; - - return FeatureSetEditionDefault; - })(); - - return FeatureSetDefaults; - })(); - - 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * Gets the default type url for SourceCodeInfo - * @function getTypeUrl - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; - }; - - 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * Gets the default type url for Location - * @function getTypeUrl - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; - }; - - 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * Gets the default type url for GeneratedCodeInfo - * @function getTypeUrl - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; - }; - - 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 - * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic - */ - - /** - * 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; - - /** - * Annotation semantic. - * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.semantic = 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); - if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); - 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, error) { - 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(); - if (tag === error) - break; - 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; - } - case 5: { - message.semantic = 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"; - if (message.semantic != null && message.hasOwnProperty("semantic")) - switch (message.semantic) { - default: - return "semantic: enum value expected"; - case 0: - case 1: - case 2: - break; - } - 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; - switch (object.semantic) { - default: - if (typeof object.semantic === "number") { - message.semantic = object.semantic; - break; - } - break; - case "NONE": - case 0: - message.semantic = 0; - break; - case "SET": - case 1: - message.semantic = 1; - break; - case "ALIAS": - case 2: - message.semantic = 2; - break; - } - 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; - object.semantic = options.enums === String ? "NONE" : 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; - if (message.semantic != null && message.hasOwnProperty("semantic")) - object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; - 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); - }; - - /** - * Gets the default type url for Annotation - * @function getTypeUrl - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; - }; - - /** - * Semantic enum. - * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic - * @enum {number} - * @property {number} NONE=0 NONE value - * @property {number} SET=1 SET value - * @property {number} ALIAS=2 ALIAS value - */ - Annotation.Semantic = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NONE"] = 0; - values[valuesById[1] = "SET"] = 1; - values[valuesById[2] = "ALIAS"] = 2; - return values; - })(); - - return Annotation; - })(); - - return GeneratedCodeInfo; - })(); - - 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * Gets the default type url for FieldMask - * @function getTypeUrl - * @memberof google.protobuf.FieldMask - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldMask"; - }; - - return FieldMask; - })(); - - 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * Gets the default type url for Timestamp - * @function getTypeUrl - * @memberof google.protobuf.Timestamp - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Timestamp"; - }; - - return Timestamp; - })(); - - 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, error) { - 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(); - if (tag === error) - break; - 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 >= 0) - 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); - }; - - /** - * Gets the default type url for Any - * @function getTypeUrl - * @memberof google.protobuf.Any - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Any"; - }; - - return Any; - })(); - - protobuf.DoubleValue = (function() { - - /** - * Properties of a DoubleValue. - * @memberof google.protobuf - * @interface IDoubleValue - * @property {number|null} [value] DoubleValue value - */ - - /** - * Constructs a new DoubleValue. - * @memberof google.protobuf - * @classdesc Represents a DoubleValue. - * @implements IDoubleValue - * @constructor - * @param {google.protobuf.IDoubleValue=} [properties] Properties to set - */ - function DoubleValue(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]]; - } - - /** - * DoubleValue value. - * @member {number} value - * @memberof google.protobuf.DoubleValue - * @instance - */ - DoubleValue.prototype.value = 0; - - /** - * Creates a new DoubleValue instance using the specified properties. - * @function create - * @memberof google.protobuf.DoubleValue - * @static - * @param {google.protobuf.IDoubleValue=} [properties] Properties to set - * @returns {google.protobuf.DoubleValue} DoubleValue instance - */ - DoubleValue.create = function create(properties) { - return new DoubleValue(properties); - }; - - /** - * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DoubleValue - * @static - * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DoubleValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.value); - return writer; - }; - - /** - * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DoubleValue - * @static - * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DoubleValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DoubleValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DoubleValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DoubleValue} DoubleValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DoubleValue.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DoubleValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.double(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DoubleValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DoubleValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DoubleValue} DoubleValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DoubleValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DoubleValue message. - * @function verify - * @memberof google.protobuf.DoubleValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DoubleValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value !== "number") - return "value: number expected"; - return null; - }; - - /** - * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DoubleValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DoubleValue} DoubleValue - */ - DoubleValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DoubleValue) - return object; - var message = new $root.google.protobuf.DoubleValue(); - if (object.value != null) - message.value = Number(object.value); - return message; - }; - - /** - * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DoubleValue - * @static - * @param {google.protobuf.DoubleValue} message DoubleValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DoubleValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = 0; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; - return object; - }; - - /** - * Converts this DoubleValue to JSON. - * @function toJSON - * @memberof google.protobuf.DoubleValue - * @instance - * @returns {Object.} JSON object - */ - DoubleValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DoubleValue - * @function getTypeUrl - * @memberof google.protobuf.DoubleValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DoubleValue"; - }; - - return DoubleValue; - })(); - - protobuf.FloatValue = (function() { - - /** - * Properties of a FloatValue. - * @memberof google.protobuf - * @interface IFloatValue - * @property {number|null} [value] FloatValue value - */ - - /** - * Constructs a new FloatValue. - * @memberof google.protobuf - * @classdesc Represents a FloatValue. - * @implements IFloatValue - * @constructor - * @param {google.protobuf.IFloatValue=} [properties] Properties to set - */ - function FloatValue(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]]; - } - - /** - * FloatValue value. - * @member {number} value - * @memberof google.protobuf.FloatValue - * @instance - */ - FloatValue.prototype.value = 0; - - /** - * Creates a new FloatValue instance using the specified properties. - * @function create - * @memberof google.protobuf.FloatValue - * @static - * @param {google.protobuf.IFloatValue=} [properties] Properties to set - * @returns {google.protobuf.FloatValue} FloatValue instance - */ - FloatValue.create = function create(properties) { - return new FloatValue(properties); - }; - - /** - * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FloatValue - * @static - * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FloatValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.value); - return writer; - }; - - /** - * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FloatValue - * @static - * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FloatValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FloatValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FloatValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FloatValue} FloatValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FloatValue.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FloatValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.float(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FloatValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FloatValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FloatValue} FloatValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FloatValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FloatValue message. - * @function verify - * @memberof google.protobuf.FloatValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FloatValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value !== "number") - return "value: number expected"; - return null; - }; - - /** - * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FloatValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FloatValue} FloatValue - */ - FloatValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FloatValue) - return object; - var message = new $root.google.protobuf.FloatValue(); - if (object.value != null) - message.value = Number(object.value); - return message; - }; - - /** - * Creates a plain object from a FloatValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FloatValue - * @static - * @param {google.protobuf.FloatValue} message FloatValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FloatValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = 0; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; - return object; - }; - - /** - * Converts this FloatValue to JSON. - * @function toJSON - * @memberof google.protobuf.FloatValue - * @instance - * @returns {Object.} JSON object - */ - FloatValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FloatValue - * @function getTypeUrl - * @memberof google.protobuf.FloatValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FloatValue"; - }; - - return FloatValue; - })(); - - protobuf.Int64Value = (function() { - - /** - * Properties of an Int64Value. - * @memberof google.protobuf - * @interface IInt64Value - * @property {number|Long|null} [value] Int64Value value - */ - - /** - * Constructs a new Int64Value. - * @memberof google.protobuf - * @classdesc Represents an Int64Value. - * @implements IInt64Value - * @constructor - * @param {google.protobuf.IInt64Value=} [properties] Properties to set - */ - function Int64Value(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]]; - } - - /** - * Int64Value value. - * @member {number|Long} value - * @memberof google.protobuf.Int64Value - * @instance - */ - Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new Int64Value instance using the specified properties. - * @function create - * @memberof google.protobuf.Int64Value - * @static - * @param {google.protobuf.IInt64Value=} [properties] Properties to set - * @returns {google.protobuf.Int64Value} Int64Value instance - */ - Int64Value.create = function create(properties) { - return new Int64Value(properties); - }; - - /** - * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Int64Value - * @static - * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Int64Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value); - return writer; - }; - - /** - * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Int64Value - * @static - * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Int64Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Int64Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Int64Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Int64Value} Int64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Int64Value.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int64Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Int64Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Int64Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Int64Value} Int64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Int64Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Int64Value message. - * @function verify - * @memberof google.protobuf.Int64Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Int64Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) - return "value: integer|Long expected"; - return null; - }; - - /** - * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Int64Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Int64Value} Int64Value - */ - Int64Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Int64Value) - return object; - var message = new $root.google.protobuf.Int64Value(); - if (object.value != null) - if ($util.Long) - (message.value = $util.Long.fromValue(object.value)).unsigned = false; - else if (typeof object.value === "string") - message.value = parseInt(object.value, 10); - else if (typeof object.value === "number") - message.value = object.value; - else if (typeof object.value === "object") - message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from an Int64Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Int64Value - * @static - * @param {google.protobuf.Int64Value} message Int64Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Int64Value.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.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.value = options.longs === String ? "0" : 0; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value === "number") - object.value = options.longs === String ? String(message.value) : message.value; - else - object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value; - return object; - }; - - /** - * Converts this Int64Value to JSON. - * @function toJSON - * @memberof google.protobuf.Int64Value - * @instance - * @returns {Object.} JSON object - */ - Int64Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Int64Value - * @function getTypeUrl - * @memberof google.protobuf.Int64Value - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Int64Value"; - }; - - return Int64Value; - })(); - - protobuf.UInt64Value = (function() { - - /** - * Properties of a UInt64Value. - * @memberof google.protobuf - * @interface IUInt64Value - * @property {number|Long|null} [value] UInt64Value value - */ - - /** - * Constructs a new UInt64Value. - * @memberof google.protobuf - * @classdesc Represents a UInt64Value. - * @implements IUInt64Value - * @constructor - * @param {google.protobuf.IUInt64Value=} [properties] Properties to set - */ - function UInt64Value(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]]; - } - - /** - * UInt64Value value. - * @member {number|Long} value - * @memberof google.protobuf.UInt64Value - * @instance - */ - UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Creates a new UInt64Value instance using the specified properties. - * @function create - * @memberof google.protobuf.UInt64Value - * @static - * @param {google.protobuf.IUInt64Value=} [properties] Properties to set - * @returns {google.protobuf.UInt64Value} UInt64Value instance - */ - UInt64Value.create = function create(properties) { - return new UInt64Value(properties); - }; - - /** - * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UInt64Value - * @static - * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UInt64Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.value); - return writer; - }; - - /** - * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UInt64Value - * @static - * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UInt64Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a UInt64Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UInt64Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UInt64Value} UInt64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UInt64Value.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt64Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.uint64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a UInt64Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UInt64Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UInt64Value} UInt64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UInt64Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a UInt64Value message. - * @function verify - * @memberof google.protobuf.UInt64Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UInt64Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) - return "value: integer|Long expected"; - return null; - }; - - /** - * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UInt64Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UInt64Value} UInt64Value - */ - UInt64Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UInt64Value) - return object; - var message = new $root.google.protobuf.UInt64Value(); - if (object.value != null) - if ($util.Long) - (message.value = $util.Long.fromValue(object.value)).unsigned = true; - else if (typeof object.value === "string") - message.value = parseInt(object.value, 10); - else if (typeof object.value === "number") - message.value = object.value; - else if (typeof object.value === "object") - message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UInt64Value - * @static - * @param {google.protobuf.UInt64Value} message UInt64Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UInt64Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.value = options.longs === String ? "0" : 0; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value === "number") - object.value = options.longs === String ? String(message.value) : message.value; - else - object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber(true) : message.value; - return object; - }; - - /** - * Converts this UInt64Value to JSON. - * @function toJSON - * @memberof google.protobuf.UInt64Value - * @instance - * @returns {Object.} JSON object - */ - UInt64Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UInt64Value - * @function getTypeUrl - * @memberof google.protobuf.UInt64Value - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UInt64Value"; - }; - - return UInt64Value; - })(); - - protobuf.Int32Value = (function() { - - /** - * Properties of an Int32Value. - * @memberof google.protobuf - * @interface IInt32Value - * @property {number|null} [value] Int32Value value - */ - - /** - * Constructs a new Int32Value. - * @memberof google.protobuf - * @classdesc Represents an Int32Value. - * @implements IInt32Value - * @constructor - * @param {google.protobuf.IInt32Value=} [properties] Properties to set - */ - function Int32Value(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]]; - } - - /** - * Int32Value value. - * @member {number} value - * @memberof google.protobuf.Int32Value - * @instance - */ - Int32Value.prototype.value = 0; - - /** - * Creates a new Int32Value instance using the specified properties. - * @function create - * @memberof google.protobuf.Int32Value - * @static - * @param {google.protobuf.IInt32Value=} [properties] Properties to set - * @returns {google.protobuf.Int32Value} Int32Value instance - */ - Int32Value.create = function create(properties) { - return new Int32Value(properties); - }; - - /** - * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Int32Value - * @static - * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Int32Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.value); - return writer; - }; - - /** - * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Int32Value - * @static - * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Int32Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Int32Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Int32Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Int32Value} Int32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Int32Value.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int32Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Int32Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Int32Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Int32Value} Int32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Int32Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Int32Value message. - * @function verify - * @memberof google.protobuf.Int32Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Int32Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value)) - return "value: integer expected"; - return null; - }; - - /** - * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Int32Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Int32Value} Int32Value - */ - Int32Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Int32Value) - return object; - var message = new $root.google.protobuf.Int32Value(); - if (object.value != null) - message.value = object.value | 0; - return message; - }; - - /** - * Creates a plain object from an Int32Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Int32Value - * @static - * @param {google.protobuf.Int32Value} message Int32Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Int32Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = 0; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; - - /** - * Converts this Int32Value to JSON. - * @function toJSON - * @memberof google.protobuf.Int32Value - * @instance - * @returns {Object.} JSON object - */ - Int32Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Int32Value - * @function getTypeUrl - * @memberof google.protobuf.Int32Value - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Int32Value"; - }; - - return Int32Value; - })(); - - protobuf.UInt32Value = (function() { - - /** - * Properties of a UInt32Value. - * @memberof google.protobuf - * @interface IUInt32Value - * @property {number|null} [value] UInt32Value value - */ - - /** - * Constructs a new UInt32Value. - * @memberof google.protobuf - * @classdesc Represents a UInt32Value. - * @implements IUInt32Value - * @constructor - * @param {google.protobuf.IUInt32Value=} [properties] Properties to set - */ - function UInt32Value(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]]; - } - - /** - * UInt32Value value. - * @member {number} value - * @memberof google.protobuf.UInt32Value - * @instance - */ - UInt32Value.prototype.value = 0; - - /** - * Creates a new UInt32Value instance using the specified properties. - * @function create - * @memberof google.protobuf.UInt32Value - * @static - * @param {google.protobuf.IUInt32Value=} [properties] Properties to set - * @returns {google.protobuf.UInt32Value} UInt32Value instance - */ - UInt32Value.create = function create(properties) { - return new UInt32Value(properties); - }; - - /** - * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UInt32Value - * @static - * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UInt32Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.value); - return writer; - }; - - /** - * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UInt32Value - * @static - * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UInt32Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a UInt32Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UInt32Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UInt32Value} UInt32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UInt32Value.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt32Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.uint32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a UInt32Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UInt32Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UInt32Value} UInt32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UInt32Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a UInt32Value message. - * @function verify - * @memberof google.protobuf.UInt32Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UInt32Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value)) - return "value: integer expected"; - return null; - }; - - /** - * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UInt32Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UInt32Value} UInt32Value - */ - UInt32Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UInt32Value) - return object; - var message = new $root.google.protobuf.UInt32Value(); - if (object.value != null) - message.value = object.value >>> 0; - return message; - }; - - /** - * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UInt32Value - * @static - * @param {google.protobuf.UInt32Value} message UInt32Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UInt32Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = 0; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; - - /** - * Converts this UInt32Value to JSON. - * @function toJSON - * @memberof google.protobuf.UInt32Value - * @instance - * @returns {Object.} JSON object - */ - UInt32Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UInt32Value - * @function getTypeUrl - * @memberof google.protobuf.UInt32Value - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UInt32Value"; - }; - - return UInt32Value; - })(); - - protobuf.BoolValue = (function() { - - /** - * Properties of a BoolValue. - * @memberof google.protobuf - * @interface IBoolValue - * @property {boolean|null} [value] BoolValue value - */ - - /** - * Constructs a new BoolValue. - * @memberof google.protobuf - * @classdesc Represents a BoolValue. - * @implements IBoolValue - * @constructor - * @param {google.protobuf.IBoolValue=} [properties] Properties to set - */ - function BoolValue(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]]; - } - - /** - * BoolValue value. - * @member {boolean} value - * @memberof google.protobuf.BoolValue - * @instance - */ - BoolValue.prototype.value = false; - - /** - * Creates a new BoolValue instance using the specified properties. - * @function create - * @memberof google.protobuf.BoolValue - * @static - * @param {google.protobuf.IBoolValue=} [properties] Properties to set - * @returns {google.protobuf.BoolValue} BoolValue instance - */ - BoolValue.create = function create(properties) { - return new BoolValue(properties); - }; - - /** - * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.BoolValue - * @static - * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BoolValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.value); - return writer; - }; - - /** - * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.BoolValue - * @static - * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BoolValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BoolValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.BoolValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.BoolValue} BoolValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BoolValue.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BoolValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BoolValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.BoolValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.BoolValue} BoolValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BoolValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BoolValue message. - * @function verify - * @memberof google.protobuf.BoolValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BoolValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value !== "boolean") - return "value: boolean expected"; - return null; - }; - - /** - * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.BoolValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.BoolValue} BoolValue - */ - BoolValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.BoolValue) - return object; - var message = new $root.google.protobuf.BoolValue(); - if (object.value != null) - message.value = Boolean(object.value); - return message; - }; - - /** - * Creates a plain object from a BoolValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.BoolValue - * @static - * @param {google.protobuf.BoolValue} message BoolValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BoolValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = false; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; - - /** - * Converts this BoolValue to JSON. - * @function toJSON - * @memberof google.protobuf.BoolValue - * @instance - * @returns {Object.} JSON object - */ - BoolValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BoolValue - * @function getTypeUrl - * @memberof google.protobuf.BoolValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.BoolValue"; - }; - - return BoolValue; - })(); - - protobuf.StringValue = (function() { - - /** - * Properties of a StringValue. - * @memberof google.protobuf - * @interface IStringValue - * @property {string|null} [value] StringValue value - */ - - /** - * Constructs a new StringValue. - * @memberof google.protobuf - * @classdesc Represents a StringValue. - * @implements IStringValue - * @constructor - * @param {google.protobuf.IStringValue=} [properties] Properties to set - */ - function StringValue(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]]; - } - - /** - * StringValue value. - * @member {string} value - * @memberof google.protobuf.StringValue - * @instance - */ - StringValue.prototype.value = ""; - - /** - * Creates a new StringValue instance using the specified properties. - * @function create - * @memberof google.protobuf.StringValue - * @static - * @param {google.protobuf.IStringValue=} [properties] Properties to set - * @returns {google.protobuf.StringValue} StringValue instance - */ - StringValue.create = function create(properties) { - return new StringValue(properties); - }; - - /** - * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.StringValue - * @static - * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StringValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); - return writer; - }; - - /** - * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.StringValue - * @static - * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StringValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StringValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.StringValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.StringValue} StringValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StringValue.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.StringValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StringValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.StringValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.StringValue} StringValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StringValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StringValue message. - * @function verify - * @memberof google.protobuf.StringValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StringValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; - return null; - }; - - /** - * Creates a StringValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.StringValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.StringValue} StringValue - */ - StringValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.StringValue) - return object; - var message = new $root.google.protobuf.StringValue(); - if (object.value != null) - message.value = String(object.value); - return message; - }; - - /** - * Creates a plain object from a StringValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.StringValue - * @static - * @param {google.protobuf.StringValue} message StringValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StringValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = ""; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; - - /** - * Converts this StringValue to JSON. - * @function toJSON - * @memberof google.protobuf.StringValue - * @instance - * @returns {Object.} JSON object - */ - StringValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StringValue - * @function getTypeUrl - * @memberof google.protobuf.StringValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.StringValue"; - }; - - return StringValue; - })(); - - protobuf.BytesValue = (function() { - - /** - * Properties of a BytesValue. - * @memberof google.protobuf - * @interface IBytesValue - * @property {Uint8Array|null} [value] BytesValue value - */ - - /** - * Constructs a new BytesValue. - * @memberof google.protobuf - * @classdesc Represents a BytesValue. - * @implements IBytesValue - * @constructor - * @param {google.protobuf.IBytesValue=} [properties] Properties to set - */ - function BytesValue(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]]; - } - - /** - * BytesValue value. - * @member {Uint8Array} value - * @memberof google.protobuf.BytesValue - * @instance - */ - BytesValue.prototype.value = $util.newBuffer([]); - - /** - * Creates a new BytesValue instance using the specified properties. - * @function create - * @memberof google.protobuf.BytesValue - * @static - * @param {google.protobuf.IBytesValue=} [properties] Properties to set - * @returns {google.protobuf.BytesValue} BytesValue instance - */ - BytesValue.create = function create(properties) { - return new BytesValue(properties); - }; - - /** - * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.BytesValue - * @static - * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BytesValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.value); - return writer; - }; - - /** - * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.BytesValue - * @static - * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BytesValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BytesValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.BytesValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.BytesValue} BytesValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BytesValue.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BytesValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BytesValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.BytesValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.BytesValue} BytesValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BytesValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BytesValue message. - * @function verify - * @memberof google.protobuf.BytesValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BytesValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object 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 a BytesValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.BytesValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.BytesValue} BytesValue - */ - BytesValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.BytesValue) - return object; - var message = new $root.google.protobuf.BytesValue(); - 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 >= 0) - message.value = object.value; - return message; - }; - - /** - * Creates a plain object from a BytesValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.BytesValue - * @static - * @param {google.protobuf.BytesValue} message BytesValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BytesValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - 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 BytesValue to JSON. - * @function toJSON - * @memberof google.protobuf.BytesValue - * @instance - * @returns {Object.} JSON object - */ - BytesValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BytesValue - * @function getTypeUrl - * @memberof google.protobuf.BytesValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.BytesValue"; - }; - - return BytesValue; - })(); - - 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * Gets the default type url for Duration - * @function getTypeUrl - * @memberof google.protobuf.Duration - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Duration"; - }; - - 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * Gets the default type url for Empty - * @function getTypeUrl - * @memberof google.protobuf.Empty - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Empty"; - }; - - return Empty; - })(); - - 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * Gets the default type url for Status - * @function getTypeUrl - * @memberof google.rpc.Status - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.rpc.Status"; - }; - - return Status; - })(); - - return rpc; - })(); - - google.type = (function() { - - /** - * Namespace type. - * @memberof google - * @namespace - */ - var type = {}; - - type.Color = (function() { - - /** - * Properties of a Color. - * @memberof google.type - * @interface IColor - * @property {number|null} [red] Color red - * @property {number|null} [green] Color green - * @property {number|null} [blue] Color blue - * @property {google.protobuf.IFloatValue|null} [alpha] Color alpha - */ - - /** - * Constructs a new Color. - * @memberof google.type - * @classdesc Represents a Color. - * @implements IColor - * @constructor - * @param {google.type.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.type.Color - * @instance - */ - Color.prototype.red = 0; - - /** - * Color green. - * @member {number} green - * @memberof google.type.Color - * @instance - */ - Color.prototype.green = 0; - - /** - * Color blue. - * @member {number} blue - * @memberof google.type.Color - * @instance - */ - Color.prototype.blue = 0; - - /** - * Color alpha. - * @member {google.protobuf.IFloatValue|null|undefined} alpha - * @memberof google.type.Color - * @instance - */ - Color.prototype.alpha = null; - - /** - * Creates a new Color instance using the specified properties. - * @function create - * @memberof google.type.Color - * @static - * @param {google.type.IColor=} [properties] Properties to set - * @returns {google.type.Color} Color instance - */ - Color.create = function create(properties) { - return new Color(properties); - }; - - /** - * Encodes the specified Color message. Does not implicitly {@link google.type.Color.verify|verify} messages. - * @function encode - * @memberof google.type.Color - * @static - * @param {google.type.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); - if (message.alpha != null && Object.hasOwnProperty.call(message, "alpha")) - $root.google.protobuf.FloatValue.encode(message.alpha, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Color message, length delimited. Does not implicitly {@link google.type.Color.verify|verify} messages. - * @function encodeDelimited - * @memberof google.type.Color - * @static - * @param {google.type.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.type.Color - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.type.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Color(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.red = reader.float(); - break; - } - case 2: { - message.green = reader.float(); - break; - } - case 3: { - message.blue = reader.float(); - break; - } - case 4: { - message.alpha = $root.google.protobuf.FloatValue.decode(reader, reader.uint32()); - 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.type.Color - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.type.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.type.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"; - if (message.alpha != null && message.hasOwnProperty("alpha")) { - var error = $root.google.protobuf.FloatValue.verify(message.alpha); - if (error) - return "alpha." + error; - } - return null; - }; - - /** - * Creates a Color message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.type.Color - * @static - * @param {Object.} object Plain object - * @returns {google.type.Color} Color - */ - Color.fromObject = function fromObject(object) { - if (object instanceof $root.google.type.Color) - return object; - var message = new $root.google.type.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); - if (object.alpha != null) { - if (typeof object.alpha !== "object") - throw TypeError(".google.type.Color.alpha: object expected"); - message.alpha = $root.google.protobuf.FloatValue.fromObject(object.alpha); - } - return message; - }; - - /** - * Creates a plain object from a Color message. Also converts values to other types if specified. - * @function toObject - * @memberof google.type.Color - * @static - * @param {google.type.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; - object.alpha = null; - } - 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; - if (message.alpha != null && message.hasOwnProperty("alpha")) - object.alpha = $root.google.protobuf.FloatValue.toObject(message.alpha, options); - return object; - }; - - /** - * Converts this Color to JSON. - * @function toJSON - * @memberof google.type.Color - * @instance - * @returns {Object.} JSON object - */ - Color.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Color - * @function getTypeUrl - * @memberof google.type.Color - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Color.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.type.Color"; - }; - - return Color; - })(); - - 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * Gets the default type url for Date - * @function getTypeUrl - * @memberof google.type.Date - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Date.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.type.Date"; - }; - - return Date; - })(); - - type.DateTime = (function() { - - /** - * Properties of a DateTime. - * @memberof google.type - * @interface IDateTime - * @property {number|null} [year] DateTime year - * @property {number|null} [month] DateTime month - * @property {number|null} [day] DateTime day - * @property {number|null} [hours] DateTime hours - * @property {number|null} [minutes] DateTime minutes - * @property {number|null} [seconds] DateTime seconds - * @property {number|null} [nanos] DateTime nanos - * @property {google.protobuf.IDuration|null} [utcOffset] DateTime utcOffset - * @property {google.type.ITimeZone|null} [timeZone] DateTime timeZone - */ - - /** - * Constructs a new DateTime. - * @memberof google.type - * @classdesc Represents a DateTime. - * @implements IDateTime - * @constructor - * @param {google.type.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 year. - * @member {number} year - * @memberof google.type.DateTime - * @instance - */ - DateTime.prototype.year = 0; - - /** - * DateTime month. - * @member {number} month - * @memberof google.type.DateTime - * @instance - */ - DateTime.prototype.month = 0; - - /** - * DateTime day. - * @member {number} day - * @memberof google.type.DateTime - * @instance - */ - DateTime.prototype.day = 0; - - /** - * DateTime hours. - * @member {number} hours - * @memberof google.type.DateTime - * @instance - */ - DateTime.prototype.hours = 0; - - /** - * DateTime minutes. - * @member {number} minutes - * @memberof google.type.DateTime - * @instance - */ - DateTime.prototype.minutes = 0; - - /** - * DateTime seconds. - * @member {number} seconds - * @memberof google.type.DateTime - * @instance - */ - DateTime.prototype.seconds = 0; - - /** - * DateTime nanos. - * @member {number} nanos - * @memberof google.type.DateTime - * @instance - */ - DateTime.prototype.nanos = 0; - - /** - * DateTime utcOffset. - * @member {google.protobuf.IDuration|null|undefined} utcOffset - * @memberof google.type.DateTime - * @instance - */ - DateTime.prototype.utcOffset = null; - - /** - * DateTime timeZone. - * @member {google.type.ITimeZone|null|undefined} timeZone - * @memberof google.type.DateTime - * @instance - */ - DateTime.prototype.timeZone = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * DateTime timeOffset. - * @member {"utcOffset"|"timeZone"|undefined} timeOffset - * @memberof google.type.DateTime - * @instance - */ - Object.defineProperty(DateTime.prototype, "timeOffset", { - get: $util.oneOfGetter($oneOfFields = ["utcOffset", "timeZone"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new DateTime instance using the specified properties. - * @function create - * @memberof google.type.DateTime - * @static - * @param {google.type.IDateTime=} [properties] Properties to set - * @returns {google.type.DateTime} DateTime instance - */ - DateTime.create = function create(properties) { - return new DateTime(properties); - }; - - /** - * Encodes the specified DateTime message. Does not implicitly {@link google.type.DateTime.verify|verify} messages. - * @function encode - * @memberof google.type.DateTime - * @static - * @param {google.type.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.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); - if (message.hours != null && Object.hasOwnProperty.call(message, "hours")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.hours); - if (message.minutes != null && Object.hasOwnProperty.call(message, "minutes")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.minutes); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.nanos); - if (message.utcOffset != null && Object.hasOwnProperty.call(message, "utcOffset")) - $root.google.protobuf.Duration.encode(message.utcOffset, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) - $root.google.type.TimeZone.encode(message.timeZone, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DateTime message, length delimited. Does not implicitly {@link google.type.DateTime.verify|verify} messages. - * @function encodeDelimited - * @memberof google.type.DateTime - * @static - * @param {google.type.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.type.DateTime - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.type.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.DateTime(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.year = reader.int32(); - break; - } - case 2: { - message.month = reader.int32(); - break; - } - case 3: { - message.day = reader.int32(); - break; - } - case 4: { - message.hours = reader.int32(); - break; - } - case 5: { - message.minutes = reader.int32(); - break; - } - case 6: { - message.seconds = reader.int32(); - break; - } - case 7: { - message.nanos = reader.int32(); - break; - } - case 8: { - message.utcOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 9: { - message.timeZone = $root.google.type.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.type.DateTime - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.type.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.type.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"; - var properties = {}; - 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"; - 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"; - if (message.utcOffset != null && message.hasOwnProperty("utcOffset")) { - properties.timeOffset = 1; - { - var error = $root.google.protobuf.Duration.verify(message.utcOffset); - if (error) - return "utcOffset." + error; - } - } - if (message.timeZone != null && message.hasOwnProperty("timeZone")) { - if (properties.timeOffset === 1) - return "timeOffset: multiple values"; - properties.timeOffset = 1; - { - var error = $root.google.type.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.type.DateTime - * @static - * @param {Object.} object Plain object - * @returns {google.type.DateTime} DateTime - */ - DateTime.fromObject = function fromObject(object) { - if (object instanceof $root.google.type.DateTime) - return object; - var message = new $root.google.type.DateTime(); - 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; - 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; - if (object.utcOffset != null) { - if (typeof object.utcOffset !== "object") - throw TypeError(".google.type.DateTime.utcOffset: object expected"); - message.utcOffset = $root.google.protobuf.Duration.fromObject(object.utcOffset); - } - if (object.timeZone != null) { - if (typeof object.timeZone !== "object") - throw TypeError(".google.type.DateTime.timeZone: object expected"); - message.timeZone = $root.google.type.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.type.DateTime - * @static - * @param {google.type.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.year = 0; - object.month = 0; - object.day = 0; - object.hours = 0; - object.minutes = 0; - object.seconds = 0; - object.nanos = 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; - 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; - if (message.utcOffset != null && message.hasOwnProperty("utcOffset")) { - object.utcOffset = $root.google.protobuf.Duration.toObject(message.utcOffset, options); - if (options.oneofs) - object.timeOffset = "utcOffset"; - } - if (message.timeZone != null && message.hasOwnProperty("timeZone")) { - object.timeZone = $root.google.type.TimeZone.toObject(message.timeZone, options); - if (options.oneofs) - object.timeOffset = "timeZone"; - } - return object; - }; - - /** - * Converts this DateTime to JSON. - * @function toJSON - * @memberof google.type.DateTime - * @instance - * @returns {Object.} JSON object - */ - DateTime.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DateTime - * @function getTypeUrl - * @memberof google.type.DateTime - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DateTime.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.type.DateTime"; - }; - - return DateTime; - })(); - - type.TimeZone = (function() { - - /** - * Properties of a TimeZone. - * @memberof google.type - * @interface ITimeZone - * @property {string|null} [id] TimeZone id - * @property {string|null} [version] TimeZone version - */ - - /** - * Constructs a new TimeZone. - * @memberof google.type - * @classdesc Represents a TimeZone. - * @implements ITimeZone - * @constructor - * @param {google.type.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 id. - * @member {string} id - * @memberof google.type.TimeZone - * @instance - */ - TimeZone.prototype.id = ""; - - /** - * TimeZone version. - * @member {string} version - * @memberof google.type.TimeZone - * @instance - */ - TimeZone.prototype.version = ""; - - /** - * Creates a new TimeZone instance using the specified properties. - * @function create - * @memberof google.type.TimeZone - * @static - * @param {google.type.ITimeZone=} [properties] Properties to set - * @returns {google.type.TimeZone} TimeZone instance - */ - TimeZone.create = function create(properties) { - return new TimeZone(properties); - }; - - /** - * Encodes the specified TimeZone message. Does not implicitly {@link google.type.TimeZone.verify|verify} messages. - * @function encode - * @memberof google.type.TimeZone - * @static - * @param {google.type.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.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.version); - return writer; - }; - - /** - * Encodes the specified TimeZone message, length delimited. Does not implicitly {@link google.type.TimeZone.verify|verify} messages. - * @function encodeDelimited - * @memberof google.type.TimeZone - * @static - * @param {google.type.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.type.TimeZone - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.type.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.TimeZone(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.id = reader.string(); - break; - } - case 2: { - message.version = reader.string(); - 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.type.TimeZone - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.type.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.type.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.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - return null; - }; - - /** - * Creates a TimeZone message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.type.TimeZone - * @static - * @param {Object.} object Plain object - * @returns {google.type.TimeZone} TimeZone - */ - TimeZone.fromObject = function fromObject(object) { - if (object instanceof $root.google.type.TimeZone) - return object; - var message = new $root.google.type.TimeZone(); - if (object.id != null) - message.id = String(object.id); - if (object.version != null) - message.version = String(object.version); - return message; - }; - - /** - * Creates a plain object from a TimeZone message. Also converts values to other types if specified. - * @function toObject - * @memberof google.type.TimeZone - * @static - * @param {google.type.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.id = ""; - object.version = ""; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - return object; - }; - - /** - * Converts this TimeZone to JSON. - * @function toJSON - * @memberof google.type.TimeZone - * @instance - * @returns {Object.} JSON object - */ - TimeZone.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TimeZone - * @function getTypeUrl - * @memberof google.type.TimeZone - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TimeZone.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.type.TimeZone"; - }; - - return TimeZone; - })(); - - type.Money = (function() { - - /** - * Properties of a Money. - * @memberof google.type - * @interface IMoney - * @property {string|null} [currencyCode] Money currencyCode - * @property {number|Long|null} [units] Money units - * @property {number|null} [nanos] Money nanos - */ - - /** - * Constructs a new Money. - * @memberof google.type - * @classdesc Represents a Money. - * @implements IMoney - * @constructor - * @param {google.type.IMoney=} [properties] Properties to set - */ - function Money(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]]; - } - - /** - * Money currencyCode. - * @member {string} currencyCode - * @memberof google.type.Money - * @instance - */ - Money.prototype.currencyCode = ""; - - /** - * Money units. - * @member {number|Long} units - * @memberof google.type.Money - * @instance - */ - Money.prototype.units = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Money nanos. - * @member {number} nanos - * @memberof google.type.Money - * @instance - */ - Money.prototype.nanos = 0; - - /** - * Creates a new Money instance using the specified properties. - * @function create - * @memberof google.type.Money - * @static - * @param {google.type.IMoney=} [properties] Properties to set - * @returns {google.type.Money} Money instance - */ - Money.create = function create(properties) { - return new Money(properties); - }; - - /** - * Encodes the specified Money message. Does not implicitly {@link google.type.Money.verify|verify} messages. - * @function encode - * @memberof google.type.Money - * @static - * @param {google.type.IMoney} message Money message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Money.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.currencyCode != null && Object.hasOwnProperty.call(message, "currencyCode")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.currencyCode); - if (message.units != null && Object.hasOwnProperty.call(message, "units")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.units); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified Money message, length delimited. Does not implicitly {@link google.type.Money.verify|verify} messages. - * @function encodeDelimited - * @memberof google.type.Money - * @static - * @param {google.type.IMoney} message Money message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Money.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Money message from the specified reader or buffer. - * @function decode - * @memberof google.type.Money - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.type.Money} Money - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Money.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Money(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.currencyCode = reader.string(); - break; - } - case 2: { - message.units = reader.int64(); - break; - } - case 3: { - message.nanos = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Money message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.type.Money - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.type.Money} Money - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Money.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Money message. - * @function verify - * @memberof google.type.Money - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Money.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) - if (!$util.isString(message.currencyCode)) - return "currencyCode: string expected"; - if (message.units != null && message.hasOwnProperty("units")) - if (!$util.isInteger(message.units) && !(message.units && $util.isInteger(message.units.low) && $util.isInteger(message.units.high))) - return "units: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; - - /** - * Creates a Money message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.type.Money - * @static - * @param {Object.} object Plain object - * @returns {google.type.Money} Money - */ - Money.fromObject = function fromObject(object) { - if (object instanceof $root.google.type.Money) - return object; - var message = new $root.google.type.Money(); - if (object.currencyCode != null) - message.currencyCode = String(object.currencyCode); - if (object.units != null) - if ($util.Long) - (message.units = $util.Long.fromValue(object.units)).unsigned = false; - else if (typeof object.units === "string") - message.units = parseInt(object.units, 10); - else if (typeof object.units === "number") - message.units = object.units; - else if (typeof object.units === "object") - message.units = new $util.LongBits(object.units.low >>> 0, object.units.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; - - /** - * Creates a plain object from a Money message. Also converts values to other types if specified. - * @function toObject - * @memberof google.type.Money - * @static - * @param {google.type.Money} message Money - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Money.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.currencyCode = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.units = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.units = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) - object.currencyCode = message.currencyCode; - if (message.units != null && message.hasOwnProperty("units")) - if (typeof message.units === "number") - object.units = options.longs === String ? String(message.units) : message.units; - else - object.units = options.longs === String ? $util.Long.prototype.toString.call(message.units) : options.longs === Number ? new $util.LongBits(message.units.low >>> 0, message.units.high >>> 0).toNumber() : message.units; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; - - /** - * Converts this Money to JSON. - * @function toJSON - * @memberof google.type.Money - * @instance - * @returns {Object.} JSON object - */ - Money.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Money - * @function getTypeUrl - * @memberof google.type.Money - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Money.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.type.Money"; - }; - - return Money; - })(); - - type.PostalAddress = (function() { - - /** - * Properties of a PostalAddress. - * @memberof google.type - * @interface IPostalAddress - * @property {number|null} [revision] PostalAddress revision - * @property {string|null} [regionCode] PostalAddress regionCode - * @property {string|null} [languageCode] PostalAddress languageCode - * @property {string|null} [postalCode] PostalAddress postalCode - * @property {string|null} [sortingCode] PostalAddress sortingCode - * @property {string|null} [administrativeArea] PostalAddress administrativeArea - * @property {string|null} [locality] PostalAddress locality - * @property {string|null} [sublocality] PostalAddress sublocality - * @property {Array.|null} [addressLines] PostalAddress addressLines - * @property {Array.|null} [recipients] PostalAddress recipients - * @property {string|null} [organization] PostalAddress organization - */ - - /** - * Constructs a new PostalAddress. - * @memberof google.type - * @classdesc Represents a PostalAddress. - * @implements IPostalAddress - * @constructor - * @param {google.type.IPostalAddress=} [properties] Properties to set - */ - function PostalAddress(properties) { - this.addressLines = []; - this.recipients = []; - 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]]; - } - - /** - * PostalAddress revision. - * @member {number} revision - * @memberof google.type.PostalAddress - * @instance - */ - PostalAddress.prototype.revision = 0; - - /** - * PostalAddress regionCode. - * @member {string} regionCode - * @memberof google.type.PostalAddress - * @instance - */ - PostalAddress.prototype.regionCode = ""; - - /** - * PostalAddress languageCode. - * @member {string} languageCode - * @memberof google.type.PostalAddress - * @instance - */ - PostalAddress.prototype.languageCode = ""; - - /** - * PostalAddress postalCode. - * @member {string} postalCode - * @memberof google.type.PostalAddress - * @instance - */ - PostalAddress.prototype.postalCode = ""; - - /** - * PostalAddress sortingCode. - * @member {string} sortingCode - * @memberof google.type.PostalAddress - * @instance - */ - PostalAddress.prototype.sortingCode = ""; - - /** - * PostalAddress administrativeArea. - * @member {string} administrativeArea - * @memberof google.type.PostalAddress - * @instance - */ - PostalAddress.prototype.administrativeArea = ""; - - /** - * PostalAddress locality. - * @member {string} locality - * @memberof google.type.PostalAddress - * @instance - */ - PostalAddress.prototype.locality = ""; - - /** - * PostalAddress sublocality. - * @member {string} sublocality - * @memberof google.type.PostalAddress - * @instance - */ - PostalAddress.prototype.sublocality = ""; - - /** - * PostalAddress addressLines. - * @member {Array.} addressLines - * @memberof google.type.PostalAddress - * @instance - */ - PostalAddress.prototype.addressLines = $util.emptyArray; - - /** - * PostalAddress recipients. - * @member {Array.} recipients - * @memberof google.type.PostalAddress - * @instance - */ - PostalAddress.prototype.recipients = $util.emptyArray; - - /** - * PostalAddress organization. - * @member {string} organization - * @memberof google.type.PostalAddress - * @instance - */ - PostalAddress.prototype.organization = ""; - - /** - * Creates a new PostalAddress instance using the specified properties. - * @function create - * @memberof google.type.PostalAddress - * @static - * @param {google.type.IPostalAddress=} [properties] Properties to set - * @returns {google.type.PostalAddress} PostalAddress instance - */ - PostalAddress.create = function create(properties) { - return new PostalAddress(properties); - }; - - /** - * Encodes the specified PostalAddress message. Does not implicitly {@link google.type.PostalAddress.verify|verify} messages. - * @function encode - * @memberof google.type.PostalAddress - * @static - * @param {google.type.IPostalAddress} message PostalAddress message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PostalAddress.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.revision != null && Object.hasOwnProperty.call(message, "revision")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.revision); - if (message.regionCode != null && Object.hasOwnProperty.call(message, "regionCode")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.regionCode); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); - if (message.postalCode != null && Object.hasOwnProperty.call(message, "postalCode")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.postalCode); - if (message.sortingCode != null && Object.hasOwnProperty.call(message, "sortingCode")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.sortingCode); - if (message.administrativeArea != null && Object.hasOwnProperty.call(message, "administrativeArea")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.administrativeArea); - if (message.locality != null && Object.hasOwnProperty.call(message, "locality")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.locality); - if (message.sublocality != null && Object.hasOwnProperty.call(message, "sublocality")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.sublocality); - if (message.addressLines != null && message.addressLines.length) - for (var i = 0; i < message.addressLines.length; ++i) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.addressLines[i]); - if (message.recipients != null && message.recipients.length) - for (var i = 0; i < message.recipients.length; ++i) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.recipients[i]); - if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.organization); - return writer; - }; - - /** - * Encodes the specified PostalAddress message, length delimited. Does not implicitly {@link google.type.PostalAddress.verify|verify} messages. - * @function encodeDelimited - * @memberof google.type.PostalAddress - * @static - * @param {google.type.IPostalAddress} message PostalAddress message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PostalAddress.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PostalAddress message from the specified reader or buffer. - * @function decode - * @memberof google.type.PostalAddress - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.type.PostalAddress} PostalAddress - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PostalAddress.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.PostalAddress(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.revision = reader.int32(); - break; - } - case 2: { - message.regionCode = reader.string(); - break; - } - case 3: { - message.languageCode = reader.string(); - break; - } - case 4: { - message.postalCode = reader.string(); - break; - } - case 5: { - message.sortingCode = reader.string(); - break; - } - case 6: { - message.administrativeArea = reader.string(); - break; - } - case 7: { - message.locality = reader.string(); - break; - } - case 8: { - message.sublocality = reader.string(); - break; - } - case 9: { - if (!(message.addressLines && message.addressLines.length)) - message.addressLines = []; - message.addressLines.push(reader.string()); - break; - } - case 10: { - if (!(message.recipients && message.recipients.length)) - message.recipients = []; - message.recipients.push(reader.string()); - break; - } - case 11: { - message.organization = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PostalAddress message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.type.PostalAddress - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.type.PostalAddress} PostalAddress - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PostalAddress.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PostalAddress message. - * @function verify - * @memberof google.type.PostalAddress - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PostalAddress.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.revision != null && message.hasOwnProperty("revision")) - if (!$util.isInteger(message.revision)) - return "revision: integer expected"; - if (message.regionCode != null && message.hasOwnProperty("regionCode")) - if (!$util.isString(message.regionCode)) - return "regionCode: string expected"; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; - if (message.postalCode != null && message.hasOwnProperty("postalCode")) - if (!$util.isString(message.postalCode)) - return "postalCode: string expected"; - if (message.sortingCode != null && message.hasOwnProperty("sortingCode")) - if (!$util.isString(message.sortingCode)) - return "sortingCode: string expected"; - if (message.administrativeArea != null && message.hasOwnProperty("administrativeArea")) - if (!$util.isString(message.administrativeArea)) - return "administrativeArea: string expected"; - if (message.locality != null && message.hasOwnProperty("locality")) - if (!$util.isString(message.locality)) - return "locality: string expected"; - if (message.sublocality != null && message.hasOwnProperty("sublocality")) - if (!$util.isString(message.sublocality)) - return "sublocality: string expected"; - if (message.addressLines != null && message.hasOwnProperty("addressLines")) { - if (!Array.isArray(message.addressLines)) - return "addressLines: array expected"; - for (var i = 0; i < message.addressLines.length; ++i) - if (!$util.isString(message.addressLines[i])) - return "addressLines: string[] expected"; - } - if (message.recipients != null && message.hasOwnProperty("recipients")) { - if (!Array.isArray(message.recipients)) - return "recipients: array expected"; - for (var i = 0; i < message.recipients.length; ++i) - if (!$util.isString(message.recipients[i])) - return "recipients: string[] expected"; - } - if (message.organization != null && message.hasOwnProperty("organization")) - if (!$util.isString(message.organization)) - return "organization: string expected"; - return null; - }; - - /** - * Creates a PostalAddress message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.type.PostalAddress - * @static - * @param {Object.} object Plain object - * @returns {google.type.PostalAddress} PostalAddress - */ - PostalAddress.fromObject = function fromObject(object) { - if (object instanceof $root.google.type.PostalAddress) - return object; - var message = new $root.google.type.PostalAddress(); - if (object.revision != null) - message.revision = object.revision | 0; - if (object.regionCode != null) - message.regionCode = String(object.regionCode); - if (object.languageCode != null) - message.languageCode = String(object.languageCode); - if (object.postalCode != null) - message.postalCode = String(object.postalCode); - if (object.sortingCode != null) - message.sortingCode = String(object.sortingCode); - if (object.administrativeArea != null) - message.administrativeArea = String(object.administrativeArea); - if (object.locality != null) - message.locality = String(object.locality); - if (object.sublocality != null) - message.sublocality = String(object.sublocality); - if (object.addressLines) { - if (!Array.isArray(object.addressLines)) - throw TypeError(".google.type.PostalAddress.addressLines: array expected"); - message.addressLines = []; - for (var i = 0; i < object.addressLines.length; ++i) - message.addressLines[i] = String(object.addressLines[i]); - } - if (object.recipients) { - if (!Array.isArray(object.recipients)) - throw TypeError(".google.type.PostalAddress.recipients: array expected"); - message.recipients = []; - for (var i = 0; i < object.recipients.length; ++i) - message.recipients[i] = String(object.recipients[i]); - } - if (object.organization != null) - message.organization = String(object.organization); - return message; - }; - - /** - * Creates a plain object from a PostalAddress message. Also converts values to other types if specified. - * @function toObject - * @memberof google.type.PostalAddress - * @static - * @param {google.type.PostalAddress} message PostalAddress - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PostalAddress.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.addressLines = []; - object.recipients = []; - } - if (options.defaults) { - object.revision = 0; - object.regionCode = ""; - object.languageCode = ""; - object.postalCode = ""; - object.sortingCode = ""; - object.administrativeArea = ""; - object.locality = ""; - object.sublocality = ""; - object.organization = ""; - } - if (message.revision != null && message.hasOwnProperty("revision")) - object.revision = message.revision; - if (message.regionCode != null && message.hasOwnProperty("regionCode")) - object.regionCode = message.regionCode; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; - if (message.postalCode != null && message.hasOwnProperty("postalCode")) - object.postalCode = message.postalCode; - if (message.sortingCode != null && message.hasOwnProperty("sortingCode")) - object.sortingCode = message.sortingCode; - if (message.administrativeArea != null && message.hasOwnProperty("administrativeArea")) - object.administrativeArea = message.administrativeArea; - if (message.locality != null && message.hasOwnProperty("locality")) - object.locality = message.locality; - if (message.sublocality != null && message.hasOwnProperty("sublocality")) - object.sublocality = message.sublocality; - if (message.addressLines && message.addressLines.length) { - object.addressLines = []; - for (var j = 0; j < message.addressLines.length; ++j) - object.addressLines[j] = message.addressLines[j]; - } - if (message.recipients && message.recipients.length) { - object.recipients = []; - for (var j = 0; j < message.recipients.length; ++j) - object.recipients[j] = message.recipients[j]; - } - if (message.organization != null && message.hasOwnProperty("organization")) - object.organization = message.organization; - return object; - }; - - /** - * Converts this PostalAddress to JSON. - * @function toJSON - * @memberof google.type.PostalAddress - * @instance - * @returns {Object.} JSON object - */ - PostalAddress.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PostalAddress - * @function getTypeUrl - * @memberof google.type.PostalAddress - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PostalAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.type.PostalAddress"; - }; - - return PostalAddress; - })(); - - type.Interval = (function() { - - /** - * Properties of an Interval. - * @memberof google.type - * @interface IInterval - * @property {google.protobuf.ITimestamp|null} [startTime] Interval startTime - * @property {google.protobuf.ITimestamp|null} [endTime] Interval endTime - */ - - /** - * Constructs a new Interval. - * @memberof google.type - * @classdesc Represents an Interval. - * @implements IInterval - * @constructor - * @param {google.type.IInterval=} [properties] Properties to set - */ - function Interval(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]]; - } - - /** - * Interval startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.type.Interval - * @instance - */ - Interval.prototype.startTime = null; - - /** - * Interval endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.type.Interval - * @instance - */ - Interval.prototype.endTime = null; - - /** - * Creates a new Interval instance using the specified properties. - * @function create - * @memberof google.type.Interval - * @static - * @param {google.type.IInterval=} [properties] Properties to set - * @returns {google.type.Interval} Interval instance - */ - Interval.create = function create(properties) { - return new Interval(properties); - }; - - /** - * Encodes the specified Interval message. Does not implicitly {@link google.type.Interval.verify|verify} messages. - * @function encode - * @memberof google.type.Interval - * @static - * @param {google.type.IInterval} message Interval message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Interval.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(); - return writer; - }; - - /** - * Encodes the specified Interval message, length delimited. Does not implicitly {@link google.type.Interval.verify|verify} messages. - * @function encodeDelimited - * @memberof google.type.Interval - * @static - * @param {google.type.IInterval} message Interval message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Interval.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Interval message from the specified reader or buffer. - * @function decode - * @memberof google.type.Interval - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.type.Interval} Interval - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Interval.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Interval(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Interval message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.type.Interval - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.type.Interval} Interval - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Interval.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Interval message. - * @function verify - * @memberof google.type.Interval - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Interval.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; - } - return null; - }; - - /** - * Creates an Interval message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.type.Interval - * @static - * @param {Object.} object Plain object - * @returns {google.type.Interval} Interval - */ - Interval.fromObject = function fromObject(object) { - if (object instanceof $root.google.type.Interval) - return object; - var message = new $root.google.type.Interval(); - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.type.Interval.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.type.Interval.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - return message; - }; - - /** - * Creates a plain object from an Interval message. Also converts values to other types if specified. - * @function toObject - * @memberof google.type.Interval - * @static - * @param {google.type.Interval} message Interval - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Interval.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.startTime = null; - object.endTime = null; - } - 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); - return object; - }; - - /** - * Converts this Interval to JSON. - * @function toJSON - * @memberof google.type.Interval - * @instance - * @returns {Object.} JSON object - */ - Interval.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Interval - * @function getTypeUrl - * @memberof google.type.Interval - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Interval.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.type.Interval"; - }; - - return Interval; - })(); - - type.Expr = (function() { - - /** - * Properties of an Expr. - * @memberof google.type - * @interface IExpr - * @property {string|null} [expression] Expr expression - * @property {string|null} [title] Expr title - * @property {string|null} [description] Expr description - * @property {string|null} [location] Expr location - */ - - /** - * Constructs a new Expr. - * @memberof google.type - * @classdesc Represents an Expr. - * @implements IExpr - * @constructor - * @param {google.type.IExpr=} [properties] Properties to set - */ - function Expr(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]]; - } - - /** - * Expr expression. - * @member {string} expression - * @memberof google.type.Expr - * @instance - */ - Expr.prototype.expression = ""; - - /** - * Expr title. - * @member {string} title - * @memberof google.type.Expr - * @instance - */ - Expr.prototype.title = ""; - - /** - * Expr description. - * @member {string} description - * @memberof google.type.Expr - * @instance - */ - Expr.prototype.description = ""; - - /** - * Expr location. - * @member {string} location - * @memberof google.type.Expr - * @instance - */ - Expr.prototype.location = ""; - - /** - * Creates a new Expr instance using the specified properties. - * @function create - * @memberof google.type.Expr - * @static - * @param {google.type.IExpr=} [properties] Properties to set - * @returns {google.type.Expr} Expr instance - */ - Expr.create = function create(properties) { - return new Expr(properties); - }; - - /** - * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. - * @function encode - * @memberof google.type.Expr - * @static - * @param {google.type.IExpr} message Expr message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Expr.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.expression != null && Object.hasOwnProperty.call(message, "expression")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.location != null && Object.hasOwnProperty.call(message, "location")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); - return writer; - }; - - /** - * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. - * @function encodeDelimited - * @memberof google.type.Expr - * @static - * @param {google.type.IExpr} message Expr message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Expr.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Expr message from the specified reader or buffer. - * @function decode - * @memberof google.type.Expr - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.type.Expr} Expr - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Expr.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Expr(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.expression = reader.string(); - break; - } - case 2: { - message.title = reader.string(); - break; - } - case 3: { - message.description = reader.string(); - break; - } - case 4: { - message.location = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Expr message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.type.Expr - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.type.Expr} Expr - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Expr.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Expr message. - * @function verify - * @memberof google.type.Expr - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Expr.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.expression != null && message.hasOwnProperty("expression")) - if (!$util.isString(message.expression)) - return "expression: string expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.location != null && message.hasOwnProperty("location")) - if (!$util.isString(message.location)) - return "location: string expected"; - return null; - }; - - /** - * Creates an Expr message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.type.Expr - * @static - * @param {Object.} object Plain object - * @returns {google.type.Expr} Expr - */ - Expr.fromObject = function fromObject(object) { - if (object instanceof $root.google.type.Expr) - return object; - var message = new $root.google.type.Expr(); - if (object.expression != null) - message.expression = String(object.expression); - if (object.title != null) - message.title = String(object.title); - if (object.description != null) - message.description = String(object.description); - if (object.location != null) - message.location = String(object.location); - return message; - }; - - /** - * Creates a plain object from an Expr message. Also converts values to other types if specified. - * @function toObject - * @memberof google.type.Expr - * @static - * @param {google.type.Expr} message Expr - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Expr.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.expression = ""; - object.title = ""; - object.description = ""; - object.location = ""; - } - if (message.expression != null && message.hasOwnProperty("expression")) - object.expression = message.expression; - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.location != null && message.hasOwnProperty("location")) - object.location = message.location; - return object; - }; - - /** - * Converts this Expr to JSON. - * @function toJSON - * @memberof google.type.Expr - * @instance - * @returns {Object.} JSON object - */ - Expr.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Expr - * @function getTypeUrl - * @memberof google.type.Expr - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Expr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.type.Expr"; - }; - - return Expr; - })(); - - return type; - })(); - - google.iam = (function() { - - /** - * Namespace iam. - * @memberof google - * @namespace - */ - var iam = {}; - - iam.v1 = (function() { - - /** - * Namespace v1. - * @memberof google.iam - * @namespace - */ - var v1 = {}; - - v1.Policy = (function() { - - /** - * Properties of a Policy. - * @memberof google.iam.v1 - * @interface IPolicy - * @property {number|null} [version] Policy version - * @property {Array.|null} [bindings] Policy bindings - * @property {Array.|null} [auditConfigs] Policy auditConfigs - * @property {Uint8Array|null} [etag] Policy etag - */ - - /** - * Constructs a new Policy. - * @memberof google.iam.v1 - * @classdesc Represents a Policy. - * @implements IPolicy - * @constructor - * @param {google.iam.v1.IPolicy=} [properties] Properties to set - */ - function Policy(properties) { - this.bindings = []; - this.auditConfigs = []; - 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]]; - } - - /** - * Policy version. - * @member {number} version - * @memberof google.iam.v1.Policy - * @instance - */ - Policy.prototype.version = 0; - - /** - * Policy bindings. - * @member {Array.} bindings - * @memberof google.iam.v1.Policy - * @instance - */ - Policy.prototype.bindings = $util.emptyArray; - - /** - * Policy auditConfigs. - * @member {Array.} auditConfigs - * @memberof google.iam.v1.Policy - * @instance - */ - Policy.prototype.auditConfigs = $util.emptyArray; - - /** - * Policy etag. - * @member {Uint8Array} etag - * @memberof google.iam.v1.Policy - * @instance - */ - Policy.prototype.etag = $util.newBuffer([]); - - /** - * Creates a new Policy instance using the specified properties. - * @function create - * @memberof google.iam.v1.Policy - * @static - * @param {google.iam.v1.IPolicy=} [properties] Properties to set - * @returns {google.iam.v1.Policy} Policy instance - */ - Policy.create = function create(properties) { - return new Policy(properties); - }; - - /** - * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.Policy - * @static - * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Policy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.etag); - if (message.bindings != null && message.bindings.length) - for (var i = 0; i < message.bindings.length; ++i) - $root.google.iam.v1.Binding.encode(message.bindings[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.auditConfigs != null && message.auditConfigs.length) - for (var i = 0; i < message.auditConfigs.length; ++i) - $root.google.iam.v1.AuditConfig.encode(message.auditConfigs[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.Policy - * @static - * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Policy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Policy message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.Policy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.Policy} Policy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Policy.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Policy(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.version = reader.int32(); - break; - } - case 4: { - if (!(message.bindings && message.bindings.length)) - message.bindings = []; - message.bindings.push($root.google.iam.v1.Binding.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.auditConfigs && message.auditConfigs.length)) - message.auditConfigs = []; - message.auditConfigs.push($root.google.iam.v1.AuditConfig.decode(reader, reader.uint32())); - break; - } - case 3: { - message.etag = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Policy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.Policy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.Policy} Policy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Policy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Policy message. - * @function verify - * @memberof google.iam.v1.Policy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Policy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isInteger(message.version)) - return "version: integer expected"; - if (message.bindings != null && message.hasOwnProperty("bindings")) { - if (!Array.isArray(message.bindings)) - return "bindings: array expected"; - for (var i = 0; i < message.bindings.length; ++i) { - var error = $root.google.iam.v1.Binding.verify(message.bindings[i]); - if (error) - return "bindings." + error; - } - } - if (message.auditConfigs != null && message.hasOwnProperty("auditConfigs")) { - if (!Array.isArray(message.auditConfigs)) - return "auditConfigs: array expected"; - for (var i = 0; i < message.auditConfigs.length; ++i) { - var error = $root.google.iam.v1.AuditConfig.verify(message.auditConfigs[i]); - if (error) - return "auditConfigs." + error; - } - } - if (message.etag != null && message.hasOwnProperty("etag")) - if (!(message.etag && typeof message.etag.length === "number" || $util.isString(message.etag))) - return "etag: buffer expected"; - return null; - }; - - /** - * Creates a Policy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.Policy - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.Policy} Policy - */ - Policy.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.Policy) - return object; - var message = new $root.google.iam.v1.Policy(); - if (object.version != null) - message.version = object.version | 0; - if (object.bindings) { - if (!Array.isArray(object.bindings)) - throw TypeError(".google.iam.v1.Policy.bindings: array expected"); - message.bindings = []; - for (var i = 0; i < object.bindings.length; ++i) { - if (typeof object.bindings[i] !== "object") - throw TypeError(".google.iam.v1.Policy.bindings: object expected"); - message.bindings[i] = $root.google.iam.v1.Binding.fromObject(object.bindings[i]); - } - } - if (object.auditConfigs) { - if (!Array.isArray(object.auditConfigs)) - throw TypeError(".google.iam.v1.Policy.auditConfigs: array expected"); - message.auditConfigs = []; - for (var i = 0; i < object.auditConfigs.length; ++i) { - if (typeof object.auditConfigs[i] !== "object") - throw TypeError(".google.iam.v1.Policy.auditConfigs: object expected"); - message.auditConfigs[i] = $root.google.iam.v1.AuditConfig.fromObject(object.auditConfigs[i]); - } - } - if (object.etag != null) - if (typeof object.etag === "string") - $util.base64.decode(object.etag, message.etag = $util.newBuffer($util.base64.length(object.etag)), 0); - else if (object.etag.length >= 0) - message.etag = object.etag; - return message; - }; - - /** - * Creates a plain object from a Policy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.Policy - * @static - * @param {google.iam.v1.Policy} message Policy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Policy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.bindings = []; - object.auditConfigs = []; - } - if (options.defaults) { - object.version = 0; - if (options.bytes === String) - object.etag = ""; - else { - object.etag = []; - if (options.bytes !== Array) - object.etag = $util.newBuffer(object.etag); - } - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = options.bytes === String ? $util.base64.encode(message.etag, 0, message.etag.length) : options.bytes === Array ? Array.prototype.slice.call(message.etag) : message.etag; - if (message.bindings && message.bindings.length) { - object.bindings = []; - for (var j = 0; j < message.bindings.length; ++j) - object.bindings[j] = $root.google.iam.v1.Binding.toObject(message.bindings[j], options); - } - if (message.auditConfigs && message.auditConfigs.length) { - object.auditConfigs = []; - for (var j = 0; j < message.auditConfigs.length; ++j) - object.auditConfigs[j] = $root.google.iam.v1.AuditConfig.toObject(message.auditConfigs[j], options); - } - return object; - }; - - /** - * Converts this Policy to JSON. - * @function toJSON - * @memberof google.iam.v1.Policy - * @instance - * @returns {Object.} JSON object - */ - Policy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Policy - * @function getTypeUrl - * @memberof google.iam.v1.Policy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Policy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.Policy"; - }; - - return Policy; - })(); - - v1.Binding = (function() { - - /** - * Properties of a Binding. - * @memberof google.iam.v1 - * @interface IBinding - * @property {string|null} [role] Binding role - * @property {Array.|null} [members] Binding members - * @property {google.type.IExpr|null} [condition] Binding condition - */ - - /** - * Constructs a new Binding. - * @memberof google.iam.v1 - * @classdesc Represents a Binding. - * @implements IBinding - * @constructor - * @param {google.iam.v1.IBinding=} [properties] Properties to set - */ - function Binding(properties) { - this.members = []; - 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]]; - } - - /** - * Binding role. - * @member {string} role - * @memberof google.iam.v1.Binding - * @instance - */ - Binding.prototype.role = ""; - - /** - * Binding members. - * @member {Array.} members - * @memberof google.iam.v1.Binding - * @instance - */ - Binding.prototype.members = $util.emptyArray; - - /** - * Binding condition. - * @member {google.type.IExpr|null|undefined} condition - * @memberof google.iam.v1.Binding - * @instance - */ - Binding.prototype.condition = null; - - /** - * Creates a new Binding instance using the specified properties. - * @function create - * @memberof google.iam.v1.Binding - * @static - * @param {google.iam.v1.IBinding=} [properties] Properties to set - * @returns {google.iam.v1.Binding} Binding instance - */ - Binding.create = function create(properties) { - return new Binding(properties); - }; - - /** - * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.Binding - * @static - * @param {google.iam.v1.IBinding} message Binding message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Binding.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.role != null && Object.hasOwnProperty.call(message, "role")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); - if (message.members != null && message.members.length) - for (var i = 0; i < message.members.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.members[i]); - if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) - $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.Binding - * @static - * @param {google.iam.v1.IBinding} message Binding message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Binding.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Binding message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.Binding - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.Binding} Binding - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Binding.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Binding(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.role = reader.string(); - break; - } - case 2: { - if (!(message.members && message.members.length)) - message.members = []; - message.members.push(reader.string()); - break; - } - case 3: { - message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Binding message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.Binding - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.Binding} Binding - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Binding.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Binding message. - * @function verify - * @memberof google.iam.v1.Binding - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Binding.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.role != null && message.hasOwnProperty("role")) - if (!$util.isString(message.role)) - return "role: string expected"; - if (message.members != null && message.hasOwnProperty("members")) { - if (!Array.isArray(message.members)) - return "members: array expected"; - for (var i = 0; i < message.members.length; ++i) - if (!$util.isString(message.members[i])) - return "members: string[] expected"; - } - if (message.condition != null && message.hasOwnProperty("condition")) { - var error = $root.google.type.Expr.verify(message.condition); - if (error) - return "condition." + error; - } - return null; - }; - - /** - * Creates a Binding message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.Binding - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.Binding} Binding - */ - Binding.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.Binding) - return object; - var message = new $root.google.iam.v1.Binding(); - if (object.role != null) - message.role = String(object.role); - if (object.members) { - if (!Array.isArray(object.members)) - throw TypeError(".google.iam.v1.Binding.members: array expected"); - message.members = []; - for (var i = 0; i < object.members.length; ++i) - message.members[i] = String(object.members[i]); - } - if (object.condition != null) { - if (typeof object.condition !== "object") - throw TypeError(".google.iam.v1.Binding.condition: object expected"); - message.condition = $root.google.type.Expr.fromObject(object.condition); - } - return message; - }; - - /** - * Creates a plain object from a Binding message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.Binding - * @static - * @param {google.iam.v1.Binding} message Binding - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Binding.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.members = []; - if (options.defaults) { - object.role = ""; - object.condition = null; - } - if (message.role != null && message.hasOwnProperty("role")) - object.role = message.role; - if (message.members && message.members.length) { - object.members = []; - for (var j = 0; j < message.members.length; ++j) - object.members[j] = message.members[j]; - } - if (message.condition != null && message.hasOwnProperty("condition")) - object.condition = $root.google.type.Expr.toObject(message.condition, options); - return object; - }; - - /** - * Converts this Binding to JSON. - * @function toJSON - * @memberof google.iam.v1.Binding - * @instance - * @returns {Object.} JSON object - */ - Binding.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Binding - * @function getTypeUrl - * @memberof google.iam.v1.Binding - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Binding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.Binding"; - }; - - return Binding; - })(); - - v1.AuditConfig = (function() { - - /** - * Properties of an AuditConfig. - * @memberof google.iam.v1 - * @interface IAuditConfig - * @property {string|null} [service] AuditConfig service - * @property {Array.|null} [auditLogConfigs] AuditConfig auditLogConfigs - */ - - /** - * Constructs a new AuditConfig. - * @memberof google.iam.v1 - * @classdesc Represents an AuditConfig. - * @implements IAuditConfig - * @constructor - * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set - */ - function AuditConfig(properties) { - this.auditLogConfigs = []; - 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]]; - } - - /** - * AuditConfig service. - * @member {string} service - * @memberof google.iam.v1.AuditConfig - * @instance - */ - AuditConfig.prototype.service = ""; - - /** - * AuditConfig auditLogConfigs. - * @member {Array.} auditLogConfigs - * @memberof google.iam.v1.AuditConfig - * @instance - */ - AuditConfig.prototype.auditLogConfigs = $util.emptyArray; - - /** - * Creates a new AuditConfig instance using the specified properties. - * @function create - * @memberof google.iam.v1.AuditConfig - * @static - * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set - * @returns {google.iam.v1.AuditConfig} AuditConfig instance - */ - AuditConfig.create = function create(properties) { - return new AuditConfig(properties); - }; - - /** - * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.AuditConfig - * @static - * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuditConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.service != null && Object.hasOwnProperty.call(message, "service")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.service); - if (message.auditLogConfigs != null && message.auditLogConfigs.length) - for (var i = 0; i < message.auditLogConfigs.length; ++i) - $root.google.iam.v1.AuditLogConfig.encode(message.auditLogConfigs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.AuditConfig - * @static - * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuditConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AuditConfig message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.AuditConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.AuditConfig} AuditConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuditConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.service = reader.string(); - break; - } - case 3: { - if (!(message.auditLogConfigs && message.auditLogConfigs.length)) - message.auditLogConfigs = []; - message.auditLogConfigs.push($root.google.iam.v1.AuditLogConfig.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AuditConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.AuditConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.AuditConfig} AuditConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuditConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AuditConfig message. - * @function verify - * @memberof google.iam.v1.AuditConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AuditConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.service != null && message.hasOwnProperty("service")) - if (!$util.isString(message.service)) - return "service: string expected"; - if (message.auditLogConfigs != null && message.hasOwnProperty("auditLogConfigs")) { - if (!Array.isArray(message.auditLogConfigs)) - return "auditLogConfigs: array expected"; - for (var i = 0; i < message.auditLogConfigs.length; ++i) { - var error = $root.google.iam.v1.AuditLogConfig.verify(message.auditLogConfigs[i]); - if (error) - return "auditLogConfigs." + error; - } - } - return null; - }; - - /** - * Creates an AuditConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.AuditConfig - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.AuditConfig} AuditConfig - */ - AuditConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.AuditConfig) - return object; - var message = new $root.google.iam.v1.AuditConfig(); - if (object.service != null) - message.service = String(object.service); - if (object.auditLogConfigs) { - if (!Array.isArray(object.auditLogConfigs)) - throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: array expected"); - message.auditLogConfigs = []; - for (var i = 0; i < object.auditLogConfigs.length; ++i) { - if (typeof object.auditLogConfigs[i] !== "object") - throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: object expected"); - message.auditLogConfigs[i] = $root.google.iam.v1.AuditLogConfig.fromObject(object.auditLogConfigs[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.AuditConfig - * @static - * @param {google.iam.v1.AuditConfig} message AuditConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AuditConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.auditLogConfigs = []; - if (options.defaults) - object.service = ""; - if (message.service != null && message.hasOwnProperty("service")) - object.service = message.service; - if (message.auditLogConfigs && message.auditLogConfigs.length) { - object.auditLogConfigs = []; - for (var j = 0; j < message.auditLogConfigs.length; ++j) - object.auditLogConfigs[j] = $root.google.iam.v1.AuditLogConfig.toObject(message.auditLogConfigs[j], options); - } - return object; - }; - - /** - * Converts this AuditConfig to JSON. - * @function toJSON - * @memberof google.iam.v1.AuditConfig - * @instance - * @returns {Object.} JSON object - */ - AuditConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AuditConfig - * @function getTypeUrl - * @memberof google.iam.v1.AuditConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AuditConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.AuditConfig"; - }; - - return AuditConfig; - })(); - - v1.AuditLogConfig = (function() { - - /** - * Properties of an AuditLogConfig. - * @memberof google.iam.v1 - * @interface IAuditLogConfig - * @property {google.iam.v1.AuditLogConfig.LogType|null} [logType] AuditLogConfig logType - * @property {Array.|null} [exemptedMembers] AuditLogConfig exemptedMembers - */ - - /** - * Constructs a new AuditLogConfig. - * @memberof google.iam.v1 - * @classdesc Represents an AuditLogConfig. - * @implements IAuditLogConfig - * @constructor - * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set - */ - function AuditLogConfig(properties) { - this.exemptedMembers = []; - 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]]; - } - - /** - * AuditLogConfig logType. - * @member {google.iam.v1.AuditLogConfig.LogType} logType - * @memberof google.iam.v1.AuditLogConfig - * @instance - */ - AuditLogConfig.prototype.logType = 0; - - /** - * AuditLogConfig exemptedMembers. - * @member {Array.} exemptedMembers - * @memberof google.iam.v1.AuditLogConfig - * @instance - */ - AuditLogConfig.prototype.exemptedMembers = $util.emptyArray; - - /** - * Creates a new AuditLogConfig instance using the specified properties. - * @function create - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set - * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig instance - */ - AuditLogConfig.create = function create(properties) { - return new AuditLogConfig(properties); - }; - - /** - * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuditLogConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.logType); - if (message.exemptedMembers != null && message.exemptedMembers.length) - for (var i = 0; i < message.exemptedMembers.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.exemptedMembers[i]); - return writer; - }; - - /** - * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuditLogConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AuditLogConfig message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuditLogConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditLogConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.logType = reader.int32(); - break; - } - case 2: { - if (!(message.exemptedMembers && message.exemptedMembers.length)) - message.exemptedMembers = []; - message.exemptedMembers.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuditLogConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AuditLogConfig message. - * @function verify - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AuditLogConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.logType != null && message.hasOwnProperty("logType")) - switch (message.logType) { - default: - return "logType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.exemptedMembers != null && message.hasOwnProperty("exemptedMembers")) { - if (!Array.isArray(message.exemptedMembers)) - return "exemptedMembers: array expected"; - for (var i = 0; i < message.exemptedMembers.length; ++i) - if (!$util.isString(message.exemptedMembers[i])) - return "exemptedMembers: string[] expected"; - } - return null; - }; - - /** - * Creates an AuditLogConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig - */ - AuditLogConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.AuditLogConfig) - return object; - var message = new $root.google.iam.v1.AuditLogConfig(); - switch (object.logType) { - default: - if (typeof object.logType === "number") { - message.logType = object.logType; - break; - } - break; - case "LOG_TYPE_UNSPECIFIED": - case 0: - message.logType = 0; - break; - case "ADMIN_READ": - case 1: - message.logType = 1; - break; - case "DATA_WRITE": - case 2: - message.logType = 2; - break; - case "DATA_READ": - case 3: - message.logType = 3; - break; - } - if (object.exemptedMembers) { - if (!Array.isArray(object.exemptedMembers)) - throw TypeError(".google.iam.v1.AuditLogConfig.exemptedMembers: array expected"); - message.exemptedMembers = []; - for (var i = 0; i < object.exemptedMembers.length; ++i) - message.exemptedMembers[i] = String(object.exemptedMembers[i]); - } - return message; - }; - - /** - * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {google.iam.v1.AuditLogConfig} message AuditLogConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AuditLogConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.exemptedMembers = []; - if (options.defaults) - object.logType = options.enums === String ? "LOG_TYPE_UNSPECIFIED" : 0; - if (message.logType != null && message.hasOwnProperty("logType")) - object.logType = options.enums === String ? $root.google.iam.v1.AuditLogConfig.LogType[message.logType] === undefined ? message.logType : $root.google.iam.v1.AuditLogConfig.LogType[message.logType] : message.logType; - if (message.exemptedMembers && message.exemptedMembers.length) { - object.exemptedMembers = []; - for (var j = 0; j < message.exemptedMembers.length; ++j) - object.exemptedMembers[j] = message.exemptedMembers[j]; - } - return object; - }; - - /** - * Converts this AuditLogConfig to JSON. - * @function toJSON - * @memberof google.iam.v1.AuditLogConfig - * @instance - * @returns {Object.} JSON object - */ - AuditLogConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AuditLogConfig - * @function getTypeUrl - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AuditLogConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.AuditLogConfig"; - }; - - /** - * LogType enum. - * @name google.iam.v1.AuditLogConfig.LogType - * @enum {number} - * @property {number} LOG_TYPE_UNSPECIFIED=0 LOG_TYPE_UNSPECIFIED value - * @property {number} ADMIN_READ=1 ADMIN_READ value - * @property {number} DATA_WRITE=2 DATA_WRITE value - * @property {number} DATA_READ=3 DATA_READ value - */ - AuditLogConfig.LogType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "LOG_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ADMIN_READ"] = 1; - values[valuesById[2] = "DATA_WRITE"] = 2; - values[valuesById[3] = "DATA_READ"] = 3; - return values; - })(); - - return AuditLogConfig; - })(); - - v1.PolicyDelta = (function() { - - /** - * Properties of a PolicyDelta. - * @memberof google.iam.v1 - * @interface IPolicyDelta - * @property {Array.|null} [bindingDeltas] PolicyDelta bindingDeltas - * @property {Array.|null} [auditConfigDeltas] PolicyDelta auditConfigDeltas - */ - - /** - * Constructs a new PolicyDelta. - * @memberof google.iam.v1 - * @classdesc Represents a PolicyDelta. - * @implements IPolicyDelta - * @constructor - * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set - */ - function PolicyDelta(properties) { - this.bindingDeltas = []; - this.auditConfigDeltas = []; - 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]]; - } - - /** - * PolicyDelta bindingDeltas. - * @member {Array.} bindingDeltas - * @memberof google.iam.v1.PolicyDelta - * @instance - */ - PolicyDelta.prototype.bindingDeltas = $util.emptyArray; - - /** - * PolicyDelta auditConfigDeltas. - * @member {Array.} auditConfigDeltas - * @memberof google.iam.v1.PolicyDelta - * @instance - */ - PolicyDelta.prototype.auditConfigDeltas = $util.emptyArray; - - /** - * Creates a new PolicyDelta instance using the specified properties. - * @function create - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set - * @returns {google.iam.v1.PolicyDelta} PolicyDelta instance - */ - PolicyDelta.create = function create(properties) { - return new PolicyDelta(properties); - }; - - /** - * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PolicyDelta.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.bindingDeltas != null && message.bindingDeltas.length) - for (var i = 0; i < message.bindingDeltas.length; ++i) - $root.google.iam.v1.BindingDelta.encode(message.bindingDeltas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.auditConfigDeltas != null && message.auditConfigDeltas.length) - for (var i = 0; i < message.auditConfigDeltas.length; ++i) - $root.google.iam.v1.AuditConfigDelta.encode(message.auditConfigDeltas[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PolicyDelta.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PolicyDelta message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.PolicyDelta} PolicyDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PolicyDelta.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.PolicyDelta(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.bindingDeltas && message.bindingDeltas.length)) - message.bindingDeltas = []; - message.bindingDeltas.push($root.google.iam.v1.BindingDelta.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.auditConfigDeltas && message.auditConfigDeltas.length)) - message.auditConfigDeltas = []; - message.auditConfigDeltas.push($root.google.iam.v1.AuditConfigDelta.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.PolicyDelta} PolicyDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PolicyDelta.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PolicyDelta message. - * @function verify - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PolicyDelta.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.bindingDeltas != null && message.hasOwnProperty("bindingDeltas")) { - if (!Array.isArray(message.bindingDeltas)) - return "bindingDeltas: array expected"; - for (var i = 0; i < message.bindingDeltas.length; ++i) { - var error = $root.google.iam.v1.BindingDelta.verify(message.bindingDeltas[i]); - if (error) - return "bindingDeltas." + error; - } - } - if (message.auditConfigDeltas != null && message.hasOwnProperty("auditConfigDeltas")) { - if (!Array.isArray(message.auditConfigDeltas)) - return "auditConfigDeltas: array expected"; - for (var i = 0; i < message.auditConfigDeltas.length; ++i) { - var error = $root.google.iam.v1.AuditConfigDelta.verify(message.auditConfigDeltas[i]); - if (error) - return "auditConfigDeltas." + error; - } - } - return null; - }; - - /** - * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.PolicyDelta} PolicyDelta - */ - PolicyDelta.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.PolicyDelta) - return object; - var message = new $root.google.iam.v1.PolicyDelta(); - if (object.bindingDeltas) { - if (!Array.isArray(object.bindingDeltas)) - throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: array expected"); - message.bindingDeltas = []; - for (var i = 0; i < object.bindingDeltas.length; ++i) { - if (typeof object.bindingDeltas[i] !== "object") - throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: object expected"); - message.bindingDeltas[i] = $root.google.iam.v1.BindingDelta.fromObject(object.bindingDeltas[i]); - } - } - if (object.auditConfigDeltas) { - if (!Array.isArray(object.auditConfigDeltas)) - throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: array expected"); - message.auditConfigDeltas = []; - for (var i = 0; i < object.auditConfigDeltas.length; ++i) { - if (typeof object.auditConfigDeltas[i] !== "object") - throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: object expected"); - message.auditConfigDeltas[i] = $root.google.iam.v1.AuditConfigDelta.fromObject(object.auditConfigDeltas[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {google.iam.v1.PolicyDelta} message PolicyDelta - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PolicyDelta.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.bindingDeltas = []; - object.auditConfigDeltas = []; - } - if (message.bindingDeltas && message.bindingDeltas.length) { - object.bindingDeltas = []; - for (var j = 0; j < message.bindingDeltas.length; ++j) - object.bindingDeltas[j] = $root.google.iam.v1.BindingDelta.toObject(message.bindingDeltas[j], options); - } - if (message.auditConfigDeltas && message.auditConfigDeltas.length) { - object.auditConfigDeltas = []; - for (var j = 0; j < message.auditConfigDeltas.length; ++j) - object.auditConfigDeltas[j] = $root.google.iam.v1.AuditConfigDelta.toObject(message.auditConfigDeltas[j], options); - } - return object; - }; - - /** - * Converts this PolicyDelta to JSON. - * @function toJSON - * @memberof google.iam.v1.PolicyDelta - * @instance - * @returns {Object.} JSON object - */ - PolicyDelta.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PolicyDelta - * @function getTypeUrl - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PolicyDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.PolicyDelta"; - }; - - return PolicyDelta; - })(); - - v1.BindingDelta = (function() { - - /** - * Properties of a BindingDelta. - * @memberof google.iam.v1 - * @interface IBindingDelta - * @property {google.iam.v1.BindingDelta.Action|null} [action] BindingDelta action - * @property {string|null} [role] BindingDelta role - * @property {string|null} [member] BindingDelta member - * @property {google.type.IExpr|null} [condition] BindingDelta condition - */ - - /** - * Constructs a new BindingDelta. - * @memberof google.iam.v1 - * @classdesc Represents a BindingDelta. - * @implements IBindingDelta - * @constructor - * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set - */ - function BindingDelta(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]]; - } - - /** - * BindingDelta action. - * @member {google.iam.v1.BindingDelta.Action} action - * @memberof google.iam.v1.BindingDelta - * @instance - */ - BindingDelta.prototype.action = 0; - - /** - * BindingDelta role. - * @member {string} role - * @memberof google.iam.v1.BindingDelta - * @instance - */ - BindingDelta.prototype.role = ""; - - /** - * BindingDelta member. - * @member {string} member - * @memberof google.iam.v1.BindingDelta - * @instance - */ - BindingDelta.prototype.member = ""; - - /** - * BindingDelta condition. - * @member {google.type.IExpr|null|undefined} condition - * @memberof google.iam.v1.BindingDelta - * @instance - */ - BindingDelta.prototype.condition = null; - - /** - * Creates a new BindingDelta instance using the specified properties. - * @function create - * @memberof google.iam.v1.BindingDelta - * @static - * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set - * @returns {google.iam.v1.BindingDelta} BindingDelta instance - */ - BindingDelta.create = function create(properties) { - return new BindingDelta(properties); - }; - - /** - * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.BindingDelta - * @static - * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BindingDelta.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.action != null && Object.hasOwnProperty.call(message, "action")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); - if (message.role != null && Object.hasOwnProperty.call(message, "role")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.role); - if (message.member != null && Object.hasOwnProperty.call(message, "member")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.member); - if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) - $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.BindingDelta - * @static - * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BindingDelta.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BindingDelta message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.BindingDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.BindingDelta} BindingDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BindingDelta.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.BindingDelta(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.action = reader.int32(); - break; - } - case 2: { - message.role = reader.string(); - break; - } - case 3: { - message.member = reader.string(); - break; - } - case 4: { - message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BindingDelta message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.BindingDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.BindingDelta} BindingDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BindingDelta.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BindingDelta message. - * @function verify - * @memberof google.iam.v1.BindingDelta - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BindingDelta.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.action != null && message.hasOwnProperty("action")) - switch (message.action) { - default: - return "action: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.role != null && message.hasOwnProperty("role")) - if (!$util.isString(message.role)) - return "role: string expected"; - if (message.member != null && message.hasOwnProperty("member")) - if (!$util.isString(message.member)) - return "member: string expected"; - if (message.condition != null && message.hasOwnProperty("condition")) { - var error = $root.google.type.Expr.verify(message.condition); - if (error) - return "condition." + error; - } - return null; - }; - - /** - * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.BindingDelta - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.BindingDelta} BindingDelta - */ - BindingDelta.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.BindingDelta) - return object; - var message = new $root.google.iam.v1.BindingDelta(); - switch (object.action) { - default: - if (typeof object.action === "number") { - message.action = object.action; - break; - } - break; - case "ACTION_UNSPECIFIED": - case 0: - message.action = 0; - break; - case "ADD": - case 1: - message.action = 1; - break; - case "REMOVE": - case 2: - message.action = 2; - break; - } - if (object.role != null) - message.role = String(object.role); - if (object.member != null) - message.member = String(object.member); - if (object.condition != null) { - if (typeof object.condition !== "object") - throw TypeError(".google.iam.v1.BindingDelta.condition: object expected"); - message.condition = $root.google.type.Expr.fromObject(object.condition); - } - return message; - }; - - /** - * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.BindingDelta - * @static - * @param {google.iam.v1.BindingDelta} message BindingDelta - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BindingDelta.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; - object.role = ""; - object.member = ""; - object.condition = null; - } - if (message.action != null && message.hasOwnProperty("action")) - object.action = options.enums === String ? $root.google.iam.v1.BindingDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.BindingDelta.Action[message.action] : message.action; - if (message.role != null && message.hasOwnProperty("role")) - object.role = message.role; - if (message.member != null && message.hasOwnProperty("member")) - object.member = message.member; - if (message.condition != null && message.hasOwnProperty("condition")) - object.condition = $root.google.type.Expr.toObject(message.condition, options); - return object; - }; - - /** - * Converts this BindingDelta to JSON. - * @function toJSON - * @memberof google.iam.v1.BindingDelta - * @instance - * @returns {Object.} JSON object - */ - BindingDelta.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BindingDelta - * @function getTypeUrl - * @memberof google.iam.v1.BindingDelta - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BindingDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.BindingDelta"; - }; - - /** - * Action enum. - * @name google.iam.v1.BindingDelta.Action - * @enum {number} - * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value - * @property {number} ADD=1 ADD value - * @property {number} REMOVE=2 REMOVE value - */ - BindingDelta.Action = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; - values[valuesById[1] = "ADD"] = 1; - values[valuesById[2] = "REMOVE"] = 2; - return values; - })(); - - return BindingDelta; - })(); - - v1.AuditConfigDelta = (function() { - - /** - * Properties of an AuditConfigDelta. - * @memberof google.iam.v1 - * @interface IAuditConfigDelta - * @property {google.iam.v1.AuditConfigDelta.Action|null} [action] AuditConfigDelta action - * @property {string|null} [service] AuditConfigDelta service - * @property {string|null} [exemptedMember] AuditConfigDelta exemptedMember - * @property {string|null} [logType] AuditConfigDelta logType - */ - - /** - * Constructs a new AuditConfigDelta. - * @memberof google.iam.v1 - * @classdesc Represents an AuditConfigDelta. - * @implements IAuditConfigDelta - * @constructor - * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set - */ - function AuditConfigDelta(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]]; - } - - /** - * AuditConfigDelta action. - * @member {google.iam.v1.AuditConfigDelta.Action} action - * @memberof google.iam.v1.AuditConfigDelta - * @instance - */ - AuditConfigDelta.prototype.action = 0; - - /** - * AuditConfigDelta service. - * @member {string} service - * @memberof google.iam.v1.AuditConfigDelta - * @instance - */ - AuditConfigDelta.prototype.service = ""; - - /** - * AuditConfigDelta exemptedMember. - * @member {string} exemptedMember - * @memberof google.iam.v1.AuditConfigDelta - * @instance - */ - AuditConfigDelta.prototype.exemptedMember = ""; - - /** - * AuditConfigDelta logType. - * @member {string} logType - * @memberof google.iam.v1.AuditConfigDelta - * @instance - */ - AuditConfigDelta.prototype.logType = ""; - - /** - * Creates a new AuditConfigDelta instance using the specified properties. - * @function create - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set - * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta instance - */ - AuditConfigDelta.create = function create(properties) { - return new AuditConfigDelta(properties); - }; - - /** - * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuditConfigDelta.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.action != null && Object.hasOwnProperty.call(message, "action")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); - if (message.service != null && Object.hasOwnProperty.call(message, "service")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.service); - if (message.exemptedMember != null && Object.hasOwnProperty.call(message, "exemptedMember")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.exemptedMember); - if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.logType); - return writer; - }; - - /** - * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuditConfigDelta.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AuditConfigDelta message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuditConfigDelta.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfigDelta(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.action = reader.int32(); - break; - } - case 2: { - message.service = reader.string(); - break; - } - case 3: { - message.exemptedMember = reader.string(); - break; - } - case 4: { - message.logType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuditConfigDelta.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AuditConfigDelta message. - * @function verify - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AuditConfigDelta.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.action != null && message.hasOwnProperty("action")) - switch (message.action) { - default: - return "action: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.service != null && message.hasOwnProperty("service")) - if (!$util.isString(message.service)) - return "service: string expected"; - if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) - if (!$util.isString(message.exemptedMember)) - return "exemptedMember: string expected"; - if (message.logType != null && message.hasOwnProperty("logType")) - if (!$util.isString(message.logType)) - return "logType: string expected"; - return null; - }; - - /** - * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta - */ - AuditConfigDelta.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.AuditConfigDelta) - return object; - var message = new $root.google.iam.v1.AuditConfigDelta(); - switch (object.action) { - default: - if (typeof object.action === "number") { - message.action = object.action; - break; - } - break; - case "ACTION_UNSPECIFIED": - case 0: - message.action = 0; - break; - case "ADD": - case 1: - message.action = 1; - break; - case "REMOVE": - case 2: - message.action = 2; - break; - } - if (object.service != null) - message.service = String(object.service); - if (object.exemptedMember != null) - message.exemptedMember = String(object.exemptedMember); - if (object.logType != null) - message.logType = String(object.logType); - return message; - }; - - /** - * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {google.iam.v1.AuditConfigDelta} message AuditConfigDelta - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AuditConfigDelta.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; - object.service = ""; - object.exemptedMember = ""; - object.logType = ""; - } - if (message.action != null && message.hasOwnProperty("action")) - object.action = options.enums === String ? $root.google.iam.v1.AuditConfigDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.AuditConfigDelta.Action[message.action] : message.action; - if (message.service != null && message.hasOwnProperty("service")) - object.service = message.service; - if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) - object.exemptedMember = message.exemptedMember; - if (message.logType != null && message.hasOwnProperty("logType")) - object.logType = message.logType; - return object; - }; - - /** - * Converts this AuditConfigDelta to JSON. - * @function toJSON - * @memberof google.iam.v1.AuditConfigDelta - * @instance - * @returns {Object.} JSON object - */ - AuditConfigDelta.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AuditConfigDelta - * @function getTypeUrl - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AuditConfigDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.AuditConfigDelta"; - }; - - /** - * Action enum. - * @name google.iam.v1.AuditConfigDelta.Action - * @enum {number} - * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value - * @property {number} ADD=1 ADD value - * @property {number} REMOVE=2 REMOVE value - */ - AuditConfigDelta.Action = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; - values[valuesById[1] = "ADD"] = 1; - values[valuesById[2] = "REMOVE"] = 2; - return values; - })(); - - return AuditConfigDelta; - })(); - - return v1; - })(); - - return iam; - })(); - - google.longrunning = (function() { - - /** - * Namespace longrunning. - * @memberof google - * @namespace - */ - var longrunning = {}; - - longrunning.Operations = (function() { - - /** - * Constructs a new Operations service. - * @memberof google.longrunning - * @classdesc Represents an Operations - * @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 Operations(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; - - /** - * Creates new Operations service using the specified rpc implementation. - * @function create - * @memberof google.longrunning.Operations - * @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 {Operations} RPC service. Useful where requests and/or responses are streamed. - */ - Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.longrunning.Operations|listOperations}. - * @memberof google.longrunning.Operations - * @typedef ListOperationsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse - */ - - /** - * Calls ListOperations. - * @function listOperations - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object - * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { - return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); - }, "name", { value: "ListOperations" }); - - /** - * Calls ListOperations. - * @function listOperations - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|getOperation}. - * @memberof google.longrunning.Operations - * @typedef GetOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls GetOperation. - * @function getOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object - * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { - return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "GetOperation" }); - - /** - * Calls GetOperation. - * @function getOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|deleteOperation}. - * @memberof google.longrunning.Operations - * @typedef DeleteOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteOperation. - * @function deleteOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object - * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { - return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteOperation" }); - - /** - * Calls DeleteOperation. - * @function deleteOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|cancelOperation}. - * @memberof google.longrunning.Operations - * @typedef CancelOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls CancelOperation. - * @function cancelOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object - * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { - return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "CancelOperation" }); - - /** - * Calls CancelOperation. - * @function cancelOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|waitOperation}. - * @memberof google.longrunning.Operations - * @typedef WaitOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls WaitOperation. - * @function waitOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object - * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { - return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "WaitOperation" }); - - /** - * Calls WaitOperation. - * @function waitOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Operations; - })(); - - longrunning.Operation = (function() { - - /** - * Properties of an Operation. - * @memberof google.longrunning - * @interface IOperation - * @property {string|null} [name] Operation name - * @property {google.protobuf.IAny|null} [metadata] Operation metadata - * @property {boolean|null} [done] Operation done - * @property {google.rpc.IStatus|null} [error] Operation error - * @property {google.protobuf.IAny|null} [response] Operation response - */ - - /** - * Constructs a new Operation. - * @memberof google.longrunning - * @classdesc Represents an Operation. - * @implements IOperation - * @constructor - * @param {google.longrunning.IOperation=} [properties] Properties to set - */ - function Operation(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]]; - } - - /** - * Operation name. - * @member {string} name - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.name = ""; - - /** - * Operation metadata. - * @member {google.protobuf.IAny|null|undefined} metadata - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.metadata = null; - - /** - * Operation done. - * @member {boolean} done - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.done = false; - - /** - * Operation error. - * @member {google.rpc.IStatus|null|undefined} error - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.error = null; - - /** - * Operation response. - * @member {google.protobuf.IAny|null|undefined} response - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.response = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Operation result. - * @member {"error"|"response"|undefined} result - * @memberof google.longrunning.Operation - * @instance - */ - Object.defineProperty(Operation.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["error", "response"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Operation instance using the specified properties. - * @function create - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.IOperation=} [properties] Properties to set - * @returns {google.longrunning.Operation} Operation instance - */ - Operation.create = function create(properties) { - return new Operation(properties); - }; - - /** - * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @function encode - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.IOperation} message Operation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Operation.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.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.done != null && Object.hasOwnProperty.call(message, "done")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); - if (message.error != null && Object.hasOwnProperty.call(message, "error")) - $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.response != null && Object.hasOwnProperty.call(message, "response")) - $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.IOperation} message Operation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Operation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Operation message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.Operation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.Operation} Operation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Operation.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - } - case 3: { - message.done = reader.bool(); - break; - } - case 4: { - message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - } - case 5: { - message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Operation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.Operation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.Operation} Operation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Operation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Operation message. - * @function verify - * @memberof google.longrunning.Operation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Operation.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.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.google.protobuf.Any.verify(message.metadata); - if (error) - return "metadata." + error; - } - if (message.done != null && message.hasOwnProperty("done")) - if (typeof message.done !== "boolean") - return "done: boolean expected"; - if (message.error != null && message.hasOwnProperty("error")) { - properties.result = 1; - { - var error = $root.google.rpc.Status.verify(message.error); - if (error) - return "error." + error; - } - } - if (message.response != null && message.hasOwnProperty("response")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.google.protobuf.Any.verify(message.response); - if (error) - return "response." + error; - } - } - return null; - }; - - /** - * Creates an Operation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.Operation - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.Operation} Operation - */ - Operation.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.Operation) - return object; - var message = new $root.google.longrunning.Operation(); - if (object.name != null) - message.name = String(object.name); - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".google.longrunning.Operation.metadata: object expected"); - message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); - } - if (object.done != null) - message.done = Boolean(object.done); - if (object.error != null) { - if (typeof object.error !== "object") - throw TypeError(".google.longrunning.Operation.error: object expected"); - message.error = $root.google.rpc.Status.fromObject(object.error); - } - if (object.response != null) { - if (typeof object.response !== "object") - throw TypeError(".google.longrunning.Operation.response: object expected"); - message.response = $root.google.protobuf.Any.fromObject(object.response); - } - return message; - }; - - /** - * Creates a plain object from an Operation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.Operation} message Operation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Operation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.metadata = null; - object.done = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); - if (message.done != null && message.hasOwnProperty("done")) - object.done = message.done; - if (message.error != null && message.hasOwnProperty("error")) { - object.error = $root.google.rpc.Status.toObject(message.error, options); - if (options.oneofs) - object.result = "error"; - } - if (message.response != null && message.hasOwnProperty("response")) { - object.response = $root.google.protobuf.Any.toObject(message.response, options); - if (options.oneofs) - object.result = "response"; - } - return object; - }; - - /** - * Converts this Operation to JSON. - * @function toJSON - * @memberof google.longrunning.Operation - * @instance - * @returns {Object.} JSON object - */ - Operation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Operation - * @function getTypeUrl - * @memberof google.longrunning.Operation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.Operation"; - }; - - return Operation; - })(); - - longrunning.GetOperationRequest = (function() { - - /** - * Properties of a GetOperationRequest. - * @memberof google.longrunning - * @interface IGetOperationRequest - * @property {string|null} [name] GetOperationRequest name - */ - - /** - * Constructs a new GetOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a GetOperationRequest. - * @implements IGetOperationRequest - * @constructor - * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set - */ - function GetOperationRequest(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]]; - } - - /** - * GetOperationRequest name. - * @member {string} name - * @memberof google.longrunning.GetOperationRequest - * @instance - */ - GetOperationRequest.prototype.name = ""; - - /** - * Creates a new GetOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance - */ - GetOperationRequest.create = function create(properties) { - return new GetOperationRequest(properties); - }; - - /** - * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetOperationRequest.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 GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetOperationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetOperationRequest message. - * @function verify - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetOperationRequest.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 GetOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest - */ - GetOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.GetOperationRequest) - return object; - var message = new $root.google.longrunning.GetOperationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.GetOperationRequest} message GetOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetOperationRequest.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 GetOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.GetOperationRequest - * @instance - * @returns {Object.} JSON object - */ - GetOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; - }; - - return GetOperationRequest; - })(); - - longrunning.ListOperationsRequest = (function() { - - /** - * Properties of a ListOperationsRequest. - * @memberof google.longrunning - * @interface IListOperationsRequest - * @property {string|null} [name] ListOperationsRequest name - * @property {string|null} [filter] ListOperationsRequest filter - * @property {number|null} [pageSize] ListOperationsRequest pageSize - * @property {string|null} [pageToken] ListOperationsRequest pageToken - */ - - /** - * Constructs a new ListOperationsRequest. - * @memberof google.longrunning - * @classdesc Represents a ListOperationsRequest. - * @implements IListOperationsRequest - * @constructor - * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set - */ - function ListOperationsRequest(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]]; - } - - /** - * ListOperationsRequest name. - * @member {string} name - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.name = ""; - - /** - * ListOperationsRequest filter. - * @member {string} filter - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.filter = ""; - - /** - * ListOperationsRequest pageSize. - * @member {number} pageSize - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.pageSize = 0; - - /** - * ListOperationsRequest pageToken. - * @member {string} pageToken - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListOperationsRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance - */ - ListOperationsRequest.create = function create(properties) { - return new ListOperationsRequest(properties); - }; - - /** - * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsRequest.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.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); - return writer; - }; - - /** - * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 4: { - message.name = reader.string(); - break; - } - case 1: { - message.filter = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListOperationsRequest message. - * @function verify - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListOperationsRequest.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.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"; - return null; - }; - - /** - * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest - */ - ListOperationsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.ListOperationsRequest) - return object; - var message = new $root.google.longrunning.ListOperationsRequest(); - if (object.name != null) - message.name = String(object.name); - 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); - return message; - }; - - /** - * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListOperationsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - object.name = ""; - } - 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.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this ListOperationsRequest to JSON. - * @function toJSON - * @memberof google.longrunning.ListOperationsRequest - * @instance - * @returns {Object.} JSON object - */ - ListOperationsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListOperationsRequest - * @function getTypeUrl - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; - }; - - return ListOperationsRequest; - })(); - - longrunning.ListOperationsResponse = (function() { - - /** - * Properties of a ListOperationsResponse. - * @memberof google.longrunning - * @interface IListOperationsResponse - * @property {Array.|null} [operations] ListOperationsResponse operations - * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken - */ - - /** - * Constructs a new ListOperationsResponse. - * @memberof google.longrunning - * @classdesc Represents a ListOperationsResponse. - * @implements IListOperationsResponse - * @constructor - * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set - */ - function ListOperationsResponse(properties) { - this.operations = []; - 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]]; - } - - /** - * ListOperationsResponse operations. - * @member {Array.} operations - * @memberof google.longrunning.ListOperationsResponse - * @instance - */ - ListOperationsResponse.prototype.operations = $util.emptyArray; - - /** - * ListOperationsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.longrunning.ListOperationsResponse - * @instance - */ - ListOperationsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListOperationsResponse instance using the specified properties. - * @function create - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance - */ - ListOperationsResponse.create = function create(properties) { - return new ListOperationsResponse(properties); - }; - - /** - * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @function encode - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.operations != null && message.operations.length) - for (var i = 0; i < message.operations.length; ++i) - $root.google.longrunning.Operation.encode(message.operations[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 ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.operations && message.operations.length)) - message.operations = []; - message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListOperationsResponse message. - * @function verify - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListOperationsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.operations != null && message.hasOwnProperty("operations")) { - if (!Array.isArray(message.operations)) - return "operations: array expected"; - for (var i = 0; i < message.operations.length; ++i) { - var error = $root.google.longrunning.Operation.verify(message.operations[i]); - if (error) - return "operations." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse - */ - ListOperationsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.ListOperationsResponse) - return object; - var message = new $root.google.longrunning.ListOperationsResponse(); - if (object.operations) { - if (!Array.isArray(object.operations)) - throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); - message.operations = []; - for (var i = 0; i < object.operations.length; ++i) { - if (typeof object.operations[i] !== "object") - throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); - message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListOperationsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.operations = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.operations && message.operations.length) { - object.operations = []; - for (var j = 0; j < message.operations.length; ++j) - object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListOperationsResponse to JSON. - * @function toJSON - * @memberof google.longrunning.ListOperationsResponse - * @instance - * @returns {Object.} JSON object - */ - ListOperationsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListOperationsResponse - * @function getTypeUrl - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; - }; - - return ListOperationsResponse; - })(); - - longrunning.CancelOperationRequest = (function() { - - /** - * Properties of a CancelOperationRequest. - * @memberof google.longrunning - * @interface ICancelOperationRequest - * @property {string|null} [name] CancelOperationRequest name - */ - - /** - * Constructs a new CancelOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a CancelOperationRequest. - * @implements ICancelOperationRequest - * @constructor - * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set - */ - function CancelOperationRequest(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]]; - } - - /** - * CancelOperationRequest name. - * @member {string} name - * @memberof google.longrunning.CancelOperationRequest - * @instance - */ - CancelOperationRequest.prototype.name = ""; - - /** - * Creates a new CancelOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance - */ - CancelOperationRequest.create = function create(properties) { - return new CancelOperationRequest(properties); - }; - - /** - * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CancelOperationRequest.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 CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CancelOperationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CancelOperationRequest message. - * @function verify - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CancelOperationRequest.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 CancelOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest - */ - CancelOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.CancelOperationRequest) - return object; - var message = new $root.google.longrunning.CancelOperationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CancelOperationRequest.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 CancelOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.CancelOperationRequest - * @instance - * @returns {Object.} JSON object - */ - CancelOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CancelOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; - }; - - return CancelOperationRequest; - })(); - - longrunning.DeleteOperationRequest = (function() { - - /** - * Properties of a DeleteOperationRequest. - * @memberof google.longrunning - * @interface IDeleteOperationRequest - * @property {string|null} [name] DeleteOperationRequest name - */ - - /** - * Constructs a new DeleteOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a DeleteOperationRequest. - * @implements IDeleteOperationRequest - * @constructor - * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set - */ - function DeleteOperationRequest(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]]; - } - - /** - * DeleteOperationRequest name. - * @member {string} name - * @memberof google.longrunning.DeleteOperationRequest - * @instance - */ - DeleteOperationRequest.prototype.name = ""; - - /** - * Creates a new DeleteOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance - */ - DeleteOperationRequest.create = function create(properties) { - return new DeleteOperationRequest(properties); - }; - - /** - * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteOperationRequest.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 DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteOperationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteOperationRequest message. - * @function verify - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteOperationRequest.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 DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest - */ - DeleteOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.DeleteOperationRequest) - return object; - var message = new $root.google.longrunning.DeleteOperationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteOperationRequest.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 DeleteOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.DeleteOperationRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; - }; - - return DeleteOperationRequest; - })(); - - longrunning.WaitOperationRequest = (function() { - - /** - * Properties of a WaitOperationRequest. - * @memberof google.longrunning - * @interface IWaitOperationRequest - * @property {string|null} [name] WaitOperationRequest name - * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout - */ - - /** - * Constructs a new WaitOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a WaitOperationRequest. - * @implements IWaitOperationRequest - * @constructor - * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set - */ - function WaitOperationRequest(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]]; - } - - /** - * WaitOperationRequest name. - * @member {string} name - * @memberof google.longrunning.WaitOperationRequest - * @instance - */ - WaitOperationRequest.prototype.name = ""; - - /** - * WaitOperationRequest timeout. - * @member {google.protobuf.IDuration|null|undefined} timeout - * @memberof google.longrunning.WaitOperationRequest - * @instance - */ - WaitOperationRequest.prototype.timeout = null; - - /** - * Creates a new WaitOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance - */ - WaitOperationRequest.create = function create(properties) { - return new WaitOperationRequest(properties); - }; - - /** - * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WaitOperationRequest.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.timeout != null && Object.hasOwnProperty.call(message, "timeout")) - $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WaitOperationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WaitOperationRequest message. - * @function verify - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WaitOperationRequest.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.timeout != null && message.hasOwnProperty("timeout")) { - var error = $root.google.protobuf.Duration.verify(message.timeout); - if (error) - return "timeout." + error; - } - return null; - }; - - /** - * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest - */ - WaitOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.WaitOperationRequest) - return object; - var message = new $root.google.longrunning.WaitOperationRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.timeout != null) { - if (typeof object.timeout !== "object") - throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); - message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); - } - return message; - }; - - /** - * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WaitOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.timeout = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.timeout != null && message.hasOwnProperty("timeout")) - object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); - return object; - }; - - /** - * Converts this WaitOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.WaitOperationRequest - * @instance - * @returns {Object.} JSON object - */ - WaitOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for WaitOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; - }; - - return WaitOperationRequest; - })(); - - longrunning.OperationInfo = (function() { - - /** - * Properties of an OperationInfo. - * @memberof google.longrunning - * @interface IOperationInfo - * @property {string|null} [responseType] OperationInfo responseType - * @property {string|null} [metadataType] OperationInfo metadataType - */ - - /** - * Constructs a new OperationInfo. - * @memberof google.longrunning - * @classdesc Represents an OperationInfo. - * @implements IOperationInfo - * @constructor - * @param {google.longrunning.IOperationInfo=} [properties] Properties to set - */ - function OperationInfo(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]]; - } - - /** - * OperationInfo responseType. - * @member {string} responseType - * @memberof google.longrunning.OperationInfo - * @instance - */ - OperationInfo.prototype.responseType = ""; - - /** - * OperationInfo metadataType. - * @member {string} metadataType - * @memberof google.longrunning.OperationInfo - * @instance - */ - OperationInfo.prototype.metadataType = ""; - - /** - * Creates a new OperationInfo instance using the specified properties. - * @function create - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.IOperationInfo=} [properties] Properties to set - * @returns {google.longrunning.OperationInfo} OperationInfo instance - */ - OperationInfo.create = function create(properties) { - return new OperationInfo(properties); - }; - - /** - * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @function encode - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); - if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); - return writer; - }; - - /** - * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OperationInfo message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.OperationInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.OperationInfo} OperationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.responseType = reader.string(); - break; - } - case 2: { - message.metadataType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OperationInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.OperationInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.OperationInfo} OperationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OperationInfo message. - * @function verify - * @memberof google.longrunning.OperationInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OperationInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.responseType != null && message.hasOwnProperty("responseType")) - if (!$util.isString(message.responseType)) - return "responseType: string expected"; - if (message.metadataType != null && message.hasOwnProperty("metadataType")) - if (!$util.isString(message.metadataType)) - return "metadataType: string expected"; - return null; - }; - - /** - * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.OperationInfo - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.OperationInfo} OperationInfo - */ - OperationInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.OperationInfo) - return object; - var message = new $root.google.longrunning.OperationInfo(); - if (object.responseType != null) - message.responseType = String(object.responseType); - if (object.metadataType != null) - message.metadataType = String(object.metadataType); - return message; - }; - - /** - * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.OperationInfo} message OperationInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OperationInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.responseType = ""; - object.metadataType = ""; - } - if (message.responseType != null && message.hasOwnProperty("responseType")) - object.responseType = message.responseType; - if (message.metadataType != null && message.hasOwnProperty("metadataType")) - object.metadataType = message.metadataType; - return object; - }; - - /** - * Converts this OperationInfo to JSON. - * @function toJSON - * @memberof google.longrunning.OperationInfo - * @instance - * @returns {Object.} JSON object - */ - OperationInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OperationInfo - * @function getTypeUrl - * @memberof google.longrunning.OperationInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.OperationInfo"; - }; - - return OperationInfo; - })(); - - return longrunning; - })(); - - return google; - })(); - - return $root; -}); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/protos/protos.json b/owl-bot-staging/google-cloud-contentwarehouse/protos/protos.json deleted file mode 100644 index 6e4d44cee1a..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/protos/protos.json +++ /dev/null @@ -1,7060 +0,0 @@ -{ - "nested": { - "google": { - "nested": { - "cloud": { - "nested": { - "contentwarehouse": { - "nested": { - "v1": { - "options": { - "csharp_namespace": "Google.Cloud.ContentWarehouse.V1", - "go_package": "cloud.google.com/go/contentwarehouse/apiv1/contentwarehousepb;contentwarehousepb", - "java_multiple_files": true, - "java_outer_classname": "SynonymSetServiceRequestProto", - "java_package": "com.google.cloud.contentwarehouse.v1", - "php_namespace": "Google\\Cloud\\ContentWarehouse\\V1", - "ruby_package": "Google::Cloud::ContentWarehouse::V1", - "(google.api.resource_definition).type": "cloudfunctions.googleapis.com/CloudFunction", - "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}/functions/{function}" - }, - "nested": { - "CreateDocumentMetadata": { - "fields": {} - }, - "UpdateDocumentMetadata": { - "fields": {} - }, - "RequestMetadata": { - "fields": { - "userInfo": { - "type": "UserInfo", - "id": 1 - } - } - }, - "ResponseMetadata": { - "fields": { - "requestId": { - "type": "string", - "id": 1 - } - } - }, - "UserInfo": { - "fields": { - "id": { - "type": "string", - "id": 1 - }, - "groupIds": { - "rule": "repeated", - "type": "string", - "id": 2 - } - } - }, - "UpdateOptions": { - "fields": { - "updateType": { - "type": "UpdateType", - "id": 1 - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2 - }, - "mergeFieldsOptions": { - "type": "MergeFieldsOptions", - "id": 3 - } - } - }, - "MergeFieldsOptions": { - "oneofs": { - "_replaceMessageFields": { - "oneof": [ - "replaceMessageFields" - ] - }, - "_replaceRepeatedFields": { - "oneof": [ - "replaceRepeatedFields" - ] - } - }, - "fields": { - "replaceMessageFields": { - "type": "bool", - "id": 1, - "options": { - "proto3_optional": true - } - }, - "replaceRepeatedFields": { - "type": "bool", - "id": 2, - "options": { - "proto3_optional": true - } - } - } - }, - "UpdateType": { - "values": { - "UPDATE_TYPE_UNSPECIFIED": 0, - "UPDATE_TYPE_REPLACE": 1, - "UPDATE_TYPE_MERGE": 2, - "UPDATE_TYPE_INSERT_PROPERTIES_BY_NAMES": 3, - "UPDATE_TYPE_REPLACE_PROPERTIES_BY_NAMES": 4, - "UPDATE_TYPE_DELETE_PROPERTIES_BY_NAMES": 5, - "UPDATE_TYPE_MERGE_AND_REPLACE_OR_INSERT_PROPERTIES_BY_NAMES": 6 - } - }, - "DatabaseType": { - "valuesOptions": { - "DB_CLOUD_SQL_POSTGRES": { - "deprecated": true - } - }, - "values": { - "DB_UNKNOWN": 0, - "DB_INFRA_SPANNER": 1, - "DB_CLOUD_SQL_POSTGRES": 2 - } - }, - "AccessControlMode": { - "values": { - "ACL_MODE_UNKNOWN": 0, - "ACL_MODE_UNIVERSAL_ACCESS": 1, - "ACL_MODE_DOCUMENT_LEVEL_ACCESS_CONTROL_BYOID": 2, - "ACL_MODE_DOCUMENT_LEVEL_ACCESS_CONTROL_GCI": 3 - } - }, - "DocumentCreatorDefaultRole": { - "values": { - "DOCUMENT_CREATOR_DEFAULT_ROLE_UNSPECIFIED": 0, - "DOCUMENT_ADMIN": 1, - "DOCUMENT_EDITOR": 2, - "DOCUMENT_VIEWER": 3 - } - }, - "Document": { - "options": { - "(google.api.resource).type": "contentwarehouse.googleapis.com/Document", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/documents/referenceId/{reference_id}" - }, - "oneofs": { - "structuredContent": { - "oneof": [ - "plainText", - "cloudAiDocument" - ] - }, - "rawDocument": { - "oneof": [ - "rawDocumentPath", - "inlineRawDocument" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "referenceId": { - "type": "string", - "id": 11 - }, - "displayName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "title": { - "type": "string", - "id": 18 - }, - "displayUri": { - "type": "string", - "id": 17 - }, - "documentSchemaName": { - "type": "string", - "id": 3, - "options": { - "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/DocumentSchema" - } - }, - "plainText": { - "type": "string", - "id": 15 - }, - "cloudAiDocument": { - "type": "google.cloud.documentai.v1.Document", - "id": 4 - }, - "structuredContentUri": { - "type": "string", - "id": 16, - "options": { - "deprecated": true - } - }, - "rawDocumentPath": { - "type": "string", - "id": 5 - }, - "inlineRawDocument": { - "type": "bytes", - "id": 6 - }, - "properties": { - "rule": "repeated", - "type": "Property", - "id": 7 - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "rawDocumentFileType": { - "type": "RawDocumentFileType", - "id": 10 - }, - "asyncEnabled": { - "type": "bool", - "id": 12, - "options": { - "deprecated": true - } - }, - "contentCategory": { - "type": "ContentCategory", - "id": 20 - }, - "textExtractionDisabled": { - "type": "bool", - "id": 19, - "options": { - "deprecated": true - } - }, - "textExtractionEnabled": { - "type": "bool", - "id": 21 - }, - "creator": { - "type": "string", - "id": 13 - }, - "updater": { - "type": "string", - "id": 14 - }, - "dispositionTime": { - "type": "google.protobuf.Timestamp", - "id": 22, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "legalHold": { - "type": "bool", - "id": 23, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "DocumentReference": { - "fields": { - "documentName": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/Document" - } - }, - "displayName": { - "type": "string", - "id": 2 - }, - "snippet": { - "type": "string", - "id": 3 - }, - "documentIsFolder": { - "type": "bool", - "id": 4 - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "deleteTime": { - "type": "google.protobuf.Timestamp", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "documentIsRetentionFolder": { - "type": "bool", - "id": 8 - }, - "documentIsLegalHoldFolder": { - "type": "bool", - "id": 9 - } - } - }, - "Property": { - "oneofs": { - "values": { - "oneof": [ - "integerValues", - "floatValues", - "textValues", - "enumValues", - "propertyValues", - "dateTimeValues", - "mapProperty", - "timestampValues" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "integerValues": { - "type": "IntegerArray", - "id": 2 - }, - "floatValues": { - "type": "FloatArray", - "id": 3 - }, - "textValues": { - "type": "TextArray", - "id": 4 - }, - "enumValues": { - "type": "EnumArray", - "id": 5 - }, - "propertyValues": { - "type": "PropertyArray", - "id": 6 - }, - "dateTimeValues": { - "type": "DateTimeArray", - "id": 7 - }, - "mapProperty": { - "type": "MapProperty", - "id": 8 - }, - "timestampValues": { - "type": "TimestampArray", - "id": 9 - } - } - }, - "IntegerArray": { - "fields": { - "values": { - "rule": "repeated", - "type": "int32", - "id": 1 - } - } - }, - "FloatArray": { - "fields": { - "values": { - "rule": "repeated", - "type": "float", - "id": 1 - } - } - }, - "TextArray": { - "fields": { - "values": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - }, - "EnumArray": { - "fields": { - "values": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - }, - "DateTimeArray": { - "fields": { - "values": { - "rule": "repeated", - "type": "google.type.DateTime", - "id": 1 - } - } - }, - "TimestampArray": { - "fields": { - "values": { - "rule": "repeated", - "type": "TimestampValue", - "id": 1 - } - } - }, - "TimestampValue": { - "oneofs": { - "value": { - "oneof": [ - "timestampValue", - "textValue" - ] - } - }, - "fields": { - "timestampValue": { - "type": "google.protobuf.Timestamp", - "id": 1 - }, - "textValue": { - "type": "string", - "id": 2 - } - } - }, - "PropertyArray": { - "fields": { - "properties": { - "rule": "repeated", - "type": "Property", - "id": 1 - } - } - }, - "MapProperty": { - "fields": { - "fields": { - "keyType": "string", - "type": "Value", - "id": 1 - } - } - }, - "Value": { - "oneofs": { - "kind": { - "oneof": [ - "floatValue", - "intValue", - "stringValue", - "enumValue", - "datetimeValue", - "timestampValue", - "booleanValue" - ] - } - }, - "fields": { - "floatValue": { - "type": "float", - "id": 1 - }, - "intValue": { - "type": "int32", - "id": 2 - }, - "stringValue": { - "type": "string", - "id": 3 - }, - "enumValue": { - "type": "EnumValue", - "id": 4 - }, - "datetimeValue": { - "type": "google.type.DateTime", - "id": 5 - }, - "timestampValue": { - "type": "TimestampValue", - "id": 6 - }, - "booleanValue": { - "type": "bool", - "id": 7 - } - } - }, - "EnumValue": { - "fields": { - "value": { - "type": "string", - "id": 1 - } - } - }, - "RawDocumentFileType": { - "values": { - "RAW_DOCUMENT_FILE_TYPE_UNSPECIFIED": 0, - "RAW_DOCUMENT_FILE_TYPE_PDF": 1, - "RAW_DOCUMENT_FILE_TYPE_DOCX": 2, - "RAW_DOCUMENT_FILE_TYPE_XLSX": 3, - "RAW_DOCUMENT_FILE_TYPE_PPTX": 4, - "RAW_DOCUMENT_FILE_TYPE_TEXT": 5, - "RAW_DOCUMENT_FILE_TYPE_TIFF": 6 - } - }, - "ContentCategory": { - "values": { - "CONTENT_CATEGORY_UNSPECIFIED": 0, - "CONTENT_CATEGORY_IMAGE": 1, - "CONTENT_CATEGORY_AUDIO": 2, - "CONTENT_CATEGORY_VIDEO": 3 - } - }, - "DocumentLinkService": { - "options": { - "(google.api.default_host)": "contentwarehouse.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "ListLinkedTargets": { - "requestType": "ListLinkedTargetsRequest", - "responseType": "ListLinkedTargetsResponse", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*/documents/*}/linkedTargets", - "(google.api.http).body": "*", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*/documents/*}/linkedTargets", - "body": "*" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "ListLinkedSources": { - "requestType": "ListLinkedSourcesRequest", - "responseType": "ListLinkedSourcesResponse", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*/documents/*}/linkedSources", - "(google.api.http).body": "*", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*/documents/*}/linkedSources", - "body": "*" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "CreateDocumentLink": { - "requestType": "CreateDocumentLinkRequest", - "responseType": "DocumentLink", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*/documents/*}/documentLinks", - "(google.api.http).body": "*", - "(google.api.method_signature)": "parent,document_link" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*/documents/*}/documentLinks", - "body": "*" - } - }, - { - "(google.api.method_signature)": "parent,document_link" - } - ] - }, - "DeleteDocumentLink": { - "requestType": "DeleteDocumentLinkRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).post": "/v1/{name=projects/*/locations/*/documents/*/documentLinks/*}:delete", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=projects/*/locations/*/documents/*/documentLinks/*}:delete", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - } - } - }, - "ListLinkedTargetsResponse": { - "fields": { - "documentLinks": { - "rule": "repeated", - "type": "DocumentLink", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "ListLinkedTargetsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/Document" - } - }, - "requestMetadata": { - "type": "RequestMetadata", - "id": 2 - } - } - }, - "ListLinkedSourcesResponse": { - "fields": { - "documentLinks": { - "rule": "repeated", - "type": "DocumentLink", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "ListLinkedSourcesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/Document" - } - }, - "pageSize": { - "type": "int32", - "id": 3 - }, - "pageToken": { - "type": "string", - "id": 4 - }, - "requestMetadata": { - "type": "RequestMetadata", - "id": 2 - } - } - }, - "DocumentLink": { - "options": { - "(google.api.resource).type": "contentwarehouse.googleapis.com/DocumentLink", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/documents/{document}/documentLinks/{document_link}" - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "sourceDocumentReference": { - "type": "DocumentReference", - "id": 2 - }, - "targetDocumentReference": { - "type": "DocumentReference", - "id": 3 - }, - "description": { - "type": "string", - "id": 4 - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "state": { - "type": "State", - "id": 7 - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "ACTIVE": 1, - "SOFT_DELETED": 2 - } - } - } - }, - "CreateDocumentLinkRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/Document" - } - }, - "documentLink": { - "type": "DocumentLink", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestMetadata": { - "type": "RequestMetadata", - "id": 3 - } - } - }, - "DeleteDocumentLinkRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/DocumentLink" - } - }, - "requestMetadata": { - "type": "RequestMetadata", - "id": 2 - } - } - }, - "DocumentSchema": { - "options": { - "(google.api.resource).type": "contentwarehouse.googleapis.com/DocumentSchema", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/documentSchemas/{document_schema}" - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "displayName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "propertyDefinitions": { - "rule": "repeated", - "type": "PropertyDefinition", - "id": 3 - }, - "documentIsFolder": { - "type": "bool", - "id": 4 - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "description": { - "type": "string", - "id": 7 - } - } - }, - "PropertyDefinition": { - "oneofs": { - "valueTypeOptions": { - "oneof": [ - "integerTypeOptions", - "floatTypeOptions", - "textTypeOptions", - "propertyTypeOptions", - "enumTypeOptions", - "dateTimeTypeOptions", - "mapTypeOptions", - "timestampTypeOptions" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "displayName": { - "type": "string", - "id": 12 - }, - "isRepeatable": { - "type": "bool", - "id": 2 - }, - "isFilterable": { - "type": "bool", - "id": 3 - }, - "isSearchable": { - "type": "bool", - "id": 4 - }, - "isMetadata": { - "type": "bool", - "id": 5 - }, - "isRequired": { - "type": "bool", - "id": 14 - }, - "retrievalImportance": { - "type": "RetrievalImportance", - "id": 18 - }, - "integerTypeOptions": { - "type": "IntegerTypeOptions", - "id": 7 - }, - "floatTypeOptions": { - "type": "FloatTypeOptions", - "id": 8 - }, - "textTypeOptions": { - "type": "TextTypeOptions", - "id": 9 - }, - "propertyTypeOptions": { - "type": "PropertyTypeOptions", - "id": 10 - }, - "enumTypeOptions": { - "type": "EnumTypeOptions", - "id": 11 - }, - "dateTimeTypeOptions": { - "type": "DateTimeTypeOptions", - "id": 13 - }, - "mapTypeOptions": { - "type": "MapTypeOptions", - "id": 15 - }, - "timestampTypeOptions": { - "type": "TimestampTypeOptions", - "id": 16 - }, - "schemaSources": { - "rule": "repeated", - "type": "SchemaSource", - "id": 19 - } - }, - "nested": { - "RetrievalImportance": { - "values": { - "RETRIEVAL_IMPORTANCE_UNSPECIFIED": 0, - "HIGHEST": 1, - "HIGHER": 2, - "HIGH": 3, - "MEDIUM": 4, - "LOW": 5, - "LOWEST": 6 - } - }, - "SchemaSource": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "processorType": { - "type": "string", - "id": 2 - } - } - } - } - }, - "IntegerTypeOptions": { - "fields": {} - }, - "FloatTypeOptions": { - "fields": {} - }, - "TextTypeOptions": { - "fields": {} - }, - "DateTimeTypeOptions": { - "fields": {} - }, - "MapTypeOptions": { - "fields": {} - }, - "TimestampTypeOptions": { - "fields": {} - }, - "PropertyTypeOptions": { - "fields": { - "propertyDefinitions": { - "rule": "repeated", - "type": "PropertyDefinition", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "EnumTypeOptions": { - "fields": { - "possibleValues": { - "rule": "repeated", - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "validationCheckDisabled": { - "type": "bool", - "id": 2 - } - } - }, - "DocumentSchemaService": { - "options": { - "(google.api.default_host)": "contentwarehouse.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "CreateDocumentSchema": { - "requestType": "CreateDocumentSchemaRequest", - "responseType": "DocumentSchema", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/documentSchemas", - "(google.api.http).body": "document_schema", - "(google.api.method_signature)": "parent,document_schema" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*}/documentSchemas", - "body": "document_schema" - } - }, - { - "(google.api.method_signature)": "parent,document_schema" - } - ] - }, - "UpdateDocumentSchema": { - "requestType": "UpdateDocumentSchemaRequest", - "responseType": "DocumentSchema", - "options": { - "(google.api.http).patch": "/v1/{name=projects/*/locations/*/documentSchemas/*}", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name,document_schema" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{name=projects/*/locations/*/documentSchemas/*}", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name,document_schema" - } - ] - }, - "GetDocumentSchema": { - "requestType": "GetDocumentSchemaRequest", - "responseType": "DocumentSchema", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/documentSchemas/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/documentSchemas/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "DeleteDocumentSchema": { - "requestType": "DeleteDocumentSchemaRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/locations/*/documentSchemas/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/locations/*/documentSchemas/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListDocumentSchemas": { - "requestType": "ListDocumentSchemasRequest", - "responseType": "ListDocumentSchemasResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/documentSchemas", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*}/documentSchemas" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - } - } - }, - "CreateDocumentSchemaRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/Location" - } - }, - "documentSchema": { - "type": "DocumentSchema", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "GetDocumentSchemaRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/DocumentSchema" - } - } - } - }, - "UpdateDocumentSchemaRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/DocumentSchema" - } - }, - "documentSchema": { - "type": "DocumentSchema", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "DeleteDocumentSchemaRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/DocumentSchema" - } - } - } - }, - "ListDocumentSchemasRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/Location" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } - }, - "ListDocumentSchemasResponse": { - "fields": { - "documentSchemas": { - "rule": "repeated", - "type": "DocumentSchema", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "DocumentService": { - "options": { - "(google.api.default_host)": "contentwarehouse.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "CreateDocument": { - "requestType": "CreateDocumentRequest", - "responseType": "CreateDocumentResponse", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/documents", - "(google.api.http).body": "*", - "(google.api.method_signature)": "parent,document" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*}/documents", - "body": "*" - } - }, - { - "(google.api.method_signature)": "parent,document" - } - ] - }, - "GetDocument": { - "requestType": "GetDocumentRequest", - "responseType": "Document", - "options": { - "(google.api.http).post": "/v1/{name=projects/*/locations/*/documents/*}:get", - "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v1/{name=projects/*/locations/*/documents/referenceId/*}:get", - "(google.api.http).additional_bindings.body": "*", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=projects/*/locations/*/documents/*}:get", - "body": "*", - "additional_bindings": { - "post": "/v1/{name=projects/*/locations/*/documents/referenceId/*}:get", - "body": "*" - } - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "UpdateDocument": { - "requestType": "UpdateDocumentRequest", - "responseType": "UpdateDocumentResponse", - "options": { - "(google.api.http).patch": "/v1/{name=projects/*/locations/*/documents/*}", - "(google.api.http).body": "*", - "(google.api.http).additional_bindings.patch": "/v1/{name=projects/*/locations/*/documents/referenceId/*}", - "(google.api.http).additional_bindings.body": "*", - "(google.api.method_signature)": "name,document" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{name=projects/*/locations/*/documents/*}", - "body": "*", - "additional_bindings": { - "patch": "/v1/{name=projects/*/locations/*/documents/referenceId/*}", - "body": "*" - } - } - }, - { - "(google.api.method_signature)": "name,document" - } - ] - }, - "DeleteDocument": { - "requestType": "DeleteDocumentRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).post": "/v1/{name=projects/*/locations/*/documents/*}:delete", - "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v1/{name=projects/*/locations/*/documents/referenceId/*}:delete", - "(google.api.http).additional_bindings.body": "*", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=projects/*/locations/*/documents/*}:delete", - "body": "*", - "additional_bindings": { - "post": "/v1/{name=projects/*/locations/*/documents/referenceId/*}:delete", - "body": "*" - } - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "SearchDocuments": { - "requestType": "SearchDocumentsRequest", - "responseType": "SearchDocumentsResponse", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/documents:search", - "(google.api.http).body": "*", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*}/documents:search", - "body": "*" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "LockDocument": { - "requestType": "LockDocumentRequest", - "responseType": "Document", - "options": { - "(google.api.http).post": "/v1/{name=projects/*/locations/*/documents/*}:lock", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=projects/*/locations/*/documents/*}:lock", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "FetchAcl": { - "requestType": "FetchAclRequest", - "responseType": "FetchAclResponse", - "options": { - "(google.api.http).post": "/v1/{resource=projects/*/locations/*/documents/*}:fetchAcl", - "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v1/{resource=projects/*}:fetchAcl", - "(google.api.http).additional_bindings.body": "*", - "(google.api.method_signature)": "resource" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{resource=projects/*/locations/*/documents/*}:fetchAcl", - "body": "*", - "additional_bindings": { - "post": "/v1/{resource=projects/*}:fetchAcl", - "body": "*" - } - } - }, - { - "(google.api.method_signature)": "resource" - } - ] - }, - "SetAcl": { - "requestType": "SetAclRequest", - "responseType": "SetAclResponse", - "options": { - "(google.api.http).post": "/v1/{resource=projects/*/locations/*/documents/*}:setAcl", - "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v1/{resource=projects/*}:setAcl", - "(google.api.http).additional_bindings.body": "*", - "(google.api.method_signature)": "resource,policy" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{resource=projects/*/locations/*/documents/*}:setAcl", - "body": "*", - "additional_bindings": { - "post": "/v1/{resource=projects/*}:setAcl", - "body": "*" - } - } - }, - { - "(google.api.method_signature)": "resource,policy" - } - ] - } - } - }, - "CreateDocumentResponse": { - "fields": { - "document": { - "type": "Document", - "id": 1 - }, - "ruleEngineOutput": { - "type": "RuleEngineOutput", - "id": 2 - }, - "metadata": { - "type": "ResponseMetadata", - "id": 3 - }, - "longRunningOperations": { - "rule": "repeated", - "type": "google.longrunning.Operation", - "id": 4 - } - } - }, - "UpdateDocumentResponse": { - "fields": { - "document": { - "type": "Document", - "id": 1 - }, - "ruleEngineOutput": { - "type": "RuleEngineOutput", - "id": 2 - }, - "metadata": { - "type": "ResponseMetadata", - "id": 3 - } - } - }, - "QAResult": { - "fields": { - "highlights": { - "rule": "repeated", - "type": "Highlight", - "id": 1 - }, - "confidenceScore": { - "type": "float", - "id": 2 - } - }, - "nested": { - "Highlight": { - "fields": { - "startIndex": { - "type": "int32", - "id": 1 - }, - "endIndex": { - "type": "int32", - "id": 2 - } - } - } - } - }, - "SearchDocumentsResponse": { - "fields": { - "matchingDocuments": { - "rule": "repeated", - "type": "MatchingDocument", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "totalSize": { - "type": "int32", - "id": 3 - }, - "metadata": { - "type": "ResponseMetadata", - "id": 4 - }, - "histogramQueryResults": { - "rule": "repeated", - "type": "HistogramQueryResult", - "id": 6 - }, - "questionAnswer": { - "type": "string", - "id": 7 - } - }, - "nested": { - "MatchingDocument": { - "fields": { - "document": { - "type": "Document", - "id": 1 - }, - "searchTextSnippet": { - "type": "string", - "id": 2 - }, - "qaResult": { - "type": "QAResult", - "id": 3 - }, - "matchedTokenPageIndices": { - "rule": "repeated", - "type": "int64", - "id": 4 - } - } - } - } - }, - "FetchAclResponse": { - "fields": { - "policy": { - "type": "google.iam.v1.Policy", - "id": 1 - }, - "metadata": { - "type": "ResponseMetadata", - "id": 2 - } - } - }, - "SetAclResponse": { - "fields": { - "policy": { - "type": "google.iam.v1.Policy", - "id": 1 - }, - "metadata": { - "type": "ResponseMetadata", - "id": 2 - } - } - }, - "CloudAIDocumentOption": { - "fields": { - "enableEntitiesConversions": { - "type": "bool", - "id": 1 - }, - "customizedEntitiesPropertiesConversions": { - "keyType": "string", - "type": "string", - "id": 2 - } - } - }, - "CreateDocumentRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/Location" - } - }, - "document": { - "type": "Document", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestMetadata": { - "type": "RequestMetadata", - "id": 3 - }, - "policy": { - "type": "google.iam.v1.Policy", - "id": 4 - }, - "cloudAiDocumentOption": { - "type": "CloudAIDocumentOption", - "id": 5 - }, - "createMask": { - "type": "google.protobuf.FieldMask", - "id": 6 - } - } - }, - "GetDocumentRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/Document" - } - }, - "requestMetadata": { - "type": "RequestMetadata", - "id": 2 - } - } - }, - "UpdateDocumentRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/Document" - } - }, - "document": { - "type": "Document", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestMetadata": { - "type": "RequestMetadata", - "id": 3 - }, - "cloudAiDocumentOption": { - "type": "CloudAIDocumentOption", - "id": 5 - }, - "updateOptions": { - "type": "UpdateOptions", - "id": 6 - } - } - }, - "DeleteDocumentRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/Document" - } - }, - "requestMetadata": { - "type": "RequestMetadata", - "id": 2 - } - } - }, - "SearchDocumentsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/Location" - } - }, - "requestMetadata": { - "type": "RequestMetadata", - "id": 3 - }, - "documentQuery": { - "type": "DocumentQuery", - "id": 4 - }, - "offset": { - "type": "int32", - "id": 5 - }, - "pageSize": { - "type": "int32", - "id": 6 - }, - "pageToken": { - "type": "string", - "id": 7 - }, - "orderBy": { - "type": "string", - "id": 8 - }, - "histogramQueries": { - "rule": "repeated", - "type": "HistogramQuery", - "id": 9 - }, - "requireTotalSize": { - "type": "bool", - "id": 10 - }, - "totalResultSize": { - "type": "TotalResultSize", - "id": 12 - }, - "qaSizeLimit": { - "type": "int32", - "id": 11 - } - }, - "nested": { - "TotalResultSize": { - "values": { - "TOTAL_RESULT_SIZE_UNSPECIFIED": 0, - "ESTIMATED_SIZE": 1, - "ACTUAL_SIZE": 2 - } - } - } - }, - "LockDocumentRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/Document" - } - }, - "collectionId": { - "type": "string", - "id": 2 - }, - "lockingUser": { - "type": "UserInfo", - "id": 3 - } - } - }, - "FetchAclRequest": { - "fields": { - "resource": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestMetadata": { - "type": "RequestMetadata", - "id": 2 - }, - "projectOwner": { - "type": "bool", - "id": 3 - } - } - }, - "SetAclRequest": { - "fields": { - "resource": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "policy": { - "type": "google.iam.v1.Policy", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestMetadata": { - "type": "RequestMetadata", - "id": 3 - }, - "projectOwner": { - "type": "bool", - "id": 4 - } - } - }, - "DocumentQuery": { - "fields": { - "query": { - "type": "string", - "id": 1 - }, - "isNlQuery": { - "type": "bool", - "id": 12 - }, - "customPropertyFilter": { - "type": "string", - "id": 4, - "options": { - "deprecated": true - } - }, - "timeFilters": { - "rule": "repeated", - "type": "TimeFilter", - "id": 5 - }, - "documentSchemaNames": { - "rule": "repeated", - "type": "string", - "id": 6 - }, - "propertyFilter": { - "rule": "repeated", - "type": "PropertyFilter", - "id": 7 - }, - "fileTypeFilter": { - "type": "FileTypeFilter", - "id": 8 - }, - "folderNameFilter": { - "type": "string", - "id": 9 - }, - "documentNameFilter": { - "rule": "repeated", - "type": "string", - "id": 14 - }, - "queryContext": { - "rule": "repeated", - "type": "string", - "id": 10 - }, - "documentCreatorFilter": { - "rule": "repeated", - "type": "string", - "id": 11 - }, - "customWeightsMetadata": { - "type": "CustomWeightsMetadata", - "id": 13 - } - } - }, - "TimeFilter": { - "fields": { - "timeRange": { - "type": "google.type.Interval", - "id": 1 - }, - "timeField": { - "type": "TimeField", - "id": 2 - } - }, - "nested": { - "TimeField": { - "values": { - "TIME_FIELD_UNSPECIFIED": 0, - "CREATE_TIME": 1, - "UPDATE_TIME": 2, - "DISPOSITION_TIME": 3 - } - } - } - }, - "PropertyFilter": { - "fields": { - "documentSchemaName": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/DocumentSchema" - } - }, - "condition": { - "type": "string", - "id": 2 - } - } - }, - "FileTypeFilter": { - "fields": { - "fileType": { - "type": "FileType", - "id": 1 - } - }, - "nested": { - "FileType": { - "values": { - "FILE_TYPE_UNSPECIFIED": 0, - "ALL": 1, - "FOLDER": 2, - "DOCUMENT": 3, - "ROOT_FOLDER": 4 - } - } - } - }, - "CustomWeightsMetadata": { - "fields": { - "weightedSchemaProperties": { - "rule": "repeated", - "type": "WeightedSchemaProperty", - "id": 1 - } - } - }, - "WeightedSchemaProperty": { - "fields": { - "documentSchemaName": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/DocumentSchema" - } - }, - "propertyNames": { - "rule": "repeated", - "type": "string", - "id": 2 - } - } - }, - "HistogramQuery": { - "fields": { - "histogramQuery": { - "type": "string", - "id": 1 - }, - "requirePreciseResultSize": { - "type": "bool", - "id": 2 - }, - "filters": { - "type": "HistogramQueryPropertyNameFilter", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "HistogramQueryPropertyNameFilter": { - "fields": { - "documentSchemas": { - "rule": "repeated", - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/DocumentSchema" - } - }, - "propertyNames": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "yAxis": { - "type": "HistogramYAxis", - "id": 3 - } - }, - "nested": { - "HistogramYAxis": { - "values": { - "HISTOGRAM_YAXIS_DOCUMENT": 0, - "HISTOGRAM_YAXIS_PROPERTY": 1 - } - } - } - }, - "HistogramQueryResult": { - "fields": { - "histogramQuery": { - "type": "string", - "id": 1 - }, - "histogram": { - "keyType": "string", - "type": "int64", - "id": 2 - } - } - }, - "RuleSet": { - "options": { - "(google.api.resource).type": "contentwarehouse.googleapis.com/RuleSet", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/ruleSets/{rule_set}" - }, - "fields": { - "name": { - "type": "string", - "id": 6 - }, - "description": { - "type": "string", - "id": 1 - }, - "source": { - "type": "string", - "id": 2 - }, - "rules": { - "rule": "repeated", - "type": "Rule", - "id": 3 - } - } - }, - "Rule": { - "fields": { - "description": { - "type": "string", - "id": 1 - }, - "ruleId": { - "type": "string", - "id": 2 - }, - "triggerType": { - "type": "TriggerType", - "id": 3 - }, - "condition": { - "type": "string", - "id": 4 - }, - "actions": { - "rule": "repeated", - "type": "Action", - "id": 5 - } - }, - "nested": { - "TriggerType": { - "values": { - "UNKNOWN": 0, - "ON_CREATE": 1, - "ON_UPDATE": 4, - "ON_CREATE_LINK": 7, - "ON_DELETE_LINK": 8 - } - } - } - }, - "Action": { - "oneofs": { - "action": { - "oneof": [ - "accessControl", - "dataValidation", - "dataUpdate", - "addToFolder", - "publishToPubSub", - "removeFromFolderAction", - "deleteDocumentAction" - ] - } - }, - "fields": { - "actionId": { - "type": "string", - "id": 1 - }, - "accessControl": { - "type": "AccessControlAction", - "id": 2 - }, - "dataValidation": { - "type": "DataValidationAction", - "id": 3 - }, - "dataUpdate": { - "type": "DataUpdateAction", - "id": 4 - }, - "addToFolder": { - "type": "AddToFolderAction", - "id": 5 - }, - "publishToPubSub": { - "type": "PublishAction", - "id": 6 - }, - "removeFromFolderAction": { - "type": "RemoveFromFolderAction", - "id": 9 - }, - "deleteDocumentAction": { - "type": "DeleteDocumentAction", - "id": 10 - } - } - }, - "AccessControlAction": { - "fields": { - "operationType": { - "type": "OperationType", - "id": 1 - }, - "policy": { - "type": "google.iam.v1.Policy", - "id": 2 - } - }, - "nested": { - "OperationType": { - "values": { - "UNKNOWN": 0, - "ADD_POLICY_BINDING": 1, - "REMOVE_POLICY_BINDING": 2, - "REPLACE_POLICY_BINDING": 3 - } - } - } - }, - "DataValidationAction": { - "fields": { - "conditions": { - "keyType": "string", - "type": "string", - "id": 1 - } - } - }, - "DataUpdateAction": { - "fields": { - "entries": { - "keyType": "string", - "type": "string", - "id": 1 - } - } - }, - "AddToFolderAction": { - "fields": { - "folders": { - "rule": "repeated", - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/Document" - } - } - } - }, - "RemoveFromFolderAction": { - "fields": { - "condition": { - "type": "string", - "id": 1 - }, - "folder": { - "type": "string", - "id": 2, - "options": { - "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/Document" - } - } - } - }, - "PublishAction": { - "fields": { - "topicId": { - "type": "string", - "id": 1 - }, - "messages": { - "rule": "repeated", - "type": "string", - "id": 2 - } - } - }, - "DeleteDocumentAction": { - "fields": { - "enableHardDelete": { - "type": "bool", - "id": 1 - } - } - }, - "RuleEngineOutput": { - "fields": { - "documentName": { - "type": "string", - "id": 3 - }, - "ruleEvaluatorOutput": { - "type": "RuleEvaluatorOutput", - "id": 1 - }, - "actionExecutorOutput": { - "type": "ActionExecutorOutput", - "id": 2 - } - } - }, - "RuleEvaluatorOutput": { - "fields": { - "triggeredRules": { - "rule": "repeated", - "type": "Rule", - "id": 1 - }, - "matchedRules": { - "rule": "repeated", - "type": "Rule", - "id": 2 - }, - "invalidRules": { - "rule": "repeated", - "type": "InvalidRule", - "id": 3 - } - } - }, - "InvalidRule": { - "fields": { - "rule": { - "type": "Rule", - "id": 1 - }, - "error": { - "type": "string", - "id": 2 - } - } - }, - "ActionExecutorOutput": { - "fields": { - "ruleActionsPairs": { - "rule": "repeated", - "type": "RuleActionsPair", - "id": 1 - } - } - }, - "RuleActionsPair": { - "fields": { - "rule": { - "type": "Rule", - "id": 1 - }, - "actionOutputs": { - "rule": "repeated", - "type": "ActionOutput", - "id": 2 - } - } - }, - "ActionOutput": { - "fields": { - "actionId": { - "type": "string", - "id": 1 - }, - "actionState": { - "type": "State", - "id": 2 - }, - "outputMessage": { - "type": "string", - "id": 3 - } - }, - "nested": { - "State": { - "values": { - "UNKNOWN": 0, - "ACTION_SUCCEEDED": 1, - "ACTION_FAILED": 2, - "ACTION_TIMED_OUT": 3, - "ACTION_PENDING": 4 - } - } - } - }, - "PipelineService": { - "options": { - "(google.api.default_host)": "contentwarehouse.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "RunPipeline": { - "requestType": "RunPipelineRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{name=projects/*/locations/*}:runPipeline", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "RunPipelineResponse", - "(google.longrunning.operation_info).metadata_type": "RunPipelineMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=projects/*/locations/*}:runPipeline", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "RunPipelineResponse", - "metadata_type": "RunPipelineMetadata" - } - } - ] - } - } - }, - "RunPipelineRequest": { - "oneofs": { - "pipeline": { - "oneof": [ - "gcsIngestPipeline", - "gcsIngestWithDocAiProcessorsPipeline", - "exportCdwPipeline", - "processWithDocAiPipeline" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/Location" - } - }, - "gcsIngestPipeline": { - "type": "GcsIngestPipeline", - "id": 2 - }, - "gcsIngestWithDocAiProcessorsPipeline": { - "type": "GcsIngestWithDocAiProcessorsPipeline", - "id": 3 - }, - "exportCdwPipeline": { - "type": "ExportToCdwPipeline", - "id": 4 - }, - "processWithDocAiPipeline": { - "type": "ProcessWithDocAiPipeline", - "id": 5 - }, - "requestMetadata": { - "type": "RequestMetadata", - "id": 6 - } - } - }, - "RunPipelineResponse": { - "fields": {} - }, - "RunPipelineMetadata": { - "oneofs": { - "pipelineMetadata": { - "oneof": [ - "gcsIngestPipelineMetadata", - "exportToCdwPipelineMetadata", - "processWithDocAiPipelineMetadata" - ] - } - }, - "fields": { - "totalFileCount": { - "type": "int32", - "id": 1 - }, - "failedFileCount": { - "type": "int32", - "id": 2 - }, - "userInfo": { - "type": "UserInfo", - "id": 3 - }, - "gcsIngestPipelineMetadata": { - "type": "GcsIngestPipelineMetadata", - "id": 4 - }, - "exportToCdwPipelineMetadata": { - "type": "ExportToCdwPipelineMetadata", - "id": 6 - }, - "processWithDocAiPipelineMetadata": { - "type": "ProcessWithDocAiPipelineMetadata", - "id": 7 - }, - "individualDocumentStatuses": { - "rule": "repeated", - "type": "IndividualDocumentStatus", - "id": 5 - } - }, - "nested": { - "GcsIngestPipelineMetadata": { - "fields": { - "inputPath": { - "type": "string", - "id": 1 - } - } - }, - "ExportToCdwPipelineMetadata": { - "fields": { - "documents": { - "rule": "repeated", - "type": "string", - "id": 1 - }, - "docAiDataset": { - "type": "string", - "id": 2 - }, - "outputPath": { - "type": "string", - "id": 3 - } - } - }, - "ProcessWithDocAiPipelineMetadata": { - "fields": { - "documents": { - "rule": "repeated", - "type": "string", - "id": 1 - }, - "processorInfo": { - "type": "ProcessorInfo", - "id": 2 - } - } - }, - "IndividualDocumentStatus": { - "fields": { - "documentId": { - "type": "string", - "id": 1 - }, - "status": { - "type": "google.rpc.Status", - "id": 2 - } - } - } - } - }, - "ProcessorInfo": { - "fields": { - "processorName": { - "type": "string", - "id": 1 - }, - "documentType": { - "type": "string", - "id": 2 - }, - "schemaName": { - "type": "string", - "id": 3 - } - } - }, - "IngestPipelineConfig": { - "fields": { - "documentAclPolicy": { - "type": "google.iam.v1.Policy", - "id": 1 - }, - "enableDocumentTextExtraction": { - "type": "bool", - "id": 2 - }, - "folder": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "cloudFunction": { - "type": "string", - "id": 4, - "options": { - "(google.api.resource_reference).type": "cloudfunctions.googleapis.com/CloudFunction" - } - } - } - }, - "GcsIngestPipeline": { - "fields": { - "inputPath": { - "type": "string", - "id": 1 - }, - "schemaName": { - "type": "string", - "id": 2 - }, - "processorType": { - "type": "string", - "id": 3 - }, - "skipIngestedDocuments": { - "type": "bool", - "id": 4 - }, - "pipelineConfig": { - "type": "IngestPipelineConfig", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "GcsIngestWithDocAiProcessorsPipeline": { - "fields": { - "inputPath": { - "type": "string", - "id": 1 - }, - "splitClassifyProcessorInfo": { - "type": "ProcessorInfo", - "id": 2 - }, - "extractProcessorInfos": { - "rule": "repeated", - "type": "ProcessorInfo", - "id": 3 - }, - "processorResultsFolderPath": { - "type": "string", - "id": 4 - }, - "skipIngestedDocuments": { - "type": "bool", - "id": 5 - }, - "pipelineConfig": { - "type": "IngestPipelineConfig", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ExportToCdwPipeline": { - "fields": { - "documents": { - "rule": "repeated", - "type": "string", - "id": 1 - }, - "exportFolderPath": { - "type": "string", - "id": 2 - }, - "docAiDataset": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "trainingSplitRatio": { - "type": "float", - "id": 4 - } - } - }, - "ProcessWithDocAiPipeline": { - "fields": { - "documents": { - "rule": "repeated", - "type": "string", - "id": 1 - }, - "exportFolderPath": { - "type": "string", - "id": 2 - }, - "processorInfo": { - "type": "ProcessorInfo", - "id": 3 - }, - "processorResultsFolderPath": { - "type": "string", - "id": 4 - } - } - }, - "RuleSetService": { - "options": { - "(google.api.default_host)": "contentwarehouse.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "CreateRuleSet": { - "requestType": "CreateRuleSetRequest", - "responseType": "RuleSet", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/ruleSets", - "(google.api.http).body": "rule_set", - "(google.api.method_signature)": "parent,rule_set" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*}/ruleSets", - "body": "rule_set" - } - }, - { - "(google.api.method_signature)": "parent,rule_set" - } - ] - }, - "GetRuleSet": { - "requestType": "GetRuleSetRequest", - "responseType": "RuleSet", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/ruleSets/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/ruleSets/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "UpdateRuleSet": { - "requestType": "UpdateRuleSetRequest", - "responseType": "RuleSet", - "options": { - "(google.api.http).patch": "/v1/{name=projects/*/locations/*/ruleSets/*}", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name,rule_set" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{name=projects/*/locations/*/ruleSets/*}", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name,rule_set" - } - ] - }, - "DeleteRuleSet": { - "requestType": "DeleteRuleSetRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/locations/*/ruleSets/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/locations/*/ruleSets/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListRuleSets": { - "requestType": "ListRuleSetsRequest", - "responseType": "ListRuleSetsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/ruleSets", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*}/ruleSets" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - } - } - }, - "CreateRuleSetRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/Location" - } - }, - "ruleSet": { - "type": "RuleSet", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "GetRuleSetRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/RuleSet" - } - } - } - }, - "UpdateRuleSetRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/RuleSet" - } - }, - "ruleSet": { - "type": "RuleSet", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "DeleteRuleSetRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/RuleSet" - } - } - } - }, - "ListRuleSetsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/Location" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } - }, - "ListRuleSetsResponse": { - "fields": { - "ruleSets": { - "rule": "repeated", - "type": "RuleSet", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "SynonymSet": { - "options": { - "(google.api.resource).type": "contentwarehouse.googleapis.com/SynonymSet", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/synonymSets/{context}" - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "context": { - "type": "string", - "id": 2 - }, - "synonyms": { - "rule": "repeated", - "type": "Synonym", - "id": 3 - } - }, - "nested": { - "Synonym": { - "fields": { - "words": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - } - } - }, - "SynonymSetService": { - "options": { - "(google.api.default_host)": "contentwarehouse.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "CreateSynonymSet": { - "requestType": "CreateSynonymSetRequest", - "responseType": "SynonymSet", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/synonymSets", - "(google.api.http).body": "synonym_set", - "(google.api.method_signature)": "parent,synonym_set" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*}/synonymSets", - "body": "synonym_set" - } - }, - { - "(google.api.method_signature)": "parent,synonym_set" - } - ] - }, - "GetSynonymSet": { - "requestType": "GetSynonymSetRequest", - "responseType": "SynonymSet", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/synonymSets/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/synonymSets/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "UpdateSynonymSet": { - "requestType": "UpdateSynonymSetRequest", - "responseType": "SynonymSet", - "options": { - "(google.api.http).patch": "/v1/{name=projects/*/locations/*/synonymSets/*}", - "(google.api.http).body": "synonym_set", - "(google.api.method_signature)": "name,synonym_set" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{name=projects/*/locations/*/synonymSets/*}", - "body": "synonym_set" - } - }, - { - "(google.api.method_signature)": "name,synonym_set" - } - ] - }, - "DeleteSynonymSet": { - "requestType": "DeleteSynonymSetRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/locations/*/synonymSets/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/locations/*/synonymSets/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListSynonymSets": { - "requestType": "ListSynonymSetsRequest", - "responseType": "ListSynonymSetsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/synonymSets", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*}/synonymSets" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - } - } - }, - "CreateSynonymSetRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/Location" - } - }, - "synonymSet": { - "type": "SynonymSet", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "GetSynonymSetRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/SynonymSet" - } - } - } - }, - "ListSynonymSetsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/Location" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } - }, - "ListSynonymSetsResponse": { - "fields": { - "synonymSets": { - "rule": "repeated", - "type": "SynonymSet", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "UpdateSynonymSetRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/SynonymSet" - } - }, - "synonymSet": { - "type": "SynonymSet", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "DeleteSynonymSetRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/SynonymSet" - } - } - } - } - } - } - } - }, - "documentai": { - "nested": { - "v1": { - "options": { - "csharp_namespace": "Google.Cloud.DocumentAI.V1", - "go_package": "cloud.google.com/go/documentai/apiv1/documentaipb;documentaipb", - "java_multiple_files": true, - "java_outer_classname": "GeometryProto", - "java_package": "com.google.cloud.documentai.v1", - "php_namespace": "Google\\Cloud\\DocumentAI\\V1", - "ruby_package": "Google::Cloud::DocumentAI::V1" - }, - "nested": { - "Document": { - "oneofs": { - "source": { - "oneof": [ - "uri", - "content" - ] - } - }, - "fields": { - "uri": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "content": { - "type": "bytes", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "docid": { - "type": "string", - "id": 15, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "mimeType": { - "type": "string", - "id": 3 - }, - "text": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "textStyles": { - "rule": "repeated", - "type": "Style", - "id": 5, - "options": { - "deprecated": true - } - }, - "pages": { - "rule": "repeated", - "type": "Page", - "id": 6 - }, - "entities": { - "rule": "repeated", - "type": "Entity", - "id": 7 - }, - "entityRelations": { - "rule": "repeated", - "type": "EntityRelation", - "id": 8 - }, - "textChanges": { - "rule": "repeated", - "type": "TextChange", - "id": 14 - }, - "shardInfo": { - "type": "ShardInfo", - "id": 9 - }, - "error": { - "type": "google.rpc.Status", - "id": 10 - }, - "revisions": { - "rule": "repeated", - "type": "Revision", - "id": 13 - }, - "documentLayout": { - "type": "DocumentLayout", - "id": 17 - }, - "chunkedDocument": { - "type": "ChunkedDocument", - "id": 18 - }, - "entityValidationOutput": { - "type": "EntityValidationOutput", - "id": 21 - }, - "entitiesRevisions": { - "rule": "repeated", - "type": "EntitiesRevision", - "id": 22 - }, - "entitiesRevisionId": { - "type": "string", - "id": 23 - } - }, - "nested": { - "ShardInfo": { - "fields": { - "shardIndex": { - "type": "int64", - "id": 1 - }, - "shardCount": { - "type": "int64", - "id": 2 - }, - "textOffset": { - "type": "int64", - "id": 3 - } - } - }, - "Style": { - "fields": { - "textAnchor": { - "type": "TextAnchor", - "id": 1 - }, - "color": { - "type": "google.type.Color", - "id": 2 - }, - "backgroundColor": { - "type": "google.type.Color", - "id": 3 - }, - "fontWeight": { - "type": "string", - "id": 4 - }, - "textStyle": { - "type": "string", - "id": 5 - }, - "textDecoration": { - "type": "string", - "id": 6 - }, - "fontSize": { - "type": "FontSize", - "id": 7 - }, - "fontFamily": { - "type": "string", - "id": 8 - } - }, - "nested": { - "FontSize": { - "fields": { - "size": { - "type": "float", - "id": 1 - }, - "unit": { - "type": "string", - "id": 2 - } - } - } - } - }, - "Page": { - "fields": { - "pageNumber": { - "type": "int32", - "id": 1 - }, - "image": { - "type": "Image", - "id": 13 - }, - "transforms": { - "rule": "repeated", - "type": "Matrix", - "id": 14 - }, - "dimension": { - "type": "Dimension", - "id": 2 - }, - "layout": { - "type": "Layout", - "id": 3 - }, - "detectedLanguages": { - "rule": "repeated", - "type": "DetectedLanguage", - "id": 4 - }, - "blocks": { - "rule": "repeated", - "type": "Block", - "id": 5 - }, - "paragraphs": { - "rule": "repeated", - "type": "Paragraph", - "id": 6 - }, - "lines": { - "rule": "repeated", - "type": "Line", - "id": 7 - }, - "tokens": { - "rule": "repeated", - "type": "Token", - "id": 8 - }, - "visualElements": { - "rule": "repeated", - "type": "VisualElement", - "id": 9 - }, - "tables": { - "rule": "repeated", - "type": "Table", - "id": 10 - }, - "formFields": { - "rule": "repeated", - "type": "FormField", - "id": 11 - }, - "symbols": { - "rule": "repeated", - "type": "Symbol", - "id": 12 - }, - "detectedBarcodes": { - "rule": "repeated", - "type": "DetectedBarcode", - "id": 15 - }, - "imageQualityScores": { - "type": "ImageQualityScores", - "id": 17 - }, - "provenance": { - "type": "Provenance", - "id": 16, - "options": { - "deprecated": true - } - } - }, - "nested": { - "Dimension": { - "fields": { - "width": { - "type": "float", - "id": 1 - }, - "height": { - "type": "float", - "id": 2 - }, - "unit": { - "type": "string", - "id": 3 - } - } - }, - "Image": { - "fields": { - "content": { - "type": "bytes", - "id": 1 - }, - "mimeType": { - "type": "string", - "id": 2 - }, - "width": { - "type": "int32", - "id": 3 - }, - "height": { - "type": "int32", - "id": 4 - } - } - }, - "Matrix": { - "fields": { - "rows": { - "type": "int32", - "id": 1 - }, - "cols": { - "type": "int32", - "id": 2 - }, - "type": { - "type": "int32", - "id": 3 - }, - "data": { - "type": "bytes", - "id": 4 - } - } - }, - "Layout": { - "fields": { - "textAnchor": { - "type": "TextAnchor", - "id": 1 - }, - "confidence": { - "type": "float", - "id": 2 - }, - "boundingPoly": { - "type": "BoundingPoly", - "id": 3 - }, - "orientation": { - "type": "Orientation", - "id": 4 - } - }, - "nested": { - "Orientation": { - "values": { - "ORIENTATION_UNSPECIFIED": 0, - "PAGE_UP": 1, - "PAGE_RIGHT": 2, - "PAGE_DOWN": 3, - "PAGE_LEFT": 4 - } - } - } - }, - "Block": { - "fields": { - "layout": { - "type": "Layout", - "id": 1 - }, - "detectedLanguages": { - "rule": "repeated", - "type": "DetectedLanguage", - "id": 2 - }, - "provenance": { - "type": "Provenance", - "id": 3, - "options": { - "deprecated": true - } - } - } - }, - "Paragraph": { - "fields": { - "layout": { - "type": "Layout", - "id": 1 - }, - "detectedLanguages": { - "rule": "repeated", - "type": "DetectedLanguage", - "id": 2 - }, - "provenance": { - "type": "Provenance", - "id": 3, - "options": { - "deprecated": true - } - } - } - }, - "Line": { - "fields": { - "layout": { - "type": "Layout", - "id": 1 - }, - "detectedLanguages": { - "rule": "repeated", - "type": "DetectedLanguage", - "id": 2 - }, - "provenance": { - "type": "Provenance", - "id": 3, - "options": { - "deprecated": true - } - } - } - }, - "Token": { - "fields": { - "layout": { - "type": "Layout", - "id": 1 - }, - "detectedBreak": { - "type": "DetectedBreak", - "id": 2 - }, - "detectedLanguages": { - "rule": "repeated", - "type": "DetectedLanguage", - "id": 3 - }, - "provenance": { - "type": "Provenance", - "id": 4, - "options": { - "deprecated": true - } - }, - "styleInfo": { - "type": "StyleInfo", - "id": 5 - } - }, - "nested": { - "DetectedBreak": { - "fields": { - "type": { - "type": "Type", - "id": 1 - } - }, - "nested": { - "Type": { - "values": { - "TYPE_UNSPECIFIED": 0, - "SPACE": 1, - "WIDE_SPACE": 2, - "HYPHEN": 3 - } - } - } - }, - "StyleInfo": { - "fields": { - "fontSize": { - "type": "int32", - "id": 1 - }, - "pixelFontSize": { - "type": "double", - "id": 2 - }, - "letterSpacing": { - "type": "double", - "id": 3 - }, - "fontType": { - "type": "string", - "id": 4 - }, - "bold": { - "type": "bool", - "id": 5 - }, - "italic": { - "type": "bool", - "id": 6 - }, - "underlined": { - "type": "bool", - "id": 7 - }, - "strikeout": { - "type": "bool", - "id": 8 - }, - "subscript": { - "type": "bool", - "id": 9 - }, - "superscript": { - "type": "bool", - "id": 10 - }, - "smallcaps": { - "type": "bool", - "id": 11 - }, - "fontWeight": { - "type": "int32", - "id": 12 - }, - "handwritten": { - "type": "bool", - "id": 13 - }, - "textColor": { - "type": "google.type.Color", - "id": 14 - }, - "backgroundColor": { - "type": "google.type.Color", - "id": 15 - } - } - } - } - }, - "Symbol": { - "fields": { - "layout": { - "type": "Layout", - "id": 1 - }, - "detectedLanguages": { - "rule": "repeated", - "type": "DetectedLanguage", - "id": 2 - } - } - }, - "VisualElement": { - "fields": { - "layout": { - "type": "Layout", - "id": 1 - }, - "type": { - "type": "string", - "id": 2 - }, - "detectedLanguages": { - "rule": "repeated", - "type": "DetectedLanguage", - "id": 3 - } - } - }, - "Table": { - "fields": { - "layout": { - "type": "Layout", - "id": 1 - }, - "headerRows": { - "rule": "repeated", - "type": "TableRow", - "id": 2 - }, - "bodyRows": { - "rule": "repeated", - "type": "TableRow", - "id": 3 - }, - "detectedLanguages": { - "rule": "repeated", - "type": "DetectedLanguage", - "id": 4 - }, - "provenance": { - "type": "Provenance", - "id": 5, - "options": { - "deprecated": true - } - } - }, - "nested": { - "TableRow": { - "fields": { - "cells": { - "rule": "repeated", - "type": "TableCell", - "id": 1 - } - } - }, - "TableCell": { - "fields": { - "layout": { - "type": "Layout", - "id": 1 - }, - "rowSpan": { - "type": "int32", - "id": 2 - }, - "colSpan": { - "type": "int32", - "id": 3 - }, - "detectedLanguages": { - "rule": "repeated", - "type": "DetectedLanguage", - "id": 4 - } - } - } - } - }, - "FormField": { - "fields": { - "fieldName": { - "type": "Layout", - "id": 1 - }, - "fieldValue": { - "type": "Layout", - "id": 2 - }, - "nameDetectedLanguages": { - "rule": "repeated", - "type": "DetectedLanguage", - "id": 3 - }, - "valueDetectedLanguages": { - "rule": "repeated", - "type": "DetectedLanguage", - "id": 4 - }, - "valueType": { - "type": "string", - "id": 5 - }, - "correctedKeyText": { - "type": "string", - "id": 6 - }, - "correctedValueText": { - "type": "string", - "id": 7 - }, - "provenance": { - "type": "Provenance", - "id": 8 - } - } - }, - "DetectedBarcode": { - "fields": { - "layout": { - "type": "Layout", - "id": 1 - }, - "barcode": { - "type": "Barcode", - "id": 2 - } - } - }, - "DetectedLanguage": { - "fields": { - "languageCode": { - "type": "string", - "id": 1 - }, - "confidence": { - "type": "float", - "id": 2 - } - } - }, - "ImageQualityScores": { - "fields": { - "qualityScore": { - "type": "float", - "id": 1 - }, - "detectedDefects": { - "rule": "repeated", - "type": "DetectedDefect", - "id": 2 - } - }, - "nested": { - "DetectedDefect": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "confidence": { - "type": "float", - "id": 2 - } - } - } - } - } - } - }, - "Entity": { - "fields": { - "textAnchor": { - "type": "TextAnchor", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "type": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "mentionText": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "mentionId": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "confidence": { - "type": "float", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageAnchor": { - "type": "PageAnchor", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "id": { - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "normalizedValue": { - "type": "NormalizedValue", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "properties": { - "rule": "repeated", - "type": "Entity", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "provenance": { - "type": "Provenance", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "redacted": { - "type": "bool", - "id": 12, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "method": { - "type": "Method", - "id": 15, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "NormalizedValue": { - "oneofs": { - "structuredValue": { - "oneof": [ - "moneyValue", - "dateValue", - "datetimeValue", - "addressValue", - "booleanValue", - "integerValue", - "floatValue", - "signatureValue" - ] - } - }, - "fields": { - "moneyValue": { - "type": "google.type.Money", - "id": 2 - }, - "dateValue": { - "type": "google.type.Date", - "id": 3 - }, - "datetimeValue": { - "type": "google.type.DateTime", - "id": 4 - }, - "addressValue": { - "type": "google.type.PostalAddress", - "id": 5 - }, - "booleanValue": { - "type": "bool", - "id": 6 - }, - "integerValue": { - "type": "int32", - "id": 7 - }, - "floatValue": { - "type": "float", - "id": 8 - }, - "signatureValue": { - "type": "bool", - "id": 10 - }, - "text": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "Method": { - "values": { - "METHOD_UNSPECIFIED": 0, - "EXTRACT": 1, - "DERIVE": 2 - } - } - } - }, - "EntityRelation": { - "fields": { - "subjectId": { - "type": "string", - "id": 1 - }, - "objectId": { - "type": "string", - "id": 2 - }, - "relation": { - "type": "string", - "id": 3 - } - } - }, - "TextAnchor": { - "fields": { - "textSegments": { - "rule": "repeated", - "type": "TextSegment", - "id": 1 - }, - "content": { - "type": "string", - "id": 2 - } - }, - "nested": { - "TextSegment": { - "fields": { - "startIndex": { - "type": "int64", - "id": 1 - }, - "endIndex": { - "type": "int64", - "id": 2 - } - } - } - } - }, - "PageAnchor": { - "fields": { - "pageRefs": { - "rule": "repeated", - "type": "PageRef", - "id": 1 - } - }, - "nested": { - "PageRef": { - "fields": { - "page": { - "type": "int64", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "layoutType": { - "type": "LayoutType", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "layoutId": { - "type": "string", - "id": 3, - "options": { - "deprecated": true, - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "boundingPoly": { - "type": "BoundingPoly", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "confidence": { - "type": "float", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "LayoutType": { - "values": { - "LAYOUT_TYPE_UNSPECIFIED": 0, - "BLOCK": 1, - "PARAGRAPH": 2, - "LINE": 3, - "TOKEN": 4, - "VISUAL_ELEMENT": 5, - "TABLE": 6, - "FORM_FIELD": 7 - } - } - } - } - } - }, - "Provenance": { - "fields": { - "revision": { - "type": "int32", - "id": 1, - "options": { - "deprecated": true - } - }, - "id": { - "type": "int32", - "id": 2, - "options": { - "deprecated": true - } - }, - "parents": { - "rule": "repeated", - "type": "Parent", - "id": 3 - }, - "type": { - "type": "OperationType", - "id": 4 - } - }, - "nested": { - "Parent": { - "fields": { - "revision": { - "type": "int32", - "id": 1 - }, - "index": { - "type": "int32", - "id": 3 - }, - "id": { - "type": "int32", - "id": 2, - "options": { - "deprecated": true - } - } - } - }, - "OperationType": { - "valuesOptions": { - "EVAL_REQUESTED": { - "deprecated": true - }, - "EVAL_APPROVED": { - "deprecated": true - }, - "EVAL_SKIPPED": { - "deprecated": true - } - }, - "values": { - "OPERATION_TYPE_UNSPECIFIED": 0, - "ADD": 1, - "REMOVE": 2, - "UPDATE": 7, - "REPLACE": 3, - "EVAL_REQUESTED": 4, - "EVAL_APPROVED": 5, - "EVAL_SKIPPED": 6 - } - } - } - }, - "Revision": { - "oneofs": { - "source": { - "oneof": [ - "agent", - "processor" - ] - } - }, - "fields": { - "agent": { - "type": "string", - "id": 4 - }, - "processor": { - "type": "string", - "id": 5 - }, - "id": { - "type": "string", - "id": 1 - }, - "parent": { - "rule": "repeated", - "type": "int32", - "id": 2, - "options": { - "deprecated": true - } - }, - "parentIds": { - "rule": "repeated", - "type": "string", - "id": 7 - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 3 - }, - "humanReview": { - "type": "HumanReview", - "id": 6 - } - }, - "nested": { - "HumanReview": { - "fields": { - "state": { - "type": "string", - "id": 1 - }, - "stateMessage": { - "type": "string", - "id": 2 - } - } - } - } - }, - "TextChange": { - "fields": { - "textAnchor": { - "type": "TextAnchor", - "id": 1 - }, - "changedText": { - "type": "string", - "id": 2 - }, - "provenance": { - "rule": "repeated", - "type": "Provenance", - "id": 3, - "options": { - "deprecated": true - } - } - } - }, - "DocumentLayout": { - "fields": { - "blocks": { - "rule": "repeated", - "type": "DocumentLayoutBlock", - "id": 1 - } - }, - "nested": { - "DocumentLayoutBlock": { - "oneofs": { - "block": { - "oneof": [ - "textBlock", - "tableBlock", - "listBlock" - ] - } - }, - "fields": { - "textBlock": { - "type": "LayoutTextBlock", - "id": 2 - }, - "tableBlock": { - "type": "LayoutTableBlock", - "id": 3 - }, - "listBlock": { - "type": "LayoutListBlock", - "id": 4 - }, - "blockId": { - "type": "string", - "id": 1 - }, - "pageSpan": { - "type": "LayoutPageSpan", - "id": 5 - }, - "boundingBox": { - "type": "BoundingPoly", - "id": 6 - } - }, - "nested": { - "LayoutPageSpan": { - "fields": { - "pageStart": { - "type": "int32", - "id": 1 - }, - "pageEnd": { - "type": "int32", - "id": 2 - } - } - }, - "LayoutTextBlock": { - "fields": { - "text": { - "type": "string", - "id": 1 - }, - "type": { - "type": "string", - "id": 2 - }, - "blocks": { - "rule": "repeated", - "type": "DocumentLayoutBlock", - "id": 3 - } - } - }, - "LayoutTableBlock": { - "fields": { - "headerRows": { - "rule": "repeated", - "type": "LayoutTableRow", - "id": 1 - }, - "bodyRows": { - "rule": "repeated", - "type": "LayoutTableRow", - "id": 2 - }, - "caption": { - "type": "string", - "id": 3 - } - } - }, - "LayoutTableRow": { - "fields": { - "cells": { - "rule": "repeated", - "type": "LayoutTableCell", - "id": 1 - } - } - }, - "LayoutTableCell": { - "fields": { - "blocks": { - "rule": "repeated", - "type": "DocumentLayoutBlock", - "id": 1 - }, - "rowSpan": { - "type": "int32", - "id": 2 - }, - "colSpan": { - "type": "int32", - "id": 3 - } - } - }, - "LayoutListBlock": { - "fields": { - "listEntries": { - "rule": "repeated", - "type": "LayoutListEntry", - "id": 1 - }, - "type": { - "type": "string", - "id": 2 - } - } - }, - "LayoutListEntry": { - "fields": { - "blocks": { - "rule": "repeated", - "type": "DocumentLayoutBlock", - "id": 1 - } - } - } - } - } - } - }, - "ChunkedDocument": { - "fields": { - "chunks": { - "rule": "repeated", - "type": "Chunk", - "id": 1 - } - }, - "nested": { - "Chunk": { - "fields": { - "chunkId": { - "type": "string", - "id": 1 - }, - "sourceBlockIds": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "content": { - "type": "string", - "id": 3 - }, - "pageSpan": { - "type": "ChunkPageSpan", - "id": 4 - }, - "pageHeaders": { - "rule": "repeated", - "type": "ChunkPageHeader", - "id": 5 - }, - "pageFooters": { - "rule": "repeated", - "type": "ChunkPageFooter", - "id": 6 - } - }, - "nested": { - "ChunkPageSpan": { - "fields": { - "pageStart": { - "type": "int32", - "id": 1 - }, - "pageEnd": { - "type": "int32", - "id": 2 - } - } - }, - "ChunkPageHeader": { - "fields": { - "text": { - "type": "string", - "id": 1 - }, - "pageSpan": { - "type": "ChunkPageSpan", - "id": 2 - } - } - }, - "ChunkPageFooter": { - "fields": { - "text": { - "type": "string", - "id": 1 - }, - "pageSpan": { - "type": "ChunkPageSpan", - "id": 2 - } - } - } - } - } - } - }, - "EntityValidationOutput": { - "fields": { - "validationResults": { - "rule": "repeated", - "type": "ValidationResult", - "id": 1 - }, - "passAllRules": { - "type": "bool", - "id": 2 - } - }, - "nested": { - "ValidationResult": { - "fields": { - "ruleName": { - "type": "string", - "id": 1 - }, - "ruleDescription": { - "type": "string", - "id": 2 - }, - "validationResultType": { - "type": "ValidationResultType", - "id": 3 - }, - "validationDetails": { - "type": "string", - "id": 4 - } - }, - "nested": { - "ValidationResultType": { - "values": { - "VALIDATION_RESULT_TYPE_UNSPECIFIED": 0, - "VALIDATION_RESULT_TYPE_VALID": 1, - "VALIDATION_RESULT_TYPE_INVALID": 2, - "VALIDATION_RESULT_TYPE_SKIPPED": 3, - "VALIDATION_RESULT_TYPE_NOT_APPLICABLE": 4 - } - } - } - } - } - }, - "EntitiesRevision": { - "fields": { - "revisionId": { - "type": "string", - "id": 1 - }, - "entities": { - "rule": "repeated", - "type": "Entity", - "id": 2 - }, - "entityValidationOutput": { - "type": "EntityValidationOutput", - "id": 3 - } - } - } - } - }, - "Barcode": { - "fields": { - "format": { - "type": "string", - "id": 1 - }, - "valueFormat": { - "type": "string", - "id": 2 - }, - "rawValue": { - "type": "string", - "id": 3 - } - } - }, - "Vertex": { - "fields": { - "x": { - "type": "int32", - "id": 1 - }, - "y": { - "type": "int32", - "id": 2 - } - } - }, - "NormalizedVertex": { - "fields": { - "x": { - "type": "float", - "id": 1 - }, - "y": { - "type": "float", - "id": 2 - } - } - }, - "BoundingPoly": { - "fields": { - "vertices": { - "rule": "repeated", - "type": "Vertex", - "id": 1 - }, - "normalizedVertices": { - "rule": "repeated", - "type": "NormalizedVertex", - "id": 2 - } - } - } - } - } - } - } - } - }, - "api": { - "options": { - "go_package": "google.golang.org/genproto/googleapis/api;api", - "java_multiple_files": true, - "java_outer_classname": "LaunchStageProto", - "java_package": "com.google.api", - "objc_class_prefix": "GAPI", - "cc_enable_arenas": true - }, - "nested": { - "fieldBehavior": { - "rule": "repeated", - "type": "google.api.FieldBehavior", - "id": 1052, - "extend": "google.protobuf.FieldOptions", - "options": { - "packed": false - } - }, - "FieldBehavior": { - "values": { - "FIELD_BEHAVIOR_UNSPECIFIED": 0, - "OPTIONAL": 1, - "REQUIRED": 2, - "OUTPUT_ONLY": 3, - "INPUT_ONLY": 4, - "IMMUTABLE": 5, - "UNORDERED_LIST": 6, - "NON_EMPTY_DEFAULT": 7, - "IDENTIFIER": 8 - } - }, - "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 - } - } - }, - "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" - }, - "apiVersion": { - "type": "string", - "id": 525000001, - "extend": "google.protobuf.ServiceOptions" - }, - "CommonLanguageSettings": { - "fields": { - "referenceDocsUri": { - "type": "string", - "id": 1, - "options": { - "deprecated": true - } - }, - "destinations": { - "rule": "repeated", - "type": "ClientLibraryDestination", - "id": 2 - } - } - }, - "ClientLibrarySettings": { - "fields": { - "version": { - "type": "string", - "id": 1 - }, - "launchStage": { - "type": "LaunchStage", - "id": 2 - }, - "restNumericEnums": { - "type": "bool", - "id": 3 - }, - "javaSettings": { - "type": "JavaSettings", - "id": 21 - }, - "cppSettings": { - "type": "CppSettings", - "id": 22 - }, - "phpSettings": { - "type": "PhpSettings", - "id": 23 - }, - "pythonSettings": { - "type": "PythonSettings", - "id": 24 - }, - "nodeSettings": { - "type": "NodeSettings", - "id": 25 - }, - "dotnetSettings": { - "type": "DotnetSettings", - "id": 26 - }, - "rubySettings": { - "type": "RubySettings", - "id": 27 - }, - "goSettings": { - "type": "GoSettings", - "id": 28 - } - } - }, - "Publishing": { - "fields": { - "methodSettings": { - "rule": "repeated", - "type": "MethodSettings", - "id": 2 - }, - "newIssueUri": { - "type": "string", - "id": 101 - }, - "documentationUri": { - "type": "string", - "id": 102 - }, - "apiShortName": { - "type": "string", - "id": 103 - }, - "githubLabel": { - "type": "string", - "id": 104 - }, - "codeownerGithubTeams": { - "rule": "repeated", - "type": "string", - "id": 105 - }, - "docTagPrefix": { - "type": "string", - "id": 106 - }, - "organization": { - "type": "ClientLibraryOrganization", - "id": 107 - }, - "librarySettings": { - "rule": "repeated", - "type": "ClientLibrarySettings", - "id": 109 - }, - "protoReferenceDocumentationUri": { - "type": "string", - "id": 110 - }, - "restReferenceDocumentationUri": { - "type": "string", - "id": 111 - } - } - }, - "JavaSettings": { - "fields": { - "libraryPackage": { - "type": "string", - "id": 1 - }, - "serviceClassNames": { - "keyType": "string", - "type": "string", - "id": 2 - }, - "common": { - "type": "CommonLanguageSettings", - "id": 3 - } - } - }, - "CppSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "PhpSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "PythonSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "NodeSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "DotnetSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - }, - "renamedServices": { - "keyType": "string", - "type": "string", - "id": 2 - }, - "renamedResources": { - "keyType": "string", - "type": "string", - "id": 3 - }, - "ignoredResources": { - "rule": "repeated", - "type": "string", - "id": 4 - }, - "forcedNamespaceAliases": { - "rule": "repeated", - "type": "string", - "id": 5 - }, - "handwrittenSignatures": { - "rule": "repeated", - "type": "string", - "id": 6 - } - } - }, - "RubySettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "GoSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "MethodSettings": { - "fields": { - "selector": { - "type": "string", - "id": 1 - }, - "longRunning": { - "type": "LongRunning", - "id": 2 - }, - "autoPopulatedFields": { - "rule": "repeated", - "type": "string", - "id": 3 - } - }, - "nested": { - "LongRunning": { - "fields": { - "initialPollDelay": { - "type": "google.protobuf.Duration", - "id": 1 - }, - "pollDelayMultiplier": { - "type": "float", - "id": 2 - }, - "maxPollDelay": { - "type": "google.protobuf.Duration", - "id": 3 - }, - "totalPollTimeout": { - "type": "google.protobuf.Duration", - "id": 4 - } - } - } - } - }, - "ClientLibraryOrganization": { - "values": { - "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, - "CLOUD": 1, - "ADS": 2, - "PHOTOS": 3, - "STREET_VIEW": 4, - "SHOPPING": 5, - "GEO": 6, - "GENERATIVE_AI": 7 - } - }, - "ClientLibraryDestination": { - "values": { - "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, - "GITHUB": 10, - "PACKAGE_MANAGER": 20 - } - }, - "LaunchStage": { - "values": { - "LAUNCH_STAGE_UNSPECIFIED": 0, - "UNIMPLEMENTED": 6, - "PRELAUNCH": 7, - "EARLY_ACCESS": 1, - "ALPHA": 2, - "BETA": 3, - "GA": 4, - "DEPRECATED": 5 - } - } - } - }, - "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": { - "edition": "proto2", - "fields": { - "file": { - "rule": "repeated", - "type": "FileDescriptorProto", - "id": 1 - } - } - }, - "Edition": { - "edition": "proto2", - "values": { - "EDITION_UNKNOWN": 0, - "EDITION_PROTO2": 998, - "EDITION_PROTO3": 999, - "EDITION_2023": 1000, - "EDITION_2024": 1001, - "EDITION_1_TEST_ONLY": 1, - "EDITION_2_TEST_ONLY": 2, - "EDITION_99997_TEST_ONLY": 99997, - "EDITION_99998_TEST_ONLY": 99998, - "EDITION_99999_TEST_ONLY": 99999, - "EDITION_MAX": 2147483647 - } - }, - "FileDescriptorProto": { - "edition": "proto2", - "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 - }, - "weakDependency": { - "rule": "repeated", - "type": "int32", - "id": 11 - }, - "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 - }, - "edition": { - "type": "Edition", - "id": 14 - } - } - }, - "DescriptorProto": { - "edition": "proto2", - "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": { - "edition": "proto2", - "fields": { - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - }, - "declaration": { - "rule": "repeated", - "type": "Declaration", - "id": 2, - "options": { - "retention": "RETENTION_SOURCE" - } - }, - "features": { - "type": "FeatureSet", - "id": 50 - }, - "verification": { - "type": "VerificationState", - "id": 3, - "options": { - "default": "UNVERIFIED", - "retention": "RETENTION_SOURCE" - } - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "nested": { - "Declaration": { - "fields": { - "number": { - "type": "int32", - "id": 1 - }, - "fullName": { - "type": "string", - "id": 2 - }, - "type": { - "type": "string", - "id": 3 - }, - "reserved": { - "type": "bool", - "id": 5 - }, - "repeated": { - "type": "bool", - "id": 6 - } - }, - "reserved": [ - [ - 4, - 4 - ] - ] - }, - "VerificationState": { - "values": { - "DECLARATION": 0, - "UNVERIFIED": 1 - } - } - } - }, - "FieldDescriptorProto": { - "edition": "proto2", - "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_REPEATED": 3, - "LABEL_REQUIRED": 2 - } - } - } - }, - "OneofDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "options": { - "type": "OneofOptions", - "id": 2 - } - } - }, - "EnumDescriptorProto": { - "edition": "proto2", - "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": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "number": { - "type": "int32", - "id": 2 - }, - "options": { - "type": "EnumValueOptions", - "id": 3 - } - } - }, - "ServiceDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "method": { - "rule": "repeated", - "type": "MethodDescriptorProto", - "id": 2 - }, - "options": { - "type": "ServiceOptions", - "id": 3 - } - } - }, - "MethodDescriptorProto": { - "edition": "proto2", - "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": { - "edition": "proto2", - "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 - } - }, - "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 - }, - "features": { - "type": "FeatureSet", - "id": 50 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 42, - 42 - ], - [ - 38, - 38 - ] - ], - "nested": { - "OptimizeMode": { - "values": { - "SPEED": 1, - "CODE_SIZE": 2, - "LITE_RUNTIME": 3 - } - } - } - }, - "MessageOptions": { - "edition": "proto2", - "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 - }, - "deprecatedLegacyJsonFieldConflicts": { - "type": "bool", - "id": 11, - "options": { - "deprecated": true - } - }, - "features": { - "type": "FeatureSet", - "id": 12 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 4, - 4 - ], - [ - 5, - 5 - ], - [ - 6, - 6 - ], - [ - 8, - 8 - ], - [ - 9, - 9 - ] - ] - }, - "FieldOptions": { - "edition": "proto2", - "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 - } - }, - "unverifiedLazy": { - "type": "bool", - "id": 15, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "weak": { - "type": "bool", - "id": 10, - "options": { - "default": false - } - }, - "debugRedact": { - "type": "bool", - "id": 16, - "options": { - "default": false - } - }, - "retention": { - "type": "OptionRetention", - "id": 17 - }, - "targets": { - "rule": "repeated", - "type": "OptionTargetType", - "id": 19 - }, - "editionDefaults": { - "rule": "repeated", - "type": "EditionDefault", - "id": 20 - }, - "features": { - "type": "FeatureSet", - "id": 21 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 4, - 4 - ], - [ - 18, - 18 - ] - ], - "nested": { - "CType": { - "values": { - "STRING": 0, - "CORD": 1, - "STRING_PIECE": 2 - } - }, - "JSType": { - "values": { - "JS_NORMAL": 0, - "JS_STRING": 1, - "JS_NUMBER": 2 - } - }, - "OptionRetention": { - "values": { - "RETENTION_UNKNOWN": 0, - "RETENTION_RUNTIME": 1, - "RETENTION_SOURCE": 2 - } - }, - "OptionTargetType": { - "values": { - "TARGET_TYPE_UNKNOWN": 0, - "TARGET_TYPE_FILE": 1, - "TARGET_TYPE_EXTENSION_RANGE": 2, - "TARGET_TYPE_MESSAGE": 3, - "TARGET_TYPE_FIELD": 4, - "TARGET_TYPE_ONEOF": 5, - "TARGET_TYPE_ENUM": 6, - "TARGET_TYPE_ENUM_ENTRY": 7, - "TARGET_TYPE_SERVICE": 8, - "TARGET_TYPE_METHOD": 9 - } - }, - "EditionDefault": { - "fields": { - "edition": { - "type": "Edition", - "id": 3 - }, - "value": { - "type": "string", - "id": 2 - } - } - } - } - }, - "OneofOptions": { - "edition": "proto2", - "fields": { - "features": { - "type": "FeatureSet", - "id": 1 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "EnumOptions": { - "edition": "proto2", - "fields": { - "allowAlias": { - "type": "bool", - "id": 2 - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "deprecatedLegacyJsonFieldConflicts": { - "type": "bool", - "id": 6, - "options": { - "deprecated": true - } - }, - "features": { - "type": "FeatureSet", - "id": 7 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 5, - 5 - ] - ] - }, - "EnumValueOptions": { - "edition": "proto2", - "fields": { - "deprecated": { - "type": "bool", - "id": 1, - "options": { - "default": false - } - }, - "features": { - "type": "FeatureSet", - "id": 2 - }, - "debugRedact": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "ServiceOptions": { - "edition": "proto2", - "fields": { - "features": { - "type": "FeatureSet", - "id": 34 - }, - "deprecated": { - "type": "bool", - "id": 33, - "options": { - "default": false - } - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "MethodOptions": { - "edition": "proto2", - "fields": { - "deprecated": { - "type": "bool", - "id": 33, - "options": { - "default": false - } - }, - "idempotencyLevel": { - "type": "IdempotencyLevel", - "id": 34, - "options": { - "default": "IDEMPOTENCY_UNKNOWN" - } - }, - "features": { - "type": "FeatureSet", - "id": 35 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "nested": { - "IdempotencyLevel": { - "values": { - "IDEMPOTENCY_UNKNOWN": 0, - "NO_SIDE_EFFECTS": 1, - "IDEMPOTENT": 2 - } - } - } - }, - "UninterpretedOption": { - "edition": "proto2", - "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 - } - } - } - } - }, - "FeatureSet": { - "edition": "proto2", - "fields": { - "fieldPresence": { - "type": "FieldPresence", - "id": 1, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_2023", - "edition_defaults.value": "EXPLICIT" - } - }, - "enumType": { - "type": "EnumType", - "id": 2, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "OPEN" - } - }, - "repeatedFieldEncoding": { - "type": "RepeatedFieldEncoding", - "id": 3, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "PACKED" - } - }, - "utf8Validation": { - "type": "Utf8Validation", - "id": 4, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "VERIFY" - } - }, - "messageEncoding": { - "type": "MessageEncoding", - "id": 5, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO2", - "edition_defaults.value": "LENGTH_PREFIXED" - } - }, - "jsonFormat": { - "type": "JsonFormat", - "id": 6, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "ALLOW" - } - } - }, - "extensions": [ - [ - 1000, - 1000 - ], - [ - 1001, - 1001 - ], - [ - 1002, - 1002 - ], - [ - 9990, - 9990 - ], - [ - 9995, - 9999 - ], - [ - 10000, - 10000 - ] - ], - "reserved": [ - [ - 999, - 999 - ] - ], - "nested": { - "FieldPresence": { - "values": { - "FIELD_PRESENCE_UNKNOWN": 0, - "EXPLICIT": 1, - "IMPLICIT": 2, - "LEGACY_REQUIRED": 3 - } - }, - "EnumType": { - "values": { - "ENUM_TYPE_UNKNOWN": 0, - "OPEN": 1, - "CLOSED": 2 - } - }, - "RepeatedFieldEncoding": { - "values": { - "REPEATED_FIELD_ENCODING_UNKNOWN": 0, - "PACKED": 1, - "EXPANDED": 2 - } - }, - "Utf8Validation": { - "values": { - "UTF8_VALIDATION_UNKNOWN": 0, - "VERIFY": 2, - "NONE": 3 - } - }, - "MessageEncoding": { - "values": { - "MESSAGE_ENCODING_UNKNOWN": 0, - "LENGTH_PREFIXED": 1, - "DELIMITED": 2 - } - }, - "JsonFormat": { - "values": { - "JSON_FORMAT_UNKNOWN": 0, - "ALLOW": 1, - "LEGACY_BEST_EFFORT": 2 - } - } - } - }, - "FeatureSetDefaults": { - "edition": "proto2", - "fields": { - "defaults": { - "rule": "repeated", - "type": "FeatureSetEditionDefault", - "id": 1 - }, - "minimumEdition": { - "type": "Edition", - "id": 4 - }, - "maximumEdition": { - "type": "Edition", - "id": 5 - } - }, - "nested": { - "FeatureSetEditionDefault": { - "fields": { - "edition": { - "type": "Edition", - "id": 3 - }, - "features": { - "type": "FeatureSet", - "id": 2 - } - } - } - } - }, - "SourceCodeInfo": { - "edition": "proto2", - "fields": { - "location": { - "rule": "repeated", - "type": "Location", - "id": 1 - } - }, - "nested": { - "Location": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1, - "options": { - "packed": true - } - }, - "span": { - "rule": "repeated", - "type": "int32", - "id": 2, - "options": { - "packed": true - } - }, - "leadingComments": { - "type": "string", - "id": 3 - }, - "trailingComments": { - "type": "string", - "id": 4 - }, - "leadingDetachedComments": { - "rule": "repeated", - "type": "string", - "id": 6 - } - } - } - } - }, - "GeneratedCodeInfo": { - "edition": "proto2", - "fields": { - "annotation": { - "rule": "repeated", - "type": "Annotation", - "id": 1 - } - }, - "nested": { - "Annotation": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1, - "options": { - "packed": true - } - }, - "sourceFile": { - "type": "string", - "id": 2 - }, - "begin": { - "type": "int32", - "id": 3 - }, - "end": { - "type": "int32", - "id": 4 - }, - "semantic": { - "type": "Semantic", - "id": 5 - } - }, - "nested": { - "Semantic": { - "values": { - "NONE": 0, - "SET": 1, - "ALIAS": 2 - } - } - } - } - } - }, - "FieldMask": { - "fields": { - "paths": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - }, - "Timestamp": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } - }, - "Any": { - "fields": { - "type_url": { - "type": "string", - "id": 1 - }, - "value": { - "type": "bytes", - "id": 2 - } - } - }, - "DoubleValue": { - "fields": { - "value": { - "type": "double", - "id": 1 - } - } - }, - "FloatValue": { - "fields": { - "value": { - "type": "float", - "id": 1 - } - } - }, - "Int64Value": { - "fields": { - "value": { - "type": "int64", - "id": 1 - } - } - }, - "UInt64Value": { - "fields": { - "value": { - "type": "uint64", - "id": 1 - } - } - }, - "Int32Value": { - "fields": { - "value": { - "type": "int32", - "id": 1 - } - } - }, - "UInt32Value": { - "fields": { - "value": { - "type": "uint32", - "id": 1 - } - } - }, - "BoolValue": { - "fields": { - "value": { - "type": "bool", - "id": 1 - } - } - }, - "StringValue": { - "fields": { - "value": { - "type": "string", - "id": 1 - } - } - }, - "BytesValue": { - "fields": { - "value": { - "type": "bytes", - "id": 1 - } - } - }, - "Duration": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } - }, - "Empty": { - "fields": {} - } - } - }, - "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/expr;expr", - "java_multiple_files": true, - "java_outer_classname": "ExprProto", - "java_package": "com.google.type", - "objc_class_prefix": "GTP" - }, - "nested": { - "Color": { - "fields": { - "red": { - "type": "float", - "id": 1 - }, - "green": { - "type": "float", - "id": 2 - }, - "blue": { - "type": "float", - "id": 3 - }, - "alpha": { - "type": "google.protobuf.FloatValue", - "id": 4 - } - } - }, - "Date": { - "fields": { - "year": { - "type": "int32", - "id": 1 - }, - "month": { - "type": "int32", - "id": 2 - }, - "day": { - "type": "int32", - "id": 3 - } - } - }, - "DateTime": { - "oneofs": { - "timeOffset": { - "oneof": [ - "utcOffset", - "timeZone" - ] - } - }, - "fields": { - "year": { - "type": "int32", - "id": 1 - }, - "month": { - "type": "int32", - "id": 2 - }, - "day": { - "type": "int32", - "id": 3 - }, - "hours": { - "type": "int32", - "id": 4 - }, - "minutes": { - "type": "int32", - "id": 5 - }, - "seconds": { - "type": "int32", - "id": 6 - }, - "nanos": { - "type": "int32", - "id": 7 - }, - "utcOffset": { - "type": "google.protobuf.Duration", - "id": 8 - }, - "timeZone": { - "type": "TimeZone", - "id": 9 - } - } - }, - "TimeZone": { - "fields": { - "id": { - "type": "string", - "id": 1 - }, - "version": { - "type": "string", - "id": 2 - } - } - }, - "Money": { - "fields": { - "currencyCode": { - "type": "string", - "id": 1 - }, - "units": { - "type": "int64", - "id": 2 - }, - "nanos": { - "type": "int32", - "id": 3 - } - } - }, - "PostalAddress": { - "fields": { - "revision": { - "type": "int32", - "id": 1 - }, - "regionCode": { - "type": "string", - "id": 2 - }, - "languageCode": { - "type": "string", - "id": 3 - }, - "postalCode": { - "type": "string", - "id": 4 - }, - "sortingCode": { - "type": "string", - "id": 5 - }, - "administrativeArea": { - "type": "string", - "id": 6 - }, - "locality": { - "type": "string", - "id": 7 - }, - "sublocality": { - "type": "string", - "id": 8 - }, - "addressLines": { - "rule": "repeated", - "type": "string", - "id": 9 - }, - "recipients": { - "rule": "repeated", - "type": "string", - "id": 10 - }, - "organization": { - "type": "string", - "id": 11 - } - } - }, - "Interval": { - "fields": { - "startTime": { - "type": "google.protobuf.Timestamp", - "id": 1 - }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - } - } - }, - "Expr": { - "fields": { - "expression": { - "type": "string", - "id": 1 - }, - "title": { - "type": "string", - "id": 2 - }, - "description": { - "type": "string", - "id": 3 - }, - "location": { - "type": "string", - "id": 4 - } - } - } - } - }, - "iam": { - "nested": { - "v1": { - "options": { - "cc_enable_arenas": true, - "csharp_namespace": "Google.Cloud.Iam.V1", - "go_package": "cloud.google.com/go/iam/apiv1/iampb;iampb", - "java_multiple_files": true, - "java_outer_classname": "PolicyProto", - "java_package": "com.google.iam.v1", - "php_namespace": "Google\\Cloud\\Iam\\V1" - }, - "nested": { - "Policy": { - "fields": { - "version": { - "type": "int32", - "id": 1 - }, - "bindings": { - "rule": "repeated", - "type": "Binding", - "id": 4 - }, - "auditConfigs": { - "rule": "repeated", - "type": "AuditConfig", - "id": 6 - }, - "etag": { - "type": "bytes", - "id": 3 - } - } - }, - "Binding": { - "fields": { - "role": { - "type": "string", - "id": 1 - }, - "members": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "condition": { - "type": "google.type.Expr", - "id": 3 - } - } - }, - "AuditConfig": { - "fields": { - "service": { - "type": "string", - "id": 1 - }, - "auditLogConfigs": { - "rule": "repeated", - "type": "AuditLogConfig", - "id": 3 - } - } - }, - "AuditLogConfig": { - "fields": { - "logType": { - "type": "LogType", - "id": 1 - }, - "exemptedMembers": { - "rule": "repeated", - "type": "string", - "id": 2 - } - }, - "nested": { - "LogType": { - "values": { - "LOG_TYPE_UNSPECIFIED": 0, - "ADMIN_READ": 1, - "DATA_WRITE": 2, - "DATA_READ": 3 - } - } - } - }, - "PolicyDelta": { - "fields": { - "bindingDeltas": { - "rule": "repeated", - "type": "BindingDelta", - "id": 1 - }, - "auditConfigDeltas": { - "rule": "repeated", - "type": "AuditConfigDelta", - "id": 2 - } - } - }, - "BindingDelta": { - "fields": { - "action": { - "type": "Action", - "id": 1 - }, - "role": { - "type": "string", - "id": 2 - }, - "member": { - "type": "string", - "id": 3 - }, - "condition": { - "type": "google.type.Expr", - "id": 4 - } - }, - "nested": { - "Action": { - "values": { - "ACTION_UNSPECIFIED": 0, - "ADD": 1, - "REMOVE": 2 - } - } - } - }, - "AuditConfigDelta": { - "fields": { - "action": { - "type": "Action", - "id": 1 - }, - "service": { - "type": "string", - "id": 2 - }, - "exemptedMember": { - "type": "string", - "id": 3 - }, - "logType": { - "type": "string", - "id": 4 - } - }, - "nested": { - "Action": { - "values": { - "ACTION_UNSPECIFIED": 0, - "ADD": 1, - "REMOVE": 2 - } - } - } - } - } - } - } - }, - "longrunning": { - "options": { - "cc_enable_arenas": true, - "csharp_namespace": "Google.LongRunning", - "go_package": "cloud.google.com/go/longrunning/autogen/longrunningpb;longrunningpb", - "java_multiple_files": true, - "java_outer_classname": "OperationsProto", - "java_package": "com.google.longrunning", - "php_namespace": "Google\\LongRunning" - }, - "nested": { - "operationInfo": { - "type": "google.longrunning.OperationInfo", - "id": 1049, - "extend": "google.protobuf.MethodOptions" - }, - "Operations": { - "options": { - "(google.api.default_host)": "longrunning.googleapis.com" - }, - "methods": { - "ListOperations": { - "requestType": "ListOperationsRequest", - "responseType": "ListOperationsResponse", - "options": { - "(google.api.http).get": "/v1/{name=operations}", - "(google.api.method_signature)": "name,filter" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=operations}" - } - }, - { - "(google.api.method_signature)": "name,filter" - } - ] - }, - "GetOperation": { - "requestType": "GetOperationRequest", - "responseType": "Operation", - "options": { - "(google.api.http).get": "/v1/{name=operations/**}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=operations/**}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "DeleteOperation": { - "requestType": "DeleteOperationRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=operations/**}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=operations/**}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CancelOperation": { - "requestType": "CancelOperationRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).post": "/v1/{name=operations/**}:cancel", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=operations/**}:cancel", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "WaitOperation": { - "requestType": "WaitOperationRequest", - "responseType": "Operation" - } - } - }, - "Operation": { - "oneofs": { - "result": { - "oneof": [ - "error", - "response" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "metadata": { - "type": "google.protobuf.Any", - "id": 2 - }, - "done": { - "type": "bool", - "id": 3 - }, - "error": { - "type": "google.rpc.Status", - "id": 4 - }, - "response": { - "type": "google.protobuf.Any", - "id": 5 - } - } - }, - "GetOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "ListOperationsRequest": { - "fields": { - "name": { - "type": "string", - "id": 4 - }, - "filter": { - "type": "string", - "id": 1 - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } - }, - "ListOperationsResponse": { - "fields": { - "operations": { - "rule": "repeated", - "type": "Operation", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "CancelOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "DeleteOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "WaitOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "timeout": { - "type": "google.protobuf.Duration", - "id": 2 - } - } - }, - "OperationInfo": { - "fields": { - "responseType": { - "type": "string", - "id": 1 - }, - "metadataType": { - "type": "string", - "id": 2 - } - } - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_link_service.create_document_link.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_link_service.create_document_link.js deleted file mode 100644 index 5d8559aaca1..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_link_service.create_document_link.js +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, documentLink) { - // [START contentwarehouse_v1_generated_DocumentLinkService_CreateDocumentLink_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Parent of the document-link to be created. - * parent of document-link should be a document. - * Format: - * projects/{project_number}/locations/{location}/documents/{source_document_id}. - */ - // const parent = 'abc123' - /** - * Required. Document links associated with the source documents - * (source_document_id). - */ - // const documentLink = {} - /** - * The meta information collected about the document creator, used to enforce - * access control for the service. - */ - // const requestMetadata = {} - - // Imports the Contentwarehouse library - const {DocumentLinkServiceClient} = require('@google-cloud/contentwarehouse').v1; - - // Instantiates a client - const contentwarehouseClient = new DocumentLinkServiceClient(); - - async function callCreateDocumentLink() { - // Construct request - const request = { - parent, - documentLink, - }; - - // Run request - const response = await contentwarehouseClient.createDocumentLink(request); - console.log(response); - } - - callCreateDocumentLink(); - // [END contentwarehouse_v1_generated_DocumentLinkService_CreateDocumentLink_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_link_service.delete_document_link.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_link_service.delete_document_link.js deleted file mode 100644 index d2ab4f5e653..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_link_service.delete_document_link.js +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START contentwarehouse_v1_generated_DocumentLinkService_DeleteDocumentLink_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the document-link to be deleted. - * Format: - * projects/{project_number}/locations/{location}/documents/{source_document_id}/documentLinks/{document_link_id}. - */ - // const name = 'abc123' - /** - * The meta information collected about the document creator, used to enforce - * access control for the service. - */ - // const requestMetadata = {} - - // Imports the Contentwarehouse library - const {DocumentLinkServiceClient} = require('@google-cloud/contentwarehouse').v1; - - // Instantiates a client - const contentwarehouseClient = new DocumentLinkServiceClient(); - - async function callDeleteDocumentLink() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await contentwarehouseClient.deleteDocumentLink(request); - console.log(response); - } - - callDeleteDocumentLink(); - // [END contentwarehouse_v1_generated_DocumentLinkService_DeleteDocumentLink_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_link_service.list_linked_sources.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_link_service.list_linked_sources.js deleted file mode 100644 index 28a30c4fd90..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_link_service.list_linked_sources.js +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START contentwarehouse_v1_generated_DocumentLinkService_ListLinkedSources_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the document, for which all source links are - * returned. Format: - * projects/{project_number}/locations/{location}/documents/{source_document_id}. - */ - // const parent = 'abc123' - /** - * The maximum number of document-links to return. The service may return - * fewer than this value. - * If unspecified, at most 50 document-links will be returned. - * The maximum value is 1000; values above 1000 will be coerced to 1000. - */ - // const pageSize = 1234 - /** - * A page token, received from a previous `ListLinkedSources` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListLinkedSources` - * must match the call that provided the page token. - */ - // const pageToken = 'abc123' - /** - * The meta information collected about the document creator, used to enforce - * access control for the service. - */ - // const requestMetadata = {} - - // Imports the Contentwarehouse library - const {DocumentLinkServiceClient} = require('@google-cloud/contentwarehouse').v1; - - // Instantiates a client - const contentwarehouseClient = new DocumentLinkServiceClient(); - - async function callListLinkedSources() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = contentwarehouseClient.listLinkedSourcesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListLinkedSources(); - // [END contentwarehouse_v1_generated_DocumentLinkService_ListLinkedSources_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_link_service.list_linked_targets.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_link_service.list_linked_targets.js deleted file mode 100644 index edda257f228..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_link_service.list_linked_targets.js +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START contentwarehouse_v1_generated_DocumentLinkService_ListLinkedTargets_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the document, for which all target links are - * returned. Format: - * projects/{project_number}/locations/{location}/documents/{target_document_id}. - */ - // const parent = 'abc123' - /** - * The meta information collected about the document creator, used to enforce - * access control for the service. - */ - // const requestMetadata = {} - - // Imports the Contentwarehouse library - const {DocumentLinkServiceClient} = require('@google-cloud/contentwarehouse').v1; - - // Instantiates a client - const contentwarehouseClient = new DocumentLinkServiceClient(); - - async function callListLinkedTargets() { - // Construct request - const request = { - parent, - }; - - // Run request - const response = await contentwarehouseClient.listLinkedTargets(request); - console.log(response); - } - - callListLinkedTargets(); - // [END contentwarehouse_v1_generated_DocumentLinkService_ListLinkedTargets_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_schema_service.create_document_schema.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_schema_service.create_document_schema.js deleted file mode 100644 index a112f4c5678..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_schema_service.create_document_schema.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, documentSchema) { - // [START contentwarehouse_v1_generated_DocumentSchemaService_CreateDocumentSchema_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent name. - */ - // const parent = 'abc123' - /** - * Required. The document schema to create. - */ - // const documentSchema = {} - - // Imports the Contentwarehouse library - const {DocumentSchemaServiceClient} = require('@google-cloud/contentwarehouse').v1; - - // Instantiates a client - const contentwarehouseClient = new DocumentSchemaServiceClient(); - - async function callCreateDocumentSchema() { - // Construct request - const request = { - parent, - documentSchema, - }; - - // Run request - const response = await contentwarehouseClient.createDocumentSchema(request); - console.log(response); - } - - callCreateDocumentSchema(); - // [END contentwarehouse_v1_generated_DocumentSchemaService_CreateDocumentSchema_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_schema_service.delete_document_schema.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_schema_service.delete_document_schema.js deleted file mode 100644 index a664ffa9dd2..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_schema_service.delete_document_schema.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START contentwarehouse_v1_generated_DocumentSchemaService_DeleteDocumentSchema_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the document schema to delete. - */ - // const name = 'abc123' - - // Imports the Contentwarehouse library - const {DocumentSchemaServiceClient} = require('@google-cloud/contentwarehouse').v1; - - // Instantiates a client - const contentwarehouseClient = new DocumentSchemaServiceClient(); - - async function callDeleteDocumentSchema() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await contentwarehouseClient.deleteDocumentSchema(request); - console.log(response); - } - - callDeleteDocumentSchema(); - // [END contentwarehouse_v1_generated_DocumentSchemaService_DeleteDocumentSchema_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_schema_service.get_document_schema.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_schema_service.get_document_schema.js deleted file mode 100644 index cc6b7231f4a..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_schema_service.get_document_schema.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START contentwarehouse_v1_generated_DocumentSchemaService_GetDocumentSchema_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the document schema to retrieve. - */ - // const name = 'abc123' - - // Imports the Contentwarehouse library - const {DocumentSchemaServiceClient} = require('@google-cloud/contentwarehouse').v1; - - // Instantiates a client - const contentwarehouseClient = new DocumentSchemaServiceClient(); - - async function callGetDocumentSchema() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await contentwarehouseClient.getDocumentSchema(request); - console.log(response); - } - - callGetDocumentSchema(); - // [END contentwarehouse_v1_generated_DocumentSchemaService_GetDocumentSchema_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_schema_service.list_document_schemas.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_schema_service.list_document_schemas.js deleted file mode 100644 index 6c0e14ff672..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_schema_service.list_document_schemas.js +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START contentwarehouse_v1_generated_DocumentSchemaService_ListDocumentSchemas_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent, which owns this collection of document schemas. - * Format: projects/{project_number}/locations/{location}. - */ - // const parent = 'abc123' - /** - * The maximum number of document schemas to return. The service may return - * fewer than this value. - * If unspecified, at most 50 document schemas will be returned. - * The maximum value is 1000; values above 1000 will be coerced to 1000. - */ - // const pageSize = 1234 - /** - * A page token, received from a previous `ListDocumentSchemas` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListDocumentSchemas` - * must match the call that provided the page token. - */ - // const pageToken = 'abc123' - - // Imports the Contentwarehouse library - const {DocumentSchemaServiceClient} = require('@google-cloud/contentwarehouse').v1; - - // Instantiates a client - const contentwarehouseClient = new DocumentSchemaServiceClient(); - - async function callListDocumentSchemas() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = contentwarehouseClient.listDocumentSchemasAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListDocumentSchemas(); - // [END contentwarehouse_v1_generated_DocumentSchemaService_ListDocumentSchemas_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_schema_service.update_document_schema.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_schema_service.update_document_schema.js deleted file mode 100644 index 40802f1b5dd..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_schema_service.update_document_schema.js +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name, documentSchema) { - // [START contentwarehouse_v1_generated_DocumentSchemaService_UpdateDocumentSchema_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the document schema to update. - * Format: - * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}. - */ - // const name = 'abc123' - /** - * Required. The document schema to update with. - */ - // const documentSchema = {} - - // Imports the Contentwarehouse library - const {DocumentSchemaServiceClient} = require('@google-cloud/contentwarehouse').v1; - - // Instantiates a client - const contentwarehouseClient = new DocumentSchemaServiceClient(); - - async function callUpdateDocumentSchema() { - // Construct request - const request = { - name, - documentSchema, - }; - - // Run request - const response = await contentwarehouseClient.updateDocumentSchema(request); - console.log(response); - } - - callUpdateDocumentSchema(); - // [END contentwarehouse_v1_generated_DocumentSchemaService_UpdateDocumentSchema_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.create_document.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.create_document.js deleted file mode 100644 index a056ee14a91..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.create_document.js +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, document) { - // [START contentwarehouse_v1_generated_DocumentService_CreateDocument_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent name. - * Format: projects/{project_number}/locations/{location}. - */ - // const parent = 'abc123' - /** - * Required. The document to create. - */ - // const document = {} - /** - * The meta information collected about the end user, used to enforce access - * control for the service. - */ - // const requestMetadata = {} - /** - * Default document policy during creation. - * This refers to an Identity and Access (IAM) policy, which specifies access - * controls for the Document. - * Conditions defined in the policy will be ignored. - */ - // const policy = {} - /** - * Request Option for processing Cloud AI Document in Document Warehouse. - * This field offers limited support for mapping entities from Cloud AI - * Document to Warehouse Document. Please consult with product team before - * using this field and other available options. - */ - // const cloudAiDocumentOption = {} - /** - * Field mask for creating Document fields. If mask path is empty, - * it means all fields are masked. - * For the `FieldMask` definition, - * see - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask. - */ - // const createMask = {} - - // Imports the Contentwarehouse library - const {DocumentServiceClient} = require('@google-cloud/contentwarehouse').v1; - - // Instantiates a client - const contentwarehouseClient = new DocumentServiceClient(); - - async function callCreateDocument() { - // Construct request - const request = { - parent, - document, - }; - - // Run request - const response = await contentwarehouseClient.createDocument(request); - console.log(response); - } - - callCreateDocument(); - // [END contentwarehouse_v1_generated_DocumentService_CreateDocument_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.delete_document.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.delete_document.js deleted file mode 100644 index 386331ba9c7..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.delete_document.js +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START contentwarehouse_v1_generated_DocumentService_DeleteDocument_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the document to delete. - * Format: - * projects/{project_number}/locations/{location}/documents/{document_id} - * or - * projects/{project_number}/locations/{location}/documents/referenceId/{reference_id}. - */ - // const name = 'abc123' - /** - * The meta information collected about the end user, used to enforce access - * control for the service. - */ - // const requestMetadata = {} - - // Imports the Contentwarehouse library - const {DocumentServiceClient} = require('@google-cloud/contentwarehouse').v1; - - // Instantiates a client - const contentwarehouseClient = new DocumentServiceClient(); - - async function callDeleteDocument() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await contentwarehouseClient.deleteDocument(request); - console.log(response); - } - - callDeleteDocument(); - // [END contentwarehouse_v1_generated_DocumentService_DeleteDocument_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.fetch_acl.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.fetch_acl.js deleted file mode 100644 index bab03a270e1..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.fetch_acl.js +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(resource) { - // [START contentwarehouse_v1_generated_DocumentService_FetchAcl_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. REQUIRED: The resource for which the policy is being requested. - * Format for document: - * projects/{project_number}/locations/{location}/documents/{document_id}. - * Format for collection: - * projects/{project_number}/locations/{location}/collections/{collection_id}. - * Format for project: projects/{project_number}. - */ - // const resource = 'abc123' - /** - * The meta information collected about the end user, used to enforce access - * control for the service. - */ - // const requestMetadata = {} - /** - * For Get Project ACL only. Authorization check for end user will be ignored - * when project_owner=true. - */ - // const projectOwner = true - - // Imports the Contentwarehouse library - const {DocumentServiceClient} = require('@google-cloud/contentwarehouse').v1; - - // Instantiates a client - const contentwarehouseClient = new DocumentServiceClient(); - - async function callFetchAcl() { - // Construct request - const request = { - resource, - }; - - // Run request - const response = await contentwarehouseClient.fetchAcl(request); - console.log(response); - } - - callFetchAcl(); - // [END contentwarehouse_v1_generated_DocumentService_FetchAcl_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.get_document.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.get_document.js deleted file mode 100644 index 6f00ab8ab0d..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.get_document.js +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START contentwarehouse_v1_generated_DocumentService_GetDocument_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the document to retrieve. - * Format: - * projects/{project_number}/locations/{location}/documents/{document_id} or - * projects/{project_number}/locations/{location}/documents/referenceId/{reference_id}. - */ - // const name = 'abc123' - /** - * The meta information collected about the end user, used to enforce access - * control for the service. - */ - // const requestMetadata = {} - - // Imports the Contentwarehouse library - const {DocumentServiceClient} = require('@google-cloud/contentwarehouse').v1; - - // Instantiates a client - const contentwarehouseClient = new DocumentServiceClient(); - - async function callGetDocument() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await contentwarehouseClient.getDocument(request); - console.log(response); - } - - callGetDocument(); - // [END contentwarehouse_v1_generated_DocumentService_GetDocument_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.lock_document.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.lock_document.js deleted file mode 100644 index 0c6e8dd36d6..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.lock_document.js +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START contentwarehouse_v1_generated_DocumentService_LockDocument_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the document to lock. - * Format: - * projects/{project_number}/locations/{location}/documents/{document}. - */ - // const name = 'abc123' - /** - * The collection the document connects to. - */ - // const collectionId = 'abc123' - /** - * The user information who locks the document. - */ - // const lockingUser = {} - - // Imports the Contentwarehouse library - const {DocumentServiceClient} = require('@google-cloud/contentwarehouse').v1; - - // Instantiates a client - const contentwarehouseClient = new DocumentServiceClient(); - - async function callLockDocument() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await contentwarehouseClient.lockDocument(request); - console.log(response); - } - - callLockDocument(); - // [END contentwarehouse_v1_generated_DocumentService_LockDocument_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.search_documents.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.search_documents.js deleted file mode 100644 index 90c508fec1e..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.search_documents.js +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START contentwarehouse_v1_generated_DocumentService_SearchDocuments_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent, which owns this collection of documents. - * Format: projects/{project_number}/locations/{location}. - */ - // const parent = 'abc123' - /** - * The meta information collected about the end user, used to enforce access - * control and improve the search quality of the service. - */ - // const requestMetadata = {} - /** - * Query used to search against documents (keyword, filters, etc.). - */ - // const documentQuery = {} - /** - * An integer that specifies the current offset (that is, starting result - * location, amongst the documents deemed by the API as relevant) in search - * results. This field is only considered if - * page_token google.cloud.contentwarehouse.v1.SearchDocumentsRequest.page_token - * is unset. - * The maximum allowed value is 5000. Otherwise an error is thrown. - * For example, 0 means to return results starting from the first matching - * document, and 10 means to return from the 11th document. This can be used - * for pagination, (for example, pageSize = 10 and offset = 10 means to return - * from the second page). - */ - // const offset = 1234 - /** - * A limit on the number of documents returned in the search results. - * Increasing this value above the default value of 10 can increase search - * response time. The value can be between 1 and 100. - */ - // const pageSize = 1234 - /** - * The token specifying the current offset within search results. - * See - * SearchDocumentsResponse.next_page_token google.cloud.contentwarehouse.v1.SearchDocumentsResponse.next_page_token - * for an explanation of how to obtain the next set of query results. - */ - // const pageToken = 'abc123' - /** - * The criteria determining how search results are sorted. For non-empty - * query, default is `"relevance desc"`. For empty query, default is - * `"upload_date desc"`. - * Supported options are: - * * `"relevance desc"`: By relevance descending, as determined by the API - * algorithms. - * * `"upload_date desc"`: By upload date descending. - * * `"upload_date"`: By upload date ascending. - * * `"update_date desc"`: By last updated date descending. - * * `"update_date"`: By last updated date ascending. - * * `"retrieval_importance desc"`: By retrieval importance of properties - * descending. This feature is still under development, please do not use - * unless otherwise instructed to do so. - */ - // const orderBy = 'abc123' - /** - * An expression specifying a histogram request against matching - * documents. Expression syntax is an aggregation function call with - * histogram facets and other options. - * The following aggregation functions are supported: - * * `count(string_histogram_facet)`: Count the number of matching entities - * for each distinct attribute value. - * Data types: - * * Histogram facet (aka filterable properties): Facet names with format - * <schema id>.<facet>. Facets will have the - * format of: `[a-zA-Z][a-zA-Z0-9_:/-.]`. If the facet is a child - * facet, then the parent hierarchy needs to be specified separated by - * dots in the prefix after the schema id. Thus, the format for a multi- - * level facet is: <schema id>.<parent facet name>. - * <child facet name>. Example: - * schema123.root_parent_facet.middle_facet.child_facet - * * DocumentSchemaId: (with no schema id prefix) to get - * histograms for each document type (returns the schema id path, e.g. - * projects/12345/locations/us-west/documentSchemas/abc123). - * Example expression: - * * Document type counts: - * count('DocumentSchemaId') - * * For schema id, abc123, get the counts for MORTGAGE_TYPE: - * count('abc123.MORTGAGE_TYPE') - */ - // const histogramQueries = [1,2,3,4] - /** - * Controls if the search document request requires the return of a total size - * of matched documents. See - * SearchDocumentsResponse.total_size google.cloud.contentwarehouse.v1.SearchDocumentsResponse.total_size. - * Enabling this flag may adversely impact performance. Hint: If this is - * used with pagination, set this flag on the initial query but set this - * to false on subsequent page calls (keep the total count locally). - * Defaults to false. - */ - // const requireTotalSize = true - /** - * Controls if the search document request requires the return of a total size - * of matched documents. See - * SearchDocumentsResponse.total_size google.cloud.contentwarehouse.v1.SearchDocumentsResponse.total_size. - */ - // const totalResultSize = {} - /** - * Experimental, do not use. - * The limit on the number of documents returned for the question-answering - * feature. To enable the question-answering feature, set - * DocumentQuery.is_nl_query to true. - */ - // const qaSizeLimit = 1234 - - // Imports the Contentwarehouse library - const {DocumentServiceClient} = require('@google-cloud/contentwarehouse').v1; - - // Instantiates a client - const contentwarehouseClient = new DocumentServiceClient(); - - async function callSearchDocuments() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = contentwarehouseClient.searchDocumentsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callSearchDocuments(); - // [END contentwarehouse_v1_generated_DocumentService_SearchDocuments_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.set_acl.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.set_acl.js deleted file mode 100644 index ad763044022..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.set_acl.js +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(resource, policy) { - // [START contentwarehouse_v1_generated_DocumentService_SetAcl_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. REQUIRED: The resource for which the policy is being requested. - * Format for document: - * projects/{project_number}/locations/{location}/documents/{document_id}. - * Format for collection: - * projects/{project_number}/locations/{location}/collections/{collection_id}. - * Format for project: projects/{project_number}. - */ - // const resource = 'abc123' - /** - * Required. REQUIRED: The complete policy to be applied to the `resource`. - * The size of the policy is limited to a few 10s of KB. This refers to an - * Identity and Access (IAM) policy, which specifies access controls for the - * Document. - * You can set ACL with condition for projects only. - * Supported operators are: `=`, `!=`, `<`, `<=`, `>`, and `>=` where - * the left of the operator is `DocumentSchemaId` or property name and the - * right of the operator is a number or a quoted string. You must escape - * backslash (\\) and quote (\") characters. - * Boolean expressions (AND/OR) are supported up to 3 levels of nesting (for - * example, "((A AND B AND C) OR D) AND E"), a maximum of 10 comparisons are - * allowed in the expression. The expression must be < 6000 bytes in length. - * Sample condition: - * `"DocumentSchemaId = \"some schema id\" OR SchemaId.floatPropertyName - * >= 10"` - */ - // const policy = {} - /** - * The meta information collected about the end user, used to enforce access - * control for the service. - */ - // const requestMetadata = {} - /** - * For Set Project ACL only. Authorization check for end user will be ignored - * when project_owner=true. - */ - // const projectOwner = true - - // Imports the Contentwarehouse library - const {DocumentServiceClient} = require('@google-cloud/contentwarehouse').v1; - - // Instantiates a client - const contentwarehouseClient = new DocumentServiceClient(); - - async function callSetAcl() { - // Construct request - const request = { - resource, - policy, - }; - - // Run request - const response = await contentwarehouseClient.setAcl(request); - console.log(response); - } - - callSetAcl(); - // [END contentwarehouse_v1_generated_DocumentService_SetAcl_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.update_document.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.update_document.js deleted file mode 100644 index 43e0dd4ce75..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/document_service.update_document.js +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name, document) { - // [START contentwarehouse_v1_generated_DocumentService_UpdateDocument_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the document to update. - * Format: - * projects/{project_number}/locations/{location}/documents/{document_id} - * or - * projects/{project_number}/locations/{location}/documents/referenceId/{reference_id}. - */ - // const name = 'abc123' - /** - * Required. The document to update. - */ - // const document = {} - /** - * The meta information collected about the end user, used to enforce access - * control for the service. - */ - // const requestMetadata = {} - /** - * Request Option for processing Cloud AI Document in Document Warehouse. - * This field offers limited support for mapping entities from Cloud AI - * Document to Warehouse Document. Please consult with product team before - * using this field and other available options. - */ - // const cloudAiDocumentOption = {} - /** - * Options for the update operation. - */ - // const updateOptions = {} - - // Imports the Contentwarehouse library - const {DocumentServiceClient} = require('@google-cloud/contentwarehouse').v1; - - // Instantiates a client - const contentwarehouseClient = new DocumentServiceClient(); - - async function callUpdateDocument() { - // Construct request - const request = { - name, - document, - }; - - // Run request - const response = await contentwarehouseClient.updateDocument(request); - console.log(response); - } - - callUpdateDocument(); - // [END contentwarehouse_v1_generated_DocumentService_UpdateDocument_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/pipeline_service.run_pipeline.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/pipeline_service.run_pipeline.js deleted file mode 100644 index e3704ceb790..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/pipeline_service.run_pipeline.js +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START contentwarehouse_v1_generated_PipelineService_RunPipeline_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name which owns the resources of the pipeline. - * Format: projects/{project_number}/locations/{location}. - */ - // const name = 'abc123' - /** - * Cloud Storage ingestion pipeline. - */ - // const gcsIngestPipeline = {} - /** - * Use DocAI processors to process documents in Cloud Storage and ingest - * them to Document Warehouse. - */ - // const gcsIngestWithDocAiProcessorsPipeline = {} - /** - * Export docuemnts from Document Warehouse to CDW for training purpose. - */ - // const exportCdwPipeline = {} - /** - * Use a DocAI processor to process documents in Document Warehouse, and - * re-ingest the updated results into Document Warehouse. - */ - // const processWithDocAiPipeline = {} - /** - * The meta information collected about the end user, used to enforce access - * control for the service. - */ - // const requestMetadata = {} - - // Imports the Contentwarehouse library - const {PipelineServiceClient} = require('@google-cloud/contentwarehouse').v1; - - // Instantiates a client - const contentwarehouseClient = new PipelineServiceClient(); - - async function callRunPipeline() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await contentwarehouseClient.runPipeline(request); - const [response] = await operation.promise(); - console.log(response); - } - - callRunPipeline(); - // [END contentwarehouse_v1_generated_PipelineService_RunPipeline_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/rule_set_service.create_rule_set.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/rule_set_service.create_rule_set.js deleted file mode 100644 index c5465d4d8af..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/rule_set_service.create_rule_set.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, ruleSet) { - // [START contentwarehouse_v1_generated_RuleSetService_CreateRuleSet_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent name. - * Format: projects/{project_number}/locations/{location}. - */ - // const parent = 'abc123' - /** - * Required. The rule set to create. - */ - // const ruleSet = {} - - // Imports the Contentwarehouse library - const {RuleSetServiceClient} = require('@google-cloud/contentwarehouse').v1; - - // Instantiates a client - const contentwarehouseClient = new RuleSetServiceClient(); - - async function callCreateRuleSet() { - // Construct request - const request = { - parent, - ruleSet, - }; - - // Run request - const response = await contentwarehouseClient.createRuleSet(request); - console.log(response); - } - - callCreateRuleSet(); - // [END contentwarehouse_v1_generated_RuleSetService_CreateRuleSet_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/rule_set_service.delete_rule_set.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/rule_set_service.delete_rule_set.js deleted file mode 100644 index e7080517a33..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/rule_set_service.delete_rule_set.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START contentwarehouse_v1_generated_RuleSetService_DeleteRuleSet_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the rule set to delete. - * Format: - * projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}. - */ - // const name = 'abc123' - - // Imports the Contentwarehouse library - const {RuleSetServiceClient} = require('@google-cloud/contentwarehouse').v1; - - // Instantiates a client - const contentwarehouseClient = new RuleSetServiceClient(); - - async function callDeleteRuleSet() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await contentwarehouseClient.deleteRuleSet(request); - console.log(response); - } - - callDeleteRuleSet(); - // [END contentwarehouse_v1_generated_RuleSetService_DeleteRuleSet_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/rule_set_service.get_rule_set.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/rule_set_service.get_rule_set.js deleted file mode 100644 index 34404dbad31..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/rule_set_service.get_rule_set.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START contentwarehouse_v1_generated_RuleSetService_GetRuleSet_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the rule set to retrieve. - * Format: - * projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}. - */ - // const name = 'abc123' - - // Imports the Contentwarehouse library - const {RuleSetServiceClient} = require('@google-cloud/contentwarehouse').v1; - - // Instantiates a client - const contentwarehouseClient = new RuleSetServiceClient(); - - async function callGetRuleSet() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await contentwarehouseClient.getRuleSet(request); - console.log(response); - } - - callGetRuleSet(); - // [END contentwarehouse_v1_generated_RuleSetService_GetRuleSet_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/rule_set_service.list_rule_sets.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/rule_set_service.list_rule_sets.js deleted file mode 100644 index ade3218846a..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/rule_set_service.list_rule_sets.js +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START contentwarehouse_v1_generated_RuleSetService_ListRuleSets_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent, which owns this collection of document. - * Format: projects/{project_number}/locations/{location}. - */ - // const parent = 'abc123' - /** - * The maximum number of rule sets to return. The service may return - * fewer than this value. - * If unspecified, at most 50 rule sets will be returned. - * The maximum value is 1000; values above 1000 will be coerced to 1000. - */ - // const pageSize = 1234 - /** - * A page token, received from a previous `ListRuleSets` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListRuleSets` - * must match the call that provided the page token. - */ - // const pageToken = 'abc123' - - // Imports the Contentwarehouse library - const {RuleSetServiceClient} = require('@google-cloud/contentwarehouse').v1; - - // Instantiates a client - const contentwarehouseClient = new RuleSetServiceClient(); - - async function callListRuleSets() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = contentwarehouseClient.listRuleSetsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListRuleSets(); - // [END contentwarehouse_v1_generated_RuleSetService_ListRuleSets_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/rule_set_service.update_rule_set.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/rule_set_service.update_rule_set.js deleted file mode 100644 index 38a0adf11bc..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/rule_set_service.update_rule_set.js +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name, ruleSet) { - // [START contentwarehouse_v1_generated_RuleSetService_UpdateRuleSet_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the rule set to update. - * Format: - * projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}. - */ - // const name = 'abc123' - /** - * Required. The rule set to update. - */ - // const ruleSet = {} - - // Imports the Contentwarehouse library - const {RuleSetServiceClient} = require('@google-cloud/contentwarehouse').v1; - - // Instantiates a client - const contentwarehouseClient = new RuleSetServiceClient(); - - async function callUpdateRuleSet() { - // Construct request - const request = { - name, - ruleSet, - }; - - // Run request - const response = await contentwarehouseClient.updateRuleSet(request); - console.log(response); - } - - callUpdateRuleSet(); - // [END contentwarehouse_v1_generated_RuleSetService_UpdateRuleSet_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/snippet_metadata_google.cloud.contentwarehouse.v1.json b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/snippet_metadata_google.cloud.contentwarehouse.v1.json deleted file mode 100644 index 52a33abeeea..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/snippet_metadata_google.cloud.contentwarehouse.v1.json +++ /dev/null @@ -1,1343 +0,0 @@ -{ - "clientLibrary": { - "name": "nodejs-contentwarehouse", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.contentwarehouse.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "regionTag": "contentwarehouse_v1_generated_DocumentLinkService_ListLinkedTargets_async", - "title": "DocumentLinkService listLinkedTargets Sample", - "origin": "API_DEFINITION", - "description": " Return all target document-links from the document.", - "canonical": true, - "file": "document_link_service.list_linked_targets.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 60, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListLinkedTargets", - "fullName": "google.cloud.contentwarehouse.v1.DocumentLinkService.ListLinkedTargets", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "request_metadata", - "type": ".google.cloud.contentwarehouse.v1.RequestMetadata" - } - ], - "resultType": ".google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse", - "client": { - "shortName": "DocumentLinkServiceClient", - "fullName": "google.cloud.contentwarehouse.v1.DocumentLinkServiceClient" - }, - "method": { - "shortName": "ListLinkedTargets", - "fullName": "google.cloud.contentwarehouse.v1.DocumentLinkService.ListLinkedTargets", - "service": { - "shortName": "DocumentLinkService", - "fullName": "google.cloud.contentwarehouse.v1.DocumentLinkService" - } - } - } - }, - { - "regionTag": "contentwarehouse_v1_generated_DocumentLinkService_ListLinkedSources_async", - "title": "DocumentLinkService listLinkedSources Sample", - "origin": "API_DEFINITION", - "description": " Return all source document-links from the document.", - "canonical": true, - "file": "document_link_service.list_linked_sources.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 76, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListLinkedSources", - "fullName": "google.cloud.contentwarehouse.v1.DocumentLinkService.ListLinkedSources", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "request_metadata", - "type": ".google.cloud.contentwarehouse.v1.RequestMetadata" - } - ], - "resultType": ".google.cloud.contentwarehouse.v1.ListLinkedSourcesResponse", - "client": { - "shortName": "DocumentLinkServiceClient", - "fullName": "google.cloud.contentwarehouse.v1.DocumentLinkServiceClient" - }, - "method": { - "shortName": "ListLinkedSources", - "fullName": "google.cloud.contentwarehouse.v1.DocumentLinkService.ListLinkedSources", - "service": { - "shortName": "DocumentLinkService", - "fullName": "google.cloud.contentwarehouse.v1.DocumentLinkService" - } - } - } - }, - { - "regionTag": "contentwarehouse_v1_generated_DocumentLinkService_CreateDocumentLink_async", - "title": "DocumentLinkService createDocumentLink Sample", - "origin": "API_DEFINITION", - "description": " Create a link between a source document and a target document.", - "canonical": true, - "file": "document_link_service.create_document_link.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 67, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateDocumentLink", - "fullName": "google.cloud.contentwarehouse.v1.DocumentLinkService.CreateDocumentLink", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "document_link", - "type": ".google.cloud.contentwarehouse.v1.DocumentLink" - }, - { - "name": "request_metadata", - "type": ".google.cloud.contentwarehouse.v1.RequestMetadata" - } - ], - "resultType": ".google.cloud.contentwarehouse.v1.DocumentLink", - "client": { - "shortName": "DocumentLinkServiceClient", - "fullName": "google.cloud.contentwarehouse.v1.DocumentLinkServiceClient" - }, - "method": { - "shortName": "CreateDocumentLink", - "fullName": "google.cloud.contentwarehouse.v1.DocumentLinkService.CreateDocumentLink", - "service": { - "shortName": "DocumentLinkService", - "fullName": "google.cloud.contentwarehouse.v1.DocumentLinkService" - } - } - } - }, - { - "regionTag": "contentwarehouse_v1_generated_DocumentLinkService_DeleteDocumentLink_async", - "title": "DocumentLinkService deleteDocumentLink Sample", - "origin": "API_DEFINITION", - "description": " Remove the link between the source and target documents.", - "canonical": true, - "file": "document_link_service.delete_document_link.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 60, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteDocumentLink", - "fullName": "google.cloud.contentwarehouse.v1.DocumentLinkService.DeleteDocumentLink", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_metadata", - "type": ".google.cloud.contentwarehouse.v1.RequestMetadata" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "DocumentLinkServiceClient", - "fullName": "google.cloud.contentwarehouse.v1.DocumentLinkServiceClient" - }, - "method": { - "shortName": "DeleteDocumentLink", - "fullName": "google.cloud.contentwarehouse.v1.DocumentLinkService.DeleteDocumentLink", - "service": { - "shortName": "DocumentLinkService", - "fullName": "google.cloud.contentwarehouse.v1.DocumentLinkService" - } - } - } - }, - { - "regionTag": "contentwarehouse_v1_generated_DocumentSchemaService_CreateDocumentSchema_async", - "title": "DocumentLinkService createDocumentSchema Sample", - "origin": "API_DEFINITION", - "description": " Creates a document schema.", - "canonical": true, - "file": "document_schema_service.create_document_schema.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateDocumentSchema", - "fullName": "google.cloud.contentwarehouse.v1.DocumentSchemaService.CreateDocumentSchema", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "document_schema", - "type": ".google.cloud.contentwarehouse.v1.DocumentSchema" - } - ], - "resultType": ".google.cloud.contentwarehouse.v1.DocumentSchema", - "client": { - "shortName": "DocumentSchemaServiceClient", - "fullName": "google.cloud.contentwarehouse.v1.DocumentSchemaServiceClient" - }, - "method": { - "shortName": "CreateDocumentSchema", - "fullName": "google.cloud.contentwarehouse.v1.DocumentSchemaService.CreateDocumentSchema", - "service": { - "shortName": "DocumentSchemaService", - "fullName": "google.cloud.contentwarehouse.v1.DocumentSchemaService" - } - } - } - }, - { - "regionTag": "contentwarehouse_v1_generated_DocumentSchemaService_UpdateDocumentSchema_async", - "title": "DocumentLinkService updateDocumentSchema Sample", - "origin": "API_DEFINITION", - "description": " Updates a Document Schema. Returns INVALID_ARGUMENT if the name of the Document Schema is non-empty and does not equal the existing name. Supports only appending new properties, adding new ENUM possible values, and updating the [EnumTypeOptions.validation_check_disabled][google.cloud.contentwarehouse.v1.EnumTypeOptions.validation_check_disabled] flag for ENUM possible values. Updating existing properties will result into INVALID_ARGUMENT.", - "canonical": true, - "file": "document_schema_service.update_document_schema.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 60, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateDocumentSchema", - "fullName": "google.cloud.contentwarehouse.v1.DocumentSchemaService.UpdateDocumentSchema", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "document_schema", - "type": ".google.cloud.contentwarehouse.v1.DocumentSchema" - } - ], - "resultType": ".google.cloud.contentwarehouse.v1.DocumentSchema", - "client": { - "shortName": "DocumentSchemaServiceClient", - "fullName": "google.cloud.contentwarehouse.v1.DocumentSchemaServiceClient" - }, - "method": { - "shortName": "UpdateDocumentSchema", - "fullName": "google.cloud.contentwarehouse.v1.DocumentSchemaService.UpdateDocumentSchema", - "service": { - "shortName": "DocumentSchemaService", - "fullName": "google.cloud.contentwarehouse.v1.DocumentSchemaService" - } - } - } - }, - { - "regionTag": "contentwarehouse_v1_generated_DocumentSchemaService_GetDocumentSchema_async", - "title": "DocumentLinkService getDocumentSchema Sample", - "origin": "API_DEFINITION", - "description": " Gets a document schema. Returns NOT_FOUND if the document schema does not exist.", - "canonical": true, - "file": "document_schema_service.get_document_schema.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetDocumentSchema", - "fullName": "google.cloud.contentwarehouse.v1.DocumentSchemaService.GetDocumentSchema", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.contentwarehouse.v1.DocumentSchema", - "client": { - "shortName": "DocumentSchemaServiceClient", - "fullName": "google.cloud.contentwarehouse.v1.DocumentSchemaServiceClient" - }, - "method": { - "shortName": "GetDocumentSchema", - "fullName": "google.cloud.contentwarehouse.v1.DocumentSchemaService.GetDocumentSchema", - "service": { - "shortName": "DocumentSchemaService", - "fullName": "google.cloud.contentwarehouse.v1.DocumentSchemaService" - } - } - } - }, - { - "regionTag": "contentwarehouse_v1_generated_DocumentSchemaService_DeleteDocumentSchema_async", - "title": "DocumentLinkService deleteDocumentSchema Sample", - "origin": "API_DEFINITION", - "description": " Deletes a document schema. Returns NOT_FOUND if the document schema does not exist. Returns BAD_REQUEST if the document schema has documents depending on it.", - "canonical": true, - "file": "document_schema_service.delete_document_schema.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteDocumentSchema", - "fullName": "google.cloud.contentwarehouse.v1.DocumentSchemaService.DeleteDocumentSchema", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "DocumentSchemaServiceClient", - "fullName": "google.cloud.contentwarehouse.v1.DocumentSchemaServiceClient" - }, - "method": { - "shortName": "DeleteDocumentSchema", - "fullName": "google.cloud.contentwarehouse.v1.DocumentSchemaService.DeleteDocumentSchema", - "service": { - "shortName": "DocumentSchemaService", - "fullName": "google.cloud.contentwarehouse.v1.DocumentSchemaService" - } - } - } - }, - { - "regionTag": "contentwarehouse_v1_generated_DocumentSchemaService_ListDocumentSchemas_async", - "title": "DocumentLinkService listDocumentSchemas Sample", - "origin": "API_DEFINITION", - "description": " Lists document schemas.", - "canonical": true, - "file": "document_schema_service.list_document_schemas.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 70, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListDocumentSchemas", - "fullName": "google.cloud.contentwarehouse.v1.DocumentSchemaService.ListDocumentSchemas", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.contentwarehouse.v1.ListDocumentSchemasResponse", - "client": { - "shortName": "DocumentSchemaServiceClient", - "fullName": "google.cloud.contentwarehouse.v1.DocumentSchemaServiceClient" - }, - "method": { - "shortName": "ListDocumentSchemas", - "fullName": "google.cloud.contentwarehouse.v1.DocumentSchemaService.ListDocumentSchemas", - "service": { - "shortName": "DocumentSchemaService", - "fullName": "google.cloud.contentwarehouse.v1.DocumentSchemaService" - } - } - } - }, - { - "regionTag": "contentwarehouse_v1_generated_DocumentService_CreateDocument_async", - "title": "DocumentLinkService createDocument Sample", - "origin": "API_DEFINITION", - "description": " Creates a document.", - "canonical": true, - "file": "document_service.create_document.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 86, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateDocument", - "fullName": "google.cloud.contentwarehouse.v1.DocumentService.CreateDocument", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "document", - "type": ".google.cloud.contentwarehouse.v1.Document" - }, - { - "name": "request_metadata", - "type": ".google.cloud.contentwarehouse.v1.RequestMetadata" - }, - { - "name": "policy", - "type": ".google.iam.v1.Policy" - }, - { - "name": "cloud_ai_document_option", - "type": ".google.cloud.contentwarehouse.v1.CloudAIDocumentOption" - }, - { - "name": "create_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.contentwarehouse.v1.CreateDocumentResponse", - "client": { - "shortName": "DocumentServiceClient", - "fullName": "google.cloud.contentwarehouse.v1.DocumentServiceClient" - }, - "method": { - "shortName": "CreateDocument", - "fullName": "google.cloud.contentwarehouse.v1.DocumentService.CreateDocument", - "service": { - "shortName": "DocumentService", - "fullName": "google.cloud.contentwarehouse.v1.DocumentService" - } - } - } - }, - { - "regionTag": "contentwarehouse_v1_generated_DocumentService_GetDocument_async", - "title": "DocumentLinkService getDocument Sample", - "origin": "API_DEFINITION", - "description": " Gets a document. Returns NOT_FOUND if the document does not exist.", - "canonical": true, - "file": "document_service.get_document.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 61, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetDocument", - "fullName": "google.cloud.contentwarehouse.v1.DocumentService.GetDocument", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_metadata", - "type": ".google.cloud.contentwarehouse.v1.RequestMetadata" - } - ], - "resultType": ".google.cloud.contentwarehouse.v1.Document", - "client": { - "shortName": "DocumentServiceClient", - "fullName": "google.cloud.contentwarehouse.v1.DocumentServiceClient" - }, - "method": { - "shortName": "GetDocument", - "fullName": "google.cloud.contentwarehouse.v1.DocumentService.GetDocument", - "service": { - "shortName": "DocumentService", - "fullName": "google.cloud.contentwarehouse.v1.DocumentService" - } - } - } - }, - { - "regionTag": "contentwarehouse_v1_generated_DocumentService_UpdateDocument_async", - "title": "DocumentLinkService updateDocument Sample", - "origin": "API_DEFINITION", - "description": " Updates a document. Returns INVALID_ARGUMENT if the name of the document is non-empty and does not equal the existing name.", - "canonical": true, - "file": "document_service.update_document.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 78, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateDocument", - "fullName": "google.cloud.contentwarehouse.v1.DocumentService.UpdateDocument", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "document", - "type": ".google.cloud.contentwarehouse.v1.Document" - }, - { - "name": "request_metadata", - "type": ".google.cloud.contentwarehouse.v1.RequestMetadata" - }, - { - "name": "cloud_ai_document_option", - "type": ".google.cloud.contentwarehouse.v1.CloudAIDocumentOption" - }, - { - "name": "update_options", - "type": ".google.cloud.contentwarehouse.v1.UpdateOptions" - } - ], - "resultType": ".google.cloud.contentwarehouse.v1.UpdateDocumentResponse", - "client": { - "shortName": "DocumentServiceClient", - "fullName": "google.cloud.contentwarehouse.v1.DocumentServiceClient" - }, - "method": { - "shortName": "UpdateDocument", - "fullName": "google.cloud.contentwarehouse.v1.DocumentService.UpdateDocument", - "service": { - "shortName": "DocumentService", - "fullName": "google.cloud.contentwarehouse.v1.DocumentService" - } - } - } - }, - { - "regionTag": "contentwarehouse_v1_generated_DocumentService_DeleteDocument_async", - "title": "DocumentLinkService deleteDocument Sample", - "origin": "API_DEFINITION", - "description": " Deletes a document. Returns NOT_FOUND if the document does not exist.", - "canonical": true, - "file": "document_service.delete_document.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 62, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteDocument", - "fullName": "google.cloud.contentwarehouse.v1.DocumentService.DeleteDocument", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_metadata", - "type": ".google.cloud.contentwarehouse.v1.RequestMetadata" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "DocumentServiceClient", - "fullName": "google.cloud.contentwarehouse.v1.DocumentServiceClient" - }, - "method": { - "shortName": "DeleteDocument", - "fullName": "google.cloud.contentwarehouse.v1.DocumentService.DeleteDocument", - "service": { - "shortName": "DocumentService", - "fullName": "google.cloud.contentwarehouse.v1.DocumentService" - } - } - } - }, - { - "regionTag": "contentwarehouse_v1_generated_DocumentService_SearchDocuments_async", - "title": "DocumentLinkService searchDocuments Sample", - "origin": "API_DEFINITION", - "description": " Searches for documents using provided [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest]. This call only returns documents that the caller has permission to search against.", - "canonical": true, - "file": "document_service.search_documents.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 156, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SearchDocuments", - "fullName": "google.cloud.contentwarehouse.v1.DocumentService.SearchDocuments", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "request_metadata", - "type": ".google.cloud.contentwarehouse.v1.RequestMetadata" - }, - { - "name": "document_query", - "type": ".google.cloud.contentwarehouse.v1.DocumentQuery" - }, - { - "name": "offset", - "type": "TYPE_INT32" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - }, - { - "name": "histogram_queries", - "type": "TYPE_MESSAGE[]" - }, - { - "name": "require_total_size", - "type": "TYPE_BOOL" - }, - { - "name": "total_result_size", - "type": ".google.cloud.contentwarehouse.v1.SearchDocumentsRequest.TotalResultSize" - }, - { - "name": "qa_size_limit", - "type": "TYPE_INT32" - } - ], - "resultType": ".google.cloud.contentwarehouse.v1.SearchDocumentsResponse", - "client": { - "shortName": "DocumentServiceClient", - "fullName": "google.cloud.contentwarehouse.v1.DocumentServiceClient" - }, - "method": { - "shortName": "SearchDocuments", - "fullName": "google.cloud.contentwarehouse.v1.DocumentService.SearchDocuments", - "service": { - "shortName": "DocumentService", - "fullName": "google.cloud.contentwarehouse.v1.DocumentService" - } - } - } - }, - { - "regionTag": "contentwarehouse_v1_generated_DocumentService_LockDocument_async", - "title": "DocumentLinkService lockDocument Sample", - "origin": "API_DEFINITION", - "description": " Lock the document so the document cannot be updated by other users.", - "canonical": true, - "file": "document_service.lock_document.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 63, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "LockDocument", - "fullName": "google.cloud.contentwarehouse.v1.DocumentService.LockDocument", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "collection_id", - "type": "TYPE_STRING" - }, - { - "name": "locking_user", - "type": ".google.cloud.contentwarehouse.v1.UserInfo" - } - ], - "resultType": ".google.cloud.contentwarehouse.v1.Document", - "client": { - "shortName": "DocumentServiceClient", - "fullName": "google.cloud.contentwarehouse.v1.DocumentServiceClient" - }, - "method": { - "shortName": "LockDocument", - "fullName": "google.cloud.contentwarehouse.v1.DocumentService.LockDocument", - "service": { - "shortName": "DocumentService", - "fullName": "google.cloud.contentwarehouse.v1.DocumentService" - } - } - } - }, - { - "regionTag": "contentwarehouse_v1_generated_DocumentService_FetchAcl_async", - "title": "DocumentLinkService fetchAcl Sample", - "origin": "API_DEFINITION", - "description": " Gets the access control policy for a resource. Returns NOT_FOUND error if the resource does not exist. Returns an empty policy if the resource exists but does not have a policy set.", - "canonical": true, - "file": "document_service.fetch_acl.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "FetchAcl", - "fullName": "google.cloud.contentwarehouse.v1.DocumentService.FetchAcl", - "async": true, - "parameters": [ - { - "name": "resource", - "type": "TYPE_STRING" - }, - { - "name": "request_metadata", - "type": ".google.cloud.contentwarehouse.v1.RequestMetadata" - }, - { - "name": "project_owner", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.cloud.contentwarehouse.v1.FetchAclResponse", - "client": { - "shortName": "DocumentServiceClient", - "fullName": "google.cloud.contentwarehouse.v1.DocumentServiceClient" - }, - "method": { - "shortName": "FetchAcl", - "fullName": "google.cloud.contentwarehouse.v1.DocumentService.FetchAcl", - "service": { - "shortName": "DocumentService", - "fullName": "google.cloud.contentwarehouse.v1.DocumentService" - } - } - } - }, - { - "regionTag": "contentwarehouse_v1_generated_DocumentService_SetAcl_async", - "title": "DocumentLinkService setAcl Sample", - "origin": "API_DEFINITION", - "description": " Sets the access control policy for a resource. Replaces any existing policy.", - "canonical": true, - "file": "document_service.set_acl.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 87, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetAcl", - "fullName": "google.cloud.contentwarehouse.v1.DocumentService.SetAcl", - "async": true, - "parameters": [ - { - "name": "resource", - "type": "TYPE_STRING" - }, - { - "name": "policy", - "type": ".google.iam.v1.Policy" - }, - { - "name": "request_metadata", - "type": ".google.cloud.contentwarehouse.v1.RequestMetadata" - }, - { - "name": "project_owner", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.cloud.contentwarehouse.v1.SetAclResponse", - "client": { - "shortName": "DocumentServiceClient", - "fullName": "google.cloud.contentwarehouse.v1.DocumentServiceClient" - }, - "method": { - "shortName": "SetAcl", - "fullName": "google.cloud.contentwarehouse.v1.DocumentService.SetAcl", - "service": { - "shortName": "DocumentService", - "fullName": "google.cloud.contentwarehouse.v1.DocumentService" - } - } - } - }, - { - "regionTag": "contentwarehouse_v1_generated_PipelineService_RunPipeline_async", - "title": "DocumentLinkService runPipeline Sample", - "origin": "API_DEFINITION", - "description": " Run a predefined pipeline.", - "canonical": true, - "file": "pipeline_service.run_pipeline.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 78, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RunPipeline", - "fullName": "google.cloud.contentwarehouse.v1.PipelineService.RunPipeline", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "gcs_ingest_pipeline", - "type": ".google.cloud.contentwarehouse.v1.GcsIngestPipeline" - }, - { - "name": "gcs_ingest_with_doc_ai_processors_pipeline", - "type": ".google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline" - }, - { - "name": "export_cdw_pipeline", - "type": ".google.cloud.contentwarehouse.v1.ExportToCdwPipeline" - }, - { - "name": "process_with_doc_ai_pipeline", - "type": ".google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline" - }, - { - "name": "request_metadata", - "type": ".google.cloud.contentwarehouse.v1.RequestMetadata" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "PipelineServiceClient", - "fullName": "google.cloud.contentwarehouse.v1.PipelineServiceClient" - }, - "method": { - "shortName": "RunPipeline", - "fullName": "google.cloud.contentwarehouse.v1.PipelineService.RunPipeline", - "service": { - "shortName": "PipelineService", - "fullName": "google.cloud.contentwarehouse.v1.PipelineService" - } - } - } - }, - { - "regionTag": "contentwarehouse_v1_generated_RuleSetService_CreateRuleSet_async", - "title": "DocumentLinkService createRuleSet Sample", - "origin": "API_DEFINITION", - "description": " Creates a ruleset.", - "canonical": true, - "file": "rule_set_service.create_rule_set.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateRuleSet", - "fullName": "google.cloud.contentwarehouse.v1.RuleSetService.CreateRuleSet", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "rule_set", - "type": ".google.cloud.contentwarehouse.v1.RuleSet" - } - ], - "resultType": ".google.cloud.contentwarehouse.v1.RuleSet", - "client": { - "shortName": "RuleSetServiceClient", - "fullName": "google.cloud.contentwarehouse.v1.RuleSetServiceClient" - }, - "method": { - "shortName": "CreateRuleSet", - "fullName": "google.cloud.contentwarehouse.v1.RuleSetService.CreateRuleSet", - "service": { - "shortName": "RuleSetService", - "fullName": "google.cloud.contentwarehouse.v1.RuleSetService" - } - } - } - }, - { - "regionTag": "contentwarehouse_v1_generated_RuleSetService_GetRuleSet_async", - "title": "DocumentLinkService getRuleSet Sample", - "origin": "API_DEFINITION", - "description": " Gets a ruleset. Returns NOT_FOUND if the ruleset does not exist.", - "canonical": true, - "file": "rule_set_service.get_rule_set.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetRuleSet", - "fullName": "google.cloud.contentwarehouse.v1.RuleSetService.GetRuleSet", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.contentwarehouse.v1.RuleSet", - "client": { - "shortName": "RuleSetServiceClient", - "fullName": "google.cloud.contentwarehouse.v1.RuleSetServiceClient" - }, - "method": { - "shortName": "GetRuleSet", - "fullName": "google.cloud.contentwarehouse.v1.RuleSetService.GetRuleSet", - "service": { - "shortName": "RuleSetService", - "fullName": "google.cloud.contentwarehouse.v1.RuleSetService" - } - } - } - }, - { - "regionTag": "contentwarehouse_v1_generated_RuleSetService_UpdateRuleSet_async", - "title": "DocumentLinkService updateRuleSet Sample", - "origin": "API_DEFINITION", - "description": " Updates a ruleset. Returns INVALID_ARGUMENT if the name of the ruleset is non-empty and does not equal the existing name.", - "canonical": true, - "file": "rule_set_service.update_rule_set.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 60, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateRuleSet", - "fullName": "google.cloud.contentwarehouse.v1.RuleSetService.UpdateRuleSet", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "rule_set", - "type": ".google.cloud.contentwarehouse.v1.RuleSet" - } - ], - "resultType": ".google.cloud.contentwarehouse.v1.RuleSet", - "client": { - "shortName": "RuleSetServiceClient", - "fullName": "google.cloud.contentwarehouse.v1.RuleSetServiceClient" - }, - "method": { - "shortName": "UpdateRuleSet", - "fullName": "google.cloud.contentwarehouse.v1.RuleSetService.UpdateRuleSet", - "service": { - "shortName": "RuleSetService", - "fullName": "google.cloud.contentwarehouse.v1.RuleSetService" - } - } - } - }, - { - "regionTag": "contentwarehouse_v1_generated_RuleSetService_DeleteRuleSet_async", - "title": "DocumentLinkService deleteRuleSet Sample", - "origin": "API_DEFINITION", - "description": " Deletes a ruleset. Returns NOT_FOUND if the document does not exist.", - "canonical": true, - "file": "rule_set_service.delete_rule_set.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteRuleSet", - "fullName": "google.cloud.contentwarehouse.v1.RuleSetService.DeleteRuleSet", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "RuleSetServiceClient", - "fullName": "google.cloud.contentwarehouse.v1.RuleSetServiceClient" - }, - "method": { - "shortName": "DeleteRuleSet", - "fullName": "google.cloud.contentwarehouse.v1.RuleSetService.DeleteRuleSet", - "service": { - "shortName": "RuleSetService", - "fullName": "google.cloud.contentwarehouse.v1.RuleSetService" - } - } - } - }, - { - "regionTag": "contentwarehouse_v1_generated_RuleSetService_ListRuleSets_async", - "title": "DocumentLinkService listRuleSets Sample", - "origin": "API_DEFINITION", - "description": " Lists rulesets.", - "canonical": true, - "file": "rule_set_service.list_rule_sets.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 70, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListRuleSets", - "fullName": "google.cloud.contentwarehouse.v1.RuleSetService.ListRuleSets", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.contentwarehouse.v1.ListRuleSetsResponse", - "client": { - "shortName": "RuleSetServiceClient", - "fullName": "google.cloud.contentwarehouse.v1.RuleSetServiceClient" - }, - "method": { - "shortName": "ListRuleSets", - "fullName": "google.cloud.contentwarehouse.v1.RuleSetService.ListRuleSets", - "service": { - "shortName": "RuleSetService", - "fullName": "google.cloud.contentwarehouse.v1.RuleSetService" - } - } - } - }, - { - "regionTag": "contentwarehouse_v1_generated_SynonymSetService_CreateSynonymSet_async", - "title": "DocumentLinkService createSynonymSet Sample", - "origin": "API_DEFINITION", - "description": " Creates a SynonymSet for a single context. Throws an ALREADY_EXISTS exception if a synonymset already exists for the context.", - "canonical": true, - "file": "synonym_set_service.create_synonym_set.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateSynonymSet", - "fullName": "google.cloud.contentwarehouse.v1.SynonymSetService.CreateSynonymSet", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "synonym_set", - "type": ".google.cloud.contentwarehouse.v1.SynonymSet" - } - ], - "resultType": ".google.cloud.contentwarehouse.v1.SynonymSet", - "client": { - "shortName": "SynonymSetServiceClient", - "fullName": "google.cloud.contentwarehouse.v1.SynonymSetServiceClient" - }, - "method": { - "shortName": "CreateSynonymSet", - "fullName": "google.cloud.contentwarehouse.v1.SynonymSetService.CreateSynonymSet", - "service": { - "shortName": "SynonymSetService", - "fullName": "google.cloud.contentwarehouse.v1.SynonymSetService" - } - } - } - }, - { - "regionTag": "contentwarehouse_v1_generated_SynonymSetService_GetSynonymSet_async", - "title": "DocumentLinkService getSynonymSet Sample", - "origin": "API_DEFINITION", - "description": " Gets a SynonymSet for a particular context. Throws a NOT_FOUND exception if the Synonymset does not exist", - "canonical": true, - "file": "synonym_set_service.get_synonym_set.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetSynonymSet", - "fullName": "google.cloud.contentwarehouse.v1.SynonymSetService.GetSynonymSet", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.contentwarehouse.v1.SynonymSet", - "client": { - "shortName": "SynonymSetServiceClient", - "fullName": "google.cloud.contentwarehouse.v1.SynonymSetServiceClient" - }, - "method": { - "shortName": "GetSynonymSet", - "fullName": "google.cloud.contentwarehouse.v1.SynonymSetService.GetSynonymSet", - "service": { - "shortName": "SynonymSetService", - "fullName": "google.cloud.contentwarehouse.v1.SynonymSetService" - } - } - } - }, - { - "regionTag": "contentwarehouse_v1_generated_SynonymSetService_UpdateSynonymSet_async", - "title": "DocumentLinkService updateSynonymSet Sample", - "origin": "API_DEFINITION", - "description": " Remove the existing SynonymSet for the context and replaces it with a new one. Throws a NOT_FOUND exception if the SynonymSet is not found.", - "canonical": true, - "file": "synonym_set_service.update_synonym_set.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 60, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateSynonymSet", - "fullName": "google.cloud.contentwarehouse.v1.SynonymSetService.UpdateSynonymSet", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "synonym_set", - "type": ".google.cloud.contentwarehouse.v1.SynonymSet" - } - ], - "resultType": ".google.cloud.contentwarehouse.v1.SynonymSet", - "client": { - "shortName": "SynonymSetServiceClient", - "fullName": "google.cloud.contentwarehouse.v1.SynonymSetServiceClient" - }, - "method": { - "shortName": "UpdateSynonymSet", - "fullName": "google.cloud.contentwarehouse.v1.SynonymSetService.UpdateSynonymSet", - "service": { - "shortName": "SynonymSetService", - "fullName": "google.cloud.contentwarehouse.v1.SynonymSetService" - } - } - } - }, - { - "regionTag": "contentwarehouse_v1_generated_SynonymSetService_DeleteSynonymSet_async", - "title": "DocumentLinkService deleteSynonymSet Sample", - "origin": "API_DEFINITION", - "description": " Deletes a SynonymSet for a given context. Throws a NOT_FOUND exception if the SynonymSet is not found.", - "canonical": true, - "file": "synonym_set_service.delete_synonym_set.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteSynonymSet", - "fullName": "google.cloud.contentwarehouse.v1.SynonymSetService.DeleteSynonymSet", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "SynonymSetServiceClient", - "fullName": "google.cloud.contentwarehouse.v1.SynonymSetServiceClient" - }, - "method": { - "shortName": "DeleteSynonymSet", - "fullName": "google.cloud.contentwarehouse.v1.SynonymSetService.DeleteSynonymSet", - "service": { - "shortName": "SynonymSetService", - "fullName": "google.cloud.contentwarehouse.v1.SynonymSetService" - } - } - } - }, - { - "regionTag": "contentwarehouse_v1_generated_SynonymSetService_ListSynonymSets_async", - "title": "DocumentLinkService listSynonymSets Sample", - "origin": "API_DEFINITION", - "description": " Returns all SynonymSets (for all contexts) for the specified location.", - "canonical": true, - "file": "synonym_set_service.list_synonym_sets.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 70, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListSynonymSets", - "fullName": "google.cloud.contentwarehouse.v1.SynonymSetService.ListSynonymSets", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.contentwarehouse.v1.ListSynonymSetsResponse", - "client": { - "shortName": "SynonymSetServiceClient", - "fullName": "google.cloud.contentwarehouse.v1.SynonymSetServiceClient" - }, - "method": { - "shortName": "ListSynonymSets", - "fullName": "google.cloud.contentwarehouse.v1.SynonymSetService.ListSynonymSets", - "service": { - "shortName": "SynonymSetService", - "fullName": "google.cloud.contentwarehouse.v1.SynonymSetService" - } - } - } - } - ] -} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/synonym_set_service.create_synonym_set.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/synonym_set_service.create_synonym_set.js deleted file mode 100644 index 8298b8b04b6..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/synonym_set_service.create_synonym_set.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, synonymSet) { - // [START contentwarehouse_v1_generated_SynonymSetService_CreateSynonymSet_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent name. - * Format: projects/{project_number}/locations/{location}. - */ - // const parent = 'abc123' - /** - * Required. The synonymSet to be created for a context - */ - // const synonymSet = {} - - // Imports the Contentwarehouse library - const {SynonymSetServiceClient} = require('@google-cloud/contentwarehouse').v1; - - // Instantiates a client - const contentwarehouseClient = new SynonymSetServiceClient(); - - async function callCreateSynonymSet() { - // Construct request - const request = { - parent, - synonymSet, - }; - - // Run request - const response = await contentwarehouseClient.createSynonymSet(request); - console.log(response); - } - - callCreateSynonymSet(); - // [END contentwarehouse_v1_generated_SynonymSetService_CreateSynonymSet_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/synonym_set_service.delete_synonym_set.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/synonym_set_service.delete_synonym_set.js deleted file mode 100644 index e358c275e31..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/synonym_set_service.delete_synonym_set.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START contentwarehouse_v1_generated_SynonymSetService_DeleteSynonymSet_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the synonymSet to delete - * Format: - * projects/{project_number}/locations/{location}/synonymSets/{context}. - */ - // const name = 'abc123' - - // Imports the Contentwarehouse library - const {SynonymSetServiceClient} = require('@google-cloud/contentwarehouse').v1; - - // Instantiates a client - const contentwarehouseClient = new SynonymSetServiceClient(); - - async function callDeleteSynonymSet() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await contentwarehouseClient.deleteSynonymSet(request); - console.log(response); - } - - callDeleteSynonymSet(); - // [END contentwarehouse_v1_generated_SynonymSetService_DeleteSynonymSet_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/synonym_set_service.get_synonym_set.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/synonym_set_service.get_synonym_set.js deleted file mode 100644 index cc7a7735a6d..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/synonym_set_service.get_synonym_set.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START contentwarehouse_v1_generated_SynonymSetService_GetSynonymSet_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the synonymSet to retrieve - * Format: - * projects/{project_number}/locations/{location}/synonymSets/{context}. - */ - // const name = 'abc123' - - // Imports the Contentwarehouse library - const {SynonymSetServiceClient} = require('@google-cloud/contentwarehouse').v1; - - // Instantiates a client - const contentwarehouseClient = new SynonymSetServiceClient(); - - async function callGetSynonymSet() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await contentwarehouseClient.getSynonymSet(request); - console.log(response); - } - - callGetSynonymSet(); - // [END contentwarehouse_v1_generated_SynonymSetService_GetSynonymSet_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/synonym_set_service.list_synonym_sets.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/synonym_set_service.list_synonym_sets.js deleted file mode 100644 index 3b702ce999c..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/synonym_set_service.list_synonym_sets.js +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START contentwarehouse_v1_generated_SynonymSetService_ListSynonymSets_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent name. - * Format: projects/{project_number}/locations/{location}. - */ - // const parent = 'abc123' - /** - * The maximum number of synonymSets to return. The service may return - * fewer than this value. - * If unspecified, at most 50 rule sets will be returned. - * The maximum value is 1000; values above 1000 will be coerced to 1000. - */ - // const pageSize = 1234 - /** - * A page token, received from a previous `ListSynonymSets` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListSynonymSets` - * must match the call that provided the page token. - */ - // const pageToken = 'abc123' - - // Imports the Contentwarehouse library - const {SynonymSetServiceClient} = require('@google-cloud/contentwarehouse').v1; - - // Instantiates a client - const contentwarehouseClient = new SynonymSetServiceClient(); - - async function callListSynonymSets() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = contentwarehouseClient.listSynonymSetsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListSynonymSets(); - // [END contentwarehouse_v1_generated_SynonymSetService_ListSynonymSets_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/synonym_set_service.update_synonym_set.js b/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/synonym_set_service.update_synonym_set.js deleted file mode 100644 index 18ee417fc8f..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/samples/generated/v1/synonym_set_service.update_synonym_set.js +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name, synonymSet) { - // [START contentwarehouse_v1_generated_SynonymSetService_UpdateSynonymSet_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the synonymSet to update - * Format: - * projects/{project_number}/locations/{location}/synonymSets/{context}. - */ - // const name = 'abc123' - /** - * Required. The synonymSet to be updated for the customer - */ - // const synonymSet = {} - - // Imports the Contentwarehouse library - const {SynonymSetServiceClient} = require('@google-cloud/contentwarehouse').v1; - - // Instantiates a client - const contentwarehouseClient = new SynonymSetServiceClient(); - - async function callUpdateSynonymSet() { - // Construct request - const request = { - name, - synonymSet, - }; - - // Run request - const response = await contentwarehouseClient.updateSynonymSet(request); - console.log(response); - } - - callUpdateSynonymSet(); - // [END contentwarehouse_v1_generated_SynonymSetService_UpdateSynonymSet_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/src/index.ts b/owl-bot-staging/google-cloud-contentwarehouse/src/index.ts deleted file mode 100644 index 15f1470600a..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/src/index.ts +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2025 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 v1 from './v1'; - -const DocumentLinkServiceClient = v1.DocumentLinkServiceClient; -type DocumentLinkServiceClient = v1.DocumentLinkServiceClient; -const DocumentSchemaServiceClient = v1.DocumentSchemaServiceClient; -type DocumentSchemaServiceClient = v1.DocumentSchemaServiceClient; -const DocumentServiceClient = v1.DocumentServiceClient; -type DocumentServiceClient = v1.DocumentServiceClient; -const PipelineServiceClient = v1.PipelineServiceClient; -type PipelineServiceClient = v1.PipelineServiceClient; -const RuleSetServiceClient = v1.RuleSetServiceClient; -type RuleSetServiceClient = v1.RuleSetServiceClient; -const SynonymSetServiceClient = v1.SynonymSetServiceClient; -type SynonymSetServiceClient = v1.SynonymSetServiceClient; - -export {v1, DocumentLinkServiceClient, DocumentSchemaServiceClient, DocumentServiceClient, PipelineServiceClient, RuleSetServiceClient, SynonymSetServiceClient}; -export default {v1, DocumentLinkServiceClient, DocumentSchemaServiceClient, DocumentServiceClient, PipelineServiceClient, RuleSetServiceClient, SynonymSetServiceClient}; -import * as protos from '../protos/protos'; -export {protos}; diff --git a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_link_service_client.ts b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_link_service_client.ts deleted file mode 100644 index 069be3eedbf..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_link_service_client.ts +++ /dev/null @@ -1,1214 +0,0 @@ -// Copyright 2026 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 type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; - -/** - * Client JSON configuration object, loaded from - * `src/v1/document_link_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './document_link_service_client_config.json'; -const version = require('../../../package.json').version; - -/** - * This service lets you manage document-links. - * Document-Links are treated as sub-resources under source documents. - * @class - * @memberof v1 - */ -export class DocumentLinkServiceClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - private _universeDomain: string; - private _servicePath: string; - private _log = logging.log('contentwarehouse'); - - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - documentLinkServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of DocumentLinkServiceClient. - * - * @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/main/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://cloud.google.com/docs/authentication/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/1.1 REST mode. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new DocumentLinkServiceClient({fallback: true}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof DocumentLinkServiceClient; - if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { - throw new Error('Please set either universe_domain or universeDomain, but not both.'); - } - const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; - this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; - this._servicePath = 'contentwarehouse.' + this._universeDomain; - const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // Request numeric enum values if REST transport is used. - opts.numericEnums = true; - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== this._servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = this._servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === this._servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process === 'object' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - documentLinkPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/documents/{document}/documentLinks/{document_link}' - ), - documentSchemaPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/documentSchemas/{document_schema}' - ), - projectLocationDocumentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/documents/{document}' - ), - projectLocationDocumentsReferenceIdPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/documents/referenceId/{reference_id}' - ), - ruleSetPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/ruleSets/{rule_set}' - ), - synonymSetPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/synonymSets/{context}' - ), - }; - - // 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 = { - listLinkedSources: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'documentLinks') - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.contentwarehouse.v1.DocumentLinkService', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = this._gaxModule.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.documentLinkServiceStub) { - return this.documentLinkServiceStub; - } - - // Put together the "service stub" for - // google.cloud.contentwarehouse.v1.DocumentLinkService. - this.documentLinkServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.contentwarehouse.v1.DocumentLinkService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.contentwarehouse.v1.DocumentLinkService, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const documentLinkServiceStubMethods = - ['listLinkedTargets', 'listLinkedSources', 'createDocumentLink', 'deleteDocumentLink']; - for (const methodName of documentLinkServiceStubMethods) { - const callPromise = this.documentLinkServiceStub.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._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.documentLinkServiceStub; - } - - /** - * The DNS address for this API service. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'contentwarehouse.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'contentwarehouse.googleapis.com'; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - get apiEndpoint() { - return this._servicePath; - } - - get universeDomain() { - return this._universeDomain; - } - - /** - * 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 -- - // ------------------- -/** - * Return all target document-links from the document. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the document, for which all target links are - * returned. Format: - * projects/{project_number}/locations/{location}/documents/{target_document_id}. - * @param {google.cloud.contentwarehouse.v1.RequestMetadata} request.requestMetadata - * The meta information collected about the document creator, used to enforce - * access control for the service. - * @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 {@link protos.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse|ListLinkedTargetsResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/document_link_service.list_linked_targets.js - * region_tag:contentwarehouse_v1_generated_DocumentLinkService_ListLinkedTargets_async - */ - listLinkedTargets( - request?: protos.google.cloud.contentwarehouse.v1.IListLinkedTargetsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.contentwarehouse.v1.IListLinkedTargetsResponse, - protos.google.cloud.contentwarehouse.v1.IListLinkedTargetsRequest|undefined, {}|undefined - ]>; - listLinkedTargets( - request: protos.google.cloud.contentwarehouse.v1.IListLinkedTargetsRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.contentwarehouse.v1.IListLinkedTargetsResponse, - protos.google.cloud.contentwarehouse.v1.IListLinkedTargetsRequest|null|undefined, - {}|null|undefined>): void; - listLinkedTargets( - request: protos.google.cloud.contentwarehouse.v1.IListLinkedTargetsRequest, - callback: Callback< - protos.google.cloud.contentwarehouse.v1.IListLinkedTargetsResponse, - protos.google.cloud.contentwarehouse.v1.IListLinkedTargetsRequest|null|undefined, - {}|null|undefined>): void; - listLinkedTargets( - request?: protos.google.cloud.contentwarehouse.v1.IListLinkedTargetsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.contentwarehouse.v1.IListLinkedTargetsResponse, - protos.google.cloud.contentwarehouse.v1.IListLinkedTargetsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.contentwarehouse.v1.IListLinkedTargetsResponse, - protos.google.cloud.contentwarehouse.v1.IListLinkedTargetsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.contentwarehouse.v1.IListLinkedTargetsResponse, - protos.google.cloud.contentwarehouse.v1.IListLinkedTargetsRequest|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('listLinkedTargets request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.contentwarehouse.v1.IListLinkedTargetsResponse, - protos.google.cloud.contentwarehouse.v1.IListLinkedTargetsRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('listLinkedTargets response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.listLinkedTargets(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.contentwarehouse.v1.IListLinkedTargetsResponse, - protos.google.cloud.contentwarehouse.v1.IListLinkedTargetsRequest|undefined, - {}|undefined - ]) => { - this._log.info('listLinkedTargets response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Create a link between a source document and a target document. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent of the document-link to be created. - * parent of document-link should be a document. - * Format: - * projects/{project_number}/locations/{location}/documents/{source_document_id}. - * @param {google.cloud.contentwarehouse.v1.DocumentLink} request.documentLink - * Required. Document links associated with the source documents - * (source_document_id). - * @param {google.cloud.contentwarehouse.v1.RequestMetadata} request.requestMetadata - * The meta information collected about the document creator, used to enforce - * access control for the service. - * @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 {@link protos.google.cloud.contentwarehouse.v1.DocumentLink|DocumentLink}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/document_link_service.create_document_link.js - * region_tag:contentwarehouse_v1_generated_DocumentLinkService_CreateDocumentLink_async - */ - createDocumentLink( - request?: protos.google.cloud.contentwarehouse.v1.ICreateDocumentLinkRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.contentwarehouse.v1.IDocumentLink, - protos.google.cloud.contentwarehouse.v1.ICreateDocumentLinkRequest|undefined, {}|undefined - ]>; - createDocumentLink( - request: protos.google.cloud.contentwarehouse.v1.ICreateDocumentLinkRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.contentwarehouse.v1.IDocumentLink, - protos.google.cloud.contentwarehouse.v1.ICreateDocumentLinkRequest|null|undefined, - {}|null|undefined>): void; - createDocumentLink( - request: protos.google.cloud.contentwarehouse.v1.ICreateDocumentLinkRequest, - callback: Callback< - protos.google.cloud.contentwarehouse.v1.IDocumentLink, - protos.google.cloud.contentwarehouse.v1.ICreateDocumentLinkRequest|null|undefined, - {}|null|undefined>): void; - createDocumentLink( - request?: protos.google.cloud.contentwarehouse.v1.ICreateDocumentLinkRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.contentwarehouse.v1.IDocumentLink, - protos.google.cloud.contentwarehouse.v1.ICreateDocumentLinkRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.contentwarehouse.v1.IDocumentLink, - protos.google.cloud.contentwarehouse.v1.ICreateDocumentLinkRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.contentwarehouse.v1.IDocumentLink, - protos.google.cloud.contentwarehouse.v1.ICreateDocumentLinkRequest|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('createDocumentLink request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.contentwarehouse.v1.IDocumentLink, - protos.google.cloud.contentwarehouse.v1.ICreateDocumentLinkRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('createDocumentLink response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.createDocumentLink(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.contentwarehouse.v1.IDocumentLink, - protos.google.cloud.contentwarehouse.v1.ICreateDocumentLinkRequest|undefined, - {}|undefined - ]) => { - this._log.info('createDocumentLink response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Remove the link between the source and target documents. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the document-link to be deleted. - * Format: - * projects/{project_number}/locations/{location}/documents/{source_document_id}/documentLinks/{document_link_id}. - * @param {google.cloud.contentwarehouse.v1.RequestMetadata} request.requestMetadata - * The meta information collected about the document creator, used to enforce - * access control for the service. - * @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 {@link protos.google.protobuf.Empty|Empty}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/document_link_service.delete_document_link.js - * region_tag:contentwarehouse_v1_generated_DocumentLinkService_DeleteDocumentLink_async - */ - deleteDocumentLink( - request?: protos.google.cloud.contentwarehouse.v1.IDeleteDocumentLinkRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.contentwarehouse.v1.IDeleteDocumentLinkRequest|undefined, {}|undefined - ]>; - deleteDocumentLink( - request: protos.google.cloud.contentwarehouse.v1.IDeleteDocumentLinkRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.contentwarehouse.v1.IDeleteDocumentLinkRequest|null|undefined, - {}|null|undefined>): void; - deleteDocumentLink( - request: protos.google.cloud.contentwarehouse.v1.IDeleteDocumentLinkRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.contentwarehouse.v1.IDeleteDocumentLinkRequest|null|undefined, - {}|null|undefined>): void; - deleteDocumentLink( - request?: protos.google.cloud.contentwarehouse.v1.IDeleteDocumentLinkRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.contentwarehouse.v1.IDeleteDocumentLinkRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.contentwarehouse.v1.IDeleteDocumentLinkRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.contentwarehouse.v1.IDeleteDocumentLinkRequest|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('deleteDocumentLink request %j', request); - const wrappedCallback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.contentwarehouse.v1.IDeleteDocumentLinkRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('deleteDocumentLink response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.deleteDocumentLink(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.protobuf.IEmpty, - protos.google.cloud.contentwarehouse.v1.IDeleteDocumentLinkRequest|undefined, - {}|undefined - ]) => { - this._log.info('deleteDocumentLink response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } - - /** - * Return all source document-links from the document. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the document, for which all source links are - * returned. Format: - * projects/{project_number}/locations/{location}/documents/{source_document_id}. - * @param {number} request.pageSize - * The maximum number of document-links to return. The service may return - * fewer than this value. - * - * If unspecified, at most 50 document-links will be returned. - * The maximum value is 1000; values above 1000 will be coerced to 1000. - * @param {string} request.pageToken - * A page token, received from a previous `ListLinkedSources` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListLinkedSources` - * must match the call that provided the page token. - * @param {google.cloud.contentwarehouse.v1.RequestMetadata} request.requestMetadata - * The meta information collected about the document creator, used to enforce - * access control for the service. - * @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 {@link protos.google.cloud.contentwarehouse.v1.DocumentLink|DocumentLink}. - * 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 `listLinkedSourcesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listLinkedSources( - request?: protos.google.cloud.contentwarehouse.v1.IListLinkedSourcesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.contentwarehouse.v1.IDocumentLink[], - protos.google.cloud.contentwarehouse.v1.IListLinkedSourcesRequest|null, - protos.google.cloud.contentwarehouse.v1.IListLinkedSourcesResponse - ]>; - listLinkedSources( - request: protos.google.cloud.contentwarehouse.v1.IListLinkedSourcesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.contentwarehouse.v1.IListLinkedSourcesRequest, - protos.google.cloud.contentwarehouse.v1.IListLinkedSourcesResponse|null|undefined, - protos.google.cloud.contentwarehouse.v1.IDocumentLink>): void; - listLinkedSources( - request: protos.google.cloud.contentwarehouse.v1.IListLinkedSourcesRequest, - callback: PaginationCallback< - protos.google.cloud.contentwarehouse.v1.IListLinkedSourcesRequest, - protos.google.cloud.contentwarehouse.v1.IListLinkedSourcesResponse|null|undefined, - protos.google.cloud.contentwarehouse.v1.IDocumentLink>): void; - listLinkedSources( - request?: protos.google.cloud.contentwarehouse.v1.IListLinkedSourcesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.contentwarehouse.v1.IListLinkedSourcesRequest, - protos.google.cloud.contentwarehouse.v1.IListLinkedSourcesResponse|null|undefined, - protos.google.cloud.contentwarehouse.v1.IDocumentLink>, - callback?: PaginationCallback< - protos.google.cloud.contentwarehouse.v1.IListLinkedSourcesRequest, - protos.google.cloud.contentwarehouse.v1.IListLinkedSourcesResponse|null|undefined, - protos.google.cloud.contentwarehouse.v1.IDocumentLink>): - Promise<[ - protos.google.cloud.contentwarehouse.v1.IDocumentLink[], - protos.google.cloud.contentwarehouse.v1.IListLinkedSourcesRequest|null, - protos.google.cloud.contentwarehouse.v1.IListLinkedSourcesResponse - ]>|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.contentwarehouse.v1.IListLinkedSourcesRequest, - protos.google.cloud.contentwarehouse.v1.IListLinkedSourcesResponse|null|undefined, - protos.google.cloud.contentwarehouse.v1.IDocumentLink>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listLinkedSources values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listLinkedSources request %j', request); - return this.innerApiCalls - .listLinkedSources(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.contentwarehouse.v1.IDocumentLink[], - protos.google.cloud.contentwarehouse.v1.IListLinkedSourcesRequest|null, - protos.google.cloud.contentwarehouse.v1.IListLinkedSourcesResponse - ]) => { - this._log.info('listLinkedSources values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listLinkedSources`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the document, for which all source links are - * returned. Format: - * projects/{project_number}/locations/{location}/documents/{source_document_id}. - * @param {number} request.pageSize - * The maximum number of document-links to return. The service may return - * fewer than this value. - * - * If unspecified, at most 50 document-links will be returned. - * The maximum value is 1000; values above 1000 will be coerced to 1000. - * @param {string} request.pageToken - * A page token, received from a previous `ListLinkedSources` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListLinkedSources` - * must match the call that provided the page token. - * @param {google.cloud.contentwarehouse.v1.RequestMetadata} request.requestMetadata - * The meta information collected about the document creator, used to enforce - * access control for the service. - * @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 {@link protos.google.cloud.contentwarehouse.v1.DocumentLink|DocumentLink} 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 `listLinkedSourcesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listLinkedSourcesStream( - request?: protos.google.cloud.contentwarehouse.v1.IListLinkedSourcesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listLinkedSources']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listLinkedSources stream %j', request); - return this.descriptors.page.listLinkedSources.createStream( - this.innerApiCalls.listLinkedSources as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listLinkedSources`, 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. The name of the document, for which all source links are - * returned. Format: - * projects/{project_number}/locations/{location}/documents/{source_document_id}. - * @param {number} request.pageSize - * The maximum number of document-links to return. The service may return - * fewer than this value. - * - * If unspecified, at most 50 document-links will be returned. - * The maximum value is 1000; values above 1000 will be coerced to 1000. - * @param {string} request.pageToken - * A page token, received from a previous `ListLinkedSources` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListLinkedSources` - * must match the call that provided the page token. - * @param {google.cloud.contentwarehouse.v1.RequestMetadata} request.requestMetadata - * The meta information collected about the document creator, used to enforce - * access control for the service. - * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.contentwarehouse.v1.DocumentLink|DocumentLink}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1/document_link_service.list_linked_sources.js - * region_tag:contentwarehouse_v1_generated_DocumentLinkService_ListLinkedSources_async - */ - listLinkedSourcesAsync( - request?: protos.google.cloud.contentwarehouse.v1.IListLinkedSourcesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listLinkedSources']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listLinkedSources iterate %j', request); - return this.descriptors.page.listLinkedSources.asyncIterate( - this.innerApiCalls['listLinkedSources'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified documentLink resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} document - * @param {string} document_link - * @returns {string} Resource name string. - */ - documentLinkPath(project:string,location:string,document:string,documentLink:string) { - return this.pathTemplates.documentLinkPathTemplate.render({ - project: project, - location: location, - document: document, - document_link: documentLink, - }); - } - - /** - * Parse the project from DocumentLink resource. - * - * @param {string} documentLinkName - * A fully-qualified path representing DocumentLink resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDocumentLinkName(documentLinkName: string) { - return this.pathTemplates.documentLinkPathTemplate.match(documentLinkName).project; - } - - /** - * Parse the location from DocumentLink resource. - * - * @param {string} documentLinkName - * A fully-qualified path representing DocumentLink resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDocumentLinkName(documentLinkName: string) { - return this.pathTemplates.documentLinkPathTemplate.match(documentLinkName).location; - } - - /** - * Parse the document from DocumentLink resource. - * - * @param {string} documentLinkName - * A fully-qualified path representing DocumentLink resource. - * @returns {string} A string representing the document. - */ - matchDocumentFromDocumentLinkName(documentLinkName: string) { - return this.pathTemplates.documentLinkPathTemplate.match(documentLinkName).document; - } - - /** - * Parse the document_link from DocumentLink resource. - * - * @param {string} documentLinkName - * A fully-qualified path representing DocumentLink resource. - * @returns {string} A string representing the document_link. - */ - matchDocumentLinkFromDocumentLinkName(documentLinkName: string) { - return this.pathTemplates.documentLinkPathTemplate.match(documentLinkName).document_link; - } - - /** - * Return a fully-qualified documentSchema resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} document_schema - * @returns {string} Resource name string. - */ - documentSchemaPath(project:string,location:string,documentSchema:string) { - return this.pathTemplates.documentSchemaPathTemplate.render({ - project: project, - location: location, - document_schema: documentSchema, - }); - } - - /** - * Parse the project from DocumentSchema resource. - * - * @param {string} documentSchemaName - * A fully-qualified path representing DocumentSchema resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDocumentSchemaName(documentSchemaName: string) { - return this.pathTemplates.documentSchemaPathTemplate.match(documentSchemaName).project; - } - - /** - * Parse the location from DocumentSchema resource. - * - * @param {string} documentSchemaName - * A fully-qualified path representing DocumentSchema resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDocumentSchemaName(documentSchemaName: string) { - return this.pathTemplates.documentSchemaPathTemplate.match(documentSchemaName).location; - } - - /** - * Parse the document_schema from DocumentSchema resource. - * - * @param {string} documentSchemaName - * A fully-qualified path representing DocumentSchema resource. - * @returns {string} A string representing the document_schema. - */ - matchDocumentSchemaFromDocumentSchemaName(documentSchemaName: string) { - return this.pathTemplates.documentSchemaPathTemplate.match(documentSchemaName).document_schema; - } - - /** - * Return a fully-qualified projectLocationDocument resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} document - * @returns {string} Resource name string. - */ - projectLocationDocumentPath(project:string,location:string,document:string) { - return this.pathTemplates.projectLocationDocumentPathTemplate.render({ - project: project, - location: location, - document: document, - }); - } - - /** - * Parse the project from ProjectLocationDocument resource. - * - * @param {string} projectLocationDocumentName - * A fully-qualified path representing project_location_document resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationDocumentName(projectLocationDocumentName: string) { - return this.pathTemplates.projectLocationDocumentPathTemplate.match(projectLocationDocumentName).project; - } - - /** - * Parse the location from ProjectLocationDocument resource. - * - * @param {string} projectLocationDocumentName - * A fully-qualified path representing project_location_document resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationDocumentName(projectLocationDocumentName: string) { - return this.pathTemplates.projectLocationDocumentPathTemplate.match(projectLocationDocumentName).location; - } - - /** - * Parse the document from ProjectLocationDocument resource. - * - * @param {string} projectLocationDocumentName - * A fully-qualified path representing project_location_document resource. - * @returns {string} A string representing the document. - */ - matchDocumentFromProjectLocationDocumentName(projectLocationDocumentName: string) { - return this.pathTemplates.projectLocationDocumentPathTemplate.match(projectLocationDocumentName).document; - } - - /** - * Return a fully-qualified projectLocationDocumentsReferenceId resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} reference_id - * @returns {string} Resource name string. - */ - projectLocationDocumentsReferenceIdPath(project:string,location:string,referenceId:string) { - return this.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.render({ - project: project, - location: location, - reference_id: referenceId, - }); - } - - /** - * Parse the project from ProjectLocationDocumentsReferenceId resource. - * - * @param {string} projectLocationDocumentsReferenceIdName - * A fully-qualified path representing project_location_documents_reference_id resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationDocumentsReferenceIdName(projectLocationDocumentsReferenceIdName: string) { - return this.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match(projectLocationDocumentsReferenceIdName).project; - } - - /** - * Parse the location from ProjectLocationDocumentsReferenceId resource. - * - * @param {string} projectLocationDocumentsReferenceIdName - * A fully-qualified path representing project_location_documents_reference_id resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationDocumentsReferenceIdName(projectLocationDocumentsReferenceIdName: string) { - return this.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match(projectLocationDocumentsReferenceIdName).location; - } - - /** - * Parse the reference_id from ProjectLocationDocumentsReferenceId resource. - * - * @param {string} projectLocationDocumentsReferenceIdName - * A fully-qualified path representing project_location_documents_reference_id resource. - * @returns {string} A string representing the reference_id. - */ - matchReferenceIdFromProjectLocationDocumentsReferenceIdName(projectLocationDocumentsReferenceIdName: string) { - return this.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match(projectLocationDocumentsReferenceIdName).reference_id; - } - - /** - * Return a fully-qualified ruleSet resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} rule_set - * @returns {string} Resource name string. - */ - ruleSetPath(project:string,location:string,ruleSet:string) { - return this.pathTemplates.ruleSetPathTemplate.render({ - project: project, - location: location, - rule_set: ruleSet, - }); - } - - /** - * Parse the project from RuleSet resource. - * - * @param {string} ruleSetName - * A fully-qualified path representing RuleSet resource. - * @returns {string} A string representing the project. - */ - matchProjectFromRuleSetName(ruleSetName: string) { - return this.pathTemplates.ruleSetPathTemplate.match(ruleSetName).project; - } - - /** - * Parse the location from RuleSet resource. - * - * @param {string} ruleSetName - * A fully-qualified path representing RuleSet resource. - * @returns {string} A string representing the location. - */ - matchLocationFromRuleSetName(ruleSetName: string) { - return this.pathTemplates.ruleSetPathTemplate.match(ruleSetName).location; - } - - /** - * Parse the rule_set from RuleSet resource. - * - * @param {string} ruleSetName - * A fully-qualified path representing RuleSet resource. - * @returns {string} A string representing the rule_set. - */ - matchRuleSetFromRuleSetName(ruleSetName: string) { - return this.pathTemplates.ruleSetPathTemplate.match(ruleSetName).rule_set; - } - - /** - * Return a fully-qualified synonymSet resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} context - * @returns {string} Resource name string. - */ - synonymSetPath(project:string,location:string,context:string) { - return this.pathTemplates.synonymSetPathTemplate.render({ - project: project, - location: location, - context: context, - }); - } - - /** - * Parse the project from SynonymSet resource. - * - * @param {string} synonymSetName - * A fully-qualified path representing SynonymSet resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSynonymSetName(synonymSetName: string) { - return this.pathTemplates.synonymSetPathTemplate.match(synonymSetName).project; - } - - /** - * Parse the location from SynonymSet resource. - * - * @param {string} synonymSetName - * A fully-qualified path representing SynonymSet resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSynonymSetName(synonymSetName: string) { - return this.pathTemplates.synonymSetPathTemplate.match(synonymSetName).location; - } - - /** - * Parse the context from SynonymSet resource. - * - * @param {string} synonymSetName - * A fully-qualified path representing SynonymSet resource. - * @returns {string} A string representing the context. - */ - matchContextFromSynonymSetName(synonymSetName: string) { - return this.pathTemplates.synonymSetPathTemplate.match(synonymSetName).context; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.documentLinkServiceStub && !this._terminated) { - return this.documentLinkServiceStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - }); - } - return Promise.resolve(); - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_link_service_client_config.json b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_link_service_client_config.json deleted file mode 100644 index 50fc7af4f4a..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_link_service_client_config.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "interfaces": { - "google.cloud.contentwarehouse.v1.DocumentLinkService": { - "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": { - "ListLinkedTargets": { - "timeout_millis": 180000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListLinkedSources": { - "timeout_millis": 180000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateDocumentLink": { - "timeout_millis": 180000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteDocumentLink": { - "timeout_millis": 180000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_link_service_proto_list.json b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_link_service_proto_list.json deleted file mode 100644 index a1775b1134d..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_link_service_proto_list.json +++ /dev/null @@ -1,23 +0,0 @@ -[ - "../../protos/google/cloud/contentwarehouse/v1/async_document_service_request.proto", - "../../protos/google/cloud/contentwarehouse/v1/common.proto", - "../../protos/google/cloud/contentwarehouse/v1/document.proto", - "../../protos/google/cloud/contentwarehouse/v1/document_link_service.proto", - "../../protos/google/cloud/contentwarehouse/v1/document_schema.proto", - "../../protos/google/cloud/contentwarehouse/v1/document_schema_service.proto", - "../../protos/google/cloud/contentwarehouse/v1/document_service.proto", - "../../protos/google/cloud/contentwarehouse/v1/document_service_request.proto", - "../../protos/google/cloud/contentwarehouse/v1/filters.proto", - "../../protos/google/cloud/contentwarehouse/v1/histogram.proto", - "../../protos/google/cloud/contentwarehouse/v1/pipeline_service.proto", - "../../protos/google/cloud/contentwarehouse/v1/pipelines.proto", - "../../protos/google/cloud/contentwarehouse/v1/rule_engine.proto", - "../../protos/google/cloud/contentwarehouse/v1/ruleset_service.proto", - "../../protos/google/cloud/contentwarehouse/v1/ruleset_service_request.proto", - "../../protos/google/cloud/contentwarehouse/v1/synonymset.proto", - "../../protos/google/cloud/contentwarehouse/v1/synonymset_service.proto", - "../../protos/google/cloud/contentwarehouse/v1/synonymset_service_request.proto", - "../../protos/google/cloud/documentai/v1/barcode.proto", - "../../protos/google/cloud/documentai/v1/document.proto", - "../../protos/google/cloud/documentai/v1/geometry.proto" -] diff --git a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_schema_service_client.ts b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_schema_service_client.ts deleted file mode 100644 index 04717fbd017..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_schema_service_client.ts +++ /dev/null @@ -1,1327 +0,0 @@ -// Copyright 2026 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 type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; - -/** - * Client JSON configuration object, loaded from - * `src/v1/document_schema_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './document_schema_service_client_config.json'; -const version = require('../../../package.json').version; - -/** - * This service lets you manage document schema. - * @class - * @memberof v1 - */ -export class DocumentSchemaServiceClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - private _universeDomain: string; - private _servicePath: string; - private _log = logging.log('contentwarehouse'); - - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - documentSchemaServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of DocumentSchemaServiceClient. - * - * @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/main/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://cloud.google.com/docs/authentication/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/1.1 REST mode. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new DocumentSchemaServiceClient({fallback: true}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof DocumentSchemaServiceClient; - if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { - throw new Error('Please set either universe_domain or universeDomain, but not both.'); - } - const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; - this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; - this._servicePath = 'contentwarehouse.' + this._universeDomain; - const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // Request numeric enum values if REST transport is used. - opts.numericEnums = true; - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== this._servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = this._servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === this._servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process === 'object' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - documentLinkPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/documents/{document}/documentLinks/{document_link}' - ), - documentSchemaPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/documentSchemas/{document_schema}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - projectLocationDocumentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/documents/{document}' - ), - projectLocationDocumentsReferenceIdPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/documents/referenceId/{reference_id}' - ), - ruleSetPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/ruleSets/{rule_set}' - ), - synonymSetPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/synonymSets/{context}' - ), - }; - - // 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 = { - listDocumentSchemas: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'documentSchemas') - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.contentwarehouse.v1.DocumentSchemaService', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = this._gaxModule.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.documentSchemaServiceStub) { - return this.documentSchemaServiceStub; - } - - // Put together the "service stub" for - // google.cloud.contentwarehouse.v1.DocumentSchemaService. - this.documentSchemaServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.contentwarehouse.v1.DocumentSchemaService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.contentwarehouse.v1.DocumentSchemaService, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const documentSchemaServiceStubMethods = - ['createDocumentSchema', 'updateDocumentSchema', 'getDocumentSchema', 'deleteDocumentSchema', 'listDocumentSchemas']; - for (const methodName of documentSchemaServiceStubMethods) { - const callPromise = this.documentSchemaServiceStub.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._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.documentSchemaServiceStub; - } - - /** - * The DNS address for this API service. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'contentwarehouse.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'contentwarehouse.googleapis.com'; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - get apiEndpoint() { - return this._servicePath; - } - - get universeDomain() { - return this._universeDomain; - } - - /** - * 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 -- - // ------------------- -/** - * Creates a document schema. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent name. - * @param {google.cloud.contentwarehouse.v1.DocumentSchema} request.documentSchema - * Required. The document schema to create. - * @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 {@link protos.google.cloud.contentwarehouse.v1.DocumentSchema|DocumentSchema}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/document_schema_service.create_document_schema.js - * region_tag:contentwarehouse_v1_generated_DocumentSchemaService_CreateDocumentSchema_async - */ - createDocumentSchema( - request?: protos.google.cloud.contentwarehouse.v1.ICreateDocumentSchemaRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.contentwarehouse.v1.IDocumentSchema, - protos.google.cloud.contentwarehouse.v1.ICreateDocumentSchemaRequest|undefined, {}|undefined - ]>; - createDocumentSchema( - request: protos.google.cloud.contentwarehouse.v1.ICreateDocumentSchemaRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.contentwarehouse.v1.IDocumentSchema, - protos.google.cloud.contentwarehouse.v1.ICreateDocumentSchemaRequest|null|undefined, - {}|null|undefined>): void; - createDocumentSchema( - request: protos.google.cloud.contentwarehouse.v1.ICreateDocumentSchemaRequest, - callback: Callback< - protos.google.cloud.contentwarehouse.v1.IDocumentSchema, - protos.google.cloud.contentwarehouse.v1.ICreateDocumentSchemaRequest|null|undefined, - {}|null|undefined>): void; - createDocumentSchema( - request?: protos.google.cloud.contentwarehouse.v1.ICreateDocumentSchemaRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.contentwarehouse.v1.IDocumentSchema, - protos.google.cloud.contentwarehouse.v1.ICreateDocumentSchemaRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.contentwarehouse.v1.IDocumentSchema, - protos.google.cloud.contentwarehouse.v1.ICreateDocumentSchemaRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.contentwarehouse.v1.IDocumentSchema, - protos.google.cloud.contentwarehouse.v1.ICreateDocumentSchemaRequest|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('createDocumentSchema request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.contentwarehouse.v1.IDocumentSchema, - protos.google.cloud.contentwarehouse.v1.ICreateDocumentSchemaRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('createDocumentSchema response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.createDocumentSchema(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.contentwarehouse.v1.IDocumentSchema, - protos.google.cloud.contentwarehouse.v1.ICreateDocumentSchemaRequest|undefined, - {}|undefined - ]) => { - this._log.info('createDocumentSchema response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Updates a Document Schema. Returns INVALID_ARGUMENT if the name of the - * Document Schema is non-empty and does not equal the existing name. - * Supports only appending new properties, adding new ENUM possible values, - * and updating the - * {@link protos.google.cloud.contentwarehouse.v1.EnumTypeOptions.validation_check_disabled|EnumTypeOptions.validation_check_disabled} - * flag for ENUM possible values. Updating existing properties will result - * into INVALID_ARGUMENT. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the document schema to update. - * Format: - * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}. - * @param {google.cloud.contentwarehouse.v1.DocumentSchema} request.documentSchema - * Required. The document schema to update with. - * @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 {@link protos.google.cloud.contentwarehouse.v1.DocumentSchema|DocumentSchema}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/document_schema_service.update_document_schema.js - * region_tag:contentwarehouse_v1_generated_DocumentSchemaService_UpdateDocumentSchema_async - */ - updateDocumentSchema( - request?: protos.google.cloud.contentwarehouse.v1.IUpdateDocumentSchemaRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.contentwarehouse.v1.IDocumentSchema, - protos.google.cloud.contentwarehouse.v1.IUpdateDocumentSchemaRequest|undefined, {}|undefined - ]>; - updateDocumentSchema( - request: protos.google.cloud.contentwarehouse.v1.IUpdateDocumentSchemaRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.contentwarehouse.v1.IDocumentSchema, - protos.google.cloud.contentwarehouse.v1.IUpdateDocumentSchemaRequest|null|undefined, - {}|null|undefined>): void; - updateDocumentSchema( - request: protos.google.cloud.contentwarehouse.v1.IUpdateDocumentSchemaRequest, - callback: Callback< - protos.google.cloud.contentwarehouse.v1.IDocumentSchema, - protos.google.cloud.contentwarehouse.v1.IUpdateDocumentSchemaRequest|null|undefined, - {}|null|undefined>): void; - updateDocumentSchema( - request?: protos.google.cloud.contentwarehouse.v1.IUpdateDocumentSchemaRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.contentwarehouse.v1.IDocumentSchema, - protos.google.cloud.contentwarehouse.v1.IUpdateDocumentSchemaRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.contentwarehouse.v1.IDocumentSchema, - protos.google.cloud.contentwarehouse.v1.IUpdateDocumentSchemaRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.contentwarehouse.v1.IDocumentSchema, - protos.google.cloud.contentwarehouse.v1.IUpdateDocumentSchemaRequest|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('updateDocumentSchema request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.contentwarehouse.v1.IDocumentSchema, - protos.google.cloud.contentwarehouse.v1.IUpdateDocumentSchemaRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateDocumentSchema response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.updateDocumentSchema(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.contentwarehouse.v1.IDocumentSchema, - protos.google.cloud.contentwarehouse.v1.IUpdateDocumentSchemaRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateDocumentSchema response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Gets a document schema. Returns NOT_FOUND if the document schema does not - * exist. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the document schema to retrieve. - * @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 {@link protos.google.cloud.contentwarehouse.v1.DocumentSchema|DocumentSchema}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/document_schema_service.get_document_schema.js - * region_tag:contentwarehouse_v1_generated_DocumentSchemaService_GetDocumentSchema_async - */ - getDocumentSchema( - request?: protos.google.cloud.contentwarehouse.v1.IGetDocumentSchemaRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.contentwarehouse.v1.IDocumentSchema, - protos.google.cloud.contentwarehouse.v1.IGetDocumentSchemaRequest|undefined, {}|undefined - ]>; - getDocumentSchema( - request: protos.google.cloud.contentwarehouse.v1.IGetDocumentSchemaRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.contentwarehouse.v1.IDocumentSchema, - protos.google.cloud.contentwarehouse.v1.IGetDocumentSchemaRequest|null|undefined, - {}|null|undefined>): void; - getDocumentSchema( - request: protos.google.cloud.contentwarehouse.v1.IGetDocumentSchemaRequest, - callback: Callback< - protos.google.cloud.contentwarehouse.v1.IDocumentSchema, - protos.google.cloud.contentwarehouse.v1.IGetDocumentSchemaRequest|null|undefined, - {}|null|undefined>): void; - getDocumentSchema( - request?: protos.google.cloud.contentwarehouse.v1.IGetDocumentSchemaRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.contentwarehouse.v1.IDocumentSchema, - protos.google.cloud.contentwarehouse.v1.IGetDocumentSchemaRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.contentwarehouse.v1.IDocumentSchema, - protos.google.cloud.contentwarehouse.v1.IGetDocumentSchemaRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.contentwarehouse.v1.IDocumentSchema, - protos.google.cloud.contentwarehouse.v1.IGetDocumentSchemaRequest|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getDocumentSchema request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.contentwarehouse.v1.IDocumentSchema, - protos.google.cloud.contentwarehouse.v1.IGetDocumentSchemaRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getDocumentSchema response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getDocumentSchema(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.contentwarehouse.v1.IDocumentSchema, - protos.google.cloud.contentwarehouse.v1.IGetDocumentSchemaRequest|undefined, - {}|undefined - ]) => { - this._log.info('getDocumentSchema response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Deletes a document schema. Returns NOT_FOUND if the document schema does - * not exist. Returns BAD_REQUEST if the document schema has documents - * depending on it. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the document schema to delete. - * @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 {@link protos.google.protobuf.Empty|Empty}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/document_schema_service.delete_document_schema.js - * region_tag:contentwarehouse_v1_generated_DocumentSchemaService_DeleteDocumentSchema_async - */ - deleteDocumentSchema( - request?: protos.google.cloud.contentwarehouse.v1.IDeleteDocumentSchemaRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.contentwarehouse.v1.IDeleteDocumentSchemaRequest|undefined, {}|undefined - ]>; - deleteDocumentSchema( - request: protos.google.cloud.contentwarehouse.v1.IDeleteDocumentSchemaRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.contentwarehouse.v1.IDeleteDocumentSchemaRequest|null|undefined, - {}|null|undefined>): void; - deleteDocumentSchema( - request: protos.google.cloud.contentwarehouse.v1.IDeleteDocumentSchemaRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.contentwarehouse.v1.IDeleteDocumentSchemaRequest|null|undefined, - {}|null|undefined>): void; - deleteDocumentSchema( - request?: protos.google.cloud.contentwarehouse.v1.IDeleteDocumentSchemaRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.contentwarehouse.v1.IDeleteDocumentSchemaRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.contentwarehouse.v1.IDeleteDocumentSchemaRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.contentwarehouse.v1.IDeleteDocumentSchemaRequest|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('deleteDocumentSchema request %j', request); - const wrappedCallback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.contentwarehouse.v1.IDeleteDocumentSchemaRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('deleteDocumentSchema response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.deleteDocumentSchema(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.protobuf.IEmpty, - protos.google.cloud.contentwarehouse.v1.IDeleteDocumentSchemaRequest|undefined, - {}|undefined - ]) => { - this._log.info('deleteDocumentSchema response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } - - /** - * Lists document schemas. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of document schemas. - * Format: projects/{project_number}/locations/{location}. - * @param {number} request.pageSize - * The maximum number of document schemas to return. The service may return - * fewer than this value. - * If unspecified, at most 50 document schemas will be returned. - * The maximum value is 1000; values above 1000 will be coerced to 1000. - * @param {string} request.pageToken - * A page token, received from a previous `ListDocumentSchemas` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListDocumentSchemas` - * must match the call that provided the page token. - * @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 {@link protos.google.cloud.contentwarehouse.v1.DocumentSchema|DocumentSchema}. - * 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 `listDocumentSchemasAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listDocumentSchemas( - request?: protos.google.cloud.contentwarehouse.v1.IListDocumentSchemasRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.contentwarehouse.v1.IDocumentSchema[], - protos.google.cloud.contentwarehouse.v1.IListDocumentSchemasRequest|null, - protos.google.cloud.contentwarehouse.v1.IListDocumentSchemasResponse - ]>; - listDocumentSchemas( - request: protos.google.cloud.contentwarehouse.v1.IListDocumentSchemasRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.contentwarehouse.v1.IListDocumentSchemasRequest, - protos.google.cloud.contentwarehouse.v1.IListDocumentSchemasResponse|null|undefined, - protos.google.cloud.contentwarehouse.v1.IDocumentSchema>): void; - listDocumentSchemas( - request: protos.google.cloud.contentwarehouse.v1.IListDocumentSchemasRequest, - callback: PaginationCallback< - protos.google.cloud.contentwarehouse.v1.IListDocumentSchemasRequest, - protos.google.cloud.contentwarehouse.v1.IListDocumentSchemasResponse|null|undefined, - protos.google.cloud.contentwarehouse.v1.IDocumentSchema>): void; - listDocumentSchemas( - request?: protos.google.cloud.contentwarehouse.v1.IListDocumentSchemasRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.contentwarehouse.v1.IListDocumentSchemasRequest, - protos.google.cloud.contentwarehouse.v1.IListDocumentSchemasResponse|null|undefined, - protos.google.cloud.contentwarehouse.v1.IDocumentSchema>, - callback?: PaginationCallback< - protos.google.cloud.contentwarehouse.v1.IListDocumentSchemasRequest, - protos.google.cloud.contentwarehouse.v1.IListDocumentSchemasResponse|null|undefined, - protos.google.cloud.contentwarehouse.v1.IDocumentSchema>): - Promise<[ - protos.google.cloud.contentwarehouse.v1.IDocumentSchema[], - protos.google.cloud.contentwarehouse.v1.IListDocumentSchemasRequest|null, - protos.google.cloud.contentwarehouse.v1.IListDocumentSchemasResponse - ]>|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.contentwarehouse.v1.IListDocumentSchemasRequest, - protos.google.cloud.contentwarehouse.v1.IListDocumentSchemasResponse|null|undefined, - protos.google.cloud.contentwarehouse.v1.IDocumentSchema>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listDocumentSchemas values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listDocumentSchemas request %j', request); - return this.innerApiCalls - .listDocumentSchemas(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.contentwarehouse.v1.IDocumentSchema[], - protos.google.cloud.contentwarehouse.v1.IListDocumentSchemasRequest|null, - protos.google.cloud.contentwarehouse.v1.IListDocumentSchemasResponse - ]) => { - this._log.info('listDocumentSchemas values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listDocumentSchemas`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of document schemas. - * Format: projects/{project_number}/locations/{location}. - * @param {number} request.pageSize - * The maximum number of document schemas to return. The service may return - * fewer than this value. - * If unspecified, at most 50 document schemas will be returned. - * The maximum value is 1000; values above 1000 will be coerced to 1000. - * @param {string} request.pageToken - * A page token, received from a previous `ListDocumentSchemas` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListDocumentSchemas` - * must match the call that provided the page token. - * @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 {@link protos.google.cloud.contentwarehouse.v1.DocumentSchema|DocumentSchema} 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 `listDocumentSchemasAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listDocumentSchemasStream( - request?: protos.google.cloud.contentwarehouse.v1.IListDocumentSchemasRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listDocumentSchemas']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listDocumentSchemas stream %j', request); - return this.descriptors.page.listDocumentSchemas.createStream( - this.innerApiCalls.listDocumentSchemas as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listDocumentSchemas`, 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. The parent, which owns this collection of document schemas. - * Format: projects/{project_number}/locations/{location}. - * @param {number} request.pageSize - * The maximum number of document schemas to return. The service may return - * fewer than this value. - * If unspecified, at most 50 document schemas will be returned. - * The maximum value is 1000; values above 1000 will be coerced to 1000. - * @param {string} request.pageToken - * A page token, received from a previous `ListDocumentSchemas` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListDocumentSchemas` - * must match the call that provided the page token. - * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.contentwarehouse.v1.DocumentSchema|DocumentSchema}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1/document_schema_service.list_document_schemas.js - * region_tag:contentwarehouse_v1_generated_DocumentSchemaService_ListDocumentSchemas_async - */ - listDocumentSchemasAsync( - request?: protos.google.cloud.contentwarehouse.v1.IListDocumentSchemasRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listDocumentSchemas']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listDocumentSchemas iterate %j', request); - return this.descriptors.page.listDocumentSchemas.asyncIterate( - this.innerApiCalls['listDocumentSchemas'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified documentLink resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} document - * @param {string} document_link - * @returns {string} Resource name string. - */ - documentLinkPath(project:string,location:string,document:string,documentLink:string) { - return this.pathTemplates.documentLinkPathTemplate.render({ - project: project, - location: location, - document: document, - document_link: documentLink, - }); - } - - /** - * Parse the project from DocumentLink resource. - * - * @param {string} documentLinkName - * A fully-qualified path representing DocumentLink resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDocumentLinkName(documentLinkName: string) { - return this.pathTemplates.documentLinkPathTemplate.match(documentLinkName).project; - } - - /** - * Parse the location from DocumentLink resource. - * - * @param {string} documentLinkName - * A fully-qualified path representing DocumentLink resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDocumentLinkName(documentLinkName: string) { - return this.pathTemplates.documentLinkPathTemplate.match(documentLinkName).location; - } - - /** - * Parse the document from DocumentLink resource. - * - * @param {string} documentLinkName - * A fully-qualified path representing DocumentLink resource. - * @returns {string} A string representing the document. - */ - matchDocumentFromDocumentLinkName(documentLinkName: string) { - return this.pathTemplates.documentLinkPathTemplate.match(documentLinkName).document; - } - - /** - * Parse the document_link from DocumentLink resource. - * - * @param {string} documentLinkName - * A fully-qualified path representing DocumentLink resource. - * @returns {string} A string representing the document_link. - */ - matchDocumentLinkFromDocumentLinkName(documentLinkName: string) { - return this.pathTemplates.documentLinkPathTemplate.match(documentLinkName).document_link; - } - - /** - * Return a fully-qualified documentSchema resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} document_schema - * @returns {string} Resource name string. - */ - documentSchemaPath(project:string,location:string,documentSchema:string) { - return this.pathTemplates.documentSchemaPathTemplate.render({ - project: project, - location: location, - document_schema: documentSchema, - }); - } - - /** - * Parse the project from DocumentSchema resource. - * - * @param {string} documentSchemaName - * A fully-qualified path representing DocumentSchema resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDocumentSchemaName(documentSchemaName: string) { - return this.pathTemplates.documentSchemaPathTemplate.match(documentSchemaName).project; - } - - /** - * Parse the location from DocumentSchema resource. - * - * @param {string} documentSchemaName - * A fully-qualified path representing DocumentSchema resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDocumentSchemaName(documentSchemaName: string) { - return this.pathTemplates.documentSchemaPathTemplate.match(documentSchemaName).location; - } - - /** - * Parse the document_schema from DocumentSchema resource. - * - * @param {string} documentSchemaName - * A fully-qualified path representing DocumentSchema resource. - * @returns {string} A string representing the document_schema. - */ - matchDocumentSchemaFromDocumentSchemaName(documentSchemaName: string) { - return this.pathTemplates.documentSchemaPathTemplate.match(documentSchemaName).document_schema; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified projectLocationDocument resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} document - * @returns {string} Resource name string. - */ - projectLocationDocumentPath(project:string,location:string,document:string) { - return this.pathTemplates.projectLocationDocumentPathTemplate.render({ - project: project, - location: location, - document: document, - }); - } - - /** - * Parse the project from ProjectLocationDocument resource. - * - * @param {string} projectLocationDocumentName - * A fully-qualified path representing project_location_document resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationDocumentName(projectLocationDocumentName: string) { - return this.pathTemplates.projectLocationDocumentPathTemplate.match(projectLocationDocumentName).project; - } - - /** - * Parse the location from ProjectLocationDocument resource. - * - * @param {string} projectLocationDocumentName - * A fully-qualified path representing project_location_document resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationDocumentName(projectLocationDocumentName: string) { - return this.pathTemplates.projectLocationDocumentPathTemplate.match(projectLocationDocumentName).location; - } - - /** - * Parse the document from ProjectLocationDocument resource. - * - * @param {string} projectLocationDocumentName - * A fully-qualified path representing project_location_document resource. - * @returns {string} A string representing the document. - */ - matchDocumentFromProjectLocationDocumentName(projectLocationDocumentName: string) { - return this.pathTemplates.projectLocationDocumentPathTemplate.match(projectLocationDocumentName).document; - } - - /** - * Return a fully-qualified projectLocationDocumentsReferenceId resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} reference_id - * @returns {string} Resource name string. - */ - projectLocationDocumentsReferenceIdPath(project:string,location:string,referenceId:string) { - return this.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.render({ - project: project, - location: location, - reference_id: referenceId, - }); - } - - /** - * Parse the project from ProjectLocationDocumentsReferenceId resource. - * - * @param {string} projectLocationDocumentsReferenceIdName - * A fully-qualified path representing project_location_documents_reference_id resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationDocumentsReferenceIdName(projectLocationDocumentsReferenceIdName: string) { - return this.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match(projectLocationDocumentsReferenceIdName).project; - } - - /** - * Parse the location from ProjectLocationDocumentsReferenceId resource. - * - * @param {string} projectLocationDocumentsReferenceIdName - * A fully-qualified path representing project_location_documents_reference_id resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationDocumentsReferenceIdName(projectLocationDocumentsReferenceIdName: string) { - return this.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match(projectLocationDocumentsReferenceIdName).location; - } - - /** - * Parse the reference_id from ProjectLocationDocumentsReferenceId resource. - * - * @param {string} projectLocationDocumentsReferenceIdName - * A fully-qualified path representing project_location_documents_reference_id resource. - * @returns {string} A string representing the reference_id. - */ - matchReferenceIdFromProjectLocationDocumentsReferenceIdName(projectLocationDocumentsReferenceIdName: string) { - return this.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match(projectLocationDocumentsReferenceIdName).reference_id; - } - - /** - * Return a fully-qualified ruleSet resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} rule_set - * @returns {string} Resource name string. - */ - ruleSetPath(project:string,location:string,ruleSet:string) { - return this.pathTemplates.ruleSetPathTemplate.render({ - project: project, - location: location, - rule_set: ruleSet, - }); - } - - /** - * Parse the project from RuleSet resource. - * - * @param {string} ruleSetName - * A fully-qualified path representing RuleSet resource. - * @returns {string} A string representing the project. - */ - matchProjectFromRuleSetName(ruleSetName: string) { - return this.pathTemplates.ruleSetPathTemplate.match(ruleSetName).project; - } - - /** - * Parse the location from RuleSet resource. - * - * @param {string} ruleSetName - * A fully-qualified path representing RuleSet resource. - * @returns {string} A string representing the location. - */ - matchLocationFromRuleSetName(ruleSetName: string) { - return this.pathTemplates.ruleSetPathTemplate.match(ruleSetName).location; - } - - /** - * Parse the rule_set from RuleSet resource. - * - * @param {string} ruleSetName - * A fully-qualified path representing RuleSet resource. - * @returns {string} A string representing the rule_set. - */ - matchRuleSetFromRuleSetName(ruleSetName: string) { - return this.pathTemplates.ruleSetPathTemplate.match(ruleSetName).rule_set; - } - - /** - * Return a fully-qualified synonymSet resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} context - * @returns {string} Resource name string. - */ - synonymSetPath(project:string,location:string,context:string) { - return this.pathTemplates.synonymSetPathTemplate.render({ - project: project, - location: location, - context: context, - }); - } - - /** - * Parse the project from SynonymSet resource. - * - * @param {string} synonymSetName - * A fully-qualified path representing SynonymSet resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSynonymSetName(synonymSetName: string) { - return this.pathTemplates.synonymSetPathTemplate.match(synonymSetName).project; - } - - /** - * Parse the location from SynonymSet resource. - * - * @param {string} synonymSetName - * A fully-qualified path representing SynonymSet resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSynonymSetName(synonymSetName: string) { - return this.pathTemplates.synonymSetPathTemplate.match(synonymSetName).location; - } - - /** - * Parse the context from SynonymSet resource. - * - * @param {string} synonymSetName - * A fully-qualified path representing SynonymSet resource. - * @returns {string} A string representing the context. - */ - matchContextFromSynonymSetName(synonymSetName: string) { - return this.pathTemplates.synonymSetPathTemplate.match(synonymSetName).context; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.documentSchemaServiceStub && !this._terminated) { - return this.documentSchemaServiceStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - }); - } - return Promise.resolve(); - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_schema_service_client_config.json b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_schema_service_client_config.json deleted file mode 100644 index 80dfa82b9d0..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_schema_service_client_config.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "interfaces": { - "google.cloud.contentwarehouse.v1.DocumentSchemaService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "unavailable": [ - "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 - }, - "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { - "initial_retry_delay_millis": 1000, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 10000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateDocumentSchema": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateDocumentSchema": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetDocumentSchema": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "DeleteDocumentSchema": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListDocumentSchemas": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_schema_service_proto_list.json b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_schema_service_proto_list.json deleted file mode 100644 index a1775b1134d..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_schema_service_proto_list.json +++ /dev/null @@ -1,23 +0,0 @@ -[ - "../../protos/google/cloud/contentwarehouse/v1/async_document_service_request.proto", - "../../protos/google/cloud/contentwarehouse/v1/common.proto", - "../../protos/google/cloud/contentwarehouse/v1/document.proto", - "../../protos/google/cloud/contentwarehouse/v1/document_link_service.proto", - "../../protos/google/cloud/contentwarehouse/v1/document_schema.proto", - "../../protos/google/cloud/contentwarehouse/v1/document_schema_service.proto", - "../../protos/google/cloud/contentwarehouse/v1/document_service.proto", - "../../protos/google/cloud/contentwarehouse/v1/document_service_request.proto", - "../../protos/google/cloud/contentwarehouse/v1/filters.proto", - "../../protos/google/cloud/contentwarehouse/v1/histogram.proto", - "../../protos/google/cloud/contentwarehouse/v1/pipeline_service.proto", - "../../protos/google/cloud/contentwarehouse/v1/pipelines.proto", - "../../protos/google/cloud/contentwarehouse/v1/rule_engine.proto", - "../../protos/google/cloud/contentwarehouse/v1/ruleset_service.proto", - "../../protos/google/cloud/contentwarehouse/v1/ruleset_service_request.proto", - "../../protos/google/cloud/contentwarehouse/v1/synonymset.proto", - "../../protos/google/cloud/contentwarehouse/v1/synonymset_service.proto", - "../../protos/google/cloud/contentwarehouse/v1/synonymset_service_request.proto", - "../../protos/google/cloud/documentai/v1/barcode.proto", - "../../protos/google/cloud/documentai/v1/document.proto", - "../../protos/google/cloud/documentai/v1/geometry.proto" -] diff --git a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_service_client.ts b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_service_client.ts deleted file mode 100644 index b66b791d12b..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_service_client.ts +++ /dev/null @@ -1,1907 +0,0 @@ -// Copyright 2026 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 type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; - -/** - * Client JSON configuration object, loaded from - * `src/v1/document_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './document_service_client_config.json'; -const version = require('../../../package.json').version; - -/** - * This service lets you manage document. - * @class - * @memberof v1 - */ -export class DocumentServiceClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - private _universeDomain: string; - private _servicePath: string; - private _log = logging.log('contentwarehouse'); - - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - documentServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of DocumentServiceClient. - * - * @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/main/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://cloud.google.com/docs/authentication/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/1.1 REST mode. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new DocumentServiceClient({fallback: true}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof DocumentServiceClient; - if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { - throw new Error('Please set either universe_domain or universeDomain, but not both.'); - } - const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; - this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; - this._servicePath = 'contentwarehouse.' + this._universeDomain; - const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // Request numeric enum values if REST transport is used. - opts.numericEnums = true; - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== this._servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = this._servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === this._servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process === 'object' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - documentLinkPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/documents/{document}/documentLinks/{document_link}' - ), - documentSchemaPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/documentSchemas/{document_schema}' - ), - projectLocationDocumentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/documents/{document}' - ), - projectLocationDocumentsReferenceIdPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/documents/referenceId/{reference_id}' - ), - ruleSetPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/ruleSets/{rule_set}' - ), - synonymSetPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/synonymSets/{context}' - ), - }; - - // 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 = { - searchDocuments: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'matchingDocuments') - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.contentwarehouse.v1.DocumentService', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = this._gaxModule.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.documentServiceStub) { - return this.documentServiceStub; - } - - // Put together the "service stub" for - // google.cloud.contentwarehouse.v1.DocumentService. - this.documentServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.contentwarehouse.v1.DocumentService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.contentwarehouse.v1.DocumentService, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const documentServiceStubMethods = - ['createDocument', 'getDocument', 'updateDocument', 'deleteDocument', 'searchDocuments', 'lockDocument', 'fetchAcl', 'setAcl']; - for (const methodName of documentServiceStubMethods) { - const callPromise = this.documentServiceStub.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._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.documentServiceStub; - } - - /** - * The DNS address for this API service. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'contentwarehouse.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'contentwarehouse.googleapis.com'; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - get apiEndpoint() { - return this._servicePath; - } - - get universeDomain() { - return this._universeDomain; - } - - /** - * 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 -- - // ------------------- -/** - * Creates a document. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent name. - * Format: projects/{project_number}/locations/{location}. - * @param {google.cloud.contentwarehouse.v1.Document} request.document - * Required. The document to create. - * @param {google.cloud.contentwarehouse.v1.RequestMetadata} request.requestMetadata - * The meta information collected about the end user, used to enforce access - * control for the service. - * @param {google.iam.v1.Policy} request.policy - * Default document policy during creation. - * This refers to an Identity and Access (IAM) policy, which specifies access - * controls for the Document. - * Conditions defined in the policy will be ignored. - * @param {google.cloud.contentwarehouse.v1.CloudAIDocumentOption} request.cloudAiDocumentOption - * Request Option for processing Cloud AI Document in Document Warehouse. - * This field offers limited support for mapping entities from Cloud AI - * Document to Warehouse Document. Please consult with product team before - * using this field and other available options. - * @param {google.protobuf.FieldMask} request.createMask - * Field mask for creating Document fields. If mask path is empty, - * it means all fields are masked. - * For the `FieldMask` definition, - * see - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask. - * @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 {@link protos.google.cloud.contentwarehouse.v1.CreateDocumentResponse|CreateDocumentResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/document_service.create_document.js - * region_tag:contentwarehouse_v1_generated_DocumentService_CreateDocument_async - */ - createDocument( - request?: protos.google.cloud.contentwarehouse.v1.ICreateDocumentRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.contentwarehouse.v1.ICreateDocumentResponse, - protos.google.cloud.contentwarehouse.v1.ICreateDocumentRequest|undefined, {}|undefined - ]>; - createDocument( - request: protos.google.cloud.contentwarehouse.v1.ICreateDocumentRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.contentwarehouse.v1.ICreateDocumentResponse, - protos.google.cloud.contentwarehouse.v1.ICreateDocumentRequest|null|undefined, - {}|null|undefined>): void; - createDocument( - request: protos.google.cloud.contentwarehouse.v1.ICreateDocumentRequest, - callback: Callback< - protos.google.cloud.contentwarehouse.v1.ICreateDocumentResponse, - protos.google.cloud.contentwarehouse.v1.ICreateDocumentRequest|null|undefined, - {}|null|undefined>): void; - createDocument( - request?: protos.google.cloud.contentwarehouse.v1.ICreateDocumentRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.contentwarehouse.v1.ICreateDocumentResponse, - protos.google.cloud.contentwarehouse.v1.ICreateDocumentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.contentwarehouse.v1.ICreateDocumentResponse, - protos.google.cloud.contentwarehouse.v1.ICreateDocumentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.contentwarehouse.v1.ICreateDocumentResponse, - protos.google.cloud.contentwarehouse.v1.ICreateDocumentRequest|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('createDocument request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.contentwarehouse.v1.ICreateDocumentResponse, - protos.google.cloud.contentwarehouse.v1.ICreateDocumentRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('createDocument response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.createDocument(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.contentwarehouse.v1.ICreateDocumentResponse, - protos.google.cloud.contentwarehouse.v1.ICreateDocumentRequest|undefined, - {}|undefined - ]) => { - this._log.info('createDocument response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Gets a document. Returns NOT_FOUND if the document does not exist. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the document to retrieve. - * Format: - * projects/{project_number}/locations/{location}/documents/{document_id} or - * projects/{project_number}/locations/{location}/documents/referenceId/{reference_id}. - * @param {google.cloud.contentwarehouse.v1.RequestMetadata} request.requestMetadata - * The meta information collected about the end user, used to enforce access - * control for the service. - * @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 {@link protos.google.cloud.contentwarehouse.v1.Document|Document}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/document_service.get_document.js - * region_tag:contentwarehouse_v1_generated_DocumentService_GetDocument_async - */ - getDocument( - request?: protos.google.cloud.contentwarehouse.v1.IGetDocumentRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.contentwarehouse.v1.IDocument, - protos.google.cloud.contentwarehouse.v1.IGetDocumentRequest|undefined, {}|undefined - ]>; - getDocument( - request: protos.google.cloud.contentwarehouse.v1.IGetDocumentRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.contentwarehouse.v1.IDocument, - protos.google.cloud.contentwarehouse.v1.IGetDocumentRequest|null|undefined, - {}|null|undefined>): void; - getDocument( - request: protos.google.cloud.contentwarehouse.v1.IGetDocumentRequest, - callback: Callback< - protos.google.cloud.contentwarehouse.v1.IDocument, - protos.google.cloud.contentwarehouse.v1.IGetDocumentRequest|null|undefined, - {}|null|undefined>): void; - getDocument( - request?: protos.google.cloud.contentwarehouse.v1.IGetDocumentRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.contentwarehouse.v1.IDocument, - protos.google.cloud.contentwarehouse.v1.IGetDocumentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.contentwarehouse.v1.IDocument, - protos.google.cloud.contentwarehouse.v1.IGetDocumentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.contentwarehouse.v1.IDocument, - protos.google.cloud.contentwarehouse.v1.IGetDocumentRequest|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getDocument request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.contentwarehouse.v1.IDocument, - protos.google.cloud.contentwarehouse.v1.IGetDocumentRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getDocument response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getDocument(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.contentwarehouse.v1.IDocument, - protos.google.cloud.contentwarehouse.v1.IGetDocumentRequest|undefined, - {}|undefined - ]) => { - this._log.info('getDocument response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Updates a document. Returns INVALID_ARGUMENT if the name of the document - * is non-empty and does not equal the existing name. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the document to update. - * Format: - * projects/{project_number}/locations/{location}/documents/{document_id} - * or - * projects/{project_number}/locations/{location}/documents/referenceId/{reference_id}. - * @param {google.cloud.contentwarehouse.v1.Document} request.document - * Required. The document to update. - * @param {google.cloud.contentwarehouse.v1.RequestMetadata} request.requestMetadata - * The meta information collected about the end user, used to enforce access - * control for the service. - * @param {google.cloud.contentwarehouse.v1.CloudAIDocumentOption} request.cloudAiDocumentOption - * Request Option for processing Cloud AI Document in Document Warehouse. - * This field offers limited support for mapping entities from Cloud AI - * Document to Warehouse Document. Please consult with product team before - * using this field and other available options. - * @param {google.cloud.contentwarehouse.v1.UpdateOptions} request.updateOptions - * Options for the update operation. - * @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 {@link protos.google.cloud.contentwarehouse.v1.UpdateDocumentResponse|UpdateDocumentResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/document_service.update_document.js - * region_tag:contentwarehouse_v1_generated_DocumentService_UpdateDocument_async - */ - updateDocument( - request?: protos.google.cloud.contentwarehouse.v1.IUpdateDocumentRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.contentwarehouse.v1.IUpdateDocumentResponse, - protos.google.cloud.contentwarehouse.v1.IUpdateDocumentRequest|undefined, {}|undefined - ]>; - updateDocument( - request: protos.google.cloud.contentwarehouse.v1.IUpdateDocumentRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.contentwarehouse.v1.IUpdateDocumentResponse, - protos.google.cloud.contentwarehouse.v1.IUpdateDocumentRequest|null|undefined, - {}|null|undefined>): void; - updateDocument( - request: protos.google.cloud.contentwarehouse.v1.IUpdateDocumentRequest, - callback: Callback< - protos.google.cloud.contentwarehouse.v1.IUpdateDocumentResponse, - protos.google.cloud.contentwarehouse.v1.IUpdateDocumentRequest|null|undefined, - {}|null|undefined>): void; - updateDocument( - request?: protos.google.cloud.contentwarehouse.v1.IUpdateDocumentRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.contentwarehouse.v1.IUpdateDocumentResponse, - protos.google.cloud.contentwarehouse.v1.IUpdateDocumentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.contentwarehouse.v1.IUpdateDocumentResponse, - protos.google.cloud.contentwarehouse.v1.IUpdateDocumentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.contentwarehouse.v1.IUpdateDocumentResponse, - protos.google.cloud.contentwarehouse.v1.IUpdateDocumentRequest|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('updateDocument request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.contentwarehouse.v1.IUpdateDocumentResponse, - protos.google.cloud.contentwarehouse.v1.IUpdateDocumentRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateDocument response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.updateDocument(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.contentwarehouse.v1.IUpdateDocumentResponse, - protos.google.cloud.contentwarehouse.v1.IUpdateDocumentRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateDocument response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Deletes a document. Returns NOT_FOUND if the document does not exist. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the document to delete. - * Format: - * projects/{project_number}/locations/{location}/documents/{document_id} - * or - * projects/{project_number}/locations/{location}/documents/referenceId/{reference_id}. - * @param {google.cloud.contentwarehouse.v1.RequestMetadata} request.requestMetadata - * The meta information collected about the end user, used to enforce access - * control for the service. - * @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 {@link protos.google.protobuf.Empty|Empty}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/document_service.delete_document.js - * region_tag:contentwarehouse_v1_generated_DocumentService_DeleteDocument_async - */ - deleteDocument( - request?: protos.google.cloud.contentwarehouse.v1.IDeleteDocumentRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.contentwarehouse.v1.IDeleteDocumentRequest|undefined, {}|undefined - ]>; - deleteDocument( - request: protos.google.cloud.contentwarehouse.v1.IDeleteDocumentRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.contentwarehouse.v1.IDeleteDocumentRequest|null|undefined, - {}|null|undefined>): void; - deleteDocument( - request: protos.google.cloud.contentwarehouse.v1.IDeleteDocumentRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.contentwarehouse.v1.IDeleteDocumentRequest|null|undefined, - {}|null|undefined>): void; - deleteDocument( - request?: protos.google.cloud.contentwarehouse.v1.IDeleteDocumentRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.contentwarehouse.v1.IDeleteDocumentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.contentwarehouse.v1.IDeleteDocumentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.contentwarehouse.v1.IDeleteDocumentRequest|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('deleteDocument request %j', request); - const wrappedCallback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.contentwarehouse.v1.IDeleteDocumentRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('deleteDocument response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.deleteDocument(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.protobuf.IEmpty, - protos.google.cloud.contentwarehouse.v1.IDeleteDocumentRequest|undefined, - {}|undefined - ]) => { - this._log.info('deleteDocument response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Lock the document so the document cannot be updated by other users. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the document to lock. - * Format: - * projects/{project_number}/locations/{location}/documents/{document}. - * @param {string} request.collectionId - * The collection the document connects to. - * @param {google.cloud.contentwarehouse.v1.UserInfo} request.lockingUser - * The user information who locks the document. - * @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 {@link protos.google.cloud.contentwarehouse.v1.Document|Document}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/document_service.lock_document.js - * region_tag:contentwarehouse_v1_generated_DocumentService_LockDocument_async - */ - lockDocument( - request?: protos.google.cloud.contentwarehouse.v1.ILockDocumentRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.contentwarehouse.v1.IDocument, - protos.google.cloud.contentwarehouse.v1.ILockDocumentRequest|undefined, {}|undefined - ]>; - lockDocument( - request: protos.google.cloud.contentwarehouse.v1.ILockDocumentRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.contentwarehouse.v1.IDocument, - protos.google.cloud.contentwarehouse.v1.ILockDocumentRequest|null|undefined, - {}|null|undefined>): void; - lockDocument( - request: protos.google.cloud.contentwarehouse.v1.ILockDocumentRequest, - callback: Callback< - protos.google.cloud.contentwarehouse.v1.IDocument, - protos.google.cloud.contentwarehouse.v1.ILockDocumentRequest|null|undefined, - {}|null|undefined>): void; - lockDocument( - request?: protos.google.cloud.contentwarehouse.v1.ILockDocumentRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.contentwarehouse.v1.IDocument, - protos.google.cloud.contentwarehouse.v1.ILockDocumentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.contentwarehouse.v1.IDocument, - protos.google.cloud.contentwarehouse.v1.ILockDocumentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.contentwarehouse.v1.IDocument, - protos.google.cloud.contentwarehouse.v1.ILockDocumentRequest|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('lockDocument request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.contentwarehouse.v1.IDocument, - protos.google.cloud.contentwarehouse.v1.ILockDocumentRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('lockDocument response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.lockDocument(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.contentwarehouse.v1.IDocument, - protos.google.cloud.contentwarehouse.v1.ILockDocumentRequest|undefined, - {}|undefined - ]) => { - this._log.info('lockDocument response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Gets the access control policy for a resource. Returns NOT_FOUND error if - * the resource does not exist. Returns an empty policy if the resource exists - * but does not have a policy set. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * Required. REQUIRED: The resource for which the policy is being requested. - * Format for document: - * projects/{project_number}/locations/{location}/documents/{document_id}. - * Format for collection: - * projects/{project_number}/locations/{location}/collections/{collection_id}. - * Format for project: projects/{project_number}. - * @param {google.cloud.contentwarehouse.v1.RequestMetadata} request.requestMetadata - * The meta information collected about the end user, used to enforce access - * control for the service. - * @param {boolean} request.projectOwner - * For Get Project ACL only. Authorization check for end user will be ignored - * when project_owner=true. - * @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 {@link protos.google.cloud.contentwarehouse.v1.FetchAclResponse|FetchAclResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/document_service.fetch_acl.js - * region_tag:contentwarehouse_v1_generated_DocumentService_FetchAcl_async - */ - fetchAcl( - request?: protos.google.cloud.contentwarehouse.v1.IFetchAclRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.contentwarehouse.v1.IFetchAclResponse, - protos.google.cloud.contentwarehouse.v1.IFetchAclRequest|undefined, {}|undefined - ]>; - fetchAcl( - request: protos.google.cloud.contentwarehouse.v1.IFetchAclRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.contentwarehouse.v1.IFetchAclResponse, - protos.google.cloud.contentwarehouse.v1.IFetchAclRequest|null|undefined, - {}|null|undefined>): void; - fetchAcl( - request: protos.google.cloud.contentwarehouse.v1.IFetchAclRequest, - callback: Callback< - protos.google.cloud.contentwarehouse.v1.IFetchAclResponse, - protos.google.cloud.contentwarehouse.v1.IFetchAclRequest|null|undefined, - {}|null|undefined>): void; - fetchAcl( - request?: protos.google.cloud.contentwarehouse.v1.IFetchAclRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.contentwarehouse.v1.IFetchAclResponse, - protos.google.cloud.contentwarehouse.v1.IFetchAclRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.contentwarehouse.v1.IFetchAclResponse, - protos.google.cloud.contentwarehouse.v1.IFetchAclRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.contentwarehouse.v1.IFetchAclResponse, - protos.google.cloud.contentwarehouse.v1.IFetchAclRequest|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'resource': request.resource ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('fetchAcl request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.contentwarehouse.v1.IFetchAclResponse, - protos.google.cloud.contentwarehouse.v1.IFetchAclRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('fetchAcl response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.fetchAcl(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.contentwarehouse.v1.IFetchAclResponse, - protos.google.cloud.contentwarehouse.v1.IFetchAclRequest|undefined, - {}|undefined - ]) => { - this._log.info('fetchAcl response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Sets the access control policy for a resource. Replaces any existing - * policy. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * Required. REQUIRED: The resource for which the policy is being requested. - * Format for document: - * projects/{project_number}/locations/{location}/documents/{document_id}. - * Format for collection: - * projects/{project_number}/locations/{location}/collections/{collection_id}. - * Format for project: projects/{project_number}. - * @param {google.iam.v1.Policy} request.policy - * Required. REQUIRED: The complete policy to be applied to the `resource`. - * The size of the policy is limited to a few 10s of KB. This refers to an - * Identity and Access (IAM) policy, which specifies access controls for the - * Document. - * - * You can set ACL with condition for projects only. - * - * Supported operators are: `=`, `!=`, `<`, `<=`, `>`, and `>=` where - * the left of the operator is `DocumentSchemaId` or property name and the - * right of the operator is a number or a quoted string. You must escape - * backslash (\\) and quote (\") characters. - * - * Boolean expressions (AND/OR) are supported up to 3 levels of nesting (for - * example, "((A AND B AND C) OR D) AND E"), a maximum of 10 comparisons are - * allowed in the expression. The expression must be < 6000 bytes in length. - * - * Sample condition: - * `"DocumentSchemaId = \"some schema id\" OR SchemaId.floatPropertyName - * >= 10"` - * @param {google.cloud.contentwarehouse.v1.RequestMetadata} request.requestMetadata - * The meta information collected about the end user, used to enforce access - * control for the service. - * @param {boolean} request.projectOwner - * For Set Project ACL only. Authorization check for end user will be ignored - * when project_owner=true. - * @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 {@link protos.google.cloud.contentwarehouse.v1.SetAclResponse|SetAclResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/document_service.set_acl.js - * region_tag:contentwarehouse_v1_generated_DocumentService_SetAcl_async - */ - setAcl( - request?: protos.google.cloud.contentwarehouse.v1.ISetAclRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.contentwarehouse.v1.ISetAclResponse, - protos.google.cloud.contentwarehouse.v1.ISetAclRequest|undefined, {}|undefined - ]>; - setAcl( - request: protos.google.cloud.contentwarehouse.v1.ISetAclRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.contentwarehouse.v1.ISetAclResponse, - protos.google.cloud.contentwarehouse.v1.ISetAclRequest|null|undefined, - {}|null|undefined>): void; - setAcl( - request: protos.google.cloud.contentwarehouse.v1.ISetAclRequest, - callback: Callback< - protos.google.cloud.contentwarehouse.v1.ISetAclResponse, - protos.google.cloud.contentwarehouse.v1.ISetAclRequest|null|undefined, - {}|null|undefined>): void; - setAcl( - request?: protos.google.cloud.contentwarehouse.v1.ISetAclRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.contentwarehouse.v1.ISetAclResponse, - protos.google.cloud.contentwarehouse.v1.ISetAclRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.contentwarehouse.v1.ISetAclResponse, - protos.google.cloud.contentwarehouse.v1.ISetAclRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.contentwarehouse.v1.ISetAclResponse, - protos.google.cloud.contentwarehouse.v1.ISetAclRequest|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'resource': request.resource ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('setAcl request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.contentwarehouse.v1.ISetAclResponse, - protos.google.cloud.contentwarehouse.v1.ISetAclRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('setAcl response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.setAcl(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.contentwarehouse.v1.ISetAclResponse, - protos.google.cloud.contentwarehouse.v1.ISetAclRequest|undefined, - {}|undefined - ]) => { - this._log.info('setAcl response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } - - /** - * Searches for documents using provided - * {@link protos.google.cloud.contentwarehouse.v1.SearchDocumentsRequest|SearchDocumentsRequest}. - * This call only returns documents that the caller has permission to search - * against. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of documents. - * Format: projects/{project_number}/locations/{location}. - * @param {google.cloud.contentwarehouse.v1.RequestMetadata} request.requestMetadata - * The meta information collected about the end user, used to enforce access - * control and improve the search quality of the service. - * @param {google.cloud.contentwarehouse.v1.DocumentQuery} request.documentQuery - * Query used to search against documents (keyword, filters, etc.). - * @param {number} request.offset - * An integer that specifies the current offset (that is, starting result - * location, amongst the documents deemed by the API as relevant) in search - * results. This field is only considered if - * {@link protos.google.cloud.contentwarehouse.v1.SearchDocumentsRequest.page_token|page_token} - * is unset. - * - * The maximum allowed value is 5000. Otherwise an error is thrown. - * - * For example, 0 means to return results starting from the first matching - * document, and 10 means to return from the 11th document. This can be used - * for pagination, (for example, pageSize = 10 and offset = 10 means to return - * from the second page). - * @param {number} request.pageSize - * A limit on the number of documents returned in the search results. - * Increasing this value above the default value of 10 can increase search - * response time. The value can be between 1 and 100. - * @param {string} request.pageToken - * The token specifying the current offset within search results. - * See - * {@link protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.next_page_token|SearchDocumentsResponse.next_page_token} - * for an explanation of how to obtain the next set of query results. - * @param {string} request.orderBy - * The criteria determining how search results are sorted. For non-empty - * query, default is `"relevance desc"`. For empty query, default is - * `"upload_date desc"`. - * - * Supported options are: - * - * * `"relevance desc"`: By relevance descending, as determined by the API - * algorithms. - * * `"upload_date desc"`: By upload date descending. - * * `"upload_date"`: By upload date ascending. - * * `"update_date desc"`: By last updated date descending. - * * `"update_date"`: By last updated date ascending. - * * `"retrieval_importance desc"`: By retrieval importance of properties - * descending. This feature is still under development, please do not use - * unless otherwise instructed to do so. - * @param {number[]} request.histogramQueries - * An expression specifying a histogram request against matching - * documents. Expression syntax is an aggregation function call with - * histogram facets and other options. - * - * The following aggregation functions are supported: - * - * * `count(string_histogram_facet)`: Count the number of matching entities - * for each distinct attribute value. - * - * Data types: - * - * * Histogram facet (aka filterable properties): Facet names with format - * <schema id>.<facet>. Facets will have the - * format of: `{@link protos.a-zA-Z0-9_:/-.|a-zA-Z}`. If the facet is a child - * facet, then the parent hierarchy needs to be specified separated by - * dots in the prefix after the schema id. Thus, the format for a multi- - * level facet is: <schema id>.<parent facet name>. - * <child facet name>. Example: - * schema123.root_parent_facet.middle_facet.child_facet - * * DocumentSchemaId: (with no schema id prefix) to get - * histograms for each document type (returns the schema id path, e.g. - * projects/12345/locations/us-west/documentSchemas/abc123). - * - * Example expression: - * - * * Document type counts: - * count('DocumentSchemaId') - * - * * For schema id, abc123, get the counts for MORTGAGE_TYPE: - * count('abc123.MORTGAGE_TYPE') - * @param {boolean} request.requireTotalSize - * Controls if the search document request requires the return of a total size - * of matched documents. See - * {@link protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.total_size|SearchDocumentsResponse.total_size}. - * - * Enabling this flag may adversely impact performance. Hint: If this is - * used with pagination, set this flag on the initial query but set this - * to false on subsequent page calls (keep the total count locally). - * - * Defaults to false. - * @param {google.cloud.contentwarehouse.v1.SearchDocumentsRequest.TotalResultSize} request.totalResultSize - * Controls if the search document request requires the return of a total size - * of matched documents. See - * {@link protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.total_size|SearchDocumentsResponse.total_size}. - * @param {number} request.qaSizeLimit - * Experimental, do not use. - * The limit on the number of documents returned for the question-answering - * feature. To enable the question-answering feature, set - * {@link protos.|DocumentQuery].[is_nl_query} to true. - * @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 {@link protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument|MatchingDocument}. - * 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 `searchDocumentsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - searchDocuments( - request?: protos.google.cloud.contentwarehouse.v1.ISearchDocumentsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.IMatchingDocument[], - protos.google.cloud.contentwarehouse.v1.ISearchDocumentsRequest|null, - protos.google.cloud.contentwarehouse.v1.ISearchDocumentsResponse - ]>; - searchDocuments( - request: protos.google.cloud.contentwarehouse.v1.ISearchDocumentsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.contentwarehouse.v1.ISearchDocumentsRequest, - protos.google.cloud.contentwarehouse.v1.ISearchDocumentsResponse|null|undefined, - protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.IMatchingDocument>): void; - searchDocuments( - request: protos.google.cloud.contentwarehouse.v1.ISearchDocumentsRequest, - callback: PaginationCallback< - protos.google.cloud.contentwarehouse.v1.ISearchDocumentsRequest, - protos.google.cloud.contentwarehouse.v1.ISearchDocumentsResponse|null|undefined, - protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.IMatchingDocument>): void; - searchDocuments( - request?: protos.google.cloud.contentwarehouse.v1.ISearchDocumentsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.contentwarehouse.v1.ISearchDocumentsRequest, - protos.google.cloud.contentwarehouse.v1.ISearchDocumentsResponse|null|undefined, - protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.IMatchingDocument>, - callback?: PaginationCallback< - protos.google.cloud.contentwarehouse.v1.ISearchDocumentsRequest, - protos.google.cloud.contentwarehouse.v1.ISearchDocumentsResponse|null|undefined, - protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.IMatchingDocument>): - Promise<[ - protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.IMatchingDocument[], - protos.google.cloud.contentwarehouse.v1.ISearchDocumentsRequest|null, - protos.google.cloud.contentwarehouse.v1.ISearchDocumentsResponse - ]>|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.contentwarehouse.v1.ISearchDocumentsRequest, - protos.google.cloud.contentwarehouse.v1.ISearchDocumentsResponse|null|undefined, - protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.IMatchingDocument>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('searchDocuments values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('searchDocuments request %j', request); - return this.innerApiCalls - .searchDocuments(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.IMatchingDocument[], - protos.google.cloud.contentwarehouse.v1.ISearchDocumentsRequest|null, - protos.google.cloud.contentwarehouse.v1.ISearchDocumentsResponse - ]) => { - this._log.info('searchDocuments values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `searchDocuments`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of documents. - * Format: projects/{project_number}/locations/{location}. - * @param {google.cloud.contentwarehouse.v1.RequestMetadata} request.requestMetadata - * The meta information collected about the end user, used to enforce access - * control and improve the search quality of the service. - * @param {google.cloud.contentwarehouse.v1.DocumentQuery} request.documentQuery - * Query used to search against documents (keyword, filters, etc.). - * @param {number} request.offset - * An integer that specifies the current offset (that is, starting result - * location, amongst the documents deemed by the API as relevant) in search - * results. This field is only considered if - * {@link protos.google.cloud.contentwarehouse.v1.SearchDocumentsRequest.page_token|page_token} - * is unset. - * - * The maximum allowed value is 5000. Otherwise an error is thrown. - * - * For example, 0 means to return results starting from the first matching - * document, and 10 means to return from the 11th document. This can be used - * for pagination, (for example, pageSize = 10 and offset = 10 means to return - * from the second page). - * @param {number} request.pageSize - * A limit on the number of documents returned in the search results. - * Increasing this value above the default value of 10 can increase search - * response time. The value can be between 1 and 100. - * @param {string} request.pageToken - * The token specifying the current offset within search results. - * See - * {@link protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.next_page_token|SearchDocumentsResponse.next_page_token} - * for an explanation of how to obtain the next set of query results. - * @param {string} request.orderBy - * The criteria determining how search results are sorted. For non-empty - * query, default is `"relevance desc"`. For empty query, default is - * `"upload_date desc"`. - * - * Supported options are: - * - * * `"relevance desc"`: By relevance descending, as determined by the API - * algorithms. - * * `"upload_date desc"`: By upload date descending. - * * `"upload_date"`: By upload date ascending. - * * `"update_date desc"`: By last updated date descending. - * * `"update_date"`: By last updated date ascending. - * * `"retrieval_importance desc"`: By retrieval importance of properties - * descending. This feature is still under development, please do not use - * unless otherwise instructed to do so. - * @param {number[]} request.histogramQueries - * An expression specifying a histogram request against matching - * documents. Expression syntax is an aggregation function call with - * histogram facets and other options. - * - * The following aggregation functions are supported: - * - * * `count(string_histogram_facet)`: Count the number of matching entities - * for each distinct attribute value. - * - * Data types: - * - * * Histogram facet (aka filterable properties): Facet names with format - * <schema id>.<facet>. Facets will have the - * format of: `{@link protos.a-zA-Z0-9_:/-.|a-zA-Z}`. If the facet is a child - * facet, then the parent hierarchy needs to be specified separated by - * dots in the prefix after the schema id. Thus, the format for a multi- - * level facet is: <schema id>.<parent facet name>. - * <child facet name>. Example: - * schema123.root_parent_facet.middle_facet.child_facet - * * DocumentSchemaId: (with no schema id prefix) to get - * histograms for each document type (returns the schema id path, e.g. - * projects/12345/locations/us-west/documentSchemas/abc123). - * - * Example expression: - * - * * Document type counts: - * count('DocumentSchemaId') - * - * * For schema id, abc123, get the counts for MORTGAGE_TYPE: - * count('abc123.MORTGAGE_TYPE') - * @param {boolean} request.requireTotalSize - * Controls if the search document request requires the return of a total size - * of matched documents. See - * {@link protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.total_size|SearchDocumentsResponse.total_size}. - * - * Enabling this flag may adversely impact performance. Hint: If this is - * used with pagination, set this flag on the initial query but set this - * to false on subsequent page calls (keep the total count locally). - * - * Defaults to false. - * @param {google.cloud.contentwarehouse.v1.SearchDocumentsRequest.TotalResultSize} request.totalResultSize - * Controls if the search document request requires the return of a total size - * of matched documents. See - * {@link protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.total_size|SearchDocumentsResponse.total_size}. - * @param {number} request.qaSizeLimit - * Experimental, do not use. - * The limit on the number of documents returned for the question-answering - * feature. To enable the question-answering feature, set - * {@link protos.|DocumentQuery].[is_nl_query} to true. - * @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 {@link protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument|MatchingDocument} 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 `searchDocumentsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - searchDocumentsStream( - request?: protos.google.cloud.contentwarehouse.v1.ISearchDocumentsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['searchDocuments']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('searchDocuments stream %j', request); - return this.descriptors.page.searchDocuments.createStream( - this.innerApiCalls.searchDocuments as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `searchDocuments`, 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. The parent, which owns this collection of documents. - * Format: projects/{project_number}/locations/{location}. - * @param {google.cloud.contentwarehouse.v1.RequestMetadata} request.requestMetadata - * The meta information collected about the end user, used to enforce access - * control and improve the search quality of the service. - * @param {google.cloud.contentwarehouse.v1.DocumentQuery} request.documentQuery - * Query used to search against documents (keyword, filters, etc.). - * @param {number} request.offset - * An integer that specifies the current offset (that is, starting result - * location, amongst the documents deemed by the API as relevant) in search - * results. This field is only considered if - * {@link protos.google.cloud.contentwarehouse.v1.SearchDocumentsRequest.page_token|page_token} - * is unset. - * - * The maximum allowed value is 5000. Otherwise an error is thrown. - * - * For example, 0 means to return results starting from the first matching - * document, and 10 means to return from the 11th document. This can be used - * for pagination, (for example, pageSize = 10 and offset = 10 means to return - * from the second page). - * @param {number} request.pageSize - * A limit on the number of documents returned in the search results. - * Increasing this value above the default value of 10 can increase search - * response time. The value can be between 1 and 100. - * @param {string} request.pageToken - * The token specifying the current offset within search results. - * See - * {@link protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.next_page_token|SearchDocumentsResponse.next_page_token} - * for an explanation of how to obtain the next set of query results. - * @param {string} request.orderBy - * The criteria determining how search results are sorted. For non-empty - * query, default is `"relevance desc"`. For empty query, default is - * `"upload_date desc"`. - * - * Supported options are: - * - * * `"relevance desc"`: By relevance descending, as determined by the API - * algorithms. - * * `"upload_date desc"`: By upload date descending. - * * `"upload_date"`: By upload date ascending. - * * `"update_date desc"`: By last updated date descending. - * * `"update_date"`: By last updated date ascending. - * * `"retrieval_importance desc"`: By retrieval importance of properties - * descending. This feature is still under development, please do not use - * unless otherwise instructed to do so. - * @param {number[]} request.histogramQueries - * An expression specifying a histogram request against matching - * documents. Expression syntax is an aggregation function call with - * histogram facets and other options. - * - * The following aggregation functions are supported: - * - * * `count(string_histogram_facet)`: Count the number of matching entities - * for each distinct attribute value. - * - * Data types: - * - * * Histogram facet (aka filterable properties): Facet names with format - * <schema id>.<facet>. Facets will have the - * format of: `{@link protos.a-zA-Z0-9_:/-.|a-zA-Z}`. If the facet is a child - * facet, then the parent hierarchy needs to be specified separated by - * dots in the prefix after the schema id. Thus, the format for a multi- - * level facet is: <schema id>.<parent facet name>. - * <child facet name>. Example: - * schema123.root_parent_facet.middle_facet.child_facet - * * DocumentSchemaId: (with no schema id prefix) to get - * histograms for each document type (returns the schema id path, e.g. - * projects/12345/locations/us-west/documentSchemas/abc123). - * - * Example expression: - * - * * Document type counts: - * count('DocumentSchemaId') - * - * * For schema id, abc123, get the counts for MORTGAGE_TYPE: - * count('abc123.MORTGAGE_TYPE') - * @param {boolean} request.requireTotalSize - * Controls if the search document request requires the return of a total size - * of matched documents. See - * {@link protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.total_size|SearchDocumentsResponse.total_size}. - * - * Enabling this flag may adversely impact performance. Hint: If this is - * used with pagination, set this flag on the initial query but set this - * to false on subsequent page calls (keep the total count locally). - * - * Defaults to false. - * @param {google.cloud.contentwarehouse.v1.SearchDocumentsRequest.TotalResultSize} request.totalResultSize - * Controls if the search document request requires the return of a total size - * of matched documents. See - * {@link protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.total_size|SearchDocumentsResponse.total_size}. - * @param {number} request.qaSizeLimit - * Experimental, do not use. - * The limit on the number of documents returned for the question-answering - * feature. To enable the question-answering feature, set - * {@link protos.|DocumentQuery].[is_nl_query} to true. - * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument|MatchingDocument}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1/document_service.search_documents.js - * region_tag:contentwarehouse_v1_generated_DocumentService_SearchDocuments_async - */ - searchDocumentsAsync( - request?: protos.google.cloud.contentwarehouse.v1.ISearchDocumentsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['searchDocuments']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('searchDocuments iterate %j', request); - return this.descriptors.page.searchDocuments.asyncIterate( - this.innerApiCalls['searchDocuments'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified documentLink resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} document - * @param {string} document_link - * @returns {string} Resource name string. - */ - documentLinkPath(project:string,location:string,document:string,documentLink:string) { - return this.pathTemplates.documentLinkPathTemplate.render({ - project: project, - location: location, - document: document, - document_link: documentLink, - }); - } - - /** - * Parse the project from DocumentLink resource. - * - * @param {string} documentLinkName - * A fully-qualified path representing DocumentLink resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDocumentLinkName(documentLinkName: string) { - return this.pathTemplates.documentLinkPathTemplate.match(documentLinkName).project; - } - - /** - * Parse the location from DocumentLink resource. - * - * @param {string} documentLinkName - * A fully-qualified path representing DocumentLink resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDocumentLinkName(documentLinkName: string) { - return this.pathTemplates.documentLinkPathTemplate.match(documentLinkName).location; - } - - /** - * Parse the document from DocumentLink resource. - * - * @param {string} documentLinkName - * A fully-qualified path representing DocumentLink resource. - * @returns {string} A string representing the document. - */ - matchDocumentFromDocumentLinkName(documentLinkName: string) { - return this.pathTemplates.documentLinkPathTemplate.match(documentLinkName).document; - } - - /** - * Parse the document_link from DocumentLink resource. - * - * @param {string} documentLinkName - * A fully-qualified path representing DocumentLink resource. - * @returns {string} A string representing the document_link. - */ - matchDocumentLinkFromDocumentLinkName(documentLinkName: string) { - return this.pathTemplates.documentLinkPathTemplate.match(documentLinkName).document_link; - } - - /** - * Return a fully-qualified documentSchema resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} document_schema - * @returns {string} Resource name string. - */ - documentSchemaPath(project:string,location:string,documentSchema:string) { - return this.pathTemplates.documentSchemaPathTemplate.render({ - project: project, - location: location, - document_schema: documentSchema, - }); - } - - /** - * Parse the project from DocumentSchema resource. - * - * @param {string} documentSchemaName - * A fully-qualified path representing DocumentSchema resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDocumentSchemaName(documentSchemaName: string) { - return this.pathTemplates.documentSchemaPathTemplate.match(documentSchemaName).project; - } - - /** - * Parse the location from DocumentSchema resource. - * - * @param {string} documentSchemaName - * A fully-qualified path representing DocumentSchema resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDocumentSchemaName(documentSchemaName: string) { - return this.pathTemplates.documentSchemaPathTemplate.match(documentSchemaName).location; - } - - /** - * Parse the document_schema from DocumentSchema resource. - * - * @param {string} documentSchemaName - * A fully-qualified path representing DocumentSchema resource. - * @returns {string} A string representing the document_schema. - */ - matchDocumentSchemaFromDocumentSchemaName(documentSchemaName: string) { - return this.pathTemplates.documentSchemaPathTemplate.match(documentSchemaName).document_schema; - } - - /** - * Return a fully-qualified projectLocationDocument resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} document - * @returns {string} Resource name string. - */ - projectLocationDocumentPath(project:string,location:string,document:string) { - return this.pathTemplates.projectLocationDocumentPathTemplate.render({ - project: project, - location: location, - document: document, - }); - } - - /** - * Parse the project from ProjectLocationDocument resource. - * - * @param {string} projectLocationDocumentName - * A fully-qualified path representing project_location_document resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationDocumentName(projectLocationDocumentName: string) { - return this.pathTemplates.projectLocationDocumentPathTemplate.match(projectLocationDocumentName).project; - } - - /** - * Parse the location from ProjectLocationDocument resource. - * - * @param {string} projectLocationDocumentName - * A fully-qualified path representing project_location_document resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationDocumentName(projectLocationDocumentName: string) { - return this.pathTemplates.projectLocationDocumentPathTemplate.match(projectLocationDocumentName).location; - } - - /** - * Parse the document from ProjectLocationDocument resource. - * - * @param {string} projectLocationDocumentName - * A fully-qualified path representing project_location_document resource. - * @returns {string} A string representing the document. - */ - matchDocumentFromProjectLocationDocumentName(projectLocationDocumentName: string) { - return this.pathTemplates.projectLocationDocumentPathTemplate.match(projectLocationDocumentName).document; - } - - /** - * Return a fully-qualified projectLocationDocumentsReferenceId resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} reference_id - * @returns {string} Resource name string. - */ - projectLocationDocumentsReferenceIdPath(project:string,location:string,referenceId:string) { - return this.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.render({ - project: project, - location: location, - reference_id: referenceId, - }); - } - - /** - * Parse the project from ProjectLocationDocumentsReferenceId resource. - * - * @param {string} projectLocationDocumentsReferenceIdName - * A fully-qualified path representing project_location_documents_reference_id resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationDocumentsReferenceIdName(projectLocationDocumentsReferenceIdName: string) { - return this.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match(projectLocationDocumentsReferenceIdName).project; - } - - /** - * Parse the location from ProjectLocationDocumentsReferenceId resource. - * - * @param {string} projectLocationDocumentsReferenceIdName - * A fully-qualified path representing project_location_documents_reference_id resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationDocumentsReferenceIdName(projectLocationDocumentsReferenceIdName: string) { - return this.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match(projectLocationDocumentsReferenceIdName).location; - } - - /** - * Parse the reference_id from ProjectLocationDocumentsReferenceId resource. - * - * @param {string} projectLocationDocumentsReferenceIdName - * A fully-qualified path representing project_location_documents_reference_id resource. - * @returns {string} A string representing the reference_id. - */ - matchReferenceIdFromProjectLocationDocumentsReferenceIdName(projectLocationDocumentsReferenceIdName: string) { - return this.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match(projectLocationDocumentsReferenceIdName).reference_id; - } - - /** - * Return a fully-qualified ruleSet resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} rule_set - * @returns {string} Resource name string. - */ - ruleSetPath(project:string,location:string,ruleSet:string) { - return this.pathTemplates.ruleSetPathTemplate.render({ - project: project, - location: location, - rule_set: ruleSet, - }); - } - - /** - * Parse the project from RuleSet resource. - * - * @param {string} ruleSetName - * A fully-qualified path representing RuleSet resource. - * @returns {string} A string representing the project. - */ - matchProjectFromRuleSetName(ruleSetName: string) { - return this.pathTemplates.ruleSetPathTemplate.match(ruleSetName).project; - } - - /** - * Parse the location from RuleSet resource. - * - * @param {string} ruleSetName - * A fully-qualified path representing RuleSet resource. - * @returns {string} A string representing the location. - */ - matchLocationFromRuleSetName(ruleSetName: string) { - return this.pathTemplates.ruleSetPathTemplate.match(ruleSetName).location; - } - - /** - * Parse the rule_set from RuleSet resource. - * - * @param {string} ruleSetName - * A fully-qualified path representing RuleSet resource. - * @returns {string} A string representing the rule_set. - */ - matchRuleSetFromRuleSetName(ruleSetName: string) { - return this.pathTemplates.ruleSetPathTemplate.match(ruleSetName).rule_set; - } - - /** - * Return a fully-qualified synonymSet resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} context - * @returns {string} Resource name string. - */ - synonymSetPath(project:string,location:string,context:string) { - return this.pathTemplates.synonymSetPathTemplate.render({ - project: project, - location: location, - context: context, - }); - } - - /** - * Parse the project from SynonymSet resource. - * - * @param {string} synonymSetName - * A fully-qualified path representing SynonymSet resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSynonymSetName(synonymSetName: string) { - return this.pathTemplates.synonymSetPathTemplate.match(synonymSetName).project; - } - - /** - * Parse the location from SynonymSet resource. - * - * @param {string} synonymSetName - * A fully-qualified path representing SynonymSet resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSynonymSetName(synonymSetName: string) { - return this.pathTemplates.synonymSetPathTemplate.match(synonymSetName).location; - } - - /** - * Parse the context from SynonymSet resource. - * - * @param {string} synonymSetName - * A fully-qualified path representing SynonymSet resource. - * @returns {string} A string representing the context. - */ - matchContextFromSynonymSetName(synonymSetName: string) { - return this.pathTemplates.synonymSetPathTemplate.match(synonymSetName).context; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.documentServiceStub && !this._terminated) { - return this.documentServiceStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - }); - } - return Promise.resolve(); - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_service_client_config.json b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_service_client_config.json deleted file mode 100644 index 5e6b92bc69b..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_service_client_config.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "interfaces": { - "google.cloud.contentwarehouse.v1.DocumentService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "unavailable": [ - "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 - }, - "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { - "initial_retry_delay_millis": 1000, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 10000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateDocument": { - "timeout_millis": 180000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetDocument": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "UpdateDocument": { - "timeout_millis": 180000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteDocument": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SearchDocuments": { - "timeout_millis": 180000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "LockDocument": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "FetchAcl": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "SetAcl": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_service_proto_list.json b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_service_proto_list.json deleted file mode 100644 index a1775b1134d..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/document_service_proto_list.json +++ /dev/null @@ -1,23 +0,0 @@ -[ - "../../protos/google/cloud/contentwarehouse/v1/async_document_service_request.proto", - "../../protos/google/cloud/contentwarehouse/v1/common.proto", - "../../protos/google/cloud/contentwarehouse/v1/document.proto", - "../../protos/google/cloud/contentwarehouse/v1/document_link_service.proto", - "../../protos/google/cloud/contentwarehouse/v1/document_schema.proto", - "../../protos/google/cloud/contentwarehouse/v1/document_schema_service.proto", - "../../protos/google/cloud/contentwarehouse/v1/document_service.proto", - "../../protos/google/cloud/contentwarehouse/v1/document_service_request.proto", - "../../protos/google/cloud/contentwarehouse/v1/filters.proto", - "../../protos/google/cloud/contentwarehouse/v1/histogram.proto", - "../../protos/google/cloud/contentwarehouse/v1/pipeline_service.proto", - "../../protos/google/cloud/contentwarehouse/v1/pipelines.proto", - "../../protos/google/cloud/contentwarehouse/v1/rule_engine.proto", - "../../protos/google/cloud/contentwarehouse/v1/ruleset_service.proto", - "../../protos/google/cloud/contentwarehouse/v1/ruleset_service_request.proto", - "../../protos/google/cloud/contentwarehouse/v1/synonymset.proto", - "../../protos/google/cloud/contentwarehouse/v1/synonymset_service.proto", - "../../protos/google/cloud/contentwarehouse/v1/synonymset_service_request.proto", - "../../protos/google/cloud/documentai/v1/barcode.proto", - "../../protos/google/cloud/documentai/v1/document.proto", - "../../protos/google/cloud/documentai/v1/geometry.proto" -] diff --git a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/gapic_metadata.json b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/gapic_metadata.json deleted file mode 100644 index a81852f4a41..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/gapic_metadata.json +++ /dev/null @@ -1,393 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.cloud.contentwarehouse.v1", - "libraryPackage": "@google-cloud/contentwarehouse", - "services": { - "DocumentLinkService": { - "clients": { - "grpc": { - "libraryClient": "DocumentLinkServiceClient", - "rpcs": { - "ListLinkedTargets": { - "methods": [ - "listLinkedTargets" - ] - }, - "CreateDocumentLink": { - "methods": [ - "createDocumentLink" - ] - }, - "DeleteDocumentLink": { - "methods": [ - "deleteDocumentLink" - ] - }, - "ListLinkedSources": { - "methods": [ - "listLinkedSources", - "listLinkedSourcesStream", - "listLinkedSourcesAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "DocumentLinkServiceClient", - "rpcs": { - "ListLinkedTargets": { - "methods": [ - "listLinkedTargets" - ] - }, - "CreateDocumentLink": { - "methods": [ - "createDocumentLink" - ] - }, - "DeleteDocumentLink": { - "methods": [ - "deleteDocumentLink" - ] - }, - "ListLinkedSources": { - "methods": [ - "listLinkedSources", - "listLinkedSourcesStream", - "listLinkedSourcesAsync" - ] - } - } - } - } - }, - "DocumentSchemaService": { - "clients": { - "grpc": { - "libraryClient": "DocumentSchemaServiceClient", - "rpcs": { - "CreateDocumentSchema": { - "methods": [ - "createDocumentSchema" - ] - }, - "UpdateDocumentSchema": { - "methods": [ - "updateDocumentSchema" - ] - }, - "GetDocumentSchema": { - "methods": [ - "getDocumentSchema" - ] - }, - "DeleteDocumentSchema": { - "methods": [ - "deleteDocumentSchema" - ] - }, - "ListDocumentSchemas": { - "methods": [ - "listDocumentSchemas", - "listDocumentSchemasStream", - "listDocumentSchemasAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "DocumentSchemaServiceClient", - "rpcs": { - "CreateDocumentSchema": { - "methods": [ - "createDocumentSchema" - ] - }, - "UpdateDocumentSchema": { - "methods": [ - "updateDocumentSchema" - ] - }, - "GetDocumentSchema": { - "methods": [ - "getDocumentSchema" - ] - }, - "DeleteDocumentSchema": { - "methods": [ - "deleteDocumentSchema" - ] - }, - "ListDocumentSchemas": { - "methods": [ - "listDocumentSchemas", - "listDocumentSchemasStream", - "listDocumentSchemasAsync" - ] - } - } - } - } - }, - "DocumentService": { - "clients": { - "grpc": { - "libraryClient": "DocumentServiceClient", - "rpcs": { - "CreateDocument": { - "methods": [ - "createDocument" - ] - }, - "GetDocument": { - "methods": [ - "getDocument" - ] - }, - "UpdateDocument": { - "methods": [ - "updateDocument" - ] - }, - "DeleteDocument": { - "methods": [ - "deleteDocument" - ] - }, - "LockDocument": { - "methods": [ - "lockDocument" - ] - }, - "FetchAcl": { - "methods": [ - "fetchAcl" - ] - }, - "SetAcl": { - "methods": [ - "setAcl" - ] - }, - "SearchDocuments": { - "methods": [ - "searchDocuments", - "searchDocumentsStream", - "searchDocumentsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "DocumentServiceClient", - "rpcs": { - "CreateDocument": { - "methods": [ - "createDocument" - ] - }, - "GetDocument": { - "methods": [ - "getDocument" - ] - }, - "UpdateDocument": { - "methods": [ - "updateDocument" - ] - }, - "DeleteDocument": { - "methods": [ - "deleteDocument" - ] - }, - "LockDocument": { - "methods": [ - "lockDocument" - ] - }, - "FetchAcl": { - "methods": [ - "fetchAcl" - ] - }, - "SetAcl": { - "methods": [ - "setAcl" - ] - }, - "SearchDocuments": { - "methods": [ - "searchDocuments", - "searchDocumentsStream", - "searchDocumentsAsync" - ] - } - } - } - } - }, - "PipelineService": { - "clients": { - "grpc": { - "libraryClient": "PipelineServiceClient", - "rpcs": { - "RunPipeline": { - "methods": [ - "runPipeline" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "PipelineServiceClient", - "rpcs": { - "RunPipeline": { - "methods": [ - "runPipeline" - ] - } - } - } - } - }, - "RuleSetService": { - "clients": { - "grpc": { - "libraryClient": "RuleSetServiceClient", - "rpcs": { - "CreateRuleSet": { - "methods": [ - "createRuleSet" - ] - }, - "GetRuleSet": { - "methods": [ - "getRuleSet" - ] - }, - "UpdateRuleSet": { - "methods": [ - "updateRuleSet" - ] - }, - "DeleteRuleSet": { - "methods": [ - "deleteRuleSet" - ] - }, - "ListRuleSets": { - "methods": [ - "listRuleSets", - "listRuleSetsStream", - "listRuleSetsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "RuleSetServiceClient", - "rpcs": { - "CreateRuleSet": { - "methods": [ - "createRuleSet" - ] - }, - "GetRuleSet": { - "methods": [ - "getRuleSet" - ] - }, - "UpdateRuleSet": { - "methods": [ - "updateRuleSet" - ] - }, - "DeleteRuleSet": { - "methods": [ - "deleteRuleSet" - ] - }, - "ListRuleSets": { - "methods": [ - "listRuleSets", - "listRuleSetsStream", - "listRuleSetsAsync" - ] - } - } - } - } - }, - "SynonymSetService": { - "clients": { - "grpc": { - "libraryClient": "SynonymSetServiceClient", - "rpcs": { - "CreateSynonymSet": { - "methods": [ - "createSynonymSet" - ] - }, - "GetSynonymSet": { - "methods": [ - "getSynonymSet" - ] - }, - "UpdateSynonymSet": { - "methods": [ - "updateSynonymSet" - ] - }, - "DeleteSynonymSet": { - "methods": [ - "deleteSynonymSet" - ] - }, - "ListSynonymSets": { - "methods": [ - "listSynonymSets", - "listSynonymSetsStream", - "listSynonymSetsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "SynonymSetServiceClient", - "rpcs": { - "CreateSynonymSet": { - "methods": [ - "createSynonymSet" - ] - }, - "GetSynonymSet": { - "methods": [ - "getSynonymSet" - ] - }, - "UpdateSynonymSet": { - "methods": [ - "updateSynonymSet" - ] - }, - "DeleteSynonymSet": { - "methods": [ - "deleteSynonymSet" - ] - }, - "ListSynonymSets": { - "methods": [ - "listSynonymSets", - "listSynonymSetsStream", - "listSynonymSetsAsync" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/index.ts b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/index.ts deleted file mode 100644 index e6134079557..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/index.ts +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2026 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 {DocumentLinkServiceClient} from './document_link_service_client'; -export {DocumentSchemaServiceClient} from './document_schema_service_client'; -export {DocumentServiceClient} from './document_service_client'; -export {PipelineServiceClient} from './pipeline_service_client'; -export {RuleSetServiceClient} from './rule_set_service_client'; -export {SynonymSetServiceClient} from './synonym_set_service_client'; diff --git a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/pipeline_service_client.ts b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/pipeline_service_client.ts deleted file mode 100644 index 028ef622ceb..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/pipeline_service_client.ts +++ /dev/null @@ -1,1085 +0,0 @@ -// Copyright 2026 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 type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation} from 'google-gax'; - -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; - -/** - * Client JSON configuration object, loaded from - * `src/v1/pipeline_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './pipeline_service_client_config.json'; -const version = require('../../../package.json').version; - -/** - * This service lets you manage pipelines. - * @class - * @memberof v1 - */ -export class PipelineServiceClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - private _universeDomain: string; - private _servicePath: string; - private _log = logging.log('contentwarehouse'); - - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - pipelineServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of PipelineServiceClient. - * - * @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/main/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://cloud.google.com/docs/authentication/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/1.1 REST mode. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new PipelineServiceClient({fallback: true}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof PipelineServiceClient; - if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { - throw new Error('Please set either universe_domain or universeDomain, but not both.'); - } - const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; - this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; - this._servicePath = 'contentwarehouse.' + this._universeDomain; - const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // Request numeric enum values if REST transport is used. - opts.numericEnums = true; - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== this._servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = this._servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === this._servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process === 'object' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - documentLinkPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/documents/{document}/documentLinks/{document_link}' - ), - documentSchemaPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/documentSchemas/{document_schema}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - projectLocationDocumentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/documents/{document}' - ), - projectLocationDocumentsReferenceIdPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/documents/referenceId/{reference_id}' - ), - ruleSetPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/ruleSets/{rule_set}' - ), - synonymSetPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/synonymSets/{context}' - ), - }; - - const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback) { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.longrunning.Operations.GetOperation',get: '/v1/{name=projects/*/locations/*/operations/*}',}]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); - const runPipelineResponse = protoFilesRoot.lookup( - '.google.cloud.contentwarehouse.v1.RunPipelineResponse') as gax.protobuf.Type; - const runPipelineMetadata = protoFilesRoot.lookup( - '.google.cloud.contentwarehouse.v1.RunPipelineMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - runPipeline: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - runPipelineResponse.decode.bind(runPipelineResponse), - runPipelineMetadata.decode.bind(runPipelineMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.contentwarehouse.v1.PipelineService', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = this._gaxModule.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.pipelineServiceStub) { - return this.pipelineServiceStub; - } - - // Put together the "service stub" for - // google.cloud.contentwarehouse.v1.PipelineService. - this.pipelineServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.contentwarehouse.v1.PipelineService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.contentwarehouse.v1.PipelineService, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const pipelineServiceStubMethods = - ['runPipeline']; - for (const methodName of pipelineServiceStubMethods) { - const callPromise = this.pipelineServiceStub.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.longrunning[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.pipelineServiceStub; - } - - /** - * The DNS address for this API service. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'contentwarehouse.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'contentwarehouse.googleapis.com'; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - get apiEndpoint() { - return this._servicePath; - } - - get universeDomain() { - return this._universeDomain; - } - - /** - * 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 -- - // ------------------- - -/** - * Run a predefined pipeline. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name which owns the resources of the pipeline. - * Format: projects/{project_number}/locations/{location}. - * @param {google.cloud.contentwarehouse.v1.GcsIngestPipeline} request.gcsIngestPipeline - * Cloud Storage ingestion pipeline. - * @param {google.cloud.contentwarehouse.v1.GcsIngestWithDocAiProcessorsPipeline} request.gcsIngestWithDocAiProcessorsPipeline - * Use DocAI processors to process documents in Cloud Storage and ingest - * them to Document Warehouse. - * @param {google.cloud.contentwarehouse.v1.ExportToCdwPipeline} request.exportCdwPipeline - * Export docuemnts from Document Warehouse to CDW for training purpose. - * @param {google.cloud.contentwarehouse.v1.ProcessWithDocAiPipeline} request.processWithDocAiPipeline - * Use a DocAI processor to process documents in Document Warehouse, and - * re-ingest the updated results into Document Warehouse. - * @param {google.cloud.contentwarehouse.v1.RequestMetadata} request.requestMetadata - * The meta information collected about the end user, used to enforce access - * control for the service. - * @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 - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/pipeline_service.run_pipeline.js - * region_tag:contentwarehouse_v1_generated_PipelineService_RunPipeline_async - */ - runPipeline( - request?: protos.google.cloud.contentwarehouse.v1.IRunPipelineRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - runPipeline( - request: protos.google.cloud.contentwarehouse.v1.IRunPipelineRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - runPipeline( - request: protos.google.cloud.contentwarehouse.v1.IRunPipelineRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - runPipeline( - request?: protos.google.cloud.contentwarehouse.v1.IRunPipelineRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('runPipeline response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('runPipeline request %j', request); - return this.innerApiCalls.runPipeline(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('runPipeline response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `runPipeline()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/pipeline_service.run_pipeline.js - * region_tag:contentwarehouse_v1_generated_PipelineService_RunPipeline_async - */ - async checkRunPipelineProgress(name: string): Promise>{ - this._log.info('runPipeline long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.runPipeline, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} - * for the details. - * @param {function(?Error, ?Object)=} callback - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * const name = ''; - * const [response] = await client.getOperation({name}); - * // doThingsWith(response) - * ``` - */ - getOperation( - request: protos.google.longrunning.GetOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} - * for the details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.deleteOperation(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified documentLink resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} document - * @param {string} document_link - * @returns {string} Resource name string. - */ - documentLinkPath(project:string,location:string,document:string,documentLink:string) { - return this.pathTemplates.documentLinkPathTemplate.render({ - project: project, - location: location, - document: document, - document_link: documentLink, - }); - } - - /** - * Parse the project from DocumentLink resource. - * - * @param {string} documentLinkName - * A fully-qualified path representing DocumentLink resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDocumentLinkName(documentLinkName: string) { - return this.pathTemplates.documentLinkPathTemplate.match(documentLinkName).project; - } - - /** - * Parse the location from DocumentLink resource. - * - * @param {string} documentLinkName - * A fully-qualified path representing DocumentLink resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDocumentLinkName(documentLinkName: string) { - return this.pathTemplates.documentLinkPathTemplate.match(documentLinkName).location; - } - - /** - * Parse the document from DocumentLink resource. - * - * @param {string} documentLinkName - * A fully-qualified path representing DocumentLink resource. - * @returns {string} A string representing the document. - */ - matchDocumentFromDocumentLinkName(documentLinkName: string) { - return this.pathTemplates.documentLinkPathTemplate.match(documentLinkName).document; - } - - /** - * Parse the document_link from DocumentLink resource. - * - * @param {string} documentLinkName - * A fully-qualified path representing DocumentLink resource. - * @returns {string} A string representing the document_link. - */ - matchDocumentLinkFromDocumentLinkName(documentLinkName: string) { - return this.pathTemplates.documentLinkPathTemplate.match(documentLinkName).document_link; - } - - /** - * Return a fully-qualified documentSchema resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} document_schema - * @returns {string} Resource name string. - */ - documentSchemaPath(project:string,location:string,documentSchema:string) { - return this.pathTemplates.documentSchemaPathTemplate.render({ - project: project, - location: location, - document_schema: documentSchema, - }); - } - - /** - * Parse the project from DocumentSchema resource. - * - * @param {string} documentSchemaName - * A fully-qualified path representing DocumentSchema resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDocumentSchemaName(documentSchemaName: string) { - return this.pathTemplates.documentSchemaPathTemplate.match(documentSchemaName).project; - } - - /** - * Parse the location from DocumentSchema resource. - * - * @param {string} documentSchemaName - * A fully-qualified path representing DocumentSchema resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDocumentSchemaName(documentSchemaName: string) { - return this.pathTemplates.documentSchemaPathTemplate.match(documentSchemaName).location; - } - - /** - * Parse the document_schema from DocumentSchema resource. - * - * @param {string} documentSchemaName - * A fully-qualified path representing DocumentSchema resource. - * @returns {string} A string representing the document_schema. - */ - matchDocumentSchemaFromDocumentSchemaName(documentSchemaName: string) { - return this.pathTemplates.documentSchemaPathTemplate.match(documentSchemaName).document_schema; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified projectLocationDocument resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} document - * @returns {string} Resource name string. - */ - projectLocationDocumentPath(project:string,location:string,document:string) { - return this.pathTemplates.projectLocationDocumentPathTemplate.render({ - project: project, - location: location, - document: document, - }); - } - - /** - * Parse the project from ProjectLocationDocument resource. - * - * @param {string} projectLocationDocumentName - * A fully-qualified path representing project_location_document resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationDocumentName(projectLocationDocumentName: string) { - return this.pathTemplates.projectLocationDocumentPathTemplate.match(projectLocationDocumentName).project; - } - - /** - * Parse the location from ProjectLocationDocument resource. - * - * @param {string} projectLocationDocumentName - * A fully-qualified path representing project_location_document resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationDocumentName(projectLocationDocumentName: string) { - return this.pathTemplates.projectLocationDocumentPathTemplate.match(projectLocationDocumentName).location; - } - - /** - * Parse the document from ProjectLocationDocument resource. - * - * @param {string} projectLocationDocumentName - * A fully-qualified path representing project_location_document resource. - * @returns {string} A string representing the document. - */ - matchDocumentFromProjectLocationDocumentName(projectLocationDocumentName: string) { - return this.pathTemplates.projectLocationDocumentPathTemplate.match(projectLocationDocumentName).document; - } - - /** - * Return a fully-qualified projectLocationDocumentsReferenceId resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} reference_id - * @returns {string} Resource name string. - */ - projectLocationDocumentsReferenceIdPath(project:string,location:string,referenceId:string) { - return this.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.render({ - project: project, - location: location, - reference_id: referenceId, - }); - } - - /** - * Parse the project from ProjectLocationDocumentsReferenceId resource. - * - * @param {string} projectLocationDocumentsReferenceIdName - * A fully-qualified path representing project_location_documents_reference_id resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationDocumentsReferenceIdName(projectLocationDocumentsReferenceIdName: string) { - return this.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match(projectLocationDocumentsReferenceIdName).project; - } - - /** - * Parse the location from ProjectLocationDocumentsReferenceId resource. - * - * @param {string} projectLocationDocumentsReferenceIdName - * A fully-qualified path representing project_location_documents_reference_id resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationDocumentsReferenceIdName(projectLocationDocumentsReferenceIdName: string) { - return this.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match(projectLocationDocumentsReferenceIdName).location; - } - - /** - * Parse the reference_id from ProjectLocationDocumentsReferenceId resource. - * - * @param {string} projectLocationDocumentsReferenceIdName - * A fully-qualified path representing project_location_documents_reference_id resource. - * @returns {string} A string representing the reference_id. - */ - matchReferenceIdFromProjectLocationDocumentsReferenceIdName(projectLocationDocumentsReferenceIdName: string) { - return this.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match(projectLocationDocumentsReferenceIdName).reference_id; - } - - /** - * Return a fully-qualified ruleSet resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} rule_set - * @returns {string} Resource name string. - */ - ruleSetPath(project:string,location:string,ruleSet:string) { - return this.pathTemplates.ruleSetPathTemplate.render({ - project: project, - location: location, - rule_set: ruleSet, - }); - } - - /** - * Parse the project from RuleSet resource. - * - * @param {string} ruleSetName - * A fully-qualified path representing RuleSet resource. - * @returns {string} A string representing the project. - */ - matchProjectFromRuleSetName(ruleSetName: string) { - return this.pathTemplates.ruleSetPathTemplate.match(ruleSetName).project; - } - - /** - * Parse the location from RuleSet resource. - * - * @param {string} ruleSetName - * A fully-qualified path representing RuleSet resource. - * @returns {string} A string representing the location. - */ - matchLocationFromRuleSetName(ruleSetName: string) { - return this.pathTemplates.ruleSetPathTemplate.match(ruleSetName).location; - } - - /** - * Parse the rule_set from RuleSet resource. - * - * @param {string} ruleSetName - * A fully-qualified path representing RuleSet resource. - * @returns {string} A string representing the rule_set. - */ - matchRuleSetFromRuleSetName(ruleSetName: string) { - return this.pathTemplates.ruleSetPathTemplate.match(ruleSetName).rule_set; - } - - /** - * Return a fully-qualified synonymSet resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} context - * @returns {string} Resource name string. - */ - synonymSetPath(project:string,location:string,context:string) { - return this.pathTemplates.synonymSetPathTemplate.render({ - project: project, - location: location, - context: context, - }); - } - - /** - * Parse the project from SynonymSet resource. - * - * @param {string} synonymSetName - * A fully-qualified path representing SynonymSet resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSynonymSetName(synonymSetName: string) { - return this.pathTemplates.synonymSetPathTemplate.match(synonymSetName).project; - } - - /** - * Parse the location from SynonymSet resource. - * - * @param {string} synonymSetName - * A fully-qualified path representing SynonymSet resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSynonymSetName(synonymSetName: string) { - return this.pathTemplates.synonymSetPathTemplate.match(synonymSetName).location; - } - - /** - * Parse the context from SynonymSet resource. - * - * @param {string} synonymSetName - * A fully-qualified path representing SynonymSet resource. - * @returns {string} A string representing the context. - */ - matchContextFromSynonymSetName(synonymSetName: string) { - return this.pathTemplates.synonymSetPathTemplate.match(synonymSetName).context; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.pipelineServiceStub && !this._terminated) { - return this.pipelineServiceStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - void this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/pipeline_service_client_config.json b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/pipeline_service_client_config.json deleted file mode 100644 index abee50e0504..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/pipeline_service_client_config.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "interfaces": { - "google.cloud.contentwarehouse.v1.PipelineService": { - "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": { - "RunPipeline": { - "timeout_millis": 120000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/pipeline_service_proto_list.json b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/pipeline_service_proto_list.json deleted file mode 100644 index a1775b1134d..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/pipeline_service_proto_list.json +++ /dev/null @@ -1,23 +0,0 @@ -[ - "../../protos/google/cloud/contentwarehouse/v1/async_document_service_request.proto", - "../../protos/google/cloud/contentwarehouse/v1/common.proto", - "../../protos/google/cloud/contentwarehouse/v1/document.proto", - "../../protos/google/cloud/contentwarehouse/v1/document_link_service.proto", - "../../protos/google/cloud/contentwarehouse/v1/document_schema.proto", - "../../protos/google/cloud/contentwarehouse/v1/document_schema_service.proto", - "../../protos/google/cloud/contentwarehouse/v1/document_service.proto", - "../../protos/google/cloud/contentwarehouse/v1/document_service_request.proto", - "../../protos/google/cloud/contentwarehouse/v1/filters.proto", - "../../protos/google/cloud/contentwarehouse/v1/histogram.proto", - "../../protos/google/cloud/contentwarehouse/v1/pipeline_service.proto", - "../../protos/google/cloud/contentwarehouse/v1/pipelines.proto", - "../../protos/google/cloud/contentwarehouse/v1/rule_engine.proto", - "../../protos/google/cloud/contentwarehouse/v1/ruleset_service.proto", - "../../protos/google/cloud/contentwarehouse/v1/ruleset_service_request.proto", - "../../protos/google/cloud/contentwarehouse/v1/synonymset.proto", - "../../protos/google/cloud/contentwarehouse/v1/synonymset_service.proto", - "../../protos/google/cloud/contentwarehouse/v1/synonymset_service_request.proto", - "../../protos/google/cloud/documentai/v1/barcode.proto", - "../../protos/google/cloud/documentai/v1/document.proto", - "../../protos/google/cloud/documentai/v1/geometry.proto" -] diff --git a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/rule_set_service_client.ts b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/rule_set_service_client.ts deleted file mode 100644 index 6226b95ce2a..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/rule_set_service_client.ts +++ /dev/null @@ -1,1285 +0,0 @@ -// Copyright 2026 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 type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; - -/** - * Client JSON configuration object, loaded from - * `src/v1/rule_set_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './rule_set_service_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Service to manage customer specific RuleSets. - * @class - * @memberof v1 - */ -export class RuleSetServiceClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - private _universeDomain: string; - private _servicePath: string; - private _log = logging.log('contentwarehouse'); - - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - ruleSetServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of RuleSetServiceClient. - * - * @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/main/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://cloud.google.com/docs/authentication/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/1.1 REST mode. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new RuleSetServiceClient({fallback: true}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof RuleSetServiceClient; - if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { - throw new Error('Please set either universe_domain or universeDomain, but not both.'); - } - const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; - this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; - this._servicePath = 'contentwarehouse.' + this._universeDomain; - const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // Request numeric enum values if REST transport is used. - opts.numericEnums = true; - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== this._servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = this._servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === this._servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process === 'object' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - documentLinkPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/documents/{document}/documentLinks/{document_link}' - ), - documentSchemaPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/documentSchemas/{document_schema}' - ), - projectLocationDocumentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/documents/{document}' - ), - projectLocationDocumentsReferenceIdPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/documents/referenceId/{reference_id}' - ), - ruleSetPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/ruleSets/{rule_set}' - ), - synonymSetPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/synonymSets/{context}' - ), - }; - - // 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 = { - listRuleSets: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'ruleSets') - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.contentwarehouse.v1.RuleSetService', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = this._gaxModule.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.ruleSetServiceStub) { - return this.ruleSetServiceStub; - } - - // Put together the "service stub" for - // google.cloud.contentwarehouse.v1.RuleSetService. - this.ruleSetServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.contentwarehouse.v1.RuleSetService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.contentwarehouse.v1.RuleSetService, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const ruleSetServiceStubMethods = - ['createRuleSet', 'getRuleSet', 'updateRuleSet', 'deleteRuleSet', 'listRuleSets']; - for (const methodName of ruleSetServiceStubMethods) { - const callPromise = this.ruleSetServiceStub.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._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.ruleSetServiceStub; - } - - /** - * The DNS address for this API service. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'contentwarehouse.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'contentwarehouse.googleapis.com'; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - get apiEndpoint() { - return this._servicePath; - } - - get universeDomain() { - return this._universeDomain; - } - - /** - * 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 -- - // ------------------- -/** - * Creates a ruleset. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent name. - * Format: projects/{project_number}/locations/{location}. - * @param {google.cloud.contentwarehouse.v1.RuleSet} request.ruleSet - * Required. The rule set to create. - * @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 {@link protos.google.cloud.contentwarehouse.v1.RuleSet|RuleSet}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/rule_set_service.create_rule_set.js - * region_tag:contentwarehouse_v1_generated_RuleSetService_CreateRuleSet_async - */ - createRuleSet( - request?: protos.google.cloud.contentwarehouse.v1.ICreateRuleSetRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.contentwarehouse.v1.IRuleSet, - protos.google.cloud.contentwarehouse.v1.ICreateRuleSetRequest|undefined, {}|undefined - ]>; - createRuleSet( - request: protos.google.cloud.contentwarehouse.v1.ICreateRuleSetRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.contentwarehouse.v1.IRuleSet, - protos.google.cloud.contentwarehouse.v1.ICreateRuleSetRequest|null|undefined, - {}|null|undefined>): void; - createRuleSet( - request: protos.google.cloud.contentwarehouse.v1.ICreateRuleSetRequest, - callback: Callback< - protos.google.cloud.contentwarehouse.v1.IRuleSet, - protos.google.cloud.contentwarehouse.v1.ICreateRuleSetRequest|null|undefined, - {}|null|undefined>): void; - createRuleSet( - request?: protos.google.cloud.contentwarehouse.v1.ICreateRuleSetRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.contentwarehouse.v1.IRuleSet, - protos.google.cloud.contentwarehouse.v1.ICreateRuleSetRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.contentwarehouse.v1.IRuleSet, - protos.google.cloud.contentwarehouse.v1.ICreateRuleSetRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.contentwarehouse.v1.IRuleSet, - protos.google.cloud.contentwarehouse.v1.ICreateRuleSetRequest|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('createRuleSet request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.contentwarehouse.v1.IRuleSet, - protos.google.cloud.contentwarehouse.v1.ICreateRuleSetRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('createRuleSet response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.createRuleSet(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.contentwarehouse.v1.IRuleSet, - protos.google.cloud.contentwarehouse.v1.ICreateRuleSetRequest|undefined, - {}|undefined - ]) => { - this._log.info('createRuleSet response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Gets a ruleset. Returns NOT_FOUND if the ruleset does not exist. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the rule set to retrieve. - * Format: - * projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}. - * @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 {@link protos.google.cloud.contentwarehouse.v1.RuleSet|RuleSet}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/rule_set_service.get_rule_set.js - * region_tag:contentwarehouse_v1_generated_RuleSetService_GetRuleSet_async - */ - getRuleSet( - request?: protos.google.cloud.contentwarehouse.v1.IGetRuleSetRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.contentwarehouse.v1.IRuleSet, - protos.google.cloud.contentwarehouse.v1.IGetRuleSetRequest|undefined, {}|undefined - ]>; - getRuleSet( - request: protos.google.cloud.contentwarehouse.v1.IGetRuleSetRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.contentwarehouse.v1.IRuleSet, - protos.google.cloud.contentwarehouse.v1.IGetRuleSetRequest|null|undefined, - {}|null|undefined>): void; - getRuleSet( - request: protos.google.cloud.contentwarehouse.v1.IGetRuleSetRequest, - callback: Callback< - protos.google.cloud.contentwarehouse.v1.IRuleSet, - protos.google.cloud.contentwarehouse.v1.IGetRuleSetRequest|null|undefined, - {}|null|undefined>): void; - getRuleSet( - request?: protos.google.cloud.contentwarehouse.v1.IGetRuleSetRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.contentwarehouse.v1.IRuleSet, - protos.google.cloud.contentwarehouse.v1.IGetRuleSetRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.contentwarehouse.v1.IRuleSet, - protos.google.cloud.contentwarehouse.v1.IGetRuleSetRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.contentwarehouse.v1.IRuleSet, - protos.google.cloud.contentwarehouse.v1.IGetRuleSetRequest|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getRuleSet request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.contentwarehouse.v1.IRuleSet, - protos.google.cloud.contentwarehouse.v1.IGetRuleSetRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getRuleSet response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getRuleSet(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.contentwarehouse.v1.IRuleSet, - protos.google.cloud.contentwarehouse.v1.IGetRuleSetRequest|undefined, - {}|undefined - ]) => { - this._log.info('getRuleSet response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Updates a ruleset. Returns INVALID_ARGUMENT if the name of the ruleset - * is non-empty and does not equal the existing name. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the rule set to update. - * Format: - * projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}. - * @param {google.cloud.contentwarehouse.v1.RuleSet} request.ruleSet - * Required. The rule set to update. - * @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 {@link protos.google.cloud.contentwarehouse.v1.RuleSet|RuleSet}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/rule_set_service.update_rule_set.js - * region_tag:contentwarehouse_v1_generated_RuleSetService_UpdateRuleSet_async - */ - updateRuleSet( - request?: protos.google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.contentwarehouse.v1.IRuleSet, - protos.google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest|undefined, {}|undefined - ]>; - updateRuleSet( - request: protos.google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.contentwarehouse.v1.IRuleSet, - protos.google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest|null|undefined, - {}|null|undefined>): void; - updateRuleSet( - request: protos.google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest, - callback: Callback< - protos.google.cloud.contentwarehouse.v1.IRuleSet, - protos.google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest|null|undefined, - {}|null|undefined>): void; - updateRuleSet( - request?: protos.google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.contentwarehouse.v1.IRuleSet, - protos.google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.contentwarehouse.v1.IRuleSet, - protos.google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.contentwarehouse.v1.IRuleSet, - protos.google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('updateRuleSet request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.contentwarehouse.v1.IRuleSet, - protos.google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateRuleSet response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.updateRuleSet(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.contentwarehouse.v1.IRuleSet, - protos.google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateRuleSet response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Deletes a ruleset. Returns NOT_FOUND if the document does not exist. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the rule set to delete. - * Format: - * projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}. - * @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 {@link protos.google.protobuf.Empty|Empty}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/rule_set_service.delete_rule_set.js - * region_tag:contentwarehouse_v1_generated_RuleSetService_DeleteRuleSet_async - */ - deleteRuleSet( - request?: protos.google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest|undefined, {}|undefined - ]>; - deleteRuleSet( - request: protos.google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest|null|undefined, - {}|null|undefined>): void; - deleteRuleSet( - request: protos.google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest|null|undefined, - {}|null|undefined>): void; - deleteRuleSet( - request?: protos.google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('deleteRuleSet request %j', request); - const wrappedCallback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('deleteRuleSet response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.deleteRuleSet(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.protobuf.IEmpty, - protos.google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest|undefined, - {}|undefined - ]) => { - this._log.info('deleteRuleSet response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } - - /** - * Lists rulesets. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of document. - * Format: projects/{project_number}/locations/{location}. - * @param {number} request.pageSize - * The maximum number of rule sets to return. The service may return - * fewer than this value. - * If unspecified, at most 50 rule sets will be returned. - * The maximum value is 1000; values above 1000 will be coerced to 1000. - * @param {string} request.pageToken - * A page token, received from a previous `ListRuleSets` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListRuleSets` - * must match the call that provided the page token. - * @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 {@link protos.google.cloud.contentwarehouse.v1.RuleSet|RuleSet}. - * 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 `listRuleSetsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listRuleSets( - request?: protos.google.cloud.contentwarehouse.v1.IListRuleSetsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.contentwarehouse.v1.IRuleSet[], - protos.google.cloud.contentwarehouse.v1.IListRuleSetsRequest|null, - protos.google.cloud.contentwarehouse.v1.IListRuleSetsResponse - ]>; - listRuleSets( - request: protos.google.cloud.contentwarehouse.v1.IListRuleSetsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.contentwarehouse.v1.IListRuleSetsRequest, - protos.google.cloud.contentwarehouse.v1.IListRuleSetsResponse|null|undefined, - protos.google.cloud.contentwarehouse.v1.IRuleSet>): void; - listRuleSets( - request: protos.google.cloud.contentwarehouse.v1.IListRuleSetsRequest, - callback: PaginationCallback< - protos.google.cloud.contentwarehouse.v1.IListRuleSetsRequest, - protos.google.cloud.contentwarehouse.v1.IListRuleSetsResponse|null|undefined, - protos.google.cloud.contentwarehouse.v1.IRuleSet>): void; - listRuleSets( - request?: protos.google.cloud.contentwarehouse.v1.IListRuleSetsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.contentwarehouse.v1.IListRuleSetsRequest, - protos.google.cloud.contentwarehouse.v1.IListRuleSetsResponse|null|undefined, - protos.google.cloud.contentwarehouse.v1.IRuleSet>, - callback?: PaginationCallback< - protos.google.cloud.contentwarehouse.v1.IListRuleSetsRequest, - protos.google.cloud.contentwarehouse.v1.IListRuleSetsResponse|null|undefined, - protos.google.cloud.contentwarehouse.v1.IRuleSet>): - Promise<[ - protos.google.cloud.contentwarehouse.v1.IRuleSet[], - protos.google.cloud.contentwarehouse.v1.IListRuleSetsRequest|null, - protos.google.cloud.contentwarehouse.v1.IListRuleSetsResponse - ]>|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.contentwarehouse.v1.IListRuleSetsRequest, - protos.google.cloud.contentwarehouse.v1.IListRuleSetsResponse|null|undefined, - protos.google.cloud.contentwarehouse.v1.IRuleSet>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listRuleSets values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listRuleSets request %j', request); - return this.innerApiCalls - .listRuleSets(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.contentwarehouse.v1.IRuleSet[], - protos.google.cloud.contentwarehouse.v1.IListRuleSetsRequest|null, - protos.google.cloud.contentwarehouse.v1.IListRuleSetsResponse - ]) => { - this._log.info('listRuleSets values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listRuleSets`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of document. - * Format: projects/{project_number}/locations/{location}. - * @param {number} request.pageSize - * The maximum number of rule sets to return. The service may return - * fewer than this value. - * If unspecified, at most 50 rule sets will be returned. - * The maximum value is 1000; values above 1000 will be coerced to 1000. - * @param {string} request.pageToken - * A page token, received from a previous `ListRuleSets` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListRuleSets` - * must match the call that provided the page token. - * @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 {@link protos.google.cloud.contentwarehouse.v1.RuleSet|RuleSet} 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 `listRuleSetsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listRuleSetsStream( - request?: protos.google.cloud.contentwarehouse.v1.IListRuleSetsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listRuleSets']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listRuleSets stream %j', request); - return this.descriptors.page.listRuleSets.createStream( - this.innerApiCalls.listRuleSets as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listRuleSets`, 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. The parent, which owns this collection of document. - * Format: projects/{project_number}/locations/{location}. - * @param {number} request.pageSize - * The maximum number of rule sets to return. The service may return - * fewer than this value. - * If unspecified, at most 50 rule sets will be returned. - * The maximum value is 1000; values above 1000 will be coerced to 1000. - * @param {string} request.pageToken - * A page token, received from a previous `ListRuleSets` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListRuleSets` - * must match the call that provided the page token. - * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.contentwarehouse.v1.RuleSet|RuleSet}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1/rule_set_service.list_rule_sets.js - * region_tag:contentwarehouse_v1_generated_RuleSetService_ListRuleSets_async - */ - listRuleSetsAsync( - request?: protos.google.cloud.contentwarehouse.v1.IListRuleSetsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listRuleSets']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listRuleSets iterate %j', request); - return this.descriptors.page.listRuleSets.asyncIterate( - this.innerApiCalls['listRuleSets'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified documentLink resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} document - * @param {string} document_link - * @returns {string} Resource name string. - */ - documentLinkPath(project:string,location:string,document:string,documentLink:string) { - return this.pathTemplates.documentLinkPathTemplate.render({ - project: project, - location: location, - document: document, - document_link: documentLink, - }); - } - - /** - * Parse the project from DocumentLink resource. - * - * @param {string} documentLinkName - * A fully-qualified path representing DocumentLink resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDocumentLinkName(documentLinkName: string) { - return this.pathTemplates.documentLinkPathTemplate.match(documentLinkName).project; - } - - /** - * Parse the location from DocumentLink resource. - * - * @param {string} documentLinkName - * A fully-qualified path representing DocumentLink resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDocumentLinkName(documentLinkName: string) { - return this.pathTemplates.documentLinkPathTemplate.match(documentLinkName).location; - } - - /** - * Parse the document from DocumentLink resource. - * - * @param {string} documentLinkName - * A fully-qualified path representing DocumentLink resource. - * @returns {string} A string representing the document. - */ - matchDocumentFromDocumentLinkName(documentLinkName: string) { - return this.pathTemplates.documentLinkPathTemplate.match(documentLinkName).document; - } - - /** - * Parse the document_link from DocumentLink resource. - * - * @param {string} documentLinkName - * A fully-qualified path representing DocumentLink resource. - * @returns {string} A string representing the document_link. - */ - matchDocumentLinkFromDocumentLinkName(documentLinkName: string) { - return this.pathTemplates.documentLinkPathTemplate.match(documentLinkName).document_link; - } - - /** - * Return a fully-qualified documentSchema resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} document_schema - * @returns {string} Resource name string. - */ - documentSchemaPath(project:string,location:string,documentSchema:string) { - return this.pathTemplates.documentSchemaPathTemplate.render({ - project: project, - location: location, - document_schema: documentSchema, - }); - } - - /** - * Parse the project from DocumentSchema resource. - * - * @param {string} documentSchemaName - * A fully-qualified path representing DocumentSchema resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDocumentSchemaName(documentSchemaName: string) { - return this.pathTemplates.documentSchemaPathTemplate.match(documentSchemaName).project; - } - - /** - * Parse the location from DocumentSchema resource. - * - * @param {string} documentSchemaName - * A fully-qualified path representing DocumentSchema resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDocumentSchemaName(documentSchemaName: string) { - return this.pathTemplates.documentSchemaPathTemplate.match(documentSchemaName).location; - } - - /** - * Parse the document_schema from DocumentSchema resource. - * - * @param {string} documentSchemaName - * A fully-qualified path representing DocumentSchema resource. - * @returns {string} A string representing the document_schema. - */ - matchDocumentSchemaFromDocumentSchemaName(documentSchemaName: string) { - return this.pathTemplates.documentSchemaPathTemplate.match(documentSchemaName).document_schema; - } - - /** - * Return a fully-qualified projectLocationDocument resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} document - * @returns {string} Resource name string. - */ - projectLocationDocumentPath(project:string,location:string,document:string) { - return this.pathTemplates.projectLocationDocumentPathTemplate.render({ - project: project, - location: location, - document: document, - }); - } - - /** - * Parse the project from ProjectLocationDocument resource. - * - * @param {string} projectLocationDocumentName - * A fully-qualified path representing project_location_document resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationDocumentName(projectLocationDocumentName: string) { - return this.pathTemplates.projectLocationDocumentPathTemplate.match(projectLocationDocumentName).project; - } - - /** - * Parse the location from ProjectLocationDocument resource. - * - * @param {string} projectLocationDocumentName - * A fully-qualified path representing project_location_document resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationDocumentName(projectLocationDocumentName: string) { - return this.pathTemplates.projectLocationDocumentPathTemplate.match(projectLocationDocumentName).location; - } - - /** - * Parse the document from ProjectLocationDocument resource. - * - * @param {string} projectLocationDocumentName - * A fully-qualified path representing project_location_document resource. - * @returns {string} A string representing the document. - */ - matchDocumentFromProjectLocationDocumentName(projectLocationDocumentName: string) { - return this.pathTemplates.projectLocationDocumentPathTemplate.match(projectLocationDocumentName).document; - } - - /** - * Return a fully-qualified projectLocationDocumentsReferenceId resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} reference_id - * @returns {string} Resource name string. - */ - projectLocationDocumentsReferenceIdPath(project:string,location:string,referenceId:string) { - return this.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.render({ - project: project, - location: location, - reference_id: referenceId, - }); - } - - /** - * Parse the project from ProjectLocationDocumentsReferenceId resource. - * - * @param {string} projectLocationDocumentsReferenceIdName - * A fully-qualified path representing project_location_documents_reference_id resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationDocumentsReferenceIdName(projectLocationDocumentsReferenceIdName: string) { - return this.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match(projectLocationDocumentsReferenceIdName).project; - } - - /** - * Parse the location from ProjectLocationDocumentsReferenceId resource. - * - * @param {string} projectLocationDocumentsReferenceIdName - * A fully-qualified path representing project_location_documents_reference_id resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationDocumentsReferenceIdName(projectLocationDocumentsReferenceIdName: string) { - return this.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match(projectLocationDocumentsReferenceIdName).location; - } - - /** - * Parse the reference_id from ProjectLocationDocumentsReferenceId resource. - * - * @param {string} projectLocationDocumentsReferenceIdName - * A fully-qualified path representing project_location_documents_reference_id resource. - * @returns {string} A string representing the reference_id. - */ - matchReferenceIdFromProjectLocationDocumentsReferenceIdName(projectLocationDocumentsReferenceIdName: string) { - return this.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match(projectLocationDocumentsReferenceIdName).reference_id; - } - - /** - * Return a fully-qualified ruleSet resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} rule_set - * @returns {string} Resource name string. - */ - ruleSetPath(project:string,location:string,ruleSet:string) { - return this.pathTemplates.ruleSetPathTemplate.render({ - project: project, - location: location, - rule_set: ruleSet, - }); - } - - /** - * Parse the project from RuleSet resource. - * - * @param {string} ruleSetName - * A fully-qualified path representing RuleSet resource. - * @returns {string} A string representing the project. - */ - matchProjectFromRuleSetName(ruleSetName: string) { - return this.pathTemplates.ruleSetPathTemplate.match(ruleSetName).project; - } - - /** - * Parse the location from RuleSet resource. - * - * @param {string} ruleSetName - * A fully-qualified path representing RuleSet resource. - * @returns {string} A string representing the location. - */ - matchLocationFromRuleSetName(ruleSetName: string) { - return this.pathTemplates.ruleSetPathTemplate.match(ruleSetName).location; - } - - /** - * Parse the rule_set from RuleSet resource. - * - * @param {string} ruleSetName - * A fully-qualified path representing RuleSet resource. - * @returns {string} A string representing the rule_set. - */ - matchRuleSetFromRuleSetName(ruleSetName: string) { - return this.pathTemplates.ruleSetPathTemplate.match(ruleSetName).rule_set; - } - - /** - * Return a fully-qualified synonymSet resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} context - * @returns {string} Resource name string. - */ - synonymSetPath(project:string,location:string,context:string) { - return this.pathTemplates.synonymSetPathTemplate.render({ - project: project, - location: location, - context: context, - }); - } - - /** - * Parse the project from SynonymSet resource. - * - * @param {string} synonymSetName - * A fully-qualified path representing SynonymSet resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSynonymSetName(synonymSetName: string) { - return this.pathTemplates.synonymSetPathTemplate.match(synonymSetName).project; - } - - /** - * Parse the location from SynonymSet resource. - * - * @param {string} synonymSetName - * A fully-qualified path representing SynonymSet resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSynonymSetName(synonymSetName: string) { - return this.pathTemplates.synonymSetPathTemplate.match(synonymSetName).location; - } - - /** - * Parse the context from SynonymSet resource. - * - * @param {string} synonymSetName - * A fully-qualified path representing SynonymSet resource. - * @returns {string} A string representing the context. - */ - matchContextFromSynonymSetName(synonymSetName: string) { - return this.pathTemplates.synonymSetPathTemplate.match(synonymSetName).context; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.ruleSetServiceStub && !this._terminated) { - return this.ruleSetServiceStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - }); - } - return Promise.resolve(); - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/rule_set_service_client_config.json b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/rule_set_service_client_config.json deleted file mode 100644 index e5e5bf93f5d..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/rule_set_service_client_config.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "interfaces": { - "google.cloud.contentwarehouse.v1.RuleSetService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "unavailable": [ - "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 - }, - "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { - "initial_retry_delay_millis": 1000, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 10000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateRuleSet": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetRuleSet": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "UpdateRuleSet": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteRuleSet": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListRuleSets": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/rule_set_service_proto_list.json b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/rule_set_service_proto_list.json deleted file mode 100644 index a1775b1134d..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/rule_set_service_proto_list.json +++ /dev/null @@ -1,23 +0,0 @@ -[ - "../../protos/google/cloud/contentwarehouse/v1/async_document_service_request.proto", - "../../protos/google/cloud/contentwarehouse/v1/common.proto", - "../../protos/google/cloud/contentwarehouse/v1/document.proto", - "../../protos/google/cloud/contentwarehouse/v1/document_link_service.proto", - "../../protos/google/cloud/contentwarehouse/v1/document_schema.proto", - "../../protos/google/cloud/contentwarehouse/v1/document_schema_service.proto", - "../../protos/google/cloud/contentwarehouse/v1/document_service.proto", - "../../protos/google/cloud/contentwarehouse/v1/document_service_request.proto", - "../../protos/google/cloud/contentwarehouse/v1/filters.proto", - "../../protos/google/cloud/contentwarehouse/v1/histogram.proto", - "../../protos/google/cloud/contentwarehouse/v1/pipeline_service.proto", - "../../protos/google/cloud/contentwarehouse/v1/pipelines.proto", - "../../protos/google/cloud/contentwarehouse/v1/rule_engine.proto", - "../../protos/google/cloud/contentwarehouse/v1/ruleset_service.proto", - "../../protos/google/cloud/contentwarehouse/v1/ruleset_service_request.proto", - "../../protos/google/cloud/contentwarehouse/v1/synonymset.proto", - "../../protos/google/cloud/contentwarehouse/v1/synonymset_service.proto", - "../../protos/google/cloud/contentwarehouse/v1/synonymset_service_request.proto", - "../../protos/google/cloud/documentai/v1/barcode.proto", - "../../protos/google/cloud/documentai/v1/document.proto", - "../../protos/google/cloud/documentai/v1/geometry.proto" -] diff --git a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/synonym_set_service_client.ts b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/synonym_set_service_client.ts deleted file mode 100644 index 936611b515e..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/synonym_set_service_client.ts +++ /dev/null @@ -1,1291 +0,0 @@ -// Copyright 2026 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 type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; - -/** - * Client JSON configuration object, loaded from - * `src/v1/synonym_set_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './synonym_set_service_client_config.json'; -const version = require('../../../package.json').version; - -/** - * A Service that manage/custom customer specified SynonymSets. - * @class - * @memberof v1 - */ -export class SynonymSetServiceClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - private _universeDomain: string; - private _servicePath: string; - private _log = logging.log('contentwarehouse'); - - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - synonymSetServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of SynonymSetServiceClient. - * - * @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/main/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://cloud.google.com/docs/authentication/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/1.1 REST mode. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new SynonymSetServiceClient({fallback: true}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof SynonymSetServiceClient; - if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { - throw new Error('Please set either universe_domain or universeDomain, but not both.'); - } - const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; - this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; - this._servicePath = 'contentwarehouse.' + this._universeDomain; - const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // Request numeric enum values if REST transport is used. - opts.numericEnums = true; - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== this._servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = this._servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === this._servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process === 'object' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - documentLinkPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/documents/{document}/documentLinks/{document_link}' - ), - documentSchemaPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/documentSchemas/{document_schema}' - ), - projectLocationDocumentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/documents/{document}' - ), - projectLocationDocumentsReferenceIdPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/documents/referenceId/{reference_id}' - ), - ruleSetPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/ruleSets/{rule_set}' - ), - synonymSetPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/synonymSets/{context}' - ), - }; - - // 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 = { - listSynonymSets: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'synonymSets') - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.contentwarehouse.v1.SynonymSetService', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = this._gaxModule.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.synonymSetServiceStub) { - return this.synonymSetServiceStub; - } - - // Put together the "service stub" for - // google.cloud.contentwarehouse.v1.SynonymSetService. - this.synonymSetServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.contentwarehouse.v1.SynonymSetService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.contentwarehouse.v1.SynonymSetService, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const synonymSetServiceStubMethods = - ['createSynonymSet', 'getSynonymSet', 'updateSynonymSet', 'deleteSynonymSet', 'listSynonymSets']; - for (const methodName of synonymSetServiceStubMethods) { - const callPromise = this.synonymSetServiceStub.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._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.synonymSetServiceStub; - } - - /** - * The DNS address for this API service. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'contentwarehouse.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'contentwarehouse.googleapis.com'; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - get apiEndpoint() { - return this._servicePath; - } - - get universeDomain() { - return this._universeDomain; - } - - /** - * 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 -- - // ------------------- -/** - * Creates a SynonymSet for a single context. - * Throws an ALREADY_EXISTS exception if a synonymset already exists - * for the context. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent name. - * Format: projects/{project_number}/locations/{location}. - * @param {google.cloud.contentwarehouse.v1.SynonymSet} request.synonymSet - * Required. The synonymSet to be created for a context - * @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 {@link protos.google.cloud.contentwarehouse.v1.SynonymSet|SynonymSet}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/synonym_set_service.create_synonym_set.js - * region_tag:contentwarehouse_v1_generated_SynonymSetService_CreateSynonymSet_async - */ - createSynonymSet( - request?: protos.google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.contentwarehouse.v1.ISynonymSet, - protos.google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest|undefined, {}|undefined - ]>; - createSynonymSet( - request: protos.google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.contentwarehouse.v1.ISynonymSet, - protos.google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest|null|undefined, - {}|null|undefined>): void; - createSynonymSet( - request: protos.google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest, - callback: Callback< - protos.google.cloud.contentwarehouse.v1.ISynonymSet, - protos.google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest|null|undefined, - {}|null|undefined>): void; - createSynonymSet( - request?: protos.google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.contentwarehouse.v1.ISynonymSet, - protos.google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.contentwarehouse.v1.ISynonymSet, - protos.google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.contentwarehouse.v1.ISynonymSet, - protos.google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('createSynonymSet request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.contentwarehouse.v1.ISynonymSet, - protos.google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('createSynonymSet response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.createSynonymSet(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.contentwarehouse.v1.ISynonymSet, - protos.google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest|undefined, - {}|undefined - ]) => { - this._log.info('createSynonymSet response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Gets a SynonymSet for a particular context. - * Throws a NOT_FOUND exception if the Synonymset - * does not exist - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the synonymSet to retrieve - * Format: - * projects/{project_number}/locations/{location}/synonymSets/{context}. - * @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 {@link protos.google.cloud.contentwarehouse.v1.SynonymSet|SynonymSet}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/synonym_set_service.get_synonym_set.js - * region_tag:contentwarehouse_v1_generated_SynonymSetService_GetSynonymSet_async - */ - getSynonymSet( - request?: protos.google.cloud.contentwarehouse.v1.IGetSynonymSetRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.contentwarehouse.v1.ISynonymSet, - protos.google.cloud.contentwarehouse.v1.IGetSynonymSetRequest|undefined, {}|undefined - ]>; - getSynonymSet( - request: protos.google.cloud.contentwarehouse.v1.IGetSynonymSetRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.contentwarehouse.v1.ISynonymSet, - protos.google.cloud.contentwarehouse.v1.IGetSynonymSetRequest|null|undefined, - {}|null|undefined>): void; - getSynonymSet( - request: protos.google.cloud.contentwarehouse.v1.IGetSynonymSetRequest, - callback: Callback< - protos.google.cloud.contentwarehouse.v1.ISynonymSet, - protos.google.cloud.contentwarehouse.v1.IGetSynonymSetRequest|null|undefined, - {}|null|undefined>): void; - getSynonymSet( - request?: protos.google.cloud.contentwarehouse.v1.IGetSynonymSetRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.contentwarehouse.v1.ISynonymSet, - protos.google.cloud.contentwarehouse.v1.IGetSynonymSetRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.contentwarehouse.v1.ISynonymSet, - protos.google.cloud.contentwarehouse.v1.IGetSynonymSetRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.contentwarehouse.v1.ISynonymSet, - protos.google.cloud.contentwarehouse.v1.IGetSynonymSetRequest|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getSynonymSet request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.contentwarehouse.v1.ISynonymSet, - protos.google.cloud.contentwarehouse.v1.IGetSynonymSetRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getSynonymSet response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getSynonymSet(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.contentwarehouse.v1.ISynonymSet, - protos.google.cloud.contentwarehouse.v1.IGetSynonymSetRequest|undefined, - {}|undefined - ]) => { - this._log.info('getSynonymSet response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Remove the existing SynonymSet for the context and replaces it - * with a new one. - * Throws a NOT_FOUND exception if the SynonymSet is not found. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the synonymSet to update - * Format: - * projects/{project_number}/locations/{location}/synonymSets/{context}. - * @param {google.cloud.contentwarehouse.v1.SynonymSet} request.synonymSet - * Required. The synonymSet to be updated for the customer - * @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 {@link protos.google.cloud.contentwarehouse.v1.SynonymSet|SynonymSet}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/synonym_set_service.update_synonym_set.js - * region_tag:contentwarehouse_v1_generated_SynonymSetService_UpdateSynonymSet_async - */ - updateSynonymSet( - request?: protos.google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.contentwarehouse.v1.ISynonymSet, - protos.google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest|undefined, {}|undefined - ]>; - updateSynonymSet( - request: protos.google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.contentwarehouse.v1.ISynonymSet, - protos.google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest|null|undefined, - {}|null|undefined>): void; - updateSynonymSet( - request: protos.google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest, - callback: Callback< - protos.google.cloud.contentwarehouse.v1.ISynonymSet, - protos.google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest|null|undefined, - {}|null|undefined>): void; - updateSynonymSet( - request?: protos.google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.contentwarehouse.v1.ISynonymSet, - protos.google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.contentwarehouse.v1.ISynonymSet, - protos.google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.contentwarehouse.v1.ISynonymSet, - protos.google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('updateSynonymSet request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.contentwarehouse.v1.ISynonymSet, - protos.google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateSynonymSet response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.updateSynonymSet(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.contentwarehouse.v1.ISynonymSet, - protos.google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateSynonymSet response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Deletes a SynonymSet for a given context. - * Throws a NOT_FOUND exception if the SynonymSet is not found. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the synonymSet to delete - * Format: - * projects/{project_number}/locations/{location}/synonymSets/{context}. - * @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 {@link protos.google.protobuf.Empty|Empty}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/synonym_set_service.delete_synonym_set.js - * region_tag:contentwarehouse_v1_generated_SynonymSetService_DeleteSynonymSet_async - */ - deleteSynonymSet( - request?: protos.google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest|undefined, {}|undefined - ]>; - deleteSynonymSet( - request: protos.google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest|null|undefined, - {}|null|undefined>): void; - deleteSynonymSet( - request: protos.google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest|null|undefined, - {}|null|undefined>): void; - deleteSynonymSet( - request?: protos.google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('deleteSynonymSet request %j', request); - const wrappedCallback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('deleteSynonymSet response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.deleteSynonymSet(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.protobuf.IEmpty, - protos.google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest|undefined, - {}|undefined - ]) => { - this._log.info('deleteSynonymSet response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } - - /** - * Returns all SynonymSets (for all contexts) for the specified location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent name. - * Format: projects/{project_number}/locations/{location}. - * @param {number} request.pageSize - * The maximum number of synonymSets to return. The service may return - * fewer than this value. - * If unspecified, at most 50 rule sets will be returned. - * The maximum value is 1000; values above 1000 will be coerced to 1000. - * @param {string} request.pageToken - * A page token, received from a previous `ListSynonymSets` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListSynonymSets` - * must match the call that provided the page token. - * @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 {@link protos.google.cloud.contentwarehouse.v1.SynonymSet|SynonymSet}. - * 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 `listSynonymSetsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listSynonymSets( - request?: protos.google.cloud.contentwarehouse.v1.IListSynonymSetsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.contentwarehouse.v1.ISynonymSet[], - protos.google.cloud.contentwarehouse.v1.IListSynonymSetsRequest|null, - protos.google.cloud.contentwarehouse.v1.IListSynonymSetsResponse - ]>; - listSynonymSets( - request: protos.google.cloud.contentwarehouse.v1.IListSynonymSetsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.contentwarehouse.v1.IListSynonymSetsRequest, - protos.google.cloud.contentwarehouse.v1.IListSynonymSetsResponse|null|undefined, - protos.google.cloud.contentwarehouse.v1.ISynonymSet>): void; - listSynonymSets( - request: protos.google.cloud.contentwarehouse.v1.IListSynonymSetsRequest, - callback: PaginationCallback< - protos.google.cloud.contentwarehouse.v1.IListSynonymSetsRequest, - protos.google.cloud.contentwarehouse.v1.IListSynonymSetsResponse|null|undefined, - protos.google.cloud.contentwarehouse.v1.ISynonymSet>): void; - listSynonymSets( - request?: protos.google.cloud.contentwarehouse.v1.IListSynonymSetsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.contentwarehouse.v1.IListSynonymSetsRequest, - protos.google.cloud.contentwarehouse.v1.IListSynonymSetsResponse|null|undefined, - protos.google.cloud.contentwarehouse.v1.ISynonymSet>, - callback?: PaginationCallback< - protos.google.cloud.contentwarehouse.v1.IListSynonymSetsRequest, - protos.google.cloud.contentwarehouse.v1.IListSynonymSetsResponse|null|undefined, - protos.google.cloud.contentwarehouse.v1.ISynonymSet>): - Promise<[ - protos.google.cloud.contentwarehouse.v1.ISynonymSet[], - protos.google.cloud.contentwarehouse.v1.IListSynonymSetsRequest|null, - protos.google.cloud.contentwarehouse.v1.IListSynonymSetsResponse - ]>|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.contentwarehouse.v1.IListSynonymSetsRequest, - protos.google.cloud.contentwarehouse.v1.IListSynonymSetsResponse|null|undefined, - protos.google.cloud.contentwarehouse.v1.ISynonymSet>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listSynonymSets values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listSynonymSets request %j', request); - return this.innerApiCalls - .listSynonymSets(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.contentwarehouse.v1.ISynonymSet[], - protos.google.cloud.contentwarehouse.v1.IListSynonymSetsRequest|null, - protos.google.cloud.contentwarehouse.v1.IListSynonymSetsResponse - ]) => { - this._log.info('listSynonymSets values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listSynonymSets`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent name. - * Format: projects/{project_number}/locations/{location}. - * @param {number} request.pageSize - * The maximum number of synonymSets to return. The service may return - * fewer than this value. - * If unspecified, at most 50 rule sets will be returned. - * The maximum value is 1000; values above 1000 will be coerced to 1000. - * @param {string} request.pageToken - * A page token, received from a previous `ListSynonymSets` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListSynonymSets` - * must match the call that provided the page token. - * @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 {@link protos.google.cloud.contentwarehouse.v1.SynonymSet|SynonymSet} 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 `listSynonymSetsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listSynonymSetsStream( - request?: protos.google.cloud.contentwarehouse.v1.IListSynonymSetsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listSynonymSets']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listSynonymSets stream %j', request); - return this.descriptors.page.listSynonymSets.createStream( - this.innerApiCalls.listSynonymSets as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listSynonymSets`, 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. The parent name. - * Format: projects/{project_number}/locations/{location}. - * @param {number} request.pageSize - * The maximum number of synonymSets to return. The service may return - * fewer than this value. - * If unspecified, at most 50 rule sets will be returned. - * The maximum value is 1000; values above 1000 will be coerced to 1000. - * @param {string} request.pageToken - * A page token, received from a previous `ListSynonymSets` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListSynonymSets` - * must match the call that provided the page token. - * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.contentwarehouse.v1.SynonymSet|SynonymSet}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1/synonym_set_service.list_synonym_sets.js - * region_tag:contentwarehouse_v1_generated_SynonymSetService_ListSynonymSets_async - */ - listSynonymSetsAsync( - request?: protos.google.cloud.contentwarehouse.v1.IListSynonymSetsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listSynonymSets']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listSynonymSets iterate %j', request); - return this.descriptors.page.listSynonymSets.asyncIterate( - this.innerApiCalls['listSynonymSets'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified documentLink resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} document - * @param {string} document_link - * @returns {string} Resource name string. - */ - documentLinkPath(project:string,location:string,document:string,documentLink:string) { - return this.pathTemplates.documentLinkPathTemplate.render({ - project: project, - location: location, - document: document, - document_link: documentLink, - }); - } - - /** - * Parse the project from DocumentLink resource. - * - * @param {string} documentLinkName - * A fully-qualified path representing DocumentLink resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDocumentLinkName(documentLinkName: string) { - return this.pathTemplates.documentLinkPathTemplate.match(documentLinkName).project; - } - - /** - * Parse the location from DocumentLink resource. - * - * @param {string} documentLinkName - * A fully-qualified path representing DocumentLink resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDocumentLinkName(documentLinkName: string) { - return this.pathTemplates.documentLinkPathTemplate.match(documentLinkName).location; - } - - /** - * Parse the document from DocumentLink resource. - * - * @param {string} documentLinkName - * A fully-qualified path representing DocumentLink resource. - * @returns {string} A string representing the document. - */ - matchDocumentFromDocumentLinkName(documentLinkName: string) { - return this.pathTemplates.documentLinkPathTemplate.match(documentLinkName).document; - } - - /** - * Parse the document_link from DocumentLink resource. - * - * @param {string} documentLinkName - * A fully-qualified path representing DocumentLink resource. - * @returns {string} A string representing the document_link. - */ - matchDocumentLinkFromDocumentLinkName(documentLinkName: string) { - return this.pathTemplates.documentLinkPathTemplate.match(documentLinkName).document_link; - } - - /** - * Return a fully-qualified documentSchema resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} document_schema - * @returns {string} Resource name string. - */ - documentSchemaPath(project:string,location:string,documentSchema:string) { - return this.pathTemplates.documentSchemaPathTemplate.render({ - project: project, - location: location, - document_schema: documentSchema, - }); - } - - /** - * Parse the project from DocumentSchema resource. - * - * @param {string} documentSchemaName - * A fully-qualified path representing DocumentSchema resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDocumentSchemaName(documentSchemaName: string) { - return this.pathTemplates.documentSchemaPathTemplate.match(documentSchemaName).project; - } - - /** - * Parse the location from DocumentSchema resource. - * - * @param {string} documentSchemaName - * A fully-qualified path representing DocumentSchema resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDocumentSchemaName(documentSchemaName: string) { - return this.pathTemplates.documentSchemaPathTemplate.match(documentSchemaName).location; - } - - /** - * Parse the document_schema from DocumentSchema resource. - * - * @param {string} documentSchemaName - * A fully-qualified path representing DocumentSchema resource. - * @returns {string} A string representing the document_schema. - */ - matchDocumentSchemaFromDocumentSchemaName(documentSchemaName: string) { - return this.pathTemplates.documentSchemaPathTemplate.match(documentSchemaName).document_schema; - } - - /** - * Return a fully-qualified projectLocationDocument resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} document - * @returns {string} Resource name string. - */ - projectLocationDocumentPath(project:string,location:string,document:string) { - return this.pathTemplates.projectLocationDocumentPathTemplate.render({ - project: project, - location: location, - document: document, - }); - } - - /** - * Parse the project from ProjectLocationDocument resource. - * - * @param {string} projectLocationDocumentName - * A fully-qualified path representing project_location_document resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationDocumentName(projectLocationDocumentName: string) { - return this.pathTemplates.projectLocationDocumentPathTemplate.match(projectLocationDocumentName).project; - } - - /** - * Parse the location from ProjectLocationDocument resource. - * - * @param {string} projectLocationDocumentName - * A fully-qualified path representing project_location_document resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationDocumentName(projectLocationDocumentName: string) { - return this.pathTemplates.projectLocationDocumentPathTemplate.match(projectLocationDocumentName).location; - } - - /** - * Parse the document from ProjectLocationDocument resource. - * - * @param {string} projectLocationDocumentName - * A fully-qualified path representing project_location_document resource. - * @returns {string} A string representing the document. - */ - matchDocumentFromProjectLocationDocumentName(projectLocationDocumentName: string) { - return this.pathTemplates.projectLocationDocumentPathTemplate.match(projectLocationDocumentName).document; - } - - /** - * Return a fully-qualified projectLocationDocumentsReferenceId resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} reference_id - * @returns {string} Resource name string. - */ - projectLocationDocumentsReferenceIdPath(project:string,location:string,referenceId:string) { - return this.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.render({ - project: project, - location: location, - reference_id: referenceId, - }); - } - - /** - * Parse the project from ProjectLocationDocumentsReferenceId resource. - * - * @param {string} projectLocationDocumentsReferenceIdName - * A fully-qualified path representing project_location_documents_reference_id resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationDocumentsReferenceIdName(projectLocationDocumentsReferenceIdName: string) { - return this.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match(projectLocationDocumentsReferenceIdName).project; - } - - /** - * Parse the location from ProjectLocationDocumentsReferenceId resource. - * - * @param {string} projectLocationDocumentsReferenceIdName - * A fully-qualified path representing project_location_documents_reference_id resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationDocumentsReferenceIdName(projectLocationDocumentsReferenceIdName: string) { - return this.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match(projectLocationDocumentsReferenceIdName).location; - } - - /** - * Parse the reference_id from ProjectLocationDocumentsReferenceId resource. - * - * @param {string} projectLocationDocumentsReferenceIdName - * A fully-qualified path representing project_location_documents_reference_id resource. - * @returns {string} A string representing the reference_id. - */ - matchReferenceIdFromProjectLocationDocumentsReferenceIdName(projectLocationDocumentsReferenceIdName: string) { - return this.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match(projectLocationDocumentsReferenceIdName).reference_id; - } - - /** - * Return a fully-qualified ruleSet resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} rule_set - * @returns {string} Resource name string. - */ - ruleSetPath(project:string,location:string,ruleSet:string) { - return this.pathTemplates.ruleSetPathTemplate.render({ - project: project, - location: location, - rule_set: ruleSet, - }); - } - - /** - * Parse the project from RuleSet resource. - * - * @param {string} ruleSetName - * A fully-qualified path representing RuleSet resource. - * @returns {string} A string representing the project. - */ - matchProjectFromRuleSetName(ruleSetName: string) { - return this.pathTemplates.ruleSetPathTemplate.match(ruleSetName).project; - } - - /** - * Parse the location from RuleSet resource. - * - * @param {string} ruleSetName - * A fully-qualified path representing RuleSet resource. - * @returns {string} A string representing the location. - */ - matchLocationFromRuleSetName(ruleSetName: string) { - return this.pathTemplates.ruleSetPathTemplate.match(ruleSetName).location; - } - - /** - * Parse the rule_set from RuleSet resource. - * - * @param {string} ruleSetName - * A fully-qualified path representing RuleSet resource. - * @returns {string} A string representing the rule_set. - */ - matchRuleSetFromRuleSetName(ruleSetName: string) { - return this.pathTemplates.ruleSetPathTemplate.match(ruleSetName).rule_set; - } - - /** - * Return a fully-qualified synonymSet resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} context - * @returns {string} Resource name string. - */ - synonymSetPath(project:string,location:string,context:string) { - return this.pathTemplates.synonymSetPathTemplate.render({ - project: project, - location: location, - context: context, - }); - } - - /** - * Parse the project from SynonymSet resource. - * - * @param {string} synonymSetName - * A fully-qualified path representing SynonymSet resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSynonymSetName(synonymSetName: string) { - return this.pathTemplates.synonymSetPathTemplate.match(synonymSetName).project; - } - - /** - * Parse the location from SynonymSet resource. - * - * @param {string} synonymSetName - * A fully-qualified path representing SynonymSet resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSynonymSetName(synonymSetName: string) { - return this.pathTemplates.synonymSetPathTemplate.match(synonymSetName).location; - } - - /** - * Parse the context from SynonymSet resource. - * - * @param {string} synonymSetName - * A fully-qualified path representing SynonymSet resource. - * @returns {string} A string representing the context. - */ - matchContextFromSynonymSetName(synonymSetName: string) { - return this.pathTemplates.synonymSetPathTemplate.match(synonymSetName).context; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.synonymSetServiceStub && !this._terminated) { - return this.synonymSetServiceStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - }); - } - return Promise.resolve(); - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/synonym_set_service_client_config.json b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/synonym_set_service_client_config.json deleted file mode 100644 index 3c3408c02f7..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/synonym_set_service_client_config.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "interfaces": { - "google.cloud.contentwarehouse.v1.SynonymSetService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "unavailable": [ - "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 - }, - "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { - "initial_retry_delay_millis": 1000, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 10000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateSynonymSet": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetSynonymSet": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "UpdateSynonymSet": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteSynonymSet": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListSynonymSets": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/synonym_set_service_proto_list.json b/owl-bot-staging/google-cloud-contentwarehouse/src/v1/synonym_set_service_proto_list.json deleted file mode 100644 index a1775b1134d..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/src/v1/synonym_set_service_proto_list.json +++ /dev/null @@ -1,23 +0,0 @@ -[ - "../../protos/google/cloud/contentwarehouse/v1/async_document_service_request.proto", - "../../protos/google/cloud/contentwarehouse/v1/common.proto", - "../../protos/google/cloud/contentwarehouse/v1/document.proto", - "../../protos/google/cloud/contentwarehouse/v1/document_link_service.proto", - "../../protos/google/cloud/contentwarehouse/v1/document_schema.proto", - "../../protos/google/cloud/contentwarehouse/v1/document_schema_service.proto", - "../../protos/google/cloud/contentwarehouse/v1/document_service.proto", - "../../protos/google/cloud/contentwarehouse/v1/document_service_request.proto", - "../../protos/google/cloud/contentwarehouse/v1/filters.proto", - "../../protos/google/cloud/contentwarehouse/v1/histogram.proto", - "../../protos/google/cloud/contentwarehouse/v1/pipeline_service.proto", - "../../protos/google/cloud/contentwarehouse/v1/pipelines.proto", - "../../protos/google/cloud/contentwarehouse/v1/rule_engine.proto", - "../../protos/google/cloud/contentwarehouse/v1/ruleset_service.proto", - "../../protos/google/cloud/contentwarehouse/v1/ruleset_service_request.proto", - "../../protos/google/cloud/contentwarehouse/v1/synonymset.proto", - "../../protos/google/cloud/contentwarehouse/v1/synonymset_service.proto", - "../../protos/google/cloud/contentwarehouse/v1/synonymset_service_request.proto", - "../../protos/google/cloud/documentai/v1/barcode.proto", - "../../protos/google/cloud/documentai/v1/document.proto", - "../../protos/google/cloud/documentai/v1/geometry.proto" -] diff --git a/owl-bot-staging/google-cloud-contentwarehouse/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-contentwarehouse/system-test/fixtures/sample/src/index.js deleted file mode 100644 index 55706ecff78..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/system-test/fixtures/sample/src/index.js +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2026 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 contentwarehouse = require('@google-cloud/contentwarehouse'); - -function main() { - const documentLinkServiceClient = new contentwarehouse.DocumentLinkServiceClient(); - const documentSchemaServiceClient = new contentwarehouse.DocumentSchemaServiceClient(); - const documentServiceClient = new contentwarehouse.DocumentServiceClient(); - const pipelineServiceClient = new contentwarehouse.PipelineServiceClient(); - const ruleSetServiceClient = new contentwarehouse.RuleSetServiceClient(); - const synonymSetServiceClient = new contentwarehouse.SynonymSetServiceClient(); -} - -main(); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-contentwarehouse/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index 46c47122125..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/system-test/fixtures/sample/src/index.ts +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2026 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 {DocumentLinkServiceClient, DocumentSchemaServiceClient, DocumentServiceClient, PipelineServiceClient, RuleSetServiceClient, SynonymSetServiceClient} from '@google-cloud/contentwarehouse'; - -// check that the client class type name can be used -function doStuffWithDocumentLinkServiceClient(client: DocumentLinkServiceClient) { - client.close(); -} -function doStuffWithDocumentSchemaServiceClient(client: DocumentSchemaServiceClient) { - client.close(); -} -function doStuffWithDocumentServiceClient(client: DocumentServiceClient) { - client.close(); -} -function doStuffWithPipelineServiceClient(client: PipelineServiceClient) { - client.close(); -} -function doStuffWithRuleSetServiceClient(client: RuleSetServiceClient) { - client.close(); -} -function doStuffWithSynonymSetServiceClient(client: SynonymSetServiceClient) { - client.close(); -} - -function main() { - // check that the client instance can be created - const documentLinkServiceClient = new DocumentLinkServiceClient(); - doStuffWithDocumentLinkServiceClient(documentLinkServiceClient); - // check that the client instance can be created - const documentSchemaServiceClient = new DocumentSchemaServiceClient(); - doStuffWithDocumentSchemaServiceClient(documentSchemaServiceClient); - // check that the client instance can be created - const documentServiceClient = new DocumentServiceClient(); - doStuffWithDocumentServiceClient(documentServiceClient); - // check that the client instance can be created - const pipelineServiceClient = new PipelineServiceClient(); - doStuffWithPipelineServiceClient(pipelineServiceClient); - // check that the client instance can be created - const ruleSetServiceClient = new RuleSetServiceClient(); - doStuffWithRuleSetServiceClient(ruleSetServiceClient); - // check that the client instance can be created - const synonymSetServiceClient = new SynonymSetServiceClient(); - doStuffWithSynonymSetServiceClient(synonymSetServiceClient); -} - -main(); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/system-test/install.ts b/owl-bot-staging/google-cloud-contentwarehouse/system-test/install.ts deleted file mode 100644 index 394f3362d20..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/system-test/install.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import {packNTest} from 'pack-n-play'; -import {readFileSync} from 'fs'; -import {describe, it} from 'mocha'; - -describe('📦 pack-n-play test', () => { - - it('TypeScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'TypeScript user can use the type definitions', - ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() - } - }; - await packNTest(options); - }); - - it('JavaScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'JavaScript user can use the library', - ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() - } - }; - await packNTest(options); - }); - -}); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/test/gapic_document_link_service_v1.ts b/owl-bot-staging/google-cloud-contentwarehouse/test/gapic_document_link_service_v1.ts deleted file mode 100644 index 0abededa259..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/test/gapic_document_link_service_v1.ts +++ /dev/null @@ -1,1117 +0,0 @@ -// Copyright 2026 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 documentlinkserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -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('v1.DocumentLinkServiceClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'contentwarehouse.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient(); - const universeDomain = client.universeDomain; - assert.strictEqual(universeDomain, "googleapis.com"); - }); - - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - it('throws DeprecationWarning if static servicePath is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const servicePath = documentlinkserviceModule.v1.DocumentLinkServiceClient.servicePath; - assert.strictEqual(servicePath, 'contentwarehouse.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = documentlinkserviceModule.v1.DocumentLinkServiceClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'contentwarehouse.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'contentwarehouse.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'contentwarehouse.example.com'); - }); - - if (typeof process === 'object' && 'env' in process) { - describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { - it('sets apiEndpoint from environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'contentwarehouse.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - - it('value configured in code has priority over environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'contentwarehouse.configured.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - }); - } - it('does not allow setting both universeDomain and universe_domain', () => { - assert.throws(() => { new documentlinkserviceModule.v1.DocumentLinkServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = documentlinkserviceModule.v1.DocumentLinkServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.documentLinkServiceStub, undefined); - await client.initialize(); - assert(client.documentLinkServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.documentLinkServiceStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.documentLinkServiceStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ - 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 documentlinkserviceModule.v1.DocumentLinkServiceClient({ - 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('listLinkedTargets', () => { - it('invokes listLinkedTargets without error', async () => { - const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse() - ); - client.innerApiCalls.listLinkedTargets = stubSimpleCall(expectedResponse); - const [response] = await client.listLinkedTargets(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listLinkedTargets as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listLinkedTargets as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listLinkedTargets without error using callback', async () => { - const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.ListLinkedTargetsResponse() - ); - client.innerApiCalls.listLinkedTargets = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listLinkedTargets( - request, - (err?: Error|null, result?: protos.google.cloud.contentwarehouse.v1.IListLinkedTargetsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listLinkedTargets as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listLinkedTargets as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listLinkedTargets with error', async () => { - const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listLinkedTargets = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listLinkedTargets(request), expectedError); - const actualRequest = (client.innerApiCalls.listLinkedTargets as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listLinkedTargets as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listLinkedTargets with closed client', async () => { - const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListLinkedTargetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.listLinkedTargets(request), expectedError); - }); - }); - - describe('createDocumentLink', () => { - it('invokes createDocumentLink without error', async () => { - const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.DocumentLink() - ); - client.innerApiCalls.createDocumentLink = stubSimpleCall(expectedResponse); - const [response] = await client.createDocumentLink(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createDocumentLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDocumentLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createDocumentLink without error using callback', async () => { - const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.DocumentLink() - ); - client.innerApiCalls.createDocumentLink = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createDocumentLink( - request, - (err?: Error|null, result?: protos.google.cloud.contentwarehouse.v1.IDocumentLink|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createDocumentLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDocumentLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createDocumentLink with error', async () => { - const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createDocumentLink = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createDocumentLink(request), expectedError); - const actualRequest = (client.innerApiCalls.createDocumentLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDocumentLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createDocumentLink with closed client', async () => { - const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.CreateDocumentLinkRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.createDocumentLink(request), expectedError); - }); - }); - - describe('deleteDocumentLink', () => { - it('invokes deleteDocumentLink without error', async () => { - const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteDocumentLink = stubSimpleCall(expectedResponse); - const [response] = await client.deleteDocumentLink(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteDocumentLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDocumentLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteDocumentLink without error using callback', async () => { - const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteDocumentLink = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteDocumentLink( - 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); - const actualRequest = (client.innerApiCalls.deleteDocumentLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDocumentLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteDocumentLink with error', async () => { - const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteDocumentLink = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteDocumentLink(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteDocumentLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDocumentLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteDocumentLink with closed client', async () => { - const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.DeleteDocumentLinkRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.deleteDocumentLink(request), expectedError); - }); - }); - - describe('listLinkedSources', () => { - it('invokes listLinkedSources without error', async () => { - const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.DocumentLink()), - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.DocumentLink()), - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.DocumentLink()), - ]; - client.innerApiCalls.listLinkedSources = stubSimpleCall(expectedResponse); - const [response] = await client.listLinkedSources(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listLinkedSources as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listLinkedSources as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listLinkedSources without error using callback', async () => { - const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.DocumentLink()), - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.DocumentLink()), - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.DocumentLink()), - ]; - client.innerApiCalls.listLinkedSources = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listLinkedSources( - request, - (err?: Error|null, result?: protos.google.cloud.contentwarehouse.v1.IDocumentLink[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listLinkedSources as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listLinkedSources as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listLinkedSources with error', async () => { - const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listLinkedSources = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listLinkedSources(request), expectedError); - const actualRequest = (client.innerApiCalls.listLinkedSources as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listLinkedSources as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listLinkedSourcesStream without error', async () => { - const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.DocumentLink()), - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.DocumentLink()), - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.DocumentLink()), - ]; - client.descriptors.page.listLinkedSources.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listLinkedSourcesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.contentwarehouse.v1.DocumentLink[] = []; - stream.on('data', (response: protos.google.cloud.contentwarehouse.v1.DocumentLink) => { - 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.listLinkedSources.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listLinkedSources, request)); - assert( - (client.descriptors.page.listLinkedSources.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listLinkedSourcesStream with error', async () => { - const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listLinkedSources.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listLinkedSourcesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.contentwarehouse.v1.DocumentLink[] = []; - stream.on('data', (response: protos.google.cloud.contentwarehouse.v1.DocumentLink) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listLinkedSources.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listLinkedSources, request)); - assert( - (client.descriptors.page.listLinkedSources.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listLinkedSources without error', async () => { - const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.DocumentLink()), - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.DocumentLink()), - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.DocumentLink()), - ]; - client.descriptors.page.listLinkedSources.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.contentwarehouse.v1.IDocumentLink[] = []; - const iterable = client.listLinkedSourcesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listLinkedSources.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listLinkedSources.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listLinkedSources with error', async () => { - const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListLinkedSourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listLinkedSources.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLinkedSourcesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.contentwarehouse.v1.IDocumentLink[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listLinkedSources.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listLinkedSources.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('Path templates', () => { - - describe('documentLink', async () => { - const fakePath = "/rendered/path/documentLink"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - document: "documentValue", - document_link: "documentLinkValue", - }; - const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.documentLinkPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.documentLinkPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('documentLinkPath', () => { - const result = client.documentLinkPath("projectValue", "locationValue", "documentValue", "documentLinkValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.documentLinkPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDocumentLinkName', () => { - const result = client.matchProjectFromDocumentLinkName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.documentLinkPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDocumentLinkName', () => { - const result = client.matchLocationFromDocumentLinkName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.documentLinkPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDocumentFromDocumentLinkName', () => { - const result = client.matchDocumentFromDocumentLinkName(fakePath); - assert.strictEqual(result, "documentValue"); - assert((client.pathTemplates.documentLinkPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDocumentLinkFromDocumentLinkName', () => { - const result = client.matchDocumentLinkFromDocumentLinkName(fakePath); - assert.strictEqual(result, "documentLinkValue"); - assert((client.pathTemplates.documentLinkPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('documentSchema', async () => { - const fakePath = "/rendered/path/documentSchema"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - document_schema: "documentSchemaValue", - }; - const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.documentSchemaPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.documentSchemaPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('documentSchemaPath', () => { - const result = client.documentSchemaPath("projectValue", "locationValue", "documentSchemaValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.documentSchemaPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDocumentSchemaName', () => { - const result = client.matchProjectFromDocumentSchemaName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.documentSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDocumentSchemaName', () => { - const result = client.matchLocationFromDocumentSchemaName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.documentSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDocumentSchemaFromDocumentSchemaName', () => { - const result = client.matchDocumentSchemaFromDocumentSchemaName(fakePath); - assert.strictEqual(result, "documentSchemaValue"); - assert((client.pathTemplates.documentSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationDocument', async () => { - const fakePath = "/rendered/path/projectLocationDocument"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - document: "documentValue", - }; - const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectLocationDocumentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationDocumentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationDocumentPath', () => { - const result = client.projectLocationDocumentPath("projectValue", "locationValue", "documentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationDocumentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationDocumentName', () => { - const result = client.matchProjectFromProjectLocationDocumentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationDocumentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationDocumentName', () => { - const result = client.matchLocationFromProjectLocationDocumentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationDocumentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDocumentFromProjectLocationDocumentName', () => { - const result = client.matchDocumentFromProjectLocationDocumentName(fakePath); - assert.strictEqual(result, "documentValue"); - assert((client.pathTemplates.projectLocationDocumentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationDocumentsReferenceId', async () => { - const fakePath = "/rendered/path/projectLocationDocumentsReferenceId"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - reference_id: "referenceIdValue", - }; - const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationDocumentsReferenceIdPath', () => { - const result = client.projectLocationDocumentsReferenceIdPath("projectValue", "locationValue", "referenceIdValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationDocumentsReferenceIdName', () => { - const result = client.matchProjectFromProjectLocationDocumentsReferenceIdName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationDocumentsReferenceIdName', () => { - const result = client.matchLocationFromProjectLocationDocumentsReferenceIdName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchReferenceIdFromProjectLocationDocumentsReferenceIdName', () => { - const result = client.matchReferenceIdFromProjectLocationDocumentsReferenceIdName(fakePath); - assert.strictEqual(result, "referenceIdValue"); - assert((client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('ruleSet', async () => { - const fakePath = "/rendered/path/ruleSet"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - rule_set: "ruleSetValue", - }; - const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.ruleSetPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.ruleSetPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('ruleSetPath', () => { - const result = client.ruleSetPath("projectValue", "locationValue", "ruleSetValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.ruleSetPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromRuleSetName', () => { - const result = client.matchProjectFromRuleSetName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.ruleSetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromRuleSetName', () => { - const result = client.matchLocationFromRuleSetName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.ruleSetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRuleSetFromRuleSetName', () => { - const result = client.matchRuleSetFromRuleSetName(fakePath); - assert.strictEqual(result, "ruleSetValue"); - assert((client.pathTemplates.ruleSetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('synonymSet', async () => { - const fakePath = "/rendered/path/synonymSet"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - context: "contextValue", - }; - const client = new documentlinkserviceModule.v1.DocumentLinkServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.synonymSetPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.synonymSetPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('synonymSetPath', () => { - const result = client.synonymSetPath("projectValue", "locationValue", "contextValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.synonymSetPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSynonymSetName', () => { - const result = client.matchProjectFromSynonymSetName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.synonymSetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSynonymSetName', () => { - const result = client.matchLocationFromSynonymSetName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.synonymSetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchContextFromSynonymSetName', () => { - const result = client.matchContextFromSynonymSetName(fakePath); - assert.strictEqual(result, "contextValue"); - assert((client.pathTemplates.synonymSetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/test/gapic_document_schema_service_v1.ts b/owl-bot-staging/google-cloud-contentwarehouse/test/gapic_document_schema_service_v1.ts deleted file mode 100644 index 86399dc6fee..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/test/gapic_document_schema_service_v1.ts +++ /dev/null @@ -1,1263 +0,0 @@ -// Copyright 2026 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 documentschemaserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -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('v1.DocumentSchemaServiceClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'contentwarehouse.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient(); - const universeDomain = client.universeDomain; - assert.strictEqual(universeDomain, "googleapis.com"); - }); - - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - it('throws DeprecationWarning if static servicePath is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const servicePath = documentschemaserviceModule.v1.DocumentSchemaServiceClient.servicePath; - assert.strictEqual(servicePath, 'contentwarehouse.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = documentschemaserviceModule.v1.DocumentSchemaServiceClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'contentwarehouse.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'contentwarehouse.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'contentwarehouse.example.com'); - }); - - if (typeof process === 'object' && 'env' in process) { - describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { - it('sets apiEndpoint from environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'contentwarehouse.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - - it('value configured in code has priority over environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'contentwarehouse.configured.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - }); - } - it('does not allow setting both universeDomain and universe_domain', () => { - assert.throws(() => { new documentschemaserviceModule.v1.DocumentSchemaServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = documentschemaserviceModule.v1.DocumentSchemaServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.documentSchemaServiceStub, undefined); - await client.initialize(); - assert(client.documentSchemaServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.documentSchemaServiceStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.documentSchemaServiceStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ - 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 documentschemaserviceModule.v1.DocumentSchemaServiceClient({ - 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('createDocumentSchema', () => { - it('invokes createDocumentSchema without error', async () => { - const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.DocumentSchema() - ); - client.innerApiCalls.createDocumentSchema = stubSimpleCall(expectedResponse); - const [response] = await client.createDocumentSchema(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createDocumentSchema as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDocumentSchema as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createDocumentSchema without error using callback', async () => { - const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.DocumentSchema() - ); - client.innerApiCalls.createDocumentSchema = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createDocumentSchema( - request, - (err?: Error|null, result?: protos.google.cloud.contentwarehouse.v1.IDocumentSchema|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createDocumentSchema as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDocumentSchema as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createDocumentSchema with error', async () => { - const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createDocumentSchema = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createDocumentSchema(request), expectedError); - const actualRequest = (client.innerApiCalls.createDocumentSchema as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDocumentSchema as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createDocumentSchema with closed client', async () => { - const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.CreateDocumentSchemaRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.createDocumentSchema(request), expectedError); - }); - }); - - describe('updateDocumentSchema', () => { - it('invokes updateDocumentSchema without error', async () => { - const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.DocumentSchema() - ); - client.innerApiCalls.updateDocumentSchema = stubSimpleCall(expectedResponse); - const [response] = await client.updateDocumentSchema(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateDocumentSchema as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDocumentSchema as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateDocumentSchema without error using callback', async () => { - const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.DocumentSchema() - ); - client.innerApiCalls.updateDocumentSchema = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateDocumentSchema( - request, - (err?: Error|null, result?: protos.google.cloud.contentwarehouse.v1.IDocumentSchema|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateDocumentSchema as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDocumentSchema as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateDocumentSchema with error', async () => { - const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateDocumentSchema = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateDocumentSchema(request), expectedError); - const actualRequest = (client.innerApiCalls.updateDocumentSchema as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDocumentSchema as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateDocumentSchema with closed client', async () => { - const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.UpdateDocumentSchemaRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.updateDocumentSchema(request), expectedError); - }); - }); - - describe('getDocumentSchema', () => { - it('invokes getDocumentSchema without error', async () => { - const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.DocumentSchema() - ); - client.innerApiCalls.getDocumentSchema = stubSimpleCall(expectedResponse); - const [response] = await client.getDocumentSchema(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getDocumentSchema as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDocumentSchema as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDocumentSchema without error using callback', async () => { - const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.DocumentSchema() - ); - client.innerApiCalls.getDocumentSchema = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getDocumentSchema( - request, - (err?: Error|null, result?: protos.google.cloud.contentwarehouse.v1.IDocumentSchema|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getDocumentSchema as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDocumentSchema as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDocumentSchema with error', async () => { - const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getDocumentSchema = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getDocumentSchema(request), expectedError); - const actualRequest = (client.innerApiCalls.getDocumentSchema as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDocumentSchema as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDocumentSchema with closed client', async () => { - const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.GetDocumentSchemaRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getDocumentSchema(request), expectedError); - }); - }); - - describe('deleteDocumentSchema', () => { - it('invokes deleteDocumentSchema without error', async () => { - const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteDocumentSchema = stubSimpleCall(expectedResponse); - const [response] = await client.deleteDocumentSchema(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteDocumentSchema as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDocumentSchema as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteDocumentSchema without error using callback', async () => { - const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteDocumentSchema = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteDocumentSchema( - 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); - const actualRequest = (client.innerApiCalls.deleteDocumentSchema as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDocumentSchema as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteDocumentSchema with error', async () => { - const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteDocumentSchema = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteDocumentSchema(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteDocumentSchema as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDocumentSchema as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteDocumentSchema with closed client', async () => { - const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.DeleteDocumentSchemaRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.deleteDocumentSchema(request), expectedError); - }); - }); - - describe('listDocumentSchemas', () => { - it('invokes listDocumentSchemas without error', async () => { - const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.DocumentSchema()), - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.DocumentSchema()), - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.DocumentSchema()), - ]; - client.innerApiCalls.listDocumentSchemas = stubSimpleCall(expectedResponse); - const [response] = await client.listDocumentSchemas(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listDocumentSchemas as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDocumentSchemas as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDocumentSchemas without error using callback', async () => { - const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.DocumentSchema()), - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.DocumentSchema()), - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.DocumentSchema()), - ]; - client.innerApiCalls.listDocumentSchemas = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listDocumentSchemas( - request, - (err?: Error|null, result?: protos.google.cloud.contentwarehouse.v1.IDocumentSchema[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listDocumentSchemas as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDocumentSchemas as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDocumentSchemas with error', async () => { - const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listDocumentSchemas = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listDocumentSchemas(request), expectedError); - const actualRequest = (client.innerApiCalls.listDocumentSchemas as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDocumentSchemas as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDocumentSchemasStream without error', async () => { - const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.DocumentSchema()), - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.DocumentSchema()), - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.DocumentSchema()), - ]; - client.descriptors.page.listDocumentSchemas.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listDocumentSchemasStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.contentwarehouse.v1.DocumentSchema[] = []; - stream.on('data', (response: protos.google.cloud.contentwarehouse.v1.DocumentSchema) => { - 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.listDocumentSchemas.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDocumentSchemas, request)); - assert( - (client.descriptors.page.listDocumentSchemas.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listDocumentSchemasStream with error', async () => { - const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listDocumentSchemas.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listDocumentSchemasStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.contentwarehouse.v1.DocumentSchema[] = []; - stream.on('data', (response: protos.google.cloud.contentwarehouse.v1.DocumentSchema) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listDocumentSchemas.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDocumentSchemas, request)); - assert( - (client.descriptors.page.listDocumentSchemas.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listDocumentSchemas without error', async () => { - const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.DocumentSchema()), - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.DocumentSchema()), - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.DocumentSchema()), - ]; - client.descriptors.page.listDocumentSchemas.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.contentwarehouse.v1.IDocumentSchema[] = []; - const iterable = client.listDocumentSchemasAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listDocumentSchemas.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listDocumentSchemas.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listDocumentSchemas with error', async () => { - const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListDocumentSchemasRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listDocumentSchemas.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listDocumentSchemasAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.contentwarehouse.v1.IDocumentSchema[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listDocumentSchemas.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listDocumentSchemas.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('Path templates', () => { - - describe('documentLink', async () => { - const fakePath = "/rendered/path/documentLink"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - document: "documentValue", - document_link: "documentLinkValue", - }; - const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.documentLinkPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.documentLinkPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('documentLinkPath', () => { - const result = client.documentLinkPath("projectValue", "locationValue", "documentValue", "documentLinkValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.documentLinkPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDocumentLinkName', () => { - const result = client.matchProjectFromDocumentLinkName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.documentLinkPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDocumentLinkName', () => { - const result = client.matchLocationFromDocumentLinkName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.documentLinkPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDocumentFromDocumentLinkName', () => { - const result = client.matchDocumentFromDocumentLinkName(fakePath); - assert.strictEqual(result, "documentValue"); - assert((client.pathTemplates.documentLinkPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDocumentLinkFromDocumentLinkName', () => { - const result = client.matchDocumentLinkFromDocumentLinkName(fakePath); - assert.strictEqual(result, "documentLinkValue"); - assert((client.pathTemplates.documentLinkPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('documentSchema', async () => { - const fakePath = "/rendered/path/documentSchema"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - document_schema: "documentSchemaValue", - }; - const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.documentSchemaPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.documentSchemaPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('documentSchemaPath', () => { - const result = client.documentSchemaPath("projectValue", "locationValue", "documentSchemaValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.documentSchemaPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDocumentSchemaName', () => { - const result = client.matchProjectFromDocumentSchemaName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.documentSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDocumentSchemaName', () => { - const result = client.matchLocationFromDocumentSchemaName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.documentSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDocumentSchemaFromDocumentSchemaName', () => { - const result = client.matchDocumentSchemaFromDocumentSchemaName(fakePath); - assert.strictEqual(result, "documentSchemaValue"); - assert((client.pathTemplates.documentSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', async () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationDocument', async () => { - const fakePath = "/rendered/path/projectLocationDocument"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - document: "documentValue", - }; - const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectLocationDocumentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationDocumentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationDocumentPath', () => { - const result = client.projectLocationDocumentPath("projectValue", "locationValue", "documentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationDocumentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationDocumentName', () => { - const result = client.matchProjectFromProjectLocationDocumentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationDocumentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationDocumentName', () => { - const result = client.matchLocationFromProjectLocationDocumentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationDocumentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDocumentFromProjectLocationDocumentName', () => { - const result = client.matchDocumentFromProjectLocationDocumentName(fakePath); - assert.strictEqual(result, "documentValue"); - assert((client.pathTemplates.projectLocationDocumentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationDocumentsReferenceId', async () => { - const fakePath = "/rendered/path/projectLocationDocumentsReferenceId"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - reference_id: "referenceIdValue", - }; - const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationDocumentsReferenceIdPath', () => { - const result = client.projectLocationDocumentsReferenceIdPath("projectValue", "locationValue", "referenceIdValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationDocumentsReferenceIdName', () => { - const result = client.matchProjectFromProjectLocationDocumentsReferenceIdName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationDocumentsReferenceIdName', () => { - const result = client.matchLocationFromProjectLocationDocumentsReferenceIdName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchReferenceIdFromProjectLocationDocumentsReferenceIdName', () => { - const result = client.matchReferenceIdFromProjectLocationDocumentsReferenceIdName(fakePath); - assert.strictEqual(result, "referenceIdValue"); - assert((client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('ruleSet', async () => { - const fakePath = "/rendered/path/ruleSet"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - rule_set: "ruleSetValue", - }; - const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.ruleSetPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.ruleSetPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('ruleSetPath', () => { - const result = client.ruleSetPath("projectValue", "locationValue", "ruleSetValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.ruleSetPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromRuleSetName', () => { - const result = client.matchProjectFromRuleSetName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.ruleSetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromRuleSetName', () => { - const result = client.matchLocationFromRuleSetName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.ruleSetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRuleSetFromRuleSetName', () => { - const result = client.matchRuleSetFromRuleSetName(fakePath); - assert.strictEqual(result, "ruleSetValue"); - assert((client.pathTemplates.ruleSetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('synonymSet', async () => { - const fakePath = "/rendered/path/synonymSet"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - context: "contextValue", - }; - const client = new documentschemaserviceModule.v1.DocumentSchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.synonymSetPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.synonymSetPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('synonymSetPath', () => { - const result = client.synonymSetPath("projectValue", "locationValue", "contextValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.synonymSetPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSynonymSetName', () => { - const result = client.matchProjectFromSynonymSetName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.synonymSetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSynonymSetName', () => { - const result = client.matchLocationFromSynonymSetName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.synonymSetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchContextFromSynonymSetName', () => { - const result = client.matchContextFromSynonymSetName(fakePath); - assert.strictEqual(result, "contextValue"); - assert((client.pathTemplates.synonymSetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/test/gapic_document_service_v1.ts b/owl-bot-staging/google-cloud-contentwarehouse/test/gapic_document_service_v1.ts deleted file mode 100644 index 57a543ea67c..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/test/gapic_document_service_v1.ts +++ /dev/null @@ -1,1549 +0,0 @@ -// Copyright 2026 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 documentserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -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('v1.DocumentServiceClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new documentserviceModule.v1.DocumentServiceClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'contentwarehouse.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new documentserviceModule.v1.DocumentServiceClient(); - const universeDomain = client.universeDomain; - assert.strictEqual(universeDomain, "googleapis.com"); - }); - - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - it('throws DeprecationWarning if static servicePath is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const servicePath = documentserviceModule.v1.DocumentServiceClient.servicePath; - assert.strictEqual(servicePath, 'contentwarehouse.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = documentserviceModule.v1.DocumentServiceClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'contentwarehouse.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new documentserviceModule.v1.DocumentServiceClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'contentwarehouse.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new documentserviceModule.v1.DocumentServiceClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'contentwarehouse.example.com'); - }); - - if (typeof process === 'object' && 'env' in process) { - describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { - it('sets apiEndpoint from environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new documentserviceModule.v1.DocumentServiceClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'contentwarehouse.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - - it('value configured in code has priority over environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new documentserviceModule.v1.DocumentServiceClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'contentwarehouse.configured.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - }); - } - it('does not allow setting both universeDomain and universe_domain', () => { - assert.throws(() => { new documentserviceModule.v1.DocumentServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = documentserviceModule.v1.DocumentServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new documentserviceModule.v1.DocumentServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new documentserviceModule.v1.DocumentServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new documentserviceModule.v1.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.documentServiceStub, undefined); - await client.initialize(); - assert(client.documentServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new documentserviceModule.v1.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.documentServiceStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new documentserviceModule.v1.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.documentServiceStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new documentserviceModule.v1.DocumentServiceClient({ - 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 documentserviceModule.v1.DocumentServiceClient({ - 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('createDocument', () => { - it('invokes createDocument without error', async () => { - const client = new documentserviceModule.v1.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.CreateDocumentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.CreateDocumentRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.CreateDocumentResponse() - ); - client.innerApiCalls.createDocument = stubSimpleCall(expectedResponse); - const [response] = await client.createDocument(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createDocument as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDocument as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createDocument without error using callback', async () => { - const client = new documentserviceModule.v1.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.CreateDocumentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.CreateDocumentRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.CreateDocumentResponse() - ); - client.innerApiCalls.createDocument = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createDocument( - request, - (err?: Error|null, result?: protos.google.cloud.contentwarehouse.v1.ICreateDocumentResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createDocument as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDocument as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createDocument with error', async () => { - const client = new documentserviceModule.v1.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.CreateDocumentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.CreateDocumentRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createDocument = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createDocument(request), expectedError); - const actualRequest = (client.innerApiCalls.createDocument as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDocument as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createDocument with closed client', async () => { - const client = new documentserviceModule.v1.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.CreateDocumentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.CreateDocumentRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.createDocument(request), expectedError); - }); - }); - - describe('getDocument', () => { - it('invokes getDocument without error', async () => { - const client = new documentserviceModule.v1.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.GetDocumentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.GetDocumentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.Document() - ); - client.innerApiCalls.getDocument = stubSimpleCall(expectedResponse); - const [response] = await client.getDocument(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getDocument as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDocument as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDocument without error using callback', async () => { - const client = new documentserviceModule.v1.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.GetDocumentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.GetDocumentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.Document() - ); - client.innerApiCalls.getDocument = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getDocument( - request, - (err?: Error|null, result?: protos.google.cloud.contentwarehouse.v1.IDocument|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getDocument as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDocument as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDocument with error', async () => { - const client = new documentserviceModule.v1.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.GetDocumentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.GetDocumentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getDocument = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getDocument(request), expectedError); - const actualRequest = (client.innerApiCalls.getDocument as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDocument as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDocument with closed client', async () => { - const client = new documentserviceModule.v1.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.GetDocumentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.GetDocumentRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getDocument(request), expectedError); - }); - }); - - describe('updateDocument', () => { - it('invokes updateDocument without error', async () => { - const client = new documentserviceModule.v1.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.UpdateDocumentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.UpdateDocumentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.UpdateDocumentResponse() - ); - client.innerApiCalls.updateDocument = stubSimpleCall(expectedResponse); - const [response] = await client.updateDocument(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateDocument as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDocument as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateDocument without error using callback', async () => { - const client = new documentserviceModule.v1.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.UpdateDocumentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.UpdateDocumentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.UpdateDocumentResponse() - ); - client.innerApiCalls.updateDocument = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateDocument( - request, - (err?: Error|null, result?: protos.google.cloud.contentwarehouse.v1.IUpdateDocumentResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateDocument as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDocument as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateDocument with error', async () => { - const client = new documentserviceModule.v1.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.UpdateDocumentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.UpdateDocumentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateDocument = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateDocument(request), expectedError); - const actualRequest = (client.innerApiCalls.updateDocument as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDocument as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateDocument with closed client', async () => { - const client = new documentserviceModule.v1.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.UpdateDocumentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.UpdateDocumentRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.updateDocument(request), expectedError); - }); - }); - - describe('deleteDocument', () => { - it('invokes deleteDocument without error', async () => { - const client = new documentserviceModule.v1.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.DeleteDocumentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.DeleteDocumentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteDocument = stubSimpleCall(expectedResponse); - const [response] = await client.deleteDocument(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteDocument as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDocument as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteDocument without error using callback', async () => { - const client = new documentserviceModule.v1.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.DeleteDocumentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.DeleteDocumentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteDocument = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteDocument( - 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); - const actualRequest = (client.innerApiCalls.deleteDocument as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDocument as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteDocument with error', async () => { - const client = new documentserviceModule.v1.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.DeleteDocumentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.DeleteDocumentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteDocument = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteDocument(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteDocument as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDocument as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteDocument with closed client', async () => { - const client = new documentserviceModule.v1.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.DeleteDocumentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.DeleteDocumentRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.deleteDocument(request), expectedError); - }); - }); - - describe('lockDocument', () => { - it('invokes lockDocument without error', async () => { - const client = new documentserviceModule.v1.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.LockDocumentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.LockDocumentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.Document() - ); - client.innerApiCalls.lockDocument = stubSimpleCall(expectedResponse); - const [response] = await client.lockDocument(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.lockDocument as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.lockDocument as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes lockDocument without error using callback', async () => { - const client = new documentserviceModule.v1.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.LockDocumentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.LockDocumentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.Document() - ); - client.innerApiCalls.lockDocument = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.lockDocument( - request, - (err?: Error|null, result?: protos.google.cloud.contentwarehouse.v1.IDocument|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.lockDocument as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.lockDocument as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes lockDocument with error', async () => { - const client = new documentserviceModule.v1.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.LockDocumentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.LockDocumentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.lockDocument = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.lockDocument(request), expectedError); - const actualRequest = (client.innerApiCalls.lockDocument as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.lockDocument as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes lockDocument with closed client', async () => { - const client = new documentserviceModule.v1.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.LockDocumentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.LockDocumentRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.lockDocument(request), expectedError); - }); - }); - - describe('fetchAcl', () => { - it('invokes fetchAcl without error', async () => { - const client = new documentserviceModule.v1.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.FetchAclRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.FetchAclRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.FetchAclResponse() - ); - client.innerApiCalls.fetchAcl = stubSimpleCall(expectedResponse); - const [response] = await client.fetchAcl(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.fetchAcl as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.fetchAcl as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes fetchAcl without error using callback', async () => { - const client = new documentserviceModule.v1.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.FetchAclRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.FetchAclRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.FetchAclResponse() - ); - client.innerApiCalls.fetchAcl = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.fetchAcl( - request, - (err?: Error|null, result?: protos.google.cloud.contentwarehouse.v1.IFetchAclResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.fetchAcl as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.fetchAcl as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes fetchAcl with error', async () => { - const client = new documentserviceModule.v1.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.FetchAclRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.FetchAclRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.fetchAcl = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.fetchAcl(request), expectedError); - const actualRequest = (client.innerApiCalls.fetchAcl as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.fetchAcl as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes fetchAcl with closed client', async () => { - const client = new documentserviceModule.v1.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.FetchAclRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.FetchAclRequest', ['resource']); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.fetchAcl(request), expectedError); - }); - }); - - describe('setAcl', () => { - it('invokes setAcl without error', async () => { - const client = new documentserviceModule.v1.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.SetAclRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.SetAclRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.SetAclResponse() - ); - client.innerApiCalls.setAcl = stubSimpleCall(expectedResponse); - const [response] = await client.setAcl(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setAcl as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setAcl as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setAcl without error using callback', async () => { - const client = new documentserviceModule.v1.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.SetAclRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.SetAclRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.SetAclResponse() - ); - client.innerApiCalls.setAcl = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setAcl( - request, - (err?: Error|null, result?: protos.google.cloud.contentwarehouse.v1.ISetAclResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setAcl as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setAcl as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setAcl with error', async () => { - const client = new documentserviceModule.v1.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.SetAclRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.SetAclRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.setAcl = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setAcl(request), expectedError); - const actualRequest = (client.innerApiCalls.setAcl as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setAcl as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setAcl with closed client', async () => { - const client = new documentserviceModule.v1.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.SetAclRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.SetAclRequest', ['resource']); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.setAcl(request), expectedError); - }); - }); - - describe('searchDocuments', () => { - it('invokes searchDocuments without error', async () => { - const client = new documentserviceModule.v1.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.SearchDocumentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.SearchDocumentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument()), - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument()), - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument()), - ]; - client.innerApiCalls.searchDocuments = stubSimpleCall(expectedResponse); - const [response] = await client.searchDocuments(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.searchDocuments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.searchDocuments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes searchDocuments without error using callback', async () => { - const client = new documentserviceModule.v1.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.SearchDocumentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.SearchDocumentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument()), - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument()), - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument()), - ]; - client.innerApiCalls.searchDocuments = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.searchDocuments( - request, - (err?: Error|null, result?: protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.IMatchingDocument[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.searchDocuments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.searchDocuments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes searchDocuments with error', async () => { - const client = new documentserviceModule.v1.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.SearchDocumentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.SearchDocumentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.searchDocuments = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.searchDocuments(request), expectedError); - const actualRequest = (client.innerApiCalls.searchDocuments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.searchDocuments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes searchDocumentsStream without error', async () => { - const client = new documentserviceModule.v1.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.SearchDocumentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.SearchDocumentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument()), - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument()), - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument()), - ]; - client.descriptors.page.searchDocuments.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.searchDocumentsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument[] = []; - stream.on('data', (response: protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument) => { - 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.searchDocuments.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.searchDocuments, request)); - assert( - (client.descriptors.page.searchDocuments.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes searchDocumentsStream with error', async () => { - const client = new documentserviceModule.v1.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.SearchDocumentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.SearchDocumentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.searchDocuments.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.searchDocumentsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument[] = []; - stream.on('data', (response: protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.searchDocuments.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.searchDocuments, request)); - assert( - (client.descriptors.page.searchDocuments.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with searchDocuments without error', async () => { - const client = new documentserviceModule.v1.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.SearchDocumentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.SearchDocumentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument()), - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument()), - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.MatchingDocument()), - ]; - client.descriptors.page.searchDocuments.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.IMatchingDocument[] = []; - const iterable = client.searchDocumentsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.searchDocuments.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.searchDocuments.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with searchDocuments with error', async () => { - const client = new documentserviceModule.v1.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.SearchDocumentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.SearchDocumentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.searchDocuments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.searchDocumentsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.contentwarehouse.v1.SearchDocumentsResponse.IMatchingDocument[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.searchDocuments.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.searchDocuments.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('Path templates', () => { - - describe('documentLink', async () => { - const fakePath = "/rendered/path/documentLink"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - document: "documentValue", - document_link: "documentLinkValue", - }; - const client = new documentserviceModule.v1.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.documentLinkPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.documentLinkPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('documentLinkPath', () => { - const result = client.documentLinkPath("projectValue", "locationValue", "documentValue", "documentLinkValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.documentLinkPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDocumentLinkName', () => { - const result = client.matchProjectFromDocumentLinkName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.documentLinkPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDocumentLinkName', () => { - const result = client.matchLocationFromDocumentLinkName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.documentLinkPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDocumentFromDocumentLinkName', () => { - const result = client.matchDocumentFromDocumentLinkName(fakePath); - assert.strictEqual(result, "documentValue"); - assert((client.pathTemplates.documentLinkPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDocumentLinkFromDocumentLinkName', () => { - const result = client.matchDocumentLinkFromDocumentLinkName(fakePath); - assert.strictEqual(result, "documentLinkValue"); - assert((client.pathTemplates.documentLinkPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('documentSchema', async () => { - const fakePath = "/rendered/path/documentSchema"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - document_schema: "documentSchemaValue", - }; - const client = new documentserviceModule.v1.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.documentSchemaPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.documentSchemaPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('documentSchemaPath', () => { - const result = client.documentSchemaPath("projectValue", "locationValue", "documentSchemaValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.documentSchemaPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDocumentSchemaName', () => { - const result = client.matchProjectFromDocumentSchemaName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.documentSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDocumentSchemaName', () => { - const result = client.matchLocationFromDocumentSchemaName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.documentSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDocumentSchemaFromDocumentSchemaName', () => { - const result = client.matchDocumentSchemaFromDocumentSchemaName(fakePath); - assert.strictEqual(result, "documentSchemaValue"); - assert((client.pathTemplates.documentSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationDocument', async () => { - const fakePath = "/rendered/path/projectLocationDocument"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - document: "documentValue", - }; - const client = new documentserviceModule.v1.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectLocationDocumentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationDocumentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationDocumentPath', () => { - const result = client.projectLocationDocumentPath("projectValue", "locationValue", "documentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationDocumentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationDocumentName', () => { - const result = client.matchProjectFromProjectLocationDocumentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationDocumentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationDocumentName', () => { - const result = client.matchLocationFromProjectLocationDocumentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationDocumentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDocumentFromProjectLocationDocumentName', () => { - const result = client.matchDocumentFromProjectLocationDocumentName(fakePath); - assert.strictEqual(result, "documentValue"); - assert((client.pathTemplates.projectLocationDocumentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationDocumentsReferenceId', async () => { - const fakePath = "/rendered/path/projectLocationDocumentsReferenceId"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - reference_id: "referenceIdValue", - }; - const client = new documentserviceModule.v1.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationDocumentsReferenceIdPath', () => { - const result = client.projectLocationDocumentsReferenceIdPath("projectValue", "locationValue", "referenceIdValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationDocumentsReferenceIdName', () => { - const result = client.matchProjectFromProjectLocationDocumentsReferenceIdName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationDocumentsReferenceIdName', () => { - const result = client.matchLocationFromProjectLocationDocumentsReferenceIdName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchReferenceIdFromProjectLocationDocumentsReferenceIdName', () => { - const result = client.matchReferenceIdFromProjectLocationDocumentsReferenceIdName(fakePath); - assert.strictEqual(result, "referenceIdValue"); - assert((client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('ruleSet', async () => { - const fakePath = "/rendered/path/ruleSet"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - rule_set: "ruleSetValue", - }; - const client = new documentserviceModule.v1.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.ruleSetPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.ruleSetPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('ruleSetPath', () => { - const result = client.ruleSetPath("projectValue", "locationValue", "ruleSetValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.ruleSetPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromRuleSetName', () => { - const result = client.matchProjectFromRuleSetName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.ruleSetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromRuleSetName', () => { - const result = client.matchLocationFromRuleSetName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.ruleSetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRuleSetFromRuleSetName', () => { - const result = client.matchRuleSetFromRuleSetName(fakePath); - assert.strictEqual(result, "ruleSetValue"); - assert((client.pathTemplates.ruleSetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('synonymSet', async () => { - const fakePath = "/rendered/path/synonymSet"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - context: "contextValue", - }; - const client = new documentserviceModule.v1.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.synonymSetPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.synonymSetPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('synonymSetPath', () => { - const result = client.synonymSetPath("projectValue", "locationValue", "contextValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.synonymSetPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSynonymSetName', () => { - const result = client.matchProjectFromSynonymSetName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.synonymSetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSynonymSetName', () => { - const result = client.matchLocationFromSynonymSetName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.synonymSetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchContextFromSynonymSetName', () => { - const result = client.matchContextFromSynonymSetName(fakePath); - assert.strictEqual(result, "contextValue"); - assert((client.pathTemplates.synonymSetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/test/gapic_pipeline_service_v1.ts b/owl-bot-staging/google-cloud-contentwarehouse/test/gapic_pipeline_service_v1.ts deleted file mode 100644 index f1f22085ea9..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/test/gapic_pipeline_service_v1.ts +++ /dev/null @@ -1,980 +0,0 @@ -// Copyright 2026 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 pipelineserviceModule from '../src'; - -import {protobuf, LROperation, operationsProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -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 stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); -} - -function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); -} - -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('v1.PipelineServiceClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'contentwarehouse.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient(); - const universeDomain = client.universeDomain; - assert.strictEqual(universeDomain, "googleapis.com"); - }); - - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - it('throws DeprecationWarning if static servicePath is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const servicePath = pipelineserviceModule.v1.PipelineServiceClient.servicePath; - assert.strictEqual(servicePath, 'contentwarehouse.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = pipelineserviceModule.v1.PipelineServiceClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'contentwarehouse.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'contentwarehouse.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'contentwarehouse.example.com'); - }); - - if (typeof process === 'object' && 'env' in process) { - describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { - it('sets apiEndpoint from environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new pipelineserviceModule.v1.PipelineServiceClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'contentwarehouse.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - - it('value configured in code has priority over environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new pipelineserviceModule.v1.PipelineServiceClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'contentwarehouse.configured.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - }); - } - it('does not allow setting both universeDomain and universe_domain', () => { - assert.throws(() => { new pipelineserviceModule.v1.PipelineServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = pipelineserviceModule.v1.PipelineServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.pipelineServiceStub, undefined); - await client.initialize(); - assert(client.pipelineServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.pipelineServiceStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.pipelineServiceStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - 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 pipelineserviceModule.v1.PipelineServiceClient({ - 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('runPipeline', () => { - it('invokes runPipeline without error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.RunPipelineRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.RunPipelineRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.runPipeline = stubLongRunningCall(expectedResponse); - const [operation] = await client.runPipeline(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.runPipeline as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.runPipeline as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes runPipeline without error using callback', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.RunPipelineRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.RunPipelineRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.runPipeline = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.runPipeline( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.runPipeline as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.runPipeline as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes runPipeline with call error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.RunPipelineRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.RunPipelineRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.runPipeline = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.runPipeline(request), expectedError); - const actualRequest = (client.innerApiCalls.runPipeline as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.runPipeline as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes runPipeline with LRO error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.RunPipelineRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.RunPipelineRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.runPipeline = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.runPipeline(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.runPipeline as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.runPipeline as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkRunPipelineProgress without error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkRunPipelineProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkRunPipelineProgress with error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkRunPipelineProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.getOperation(request)}, expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('deleteOperation', () => { - it('invokes deleteOperation without error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('listOperationsAsync', () => { - it('uses async iteration with listOperations without error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.IOperation[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.IOperation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - describe('Path templates', () => { - - describe('documentLink', async () => { - const fakePath = "/rendered/path/documentLink"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - document: "documentValue", - document_link: "documentLinkValue", - }; - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.documentLinkPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.documentLinkPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('documentLinkPath', () => { - const result = client.documentLinkPath("projectValue", "locationValue", "documentValue", "documentLinkValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.documentLinkPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDocumentLinkName', () => { - const result = client.matchProjectFromDocumentLinkName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.documentLinkPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDocumentLinkName', () => { - const result = client.matchLocationFromDocumentLinkName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.documentLinkPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDocumentFromDocumentLinkName', () => { - const result = client.matchDocumentFromDocumentLinkName(fakePath); - assert.strictEqual(result, "documentValue"); - assert((client.pathTemplates.documentLinkPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDocumentLinkFromDocumentLinkName', () => { - const result = client.matchDocumentLinkFromDocumentLinkName(fakePath); - assert.strictEqual(result, "documentLinkValue"); - assert((client.pathTemplates.documentLinkPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('documentSchema', async () => { - const fakePath = "/rendered/path/documentSchema"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - document_schema: "documentSchemaValue", - }; - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.documentSchemaPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.documentSchemaPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('documentSchemaPath', () => { - const result = client.documentSchemaPath("projectValue", "locationValue", "documentSchemaValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.documentSchemaPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDocumentSchemaName', () => { - const result = client.matchProjectFromDocumentSchemaName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.documentSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDocumentSchemaName', () => { - const result = client.matchLocationFromDocumentSchemaName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.documentSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDocumentSchemaFromDocumentSchemaName', () => { - const result = client.matchDocumentSchemaFromDocumentSchemaName(fakePath); - assert.strictEqual(result, "documentSchemaValue"); - assert((client.pathTemplates.documentSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', async () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationDocument', async () => { - const fakePath = "/rendered/path/projectLocationDocument"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - document: "documentValue", - }; - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectLocationDocumentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationDocumentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationDocumentPath', () => { - const result = client.projectLocationDocumentPath("projectValue", "locationValue", "documentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationDocumentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationDocumentName', () => { - const result = client.matchProjectFromProjectLocationDocumentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationDocumentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationDocumentName', () => { - const result = client.matchLocationFromProjectLocationDocumentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationDocumentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDocumentFromProjectLocationDocumentName', () => { - const result = client.matchDocumentFromProjectLocationDocumentName(fakePath); - assert.strictEqual(result, "documentValue"); - assert((client.pathTemplates.projectLocationDocumentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationDocumentsReferenceId', async () => { - const fakePath = "/rendered/path/projectLocationDocumentsReferenceId"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - reference_id: "referenceIdValue", - }; - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationDocumentsReferenceIdPath', () => { - const result = client.projectLocationDocumentsReferenceIdPath("projectValue", "locationValue", "referenceIdValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationDocumentsReferenceIdName', () => { - const result = client.matchProjectFromProjectLocationDocumentsReferenceIdName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationDocumentsReferenceIdName', () => { - const result = client.matchLocationFromProjectLocationDocumentsReferenceIdName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchReferenceIdFromProjectLocationDocumentsReferenceIdName', () => { - const result = client.matchReferenceIdFromProjectLocationDocumentsReferenceIdName(fakePath); - assert.strictEqual(result, "referenceIdValue"); - assert((client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('ruleSet', async () => { - const fakePath = "/rendered/path/ruleSet"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - rule_set: "ruleSetValue", - }; - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.ruleSetPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.ruleSetPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('ruleSetPath', () => { - const result = client.ruleSetPath("projectValue", "locationValue", "ruleSetValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.ruleSetPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromRuleSetName', () => { - const result = client.matchProjectFromRuleSetName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.ruleSetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromRuleSetName', () => { - const result = client.matchLocationFromRuleSetName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.ruleSetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRuleSetFromRuleSetName', () => { - const result = client.matchRuleSetFromRuleSetName(fakePath); - assert.strictEqual(result, "ruleSetValue"); - assert((client.pathTemplates.ruleSetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('synonymSet', async () => { - const fakePath = "/rendered/path/synonymSet"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - context: "contextValue", - }; - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.synonymSetPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.synonymSetPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('synonymSetPath', () => { - const result = client.synonymSetPath("projectValue", "locationValue", "contextValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.synonymSetPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSynonymSetName', () => { - const result = client.matchProjectFromSynonymSetName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.synonymSetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSynonymSetName', () => { - const result = client.matchLocationFromSynonymSetName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.synonymSetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchContextFromSynonymSetName', () => { - const result = client.matchContextFromSynonymSetName(fakePath); - assert.strictEqual(result, "contextValue"); - assert((client.pathTemplates.synonymSetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/test/gapic_rule_set_service_v1.ts b/owl-bot-staging/google-cloud-contentwarehouse/test/gapic_rule_set_service_v1.ts deleted file mode 100644 index 229257a6fcb..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/test/gapic_rule_set_service_v1.ts +++ /dev/null @@ -1,1225 +0,0 @@ -// Copyright 2026 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 rulesetserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -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('v1.RuleSetServiceClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new rulesetserviceModule.v1.RuleSetServiceClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'contentwarehouse.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new rulesetserviceModule.v1.RuleSetServiceClient(); - const universeDomain = client.universeDomain; - assert.strictEqual(universeDomain, "googleapis.com"); - }); - - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - it('throws DeprecationWarning if static servicePath is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const servicePath = rulesetserviceModule.v1.RuleSetServiceClient.servicePath; - assert.strictEqual(servicePath, 'contentwarehouse.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = rulesetserviceModule.v1.RuleSetServiceClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'contentwarehouse.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new rulesetserviceModule.v1.RuleSetServiceClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'contentwarehouse.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new rulesetserviceModule.v1.RuleSetServiceClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'contentwarehouse.example.com'); - }); - - if (typeof process === 'object' && 'env' in process) { - describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { - it('sets apiEndpoint from environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new rulesetserviceModule.v1.RuleSetServiceClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'contentwarehouse.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - - it('value configured in code has priority over environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new rulesetserviceModule.v1.RuleSetServiceClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'contentwarehouse.configured.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - }); - } - it('does not allow setting both universeDomain and universe_domain', () => { - assert.throws(() => { new rulesetserviceModule.v1.RuleSetServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = rulesetserviceModule.v1.RuleSetServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new rulesetserviceModule.v1.RuleSetServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new rulesetserviceModule.v1.RuleSetServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new rulesetserviceModule.v1.RuleSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.ruleSetServiceStub, undefined); - await client.initialize(); - assert(client.ruleSetServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new rulesetserviceModule.v1.RuleSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.ruleSetServiceStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new rulesetserviceModule.v1.RuleSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.ruleSetServiceStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new rulesetserviceModule.v1.RuleSetServiceClient({ - 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 rulesetserviceModule.v1.RuleSetServiceClient({ - 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('createRuleSet', () => { - it('invokes createRuleSet without error', async () => { - const client = new rulesetserviceModule.v1.RuleSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.CreateRuleSetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.CreateRuleSetRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.RuleSet() - ); - client.innerApiCalls.createRuleSet = stubSimpleCall(expectedResponse); - const [response] = await client.createRuleSet(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createRuleSet as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createRuleSet as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createRuleSet without error using callback', async () => { - const client = new rulesetserviceModule.v1.RuleSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.CreateRuleSetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.CreateRuleSetRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.RuleSet() - ); - client.innerApiCalls.createRuleSet = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createRuleSet( - request, - (err?: Error|null, result?: protos.google.cloud.contentwarehouse.v1.IRuleSet|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createRuleSet as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createRuleSet as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createRuleSet with error', async () => { - const client = new rulesetserviceModule.v1.RuleSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.CreateRuleSetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.CreateRuleSetRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createRuleSet = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createRuleSet(request), expectedError); - const actualRequest = (client.innerApiCalls.createRuleSet as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createRuleSet as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createRuleSet with closed client', async () => { - const client = new rulesetserviceModule.v1.RuleSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.CreateRuleSetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.CreateRuleSetRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.createRuleSet(request), expectedError); - }); - }); - - describe('getRuleSet', () => { - it('invokes getRuleSet without error', async () => { - const client = new rulesetserviceModule.v1.RuleSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.GetRuleSetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.GetRuleSetRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.RuleSet() - ); - client.innerApiCalls.getRuleSet = stubSimpleCall(expectedResponse); - const [response] = await client.getRuleSet(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getRuleSet as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getRuleSet as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getRuleSet without error using callback', async () => { - const client = new rulesetserviceModule.v1.RuleSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.GetRuleSetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.GetRuleSetRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.RuleSet() - ); - client.innerApiCalls.getRuleSet = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getRuleSet( - request, - (err?: Error|null, result?: protos.google.cloud.contentwarehouse.v1.IRuleSet|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getRuleSet as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getRuleSet as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getRuleSet with error', async () => { - const client = new rulesetserviceModule.v1.RuleSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.GetRuleSetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.GetRuleSetRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getRuleSet = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getRuleSet(request), expectedError); - const actualRequest = (client.innerApiCalls.getRuleSet as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getRuleSet as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getRuleSet with closed client', async () => { - const client = new rulesetserviceModule.v1.RuleSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.GetRuleSetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.GetRuleSetRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getRuleSet(request), expectedError); - }); - }); - - describe('updateRuleSet', () => { - it('invokes updateRuleSet without error', async () => { - const client = new rulesetserviceModule.v1.RuleSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.RuleSet() - ); - client.innerApiCalls.updateRuleSet = stubSimpleCall(expectedResponse); - const [response] = await client.updateRuleSet(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateRuleSet as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateRuleSet as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateRuleSet without error using callback', async () => { - const client = new rulesetserviceModule.v1.RuleSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.RuleSet() - ); - client.innerApiCalls.updateRuleSet = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateRuleSet( - request, - (err?: Error|null, result?: protos.google.cloud.contentwarehouse.v1.IRuleSet|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateRuleSet as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateRuleSet as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateRuleSet with error', async () => { - const client = new rulesetserviceModule.v1.RuleSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateRuleSet = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateRuleSet(request), expectedError); - const actualRequest = (client.innerApiCalls.updateRuleSet as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateRuleSet as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateRuleSet with closed client', async () => { - const client = new rulesetserviceModule.v1.RuleSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.UpdateRuleSetRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.updateRuleSet(request), expectedError); - }); - }); - - describe('deleteRuleSet', () => { - it('invokes deleteRuleSet without error', async () => { - const client = new rulesetserviceModule.v1.RuleSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteRuleSet = stubSimpleCall(expectedResponse); - const [response] = await client.deleteRuleSet(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteRuleSet as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteRuleSet as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteRuleSet without error using callback', async () => { - const client = new rulesetserviceModule.v1.RuleSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteRuleSet = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteRuleSet( - 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); - const actualRequest = (client.innerApiCalls.deleteRuleSet as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteRuleSet as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteRuleSet with error', async () => { - const client = new rulesetserviceModule.v1.RuleSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteRuleSet = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteRuleSet(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteRuleSet as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteRuleSet as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteRuleSet with closed client', async () => { - const client = new rulesetserviceModule.v1.RuleSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.DeleteRuleSetRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.deleteRuleSet(request), expectedError); - }); - }); - - describe('listRuleSets', () => { - it('invokes listRuleSets without error', async () => { - const client = new rulesetserviceModule.v1.RuleSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.ListRuleSetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListRuleSetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.RuleSet()), - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.RuleSet()), - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.RuleSet()), - ]; - client.innerApiCalls.listRuleSets = stubSimpleCall(expectedResponse); - const [response] = await client.listRuleSets(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listRuleSets as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listRuleSets as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listRuleSets without error using callback', async () => { - const client = new rulesetserviceModule.v1.RuleSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.ListRuleSetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListRuleSetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.RuleSet()), - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.RuleSet()), - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.RuleSet()), - ]; - client.innerApiCalls.listRuleSets = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listRuleSets( - request, - (err?: Error|null, result?: protos.google.cloud.contentwarehouse.v1.IRuleSet[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listRuleSets as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listRuleSets as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listRuleSets with error', async () => { - const client = new rulesetserviceModule.v1.RuleSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.ListRuleSetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListRuleSetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listRuleSets = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listRuleSets(request), expectedError); - const actualRequest = (client.innerApiCalls.listRuleSets as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listRuleSets as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listRuleSetsStream without error', async () => { - const client = new rulesetserviceModule.v1.RuleSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.ListRuleSetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListRuleSetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.RuleSet()), - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.RuleSet()), - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.RuleSet()), - ]; - client.descriptors.page.listRuleSets.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listRuleSetsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.contentwarehouse.v1.RuleSet[] = []; - stream.on('data', (response: protos.google.cloud.contentwarehouse.v1.RuleSet) => { - 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.listRuleSets.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listRuleSets, request)); - assert( - (client.descriptors.page.listRuleSets.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listRuleSetsStream with error', async () => { - const client = new rulesetserviceModule.v1.RuleSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.ListRuleSetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListRuleSetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listRuleSets.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listRuleSetsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.contentwarehouse.v1.RuleSet[] = []; - stream.on('data', (response: protos.google.cloud.contentwarehouse.v1.RuleSet) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listRuleSets.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listRuleSets, request)); - assert( - (client.descriptors.page.listRuleSets.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listRuleSets without error', async () => { - const client = new rulesetserviceModule.v1.RuleSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.ListRuleSetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListRuleSetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.RuleSet()), - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.RuleSet()), - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.RuleSet()), - ]; - client.descriptors.page.listRuleSets.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.contentwarehouse.v1.IRuleSet[] = []; - const iterable = client.listRuleSetsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listRuleSets.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listRuleSets.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listRuleSets with error', async () => { - const client = new rulesetserviceModule.v1.RuleSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.ListRuleSetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListRuleSetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listRuleSets.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listRuleSetsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.contentwarehouse.v1.IRuleSet[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listRuleSets.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listRuleSets.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('Path templates', () => { - - describe('documentLink', async () => { - const fakePath = "/rendered/path/documentLink"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - document: "documentValue", - document_link: "documentLinkValue", - }; - const client = new rulesetserviceModule.v1.RuleSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.documentLinkPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.documentLinkPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('documentLinkPath', () => { - const result = client.documentLinkPath("projectValue", "locationValue", "documentValue", "documentLinkValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.documentLinkPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDocumentLinkName', () => { - const result = client.matchProjectFromDocumentLinkName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.documentLinkPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDocumentLinkName', () => { - const result = client.matchLocationFromDocumentLinkName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.documentLinkPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDocumentFromDocumentLinkName', () => { - const result = client.matchDocumentFromDocumentLinkName(fakePath); - assert.strictEqual(result, "documentValue"); - assert((client.pathTemplates.documentLinkPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDocumentLinkFromDocumentLinkName', () => { - const result = client.matchDocumentLinkFromDocumentLinkName(fakePath); - assert.strictEqual(result, "documentLinkValue"); - assert((client.pathTemplates.documentLinkPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('documentSchema', async () => { - const fakePath = "/rendered/path/documentSchema"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - document_schema: "documentSchemaValue", - }; - const client = new rulesetserviceModule.v1.RuleSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.documentSchemaPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.documentSchemaPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('documentSchemaPath', () => { - const result = client.documentSchemaPath("projectValue", "locationValue", "documentSchemaValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.documentSchemaPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDocumentSchemaName', () => { - const result = client.matchProjectFromDocumentSchemaName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.documentSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDocumentSchemaName', () => { - const result = client.matchLocationFromDocumentSchemaName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.documentSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDocumentSchemaFromDocumentSchemaName', () => { - const result = client.matchDocumentSchemaFromDocumentSchemaName(fakePath); - assert.strictEqual(result, "documentSchemaValue"); - assert((client.pathTemplates.documentSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationDocument', async () => { - const fakePath = "/rendered/path/projectLocationDocument"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - document: "documentValue", - }; - const client = new rulesetserviceModule.v1.RuleSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectLocationDocumentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationDocumentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationDocumentPath', () => { - const result = client.projectLocationDocumentPath("projectValue", "locationValue", "documentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationDocumentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationDocumentName', () => { - const result = client.matchProjectFromProjectLocationDocumentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationDocumentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationDocumentName', () => { - const result = client.matchLocationFromProjectLocationDocumentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationDocumentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDocumentFromProjectLocationDocumentName', () => { - const result = client.matchDocumentFromProjectLocationDocumentName(fakePath); - assert.strictEqual(result, "documentValue"); - assert((client.pathTemplates.projectLocationDocumentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationDocumentsReferenceId', async () => { - const fakePath = "/rendered/path/projectLocationDocumentsReferenceId"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - reference_id: "referenceIdValue", - }; - const client = new rulesetserviceModule.v1.RuleSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationDocumentsReferenceIdPath', () => { - const result = client.projectLocationDocumentsReferenceIdPath("projectValue", "locationValue", "referenceIdValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationDocumentsReferenceIdName', () => { - const result = client.matchProjectFromProjectLocationDocumentsReferenceIdName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationDocumentsReferenceIdName', () => { - const result = client.matchLocationFromProjectLocationDocumentsReferenceIdName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchReferenceIdFromProjectLocationDocumentsReferenceIdName', () => { - const result = client.matchReferenceIdFromProjectLocationDocumentsReferenceIdName(fakePath); - assert.strictEqual(result, "referenceIdValue"); - assert((client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('ruleSet', async () => { - const fakePath = "/rendered/path/ruleSet"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - rule_set: "ruleSetValue", - }; - const client = new rulesetserviceModule.v1.RuleSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.ruleSetPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.ruleSetPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('ruleSetPath', () => { - const result = client.ruleSetPath("projectValue", "locationValue", "ruleSetValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.ruleSetPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromRuleSetName', () => { - const result = client.matchProjectFromRuleSetName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.ruleSetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromRuleSetName', () => { - const result = client.matchLocationFromRuleSetName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.ruleSetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRuleSetFromRuleSetName', () => { - const result = client.matchRuleSetFromRuleSetName(fakePath); - assert.strictEqual(result, "ruleSetValue"); - assert((client.pathTemplates.ruleSetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('synonymSet', async () => { - const fakePath = "/rendered/path/synonymSet"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - context: "contextValue", - }; - const client = new rulesetserviceModule.v1.RuleSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.synonymSetPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.synonymSetPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('synonymSetPath', () => { - const result = client.synonymSetPath("projectValue", "locationValue", "contextValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.synonymSetPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSynonymSetName', () => { - const result = client.matchProjectFromSynonymSetName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.synonymSetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSynonymSetName', () => { - const result = client.matchLocationFromSynonymSetName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.synonymSetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchContextFromSynonymSetName', () => { - const result = client.matchContextFromSynonymSetName(fakePath); - assert.strictEqual(result, "contextValue"); - assert((client.pathTemplates.synonymSetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/test/gapic_synonym_set_service_v1.ts b/owl-bot-staging/google-cloud-contentwarehouse/test/gapic_synonym_set_service_v1.ts deleted file mode 100644 index 13786d043fb..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/test/gapic_synonym_set_service_v1.ts +++ /dev/null @@ -1,1225 +0,0 @@ -// Copyright 2026 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 synonymsetserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -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('v1.SynonymSetServiceClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new synonymsetserviceModule.v1.SynonymSetServiceClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'contentwarehouse.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new synonymsetserviceModule.v1.SynonymSetServiceClient(); - const universeDomain = client.universeDomain; - assert.strictEqual(universeDomain, "googleapis.com"); - }); - - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - it('throws DeprecationWarning if static servicePath is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const servicePath = synonymsetserviceModule.v1.SynonymSetServiceClient.servicePath; - assert.strictEqual(servicePath, 'contentwarehouse.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = synonymsetserviceModule.v1.SynonymSetServiceClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'contentwarehouse.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'contentwarehouse.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'contentwarehouse.example.com'); - }); - - if (typeof process === 'object' && 'env' in process) { - describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { - it('sets apiEndpoint from environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new synonymsetserviceModule.v1.SynonymSetServiceClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'contentwarehouse.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - - it('value configured in code has priority over environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'contentwarehouse.configured.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - }); - } - it('does not allow setting both universeDomain and universe_domain', () => { - assert.throws(() => { new synonymsetserviceModule.v1.SynonymSetServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = synonymsetserviceModule.v1.SynonymSetServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new synonymsetserviceModule.v1.SynonymSetServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.synonymSetServiceStub, undefined); - await client.initialize(); - assert(client.synonymSetServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.synonymSetServiceStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.synonymSetServiceStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ - 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 synonymsetserviceModule.v1.SynonymSetServiceClient({ - 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('createSynonymSet', () => { - it('invokes createSynonymSet without error', async () => { - const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.SynonymSet() - ); - client.innerApiCalls.createSynonymSet = stubSimpleCall(expectedResponse); - const [response] = await client.createSynonymSet(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createSynonymSet as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSynonymSet as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSynonymSet without error using callback', async () => { - const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.SynonymSet() - ); - client.innerApiCalls.createSynonymSet = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createSynonymSet( - request, - (err?: Error|null, result?: protos.google.cloud.contentwarehouse.v1.ISynonymSet|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createSynonymSet as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSynonymSet as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSynonymSet with error', async () => { - const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createSynonymSet = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createSynonymSet(request), expectedError); - const actualRequest = (client.innerApiCalls.createSynonymSet as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSynonymSet as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSynonymSet with closed client', async () => { - const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.CreateSynonymSetRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.createSynonymSet(request), expectedError); - }); - }); - - describe('getSynonymSet', () => { - it('invokes getSynonymSet without error', async () => { - const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.GetSynonymSetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.GetSynonymSetRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.SynonymSet() - ); - client.innerApiCalls.getSynonymSet = stubSimpleCall(expectedResponse); - const [response] = await client.getSynonymSet(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getSynonymSet as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSynonymSet as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSynonymSet without error using callback', async () => { - const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.GetSynonymSetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.GetSynonymSetRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.SynonymSet() - ); - client.innerApiCalls.getSynonymSet = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getSynonymSet( - request, - (err?: Error|null, result?: protos.google.cloud.contentwarehouse.v1.ISynonymSet|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getSynonymSet as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSynonymSet as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSynonymSet with error', async () => { - const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.GetSynonymSetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.GetSynonymSetRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getSynonymSet = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getSynonymSet(request), expectedError); - const actualRequest = (client.innerApiCalls.getSynonymSet as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSynonymSet as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSynonymSet with closed client', async () => { - const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.GetSynonymSetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.GetSynonymSetRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getSynonymSet(request), expectedError); - }); - }); - - describe('updateSynonymSet', () => { - it('invokes updateSynonymSet without error', async () => { - const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.SynonymSet() - ); - client.innerApiCalls.updateSynonymSet = stubSimpleCall(expectedResponse); - const [response] = await client.updateSynonymSet(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateSynonymSet as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateSynonymSet as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateSynonymSet without error using callback', async () => { - const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.SynonymSet() - ); - client.innerApiCalls.updateSynonymSet = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateSynonymSet( - request, - (err?: Error|null, result?: protos.google.cloud.contentwarehouse.v1.ISynonymSet|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateSynonymSet as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateSynonymSet as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateSynonymSet with error', async () => { - const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateSynonymSet = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateSynonymSet(request), expectedError); - const actualRequest = (client.innerApiCalls.updateSynonymSet as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateSynonymSet as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateSynonymSet with closed client', async () => { - const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.UpdateSynonymSetRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.updateSynonymSet(request), expectedError); - }); - }); - - describe('deleteSynonymSet', () => { - it('invokes deleteSynonymSet without error', async () => { - const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteSynonymSet = stubSimpleCall(expectedResponse); - const [response] = await client.deleteSynonymSet(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteSynonymSet as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteSynonymSet as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteSynonymSet without error using callback', async () => { - const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteSynonymSet = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteSynonymSet( - 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); - const actualRequest = (client.innerApiCalls.deleteSynonymSet as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteSynonymSet as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteSynonymSet with error', async () => { - const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteSynonymSet = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteSynonymSet(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteSynonymSet as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteSynonymSet as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteSynonymSet with closed client', async () => { - const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.DeleteSynonymSetRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.deleteSynonymSet(request), expectedError); - }); - }); - - describe('listSynonymSets', () => { - it('invokes listSynonymSets without error', async () => { - const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.SynonymSet()), - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.SynonymSet()), - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.SynonymSet()), - ]; - client.innerApiCalls.listSynonymSets = stubSimpleCall(expectedResponse); - const [response] = await client.listSynonymSets(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listSynonymSets as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSynonymSets as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSynonymSets without error using callback', async () => { - const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.SynonymSet()), - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.SynonymSet()), - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.SynonymSet()), - ]; - client.innerApiCalls.listSynonymSets = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listSynonymSets( - request, - (err?: Error|null, result?: protos.google.cloud.contentwarehouse.v1.ISynonymSet[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listSynonymSets as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSynonymSets as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSynonymSets with error', async () => { - const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listSynonymSets = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listSynonymSets(request), expectedError); - const actualRequest = (client.innerApiCalls.listSynonymSets as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSynonymSets as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSynonymSetsStream without error', async () => { - const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.SynonymSet()), - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.SynonymSet()), - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.SynonymSet()), - ]; - client.descriptors.page.listSynonymSets.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listSynonymSetsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.contentwarehouse.v1.SynonymSet[] = []; - stream.on('data', (response: protos.google.cloud.contentwarehouse.v1.SynonymSet) => { - 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.listSynonymSets.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listSynonymSets, request)); - assert( - (client.descriptors.page.listSynonymSets.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listSynonymSetsStream with error', async () => { - const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listSynonymSets.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listSynonymSetsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.contentwarehouse.v1.SynonymSet[] = []; - stream.on('data', (response: protos.google.cloud.contentwarehouse.v1.SynonymSet) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listSynonymSets.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listSynonymSets, request)); - assert( - (client.descriptors.page.listSynonymSets.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listSynonymSets without error', async () => { - const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.SynonymSet()), - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.SynonymSet()), - generateSampleMessage(new protos.google.cloud.contentwarehouse.v1.SynonymSet()), - ]; - client.descriptors.page.listSynonymSets.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.contentwarehouse.v1.ISynonymSet[] = []; - const iterable = client.listSynonymSetsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listSynonymSets.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listSynonymSets.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listSynonymSets with error', async () => { - const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contentwarehouse.v1.ListSynonymSetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listSynonymSets.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listSynonymSetsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.contentwarehouse.v1.ISynonymSet[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listSynonymSets.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listSynonymSets.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('Path templates', () => { - - describe('documentLink', async () => { - const fakePath = "/rendered/path/documentLink"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - document: "documentValue", - document_link: "documentLinkValue", - }; - const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.documentLinkPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.documentLinkPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('documentLinkPath', () => { - const result = client.documentLinkPath("projectValue", "locationValue", "documentValue", "documentLinkValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.documentLinkPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDocumentLinkName', () => { - const result = client.matchProjectFromDocumentLinkName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.documentLinkPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDocumentLinkName', () => { - const result = client.matchLocationFromDocumentLinkName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.documentLinkPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDocumentFromDocumentLinkName', () => { - const result = client.matchDocumentFromDocumentLinkName(fakePath); - assert.strictEqual(result, "documentValue"); - assert((client.pathTemplates.documentLinkPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDocumentLinkFromDocumentLinkName', () => { - const result = client.matchDocumentLinkFromDocumentLinkName(fakePath); - assert.strictEqual(result, "documentLinkValue"); - assert((client.pathTemplates.documentLinkPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('documentSchema', async () => { - const fakePath = "/rendered/path/documentSchema"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - document_schema: "documentSchemaValue", - }; - const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.documentSchemaPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.documentSchemaPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('documentSchemaPath', () => { - const result = client.documentSchemaPath("projectValue", "locationValue", "documentSchemaValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.documentSchemaPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDocumentSchemaName', () => { - const result = client.matchProjectFromDocumentSchemaName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.documentSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDocumentSchemaName', () => { - const result = client.matchLocationFromDocumentSchemaName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.documentSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDocumentSchemaFromDocumentSchemaName', () => { - const result = client.matchDocumentSchemaFromDocumentSchemaName(fakePath); - assert.strictEqual(result, "documentSchemaValue"); - assert((client.pathTemplates.documentSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationDocument', async () => { - const fakePath = "/rendered/path/projectLocationDocument"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - document: "documentValue", - }; - const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectLocationDocumentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationDocumentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationDocumentPath', () => { - const result = client.projectLocationDocumentPath("projectValue", "locationValue", "documentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationDocumentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationDocumentName', () => { - const result = client.matchProjectFromProjectLocationDocumentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationDocumentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationDocumentName', () => { - const result = client.matchLocationFromProjectLocationDocumentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationDocumentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDocumentFromProjectLocationDocumentName', () => { - const result = client.matchDocumentFromProjectLocationDocumentName(fakePath); - assert.strictEqual(result, "documentValue"); - assert((client.pathTemplates.projectLocationDocumentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationDocumentsReferenceId', async () => { - const fakePath = "/rendered/path/projectLocationDocumentsReferenceId"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - reference_id: "referenceIdValue", - }; - const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationDocumentsReferenceIdPath', () => { - const result = client.projectLocationDocumentsReferenceIdPath("projectValue", "locationValue", "referenceIdValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationDocumentsReferenceIdName', () => { - const result = client.matchProjectFromProjectLocationDocumentsReferenceIdName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationDocumentsReferenceIdName', () => { - const result = client.matchLocationFromProjectLocationDocumentsReferenceIdName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchReferenceIdFromProjectLocationDocumentsReferenceIdName', () => { - const result = client.matchReferenceIdFromProjectLocationDocumentsReferenceIdName(fakePath); - assert.strictEqual(result, "referenceIdValue"); - assert((client.pathTemplates.projectLocationDocumentsReferenceIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('ruleSet', async () => { - const fakePath = "/rendered/path/ruleSet"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - rule_set: "ruleSetValue", - }; - const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.ruleSetPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.ruleSetPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('ruleSetPath', () => { - const result = client.ruleSetPath("projectValue", "locationValue", "ruleSetValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.ruleSetPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromRuleSetName', () => { - const result = client.matchProjectFromRuleSetName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.ruleSetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromRuleSetName', () => { - const result = client.matchLocationFromRuleSetName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.ruleSetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRuleSetFromRuleSetName', () => { - const result = client.matchRuleSetFromRuleSetName(fakePath); - assert.strictEqual(result, "ruleSetValue"); - assert((client.pathTemplates.ruleSetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('synonymSet', async () => { - const fakePath = "/rendered/path/synonymSet"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - context: "contextValue", - }; - const client = new synonymsetserviceModule.v1.SynonymSetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.synonymSetPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.synonymSetPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('synonymSetPath', () => { - const result = client.synonymSetPath("projectValue", "locationValue", "contextValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.synonymSetPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSynonymSetName', () => { - const result = client.matchProjectFromSynonymSetName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.synonymSetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSynonymSetName', () => { - const result = client.matchLocationFromSynonymSetName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.synonymSetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchContextFromSynonymSetName', () => { - const result = client.matchContextFromSynonymSetName(fakePath); - assert.strictEqual(result, "contextValue"); - assert((client.pathTemplates.synonymSetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-contentwarehouse/tsconfig.json b/owl-bot-staging/google-cloud-contentwarehouse/tsconfig.json deleted file mode 100644 index ca73e7bfc82..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "extends": "./node_modules/gts/tsconfig-google.json", - "compilerOptions": { - "rootDir": ".", - "outDir": "build", - "resolveJsonModule": true, - "lib": [ - "es2023", - "dom" - ] - }, - "include": [ - "src/*.ts", - "src/**/*.ts", - "test/*.ts", - "test/**/*.ts", - "system-test/*.ts", - "src/**/*.json", - "samples/**/*.json", - "protos/protos.json" - ] -} diff --git a/owl-bot-staging/google-cloud-contentwarehouse/webpack.config.js b/owl-bot-staging/google-cloud-contentwarehouse/webpack.config.js deleted file mode 100644 index aa25d4769e1..00000000000 --- a/owl-bot-staging/google-cloud-contentwarehouse/webpack.config.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -const path = require('path'); - -module.exports = { - entry: './src/index.ts', - output: { - library: 'DocumentLinkService', - filename: './document-link-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/packages/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/document_processor_service.proto b/packages/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/document_processor_service.proto index b8a1a76e649..ffd175f036c 100644 --- a/packages/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/document_processor_service.proto +++ b/packages/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/document_processor_service.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -354,6 +354,12 @@ message ProcessOptions { // Optional. Whether to include bounding boxes in layout parser processor // response. bool return_bounding_boxes = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether to include image annotations in layout parser response. + bool enable_image_annotation = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether to include table annotations in layout parser response. + bool enable_table_annotation = 6 [(google.api.field_behavior) = OPTIONAL]; } // A list of individual page numbers.